changed hyprland from GCC to clang;

fixed hyprland.desktop with emerge hook for custom hyprland-start wrapper
This commit is contained in:
Damien Coles 2026-01-26 16:11:07 -05:00
parent 0bbe929035
commit 585ff542f2
6 changed files with 80 additions and 1 deletions

View File

@ -61,7 +61,8 @@ gentoo-legion/
├── system/ # System configuration ├── system/ # System configuration
│ ├── ccache.conf # Compiler cache config │ ├── ccache.conf # Compiler cache config
│ ├── dracut.conf.d/ # Initramfs configuration │ ├── dracut.conf.d/ # Initramfs configuration
│ └── conf.d/ # OpenRC service configs │ ├── conf.d/ # OpenRC service configs
│ └── udev/ # udev rules (power profile switching)
├── greetd/ # Display manager configuration ├── greetd/ # Display manager configuration
│ ├── config.toml # greetd main config │ ├── config.toml # greetd main config
│ ├── regreet.toml # GTK greeter theming │ ├── regreet.toml # GTK greeter theming
@ -91,6 +92,7 @@ These files can be copied directly to your system:
| `system/ccache.conf` | `/etc/ccache.conf` | | `system/ccache.conf` | `/etc/ccache.conf` |
| `system/dracut.conf.d/*` | `/etc/dracut.conf.d/` | | `system/dracut.conf.d/*` | `/etc/dracut.conf.d/` |
| `system/conf.d/{iptables,ip6tables,snapper}` | `/etc/conf.d/` | | `system/conf.d/{iptables,ip6tables,snapper}` | `/etc/conf.d/` |
| `system/udev/*` | `/etc/udev/rules.d/` |
| `greetd/*` | `/etc/greetd/` (and `/etc/pam.d/greetd`) | | `greetd/*` | `/etc/greetd/` (and `/etc/pam.d/greetd`) |
| `firewall/ip6tables.rules` | `/etc/iptables/` | | `firewall/ip6tables.rules` | `/etc/iptables/` |
| `shell/starship.toml` | `~/.config/starship.toml` | | `shell/starship.toml` | `~/.config/starship.toml` |

View File

@ -237,6 +237,32 @@ llvm-core/clang clang
This is already included in the provided `package.use/steam` file. This is already included in the provided `package.use/steam` file.
### Hyprland GCC 15 ICE
GCC 15 crashes with an internal compiler error when compiling Hyprland with `-march=znver3` and C++26 modules:
```
internal compiler error: Segmentation fault
```
This occurs on `SinglePixel.cpp` due to a bug in GCC's handling of C++26 module imports with aggressive optimizations.
**Fix:** Compile Hyprland with clang instead of GCC:
```bash
# Create clang environment
echo 'CC="clang"' > /etc/portage/env/clang.conf
echo 'CXX="clang++"' >> /etc/portage/env/clang.conf
# Apply to Hyprland
echo "gui-wm/hyprland clang.conf" >> /etc/portage/package.env/clang
# Rebuild
emerge -1 gui-wm/hyprland
```
This is already included in the provided `env/clang.conf` and `package.env/clang` files.
### Circular Dependency (freetype/harfbuzz) ### Circular Dependency (freetype/harfbuzz)
During initial install, use `-harfbuzz` flag temporarily: During initial install, use `-harfbuzz` flag temporarily:
@ -268,6 +294,37 @@ emerge -pv <package>
Add missing flags to `/etc/portage/package.use/`. Add missing flags to `/etc/portage/package.use/`.
## Hyprland Session Logging
By default, Hyprland outputs startup logs to the terminal. To redirect to a file:
1. Create a wrapper script `/usr/local/bin/start-hyprland-dbus`:
```bash
#!/bin/bash
exec dbus-run-session /usr/bin/start-hyprland > ~/.local/log/hyprland.log 2>&1
```
2. Ensure log directory exists:
```bash
mkdir -p ~/.local/log
```
3. Automate the session entry update via `/etc/portage/bashrc`:
```bash
# Portage hooks
post_pkg_postinst() {
case "${CATEGORY}/${PN}" in
gui-wm/hyprland)
sed -i 's|Exec=.*|Exec=/usr/local/bin/start-hyprland-dbus|' /usr/share/wayland-sessions/hyprland.desktop
einfo "Updated hyprland.desktop to use start-hyprland-dbus"
;;
esac
}
```
This hook automatically patches `/usr/share/wayland-sessions/hyprland.desktop` after each Hyprland update.
## Getting Help ## Getting Help
1. Check Gentoo Wiki: https://wiki.gentoo.org/ 1. Check Gentoo Wiki: https://wiki.gentoo.org/

10
portage/bashrc Normal file
View File

@ -0,0 +1,10 @@
# Portage hooks
post_pkg_postinst() {
case "${CATEGORY}/${PN}" in
gui-wm/hyprland)
sed -i 's|Exec=.*|Exec=/usr/local/bin/start-hyprland-dbus|' /usr/share/wayland-sessions/hyprland.desktop
einfo "Updated hyprland.desktop to use start-hyprland-dbus"
;;
esac
}

5
portage/env/clang.conf vendored Normal file
View File

@ -0,0 +1,5 @@
# Use clang/clang++ instead of GCC
# Workaround for GCC 15 ICE (internal compiler error) with -march=znver3
# and C++26 modules on certain packages
CC="clang"
CXX="clang++"

View File

@ -0,0 +1,2 @@
# Packages that need clang due to GCC 15 ICE with -march=znver3 + C++26 modules
gui-wm/hyprland clang.conf

View File

@ -0,0 +1,3 @@
# Automatic power profile switching based on AC state
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="1", RUN+="/usr/bin/powerprofilesctl set performance"
ACTION=="change", SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ATTR{online}=="0", RUN+="/usr/bin/powerprofilesctl set power-saver"