Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't emerge Firefox on a fresh LLVM install
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
luke_
n00b
n00b


Joined: 03 Sep 2024
Posts: 3

PostPosted: Tue Sep 03, 2024 7:40 pm    Post subject: Can't emerge Firefox on a fresh LLVM install Reply with quote

Hey all, I have a fairly new install using the "default/linux/amd64/23.0/llvm/systemd" profile and corresponding stage3 build. I've had no issues so far really building all of the XFCE4 desktop but Firefox is giving me some trouble. According to the build info it should be using clang/llvm:
Code:

[ebuild  N     ] www-client/firefox-115.14.0  USE="X (clang) gmp-autoupdate system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp -dbus -debug -eme-free -geckodriver -hardened -hwaccel -jack -libproxy -lto -openh264 -pgo -pulseaudio -screencast (-selinux) -sndio -system-png (-system-python-libs) -wayland -wifi" L10N="-ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fur -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -sc -sco -si -sk -sl -son -sq -sr -sv -szl -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW"

It builds for quite some time and then fails with this:
Code:

 5:17.51 /usr/lib/llvm/18/bin/x86_64-pc-linux-gnu-clang++-18 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fstack-clash-protection -fno-sized-deallocation -fno-
aligned-new -march=native -pipe -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -O2 -fomit-frame-pointer -funwi
nd-tables  -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o libxul.so /var/tmp/portage/www-client/firefox-115.14.0/work/firefox_build/toolkit/library/build/libxul_so.lis
t   -lpthread -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed -Wl,--compress-debug-sections=zlib -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags -fuse-ld=lld
 -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -fstack-protector-strong -fstack-clash-protection -Wl,-rpath-link,/var/tmp/portage/www-cl
ient/firefox-115.14.0/work/firefox_build/dist/bin -Wl,-rpath-link,/usr/lib  ../../../js/src/build/libjs_static.a /var/tmp/portage/www-client/firefox-115.14.0/work/firefox_build/x
86_64-unknown-linux-gnu/release/libgkrust.a ../../../security/sandbox/linux/libmozsandbox.so ../../../config/external/lgpllibs/liblgpllibs.so ../../../config/external/sqlite/libm
ozsqlite3.so ../../../widget/gtk/mozgtk/libmozgtk.so -Wl,--version-script,symverscript  -licui18n -licuuc -licudata -laom -ldav1d -lasound -lrt -lX11 -lXcomposite -lXdamage -lXex
t -lXfixes -lXrandr -lXrender -lXtst -lpthread -ldl -lc -lffi -lplds4 -lplc4 -lnspr4 -lz -lm -lssl3 -lsmime3 -lnss3 -lnssutil3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocair
o-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgraphite2 -lwebp -lwebpdemux -levent -lvpx -lpixman-1 -lxcb-s
hm -lX11-xcb -lxcb -lXcursor -lXi                                                                                                                                                 
 5:17.52 ld.lld: error: undefined hidden symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::assign(char const*)                       
 5:17.52 >>> referenced by Unified_cpp_linux_launch0.cpp                                                                                                                         
 5:17.52 >>>               /var/tmp/portage/www-client/firefox-115.14.0/work/firefox_build/toolkit/library/build/../../../security/sandbox/linux/launch/Unified_cpp_linux_launch0.


This matches exactly the linking error from the Gentoo Clang wiki entry however that entry is implying that I've changed from the GCC to LLVM profile and I have not made any changes as it's a brand new system. I've tried re-emerging the base llvm components per that entry but the Firefox build fails at exactly the same part.

Here's the system info: https://pastebin.com/WYj7Kt27

I can provide the full build.log as well if someone points me to a place to upload it. Thanks!
Back to top
View user's profile Send private message
luke_
n00b
n00b


Joined: 03 Sep 2024
Posts: 3

PostPosted: Wed Sep 04, 2024 2:25 pm    Post subject: Reply with quote

I did some more digging with this and had a bit of a success. So the LLVM-systemd profile sets up everything to use libc++ as the standard C++ library (maybe obviously?) and I figured I'd try to compile Firefox against the GCC one (libstdc++) by creating an environment override just for that package like so:
Code:

CXXFLAGS="-stdlib=libstdc++ ${CFLAGS}"

After that change Firefox finished building with no errors. Great! I'm unsure though why it wouldn't find the proper symbols in libc++ however so I'm doing a full system rebuild with that env change removed to see if there's some dependencies that were built incorrectly.
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 750
Location: /home

PostPosted: Sat Sep 07, 2024 5:50 am    Post subject: Reply with quote

IIRC there's a problem exactly when using libc++-18. So you can downgrade to llvm-17 toolchain and use that, or compile firefox with "-clang" use flag to force using gcc.

The point of using system-wide libc++ is that you then can get rid of gcc and glibc. If you force usage of libstdc++ on pure llvm profile - then you shouldn't be using the llvm profile :) you can go system-wide clang/llvm (with gcc & glibc installed) using any default profile too.

Mixing libc++ and libstdc++ like that is a pretty sure way to break things along the way.
Back to top
View user's profile Send private message
luke_
n00b
n00b


Joined: 03 Sep 2024
Posts: 3

PostPosted: Sun Sep 08, 2024 1:47 pm    Post subject: Reply with quote

Yeah I was mostly trying different workarounds. For now firefox:rapid builds and works with the latest llvm. I'm also kind of curious when you say it's a known issue, I looked everywhere I could for issues, bugs and open PRs around the Firefox package and couldn't find anything. Do you have any pointers where to look for this stuff in the future?
Back to top
View user's profile Send private message
Juippisi
Developer
Developer


Joined: 30 Sep 2005
Posts: 750
Location: /home

PostPosted: Mon Sep 09, 2024 6:20 am    Post subject: Reply with quote

luke_ wrote:

Do you have any pointers where to look for this stuff in the future?


Upstream bugzilla :)
https://bugzilla.mozilla.org/show_bug.cgi?id=1874059

but I'll admit these things aren't always obvious or easy to find. Also I'm pretty sure there's a bug open in Gentoo's bugzilla about it, but the libcxx-18 connection is probably hidden somewhere in comments.
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