View previous topic :: View next topic |
Author |
Message |
Slashhhh n00b
Joined: 07 Nov 2023 Posts: 25
|
Posted: Fri Mar 08, 2024 10:24 pm Post subject: Waybar fails to compile due to `undefined reference` to glib |
|
|
I'm on a clang based install of Gentoo trying to get my GUI running. I have Hyprland running already, and I'm trying to install waybar.
On the first try it failed due to clang as happens sometimes, so I set waybar to compile with gcc (my gcc fallback env) as one does. After trying to compile with gcc, it spits out a linker error along the lines of:
Code: | undefined reference to <some library function> |
This is not something uncommon. Normally the fix is to set gcc as the compiler for that library aswell and recompile. Even on waybar this worked for the first 4 or so libraries it failed to link with.
But with `dev-libs/glib` that just does not work. Glib seems to compile on my fallback env without any issues. But trying to compile waybar still spits out the issue.
Tail of the build.log of waybar (full file is too long for pastebin): https://pastebin.com/h61hDM4d
emerge --info: https://pastebin.com/i3Qf37aF
Could it be that since glib is a C library and waybar is a C++ codebase, that there is some issue with ABI? |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 1697
|
Posted: Fri Mar 08, 2024 10:43 pm Post subject: |
|
|
On Clang profiles, libc++ is used, which means you cannot use a GCC fallback for any C++ applications (as GCC always uses libstdc++). |
|
Back to top |
|
|
Slashhhh n00b
Joined: 07 Nov 2023 Posts: 25
|
Posted: Fri Mar 08, 2024 10:55 pm Post subject: |
|
|
sam_ wrote: | On Clang profiles, libc++ is used, which means you cannot use a GCC fallback for any C++ applications (as GCC always uses libstdc++). |
So the only real way to get waybar working is to find a way to get it to compile with clang?
And I assume I managed to compile hyprland with the gcc fallback because they don't use the stdlib? |
|
Back to top |
|
|
sam_ Developer
Joined: 14 Aug 2020 Posts: 1697
|
Posted: Sat Mar 09, 2024 12:05 am Post subject: |
|
|
On the first point: yes. IIRC, there's a fix for this in libc++ 18 which was just released? Not 100% sure.
On the second: It sounds like luck that you got it working, but it's possible they don't use certain components. |
|
Back to top |
|
|
Slashhhh n00b
Joined: 07 Nov 2023 Posts: 25
|
Posted: Sat Mar 09, 2024 5:12 pm Post subject: |
|
|
sam_ wrote: | IIRC, there's a fix for this in libc++ 18 which was just released |
Will try.
sam_ wrote: | It sounds like luck that you got it working, but it's possible they don't use certain components. |
Slashhhh wrote: | This is not something uncommon. Normally the fix is to set gcc as the compiler for that library aswell and recompile. |
Most likely its whole dependency tree was on libstdc++ and the C++ parts of its dependency tree overlapped nowhere with anything else. |
|
Back to top |
|
|
Slashhhh n00b
Joined: 07 Nov 2023 Posts: 25
|
Posted: Wed Mar 20, 2024 1:33 pm Post subject: |
|
|
Slashhhh wrote: | sam_ wrote: | IIRC, there's a fix for this in libc++ 18 which was just released |
Will try. |
Ah BTW forgot to follow up. It worked. Waybar compiles now no issues |
|
Back to top |
|
|
|