Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 925502

Summary: www-client/firefox-123.0: fails to link (MUSL-CLANG19): undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::push_back(char)
Product: Gentoo Linux Reporter: hugegameartgd
Component: Current packagesAssignee: Mozilla Gentoo Team <mozilla>
Status: RESOLVED DUPLICATE    
Severity: normal CC: hugegameartgd
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugzilla.mozilla.org/show_bug.cgi?id=1874059
https://bugs.gentoo.org/show_bug.cgi?id=917694
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
0002-gcc_hidden.patch

Description hugegameartgd 2024-02-25 19:22:17 UTC
Created attachment 885984 [details]
build.log

www-client/firefox-123.0 (LLVM 17 slot) fails to compile with libc++-19 (musl/clang/merged-usr)

Steps to Reproduce:
emerge =sys-devel/clang-19*
emerge =sys-devel/clang-17*
- patch firefox-123.0.ebuild for linking with `-flto`:
https://bugs.gentoo.org/attachment.cgi?id=885959&action=diff

```
265:26.03 mold: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::insert(unsigned long, char const*)
265:26.03 >>> referenced by ld-temp.o
265:26.04 >>>               /var/tmp/portage/www-client/firefox-123.0/temp/lto-llvm-3b39e5.o:(mozilla::ipc::GeckoChildProcessHost::AsyncLaunch(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>>))>>> referenced by ld-temp.o
265:26.04 >>>               /var/tmp/portage/www-client/firefox-123.0/temp/lto-llvm-3b39e5.o:(Json::Reader::decodeDouble(Json::Reader::Token&, Json::Value&))>>> referenced by ld-temp.o
265:26.04 >>>               /var/tmp/portage/www-client/firefox-123.0/temp/lto-llvm-3b39e5.o:(Json::OurCharReader::parse(char const*, char const*, Json::Value*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*))>>> referenced 14 more times
265:26.04 mold: error: undefined symbol: std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>::insert(unsigned long, char const*, unsigned long)
265:26.04 >>> referenced by ld-temp.o
265:26.05 >>>               /var/tmp/portage/www-client/firefox-123.0/temp/lto-llvm-3b39e5.o>>> referenced by ld-temp.o
265:26.05 >>>               /var/tmp/portage/www-client/firefox-123.0/temp/lto-llvm-3b39e5.o
265:26.05 x86_64-gentoo-linux-musl-clang++-17: error: linker command failed with exit code 1 (use -v to see invocation)
265:26.12 gmake[4]: *** [/var/tmp/portage/www-client/firefox-123.0/work/firefox-123.0/config/rules.mk:541: libxul.so] Error 1
265:26.14 gmake[4]: Leaving directory '/var/tmp/portage/www-client/firefox-123.0/work/firefox_build/toolkit/library/build'
265:26.14 gmake[3]: *** [/var/tmp/portage/www-client/firefox-123.0/work/firefox-123.0/config/recurse.mk:72: toolkit/library/build/target] Error 2
265:26.20 gmake[3]: Leaving directory '/var/tmp/portage/www-client/firefox-123.0/work/firefox_build'
265:26.20 gmake[2]: *** [/var/tmp/portage/www-client/firefox-123.0/work/firefox-123.0/config/recurse.mk:34: compile] Error 2
265:26.23 gmake[2]: Leaving directory '/var/tmp/portage/www-client/firefox-123.0/work/firefox_build'
265:26.24 gmake[1]: *** [/var/tmp/portage/www-client/firefox-123.0/work/firefox-123.0/config/rules.mk:361: default] Error 2
265:26.26 gmake[1]: Leaving directory '/var/tmp/portage/www-client/firefox-123.0/work/firefox_build'
265:26.27 gmake: *** [client.mk:60: build] Error 2
```

emerge --info: https://bugs.gentoo.org/attachment.cgi?id=885960
emerge -pqv: https://bugs.gentoo.org/attachment.cgi?id=885961
Comment 1 hugegameartgd 2024-02-25 19:24:41 UTC
*** Bug 925492 has been marked as a duplicate of this bug. ***
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-02-27 23:29:17 UTC
We're _very_ early in the LLVM 19 cycle (6 months out) and given you've had two separate confusing issues here, not really sure it's worth reporting these so early to us.

Besides, the bug you linked is vimproved's, and we have bug 917694?

*** This bug has been marked as a duplicate of bug 917694 ***
Comment 3 hugegameartgd 2024-03-02 13:15:46 UTC
Created attachment 886522 [details, diff]
0002-gcc_hidden.patch

> We're _very_ early in the LLVM 19 cycle (6 months out)

Though this issue is also reproducible with LLVM 18 and libc++ according to vimproved's upstream bug report

> Besides, the bug you linked is vimproved's, and we have bug 917694?

Yes, bug 917694 is tracking two issues: "cannot find type `_Pred` in this scope" has been fixed upstream in firefox 123-0, for the second libc++ std::basic_string error (which I've reported in this issue) vimproved sent a patch via Discord: `0002-gcc_hidden.patch`
Comment 4 hugegameartgd 2024-03-17 14:54:47 UTC

*** This bug has been marked as a duplicate of bug 927148 ***