In a system with Clang toolchain, default libcxx and USE="clang", Firefox fails to build due to what looks to me to be missing SSE intrinsics in libcxx-15.0.3: ---- 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2108:19: error: use of undeclared identifier '__builtin_elementwise_add_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2129:19: error: use of undeclared identifier '__builtin_elementwise_add_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2149:19: error: use of undeclared identifier '__builtin_elementwise_add_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2169:19: error: use of undeclared identifier '__builtin_elementwise_add_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2528:19: error: use of undeclared identifier '__builtin_elementwise_sub_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2548:19: error: use of undeclared identifier '__builtin_elementwise_sub_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2567:19: error: use of undeclared identifier '__builtin_elementwise_sub_sat' 8 7:53.00 [style 0.0.1] /usr/lib/llvm/15/bin/../../../../lib/clang/15.0.3/include/emmintrin.h:2586:19: error: use of undeclared identifier '__builtin_elementwise_sub_sat' ---- Curiously, Firefox builds just fine with USE="-clang" even though my GCC toolchain also defaults to libcxx. I'm not sure what's going on here, and if it is an issue in Firefox or libcxx or even Clang, but since Firefox is the only package failing with this on my all-libcxx system, I'll start here. Reproducible: Always Steps to Reproduce: 1. Have a Gentoo install with Clang toolchain and default libcxx 2. Try to build firefox with USE="clang" Actual Results: Fails with quoted error message Expected Results: Should compile with Clang and libcxx
Created attachment 826701 [details] build.log
Created attachment 826703 [details] emerge --info
The issue is that the llvm slot you used to build dev-lang/rust must match the one you are using to build firefox (and other mozilla software).
Something weird is definitely happening. The build log says you're using llvm slot 14 but still compiling with clang-15? Do you have some custom overrides in package.env file? Anyway I see ccache is also being used. Always first drop ccache when a build issue happens - it's known to break every now and then. So try again without ccache and without custom overrides if there's such in place.
Both versions 14 and 15 of Clang/LLVM are installed on my system. Rust forces 14 (that's actually the only reason it is still there), but 15 is my system-wide, default compiler so that's used for Firefox. If there is such a dependency that Firefox requires the same LLVM version that was used to build Rust, then that should be expressed in the ebuild(s) somehow, no? Current behavior is pretty unexpected (and I have to find a way to tell Firefox to use the older version, hopefully setting CC/CXX via env is enough for that...). Given the fact that Rust and some other packages tend to take months to upgrade their maximum LLVM requirement after a new version has been made available, I think this is not an uncommon issue.
(In reply to Manuel Nickschas from comment #5) > Both versions 14 and 15 of Clang/LLVM are installed on my system. Rust > forces 14 (that's actually the only reason it is still there), but 15 is my > system-wide, default compiler so that's used for Firefox. > > If there is such a dependency that Firefox requires the same LLVM version > that was used to build Rust, then that should be expressed in the ebuild(s) > somehow, no? Current behavior is pretty unexpected (and I have to find a way > to tell Firefox to use the older version, hopefully setting CC/CXX via env > is enough for that...). Given the fact that Rust and some other packages > tend to take months to upgrade their maximum LLVM requirement after a new > version has been made available, I think this is not an uncommon issue. The ebuild should force 14 to be used with clang. But I believe it may misbehave from a previous successful build with gcc due to ccache - or as said, you have some local overrides in /etc/portage. But I do admit there may be some weird interactions with the newly introduced clang-toolchain-symlinks. But try without ccache first and if you know you have some overrides, try without those too.
Oh, by the way, 106.0.4 is out. You may want to wait a few hours until I finish testing it and push it to ::gentoo before you compile Firefox again.
Created attachment 826831 [details] build.log with ccache disabled Uploaded a build log without ccache, issue persists. I have no relevant overrides that I know of, besides of course enabling the system-wide clang toolchain via setting CC, CXX and friends in make.conf. These are all set without version, so CXX="clang++". I now see that the configure output claims to be using LLVM 14, but explicitly invokes clang-15 and clang++-15, which certainly does not come out of my global variables...
I can't really put my finger on it, but it _looks_ like either your env is somehow messed up (the local overrides I've mentioned), or that some of your overlays is overriding ::gentoo's eclasses? For example you get a weird return code on toolchain-func's tc-is-clang function. Could you ship your /etc/portage and/or try by disabling your overlays?
The good news is that earlier today, upstream dropped rust-1.65 , and this version uses llvm:15 by default. I imagine this will be in ::gentoo soonish, but rust-1.65 spidermonkey-102.4 firefox-106 are all working fine for me so far ...
Created attachment 827047 [details] /etc/portage Snapshot of my current portage configuration. I can't see anything fishy in there... I use overlays edgets, HomeAssistantRepository, jorgicio and steam-overlay.
(In reply to Manuel Nickschas from comment #8) > ... besides of course enabling the system-wide clang > toolchain via setting CC, CXX and friends in make.conf. These are all set > without version, so CXX="clang++". Setting those without version will prefer the newest one you have installed (clang:15) rather than the one the firefox ebuild wants (clang:14).
(In reply to cyrillic from comment #12) > > Setting those without version will prefer the newest one you have installed > (clang:15) rather than the one the firefox ebuild wants (clang:14). Firefox ebuild, or more specifically llvm.eclass, should still force 14 to be used with firefox. And (In reply to Manuel Nickschas from comment #11) > Created attachment 827047 [details] > /etc/portage > > Snapshot of my current portage configuration. I can't see anything fishy in > there... > > I use overlays edgets, HomeAssistantRepository, jorgicio and steam-overlay. Yeah I can't spot anything obvious in there breaking it, but... well your settings are overall pretty excessive. But I'm pretty confident it's something in your setup. As I have llvm & clang 14 and 15 installed, compiling Firefox works properly with 14. And I can see toolchain-funcs.eclass is misbehaving for you, maybe llvm.eclass doesn't work either. But no clue what exactly breaks them - some overlay, or something in your setup. I could try with your settings when I have more time, but I wouldn't have system-wide libcxx which may make that experiment a failure to begin with.
I'm hitting the same issue with rust-1.65.0 (llvm-15) when building firefox 106.0.4. (In reply to Joonas Niilola from comment #13) > (In reply to cyrillic from comment #12) > > > > Setting those without version will prefer the newest one you have installed > > (clang:15) rather than the one the firefox ebuild wants (clang:14). > > Firefox ebuild, or more specifically llvm.eclass, should still force 14 to > be used with firefox. And > I have nothing related to firefox in my env, but I do also set CXX=clang++ etc. It doesn't seem that llvm.eclass is forcing the correct slot
I should also mention that I don't use default-libcxx, but default-{compiler-rt,lld,unwind} are set
(In reply to James Beddek from comment #14) > I'm hitting the same issue with rust-1.65.0 (llvm-15) when building firefox > 106.0.4. > > (In reply to Joonas Niilola from comment #13) > > > (In reply to cyrillic from comment #12) > > > > > > Setting those without version will prefer the newest one you have installed > > > (clang:15) rather than the one the firefox ebuild wants (clang:14). > > > > Firefox ebuild, or more specifically llvm.eclass, should still force 14 to > > be used with firefox. And > > > > I have nothing related to firefox in my env, but I do also set CXX=clang++ > etc. It doesn't seem that llvm.eclass is forcing the correct slot I wonder if the two latest commits to llvm.eclass makes it so, https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/llvm.eclass could you try reverting those and attempt again?
The recently (3fc1dcf94) introduced llvm_fix_clang_version is indeed the culprit. Which, come to think about it, isn't surprising given that this commit's purpose is to prevent ebuilds from overriding the compiler... I am not deep into toolchain things, but I guess the usecase for mgorny's change is to allow the use of LLVM libraries but with the current compiler, whilst Firefox requires also an older compiler, which is no longer possible to enforce with these changes?
Okay, guess the culprit is identified then.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f0f9b26edf493e6e8d4c689abbbbc4924f56cee commit 8f0f9b26edf493e6e8d4c689abbbbc4924f56cee Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-11-07 14:53:45 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-11-07 15:03:37 +0000 www-client/firefox: fix ebuilds to reflect latest llvm.eclass changes - also update lld check to match a slot. Closes: https://bugs.gentoo.org/879177 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-client/firefox/firefox-102.4.0.ebuild | 10 ++++++---- www-client/firefox/firefox-106.0.5.ebuild | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b67430d2028ac285023796884012bd563bbf56cf commit b67430d2028ac285023796884012bd563bbf56cf Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-11-07 14:59:18 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-11-07 15:03:37 +0000 dev-lang/spidermonkey: fix ebuilds to reflect latest llvm.eclass changes - also match lld checks to a slot. Bug: https://bugs.gentoo.org/879177 Signed-off-by: Joonas Niilola <juippis@gentoo.org> dev-lang/spidermonkey/spidermonkey-102.4.0.ebuild | 10 ++++++---- dev-lang/spidermonkey/spidermonkey-78.15.0.ebuild | 10 ++++++---- dev-lang/spidermonkey/spidermonkey-91.13.0.ebuild | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6bfcfc2d41635e7ba926631619cf9b7d8eef02b commit b6bfcfc2d41635e7ba926631619cf9b7d8eef02b Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-11-07 14:56:25 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-11-07 15:03:37 +0000 mail-client/thunderbird: fix ebuilds to reflect latest llvm.eclass changes - also match lld to a slot. Bug: https://bugs.gentoo.org/879177 Signed-off-by: Joonas Niilola <juippis@gentoo.org> mail-client/thunderbird/thunderbird-102.4.0.ebuild | 10 ++++++---- mail-client/thunderbird/thunderbird-102.4.2.ebuild | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-)
Created attachment 828989 [details] build.log after supposed fix Sorry, this is still not fixed, because it still uses unversioned CC/CXX and thus clang-15 on my system. See attached build log.
(In reply to Manuel Nickschas from comment #20) > Created attachment 828989 [details] > build.log after supposed fix > > Sorry, this is still not fixed, because it still uses unversioned CC/CXX and > thus clang-15 on my system. See attached build log. Try without ccache first. I do see some calls to llvm/15 but it's mostly using llvm/14 correctly now.
Hmm, I think it's actually a different issue now (with or without ccache), I guess llvm-as does not support all the arguments that standard as supports... 822:36.97 xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.o 822:36.97 /usr/lib/llvm/14/bin/llvm-as -o xptcinvoke_asm_x86_64_unix.o -DNDEBUG=1 -DTRIMMED=1 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -DSTATIC_EXPORTABLE_JS_API -fPIC -Wa,--noexecstack -include /var/tmp/portage/www-client/firefox- 106.0.5/work/firefox_build/instrumented/mozilla-config.h -DMOZILLA_CLIENT -I/var/tmp/portage/www-client/firefox-106.0.5/work/firefox-106.0.5/xpcom/reflect/xptcall -c /var/tmp/portage/www-client/firefox-106.0.5/work/firefox-106.0.5/xpcom/reflect /xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S 822:36.97 xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_unix.o 822:37.00 llvm-as: Unknown command line argument '-DNDEBUG=1'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '--o=1'? 822:37.00 llvm-as: Unknown command line argument '-DTRIMMED=1'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '--o=1'? 822:37.00 llvm-as: Unknown command line argument '-DMOZ_HAS_MOZGLUE'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Unknown command line argument '-DMOZILLA_INTERNAL_API'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Unknown command line argument '-DIMPL_LIBXUL'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Unknown command line argument '-DSTATIC_EXPORTABLE_JS_API'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Unknown command line argument '-fPIC'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Unknown command line argument '-Wa,--noexecstack'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '--help-list'? 822:37.00 llvm-as: Unknown command line argument '-include'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-d'? 822:37.00 llvm-as: Unknown command line argument '-DMOZILLA_CLIENT'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Unknown command line argument '-I/var/tmp/portage/www-client/firefox-106.0.5/work/firefox-106.0.5/xpcom/reflect/xptcall'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '--preserve-bc-uselistorder'? 822:37.00 llvm-as: Unknown command line argument '-c'. Try: '/usr/lib/llvm/14/bin/llvm-as --help' 822:37.00 llvm-as: Did you mean '-o'? 822:37.00 llvm-as: Too many positional arguments specified! 822:37.00 Can specify at most 1 positional arguments: See: /usr/lib/llvm/14/bin/llvm-as --help 822:37.01 gmake[4]: *** [/var/tmp/portage/www-client/firefox-106.0.5/work/firefox-106.0.5/config/rules.mk:664: xptcinvoke_asm_x86_64_unix.o] Error 1 822:37.01 gmake[4]: Leaving directory '/var/tmp/portage/www-client/firefox-106.0.5/work/firefox_build/instrumented/xpcom/reflect/xptcall/md/unix' 822:37.01 gmake[3]: *** [/var/tmp/portage/www-client/firefox-106.0.5/work/firefox-106.0.5/config/recurse.mk:72: xpcom/reflect/xptcall/md/unix/target-objects] Error 2
(In reply to Manuel Nickschas from comment #22) > Hmm, I think it's actually a different issue now (with or without ccache), I > guess llvm-as does not support all the arguments that standard as supports... Binutils ``as'' does not run the preprocessor either, and hence lacks these flags. [c] ~$ as -DABC=def as: invalid option -- 'A' [i] ~ 1 $
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=884c5548a2b969f8be9253f53d351a7886450a91 commit 884c5548a2b969f8be9253f53d351a7886450a91 Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-11-08 18:06:22 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-11-08 18:07:24 +0000 mail-client/thunderbird: switch from llvm-as to "clang -c" Closes: https://bugs.gentoo.org/879177 Signed-off-by: Joonas Niilola <juippis@gentoo.org> mail-client/thunderbird/thunderbird-102.4.0.ebuild | 4 ++-- mail-client/thunderbird/thunderbird-102.4.2.ebuild | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56bdf6fcd79b48588670071f341e31c0ca54c34d commit 56bdf6fcd79b48588670071f341e31c0ca54c34d Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-11-08 18:05:28 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-11-08 18:07:24 +0000 dev-lang/spidermonkey: switch from llvm-as to "clang -c" Closes: https://bugs.gentoo.org/879177 Signed-off-by: Joonas Niilola <juippis@gentoo.org> dev-lang/spidermonkey/spidermonkey-102.4.0.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6db890f35f8d70b829a6a2e5d2a98b87da0ca70 commit f6db890f35f8d70b829a6a2e5d2a98b87da0ca70 Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-11-08 18:04:35 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-11-08 18:07:24 +0000 www-client/firefox: switch from llvm-as to "clang -c" Closes: https://bugs.gentoo.org/879177 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-client/firefox/firefox-102.4.0.ebuild | 4 ++-- www-client/firefox/firefox-106.0.5.ebuild | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
(In reply to Manuel Nickschas from comment #22) > Hmm, I think it's actually a different issue now (with or without ccache), I > guess llvm-as does not support all the arguments that standard as supports... > Try now, without ccache... and give me good news for once! :)
YES! Compiled without issues now, even with ccache enabled. Thanks for sticking with me and my fully unsupported setup! Much appreciated.
Glad to hear it works! I guess the recent llvm.eclass changes did expose some faults in the ebuild, and this was also updated quite recently: https://gitweb.gentoo.org/repo/gentoo.git/commit/profiles/features/clang/make.defaults?id=59d666d032353b054e3cdf4f18ad55e3346e73ca but I still can't shake off the feeling there's some weird interaction going on with toolchain-funcs.eclass too. Oh well, if it works now... (I did notice since not every llvm-related tool is exported it uses 15 for some parts, but doesn't seem to explode with those)