Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Waybar fails to compile due to `undefined reference` to glib
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Fri Mar 08, 2024 10:24 pm    Post subject: Waybar fails to compile due to `undefined reference` to glib Reply with quote

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
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1685

PostPosted: Fri Mar 08, 2024 10:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Fri Mar 08, 2024 10:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
sam_
Developer
Developer


Joined: 14 Aug 2020
Posts: 1685

PostPosted: Sat Mar 09, 2024 12:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Sat Mar 09, 2024 5:12 pm    Post subject: Reply with quote

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. :lol:
Back to top
View user's profile Send private message
Slashhhh
n00b
n00b


Joined: 07 Nov 2023
Posts: 25

PostPosted: Wed Mar 20, 2024 1:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum