Summary: | www-client/firefox-98.0.2 fails to compile with libcxx | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Christian Apeltauer <c.apeltauer> |
Component: | Current packages | Assignee: | Mozilla Gentoo Team <mozilla> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ajak, atoth, herrtimson, info, llvm, lucas.yamanishi, marek.bartosiewicz, michi.kurz, perfect007gentleman, poncho, redblade7, solpeth |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262598 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 836220 | ||
Attachments: |
build.log
emerge --info bgo-836219.patch ld.lld: error firefox-99.0 build log |
Description
Christian Apeltauer
2022-03-26 20:38:48 UTC
Please always include the full build.log & emerge --info. Anyway, ajak hit this in #gentoo-mozilla 2 days ago -- it's to do with libcxx/libc++. Created attachment 767918 [details]
build.log
Created attachment 767919 [details]
emerge --info
Created attachment 767961 [details]
bgo-836219.patch
Can you try the patch provided in the FreeBSD bug?
mkdir -p /etc/portage/patches/www-client/firefox-98.0.2/
And place the cleaned patch there, for convenience I've attached it to this bug. Then continue emerging firefox:rapid normally and make sure you see
* Applying user patches from /etc/portage/patches ...
* Applying bgo-836219.patch ... [ ok ]
* User patches applied.
Let me know if you need more detailed steps!
(In reply to Joonas Niilola from comment #4) > Created attachment 767961 [details] > bgo-836219.patch > > Can you try the patch provided in the FreeBSD bug? > > mkdir -p /etc/portage/patches/www-client/firefox-98.0.2/ > > And place the cleaned patch there, for convenience I've attached it to this > bug. Then continue emerging firefox:rapid normally and make sure you see > > * Applying user patches from /etc/portage/patches ... > * Applying bgo-836219.patch ... [ ok ] > * User patches applied. > > Let me know if you need more detailed steps! Have you done the full test of this patch? 0:46.15 In file included from /tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/mozglue/baseprofiler/core/shared-libraries-linux.cc:16: 0:46.15 In file included from /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/system_wrappers/fstream:3: 0:46.15 In file included from /usr/include/c++/v1/fstream:193: 0:46.16 In file included from /usr/include/c++/v1/filesystem:244: 0:46.16 /usr/include/c++/v1/__filesystem/directory_iterator.h:32:7: error: visibility does not match previous declaration 0:46.16 class _LIBCPP_HIDDEN __dir_stream; 0:46.16 ^ 0:46.16 /usr/include/c++/v1/__config:688:44: note: expanded from macro '_LIBCPP_HIDDEN' 0:46.16 # define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) 0:46.16 ^ 0:46.16 /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/system_wrappers/fstream:2:13: note: previous attribute is here 0:46.16 #pragma GCC visibility push(default) 0:46.16 ^ 0:46.16 1 error generated. 0:46.16 make[4]: *** [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/rules.mk:660: shared-libraries-linux.o] Error 1 0:46.16 make[4]: Leaving directory '/tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/mozglue/baseprofiler' 0:46.16 make[3]: *** [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/recurse.mk:72: mozglue/baseprofiler/target-objects] Error 2 0:46.16 make[3]: *** Waiting for unfinished jobs... *** Bug 836338 has been marked as a duplicate of this bug. *** (In reply to Perfect Gentleman from comment #6) > 0:46.15 In file included from > /tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/mozglue/ > baseprofiler/core/shared-libraries-linux.cc:16: > 0:46.15 In file included from > /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > system_wrappers/fstream:3: > 0:46.15 In file included from /usr/include/c++/v1/fstream:193: > 0:46.16 In file included from /usr/include/c++/v1/filesystem:244: > 0:46.16 /usr/include/c++/v1/__filesystem/directory_iterator.h:32:7: error: > visibility does not match previous declaration > 0:46.16 class _LIBCPP_HIDDEN __dir_stream; > 0:46.16 ^ > 0:46.16 /usr/include/c++/v1/__config:688:44: note: expanded from macro > '_LIBCPP_HIDDEN' > 0:46.16 # define _LIBCPP_HIDDEN __attribute__ > ((__visibility__("hidden"))) > 0:46.16 ^ > 0:46.16 > /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > system_wrappers/fstream:2:13: note: previous attribute is here > 0:46.16 #pragma GCC visibility push(default) > 0:46.16 ^ > 0:46.16 1 error generated. > 0:46.16 make[4]: *** > [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/rules.mk: > 660: shared-libraries-linux.o] Error 1 > 0:46.16 make[4]: Leaving directory > '/tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/ > mozglue/baseprofiler' > 0:46.16 make[3]: *** > [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/recurse. > mk:72: mozglue/baseprofiler/target-objects] Error 2 > 0:46.16 make[3]: *** Waiting for unfinished jobs... Me too. Removing the pragma from tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/system_wrappers/fstream is a workaround for this. Three questions came into my mind. 1. How this file is generated during compile? 2. How a GCC pragma screws up clang? 3. Could we just go back to gcc or is it too oldschool? (In reply to Attila Tóth from comment #8) > > Me too. Removing the pragma from > tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > system_wrappers/fstream is a workaround for this. Three questions came into > my mind. > 1. How this file is generated during compile? > 2. How a GCC pragma screws up clang? > 3. Could we just go back to gcc or is it too oldschool? This workaround didn't work in my cases. (In reply to Perfect Gentleman from comment #9) > (In reply to Attila Tóth from comment #8) > > > > Me too. Removing the pragma from > > tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > > system_wrappers/fstream is a workaround for this. Three questions came into > > my mind. > > 1. How this file is generated during compile? > > 2. How a GCC pragma screws up clang? > > 3. Could we just go back to gcc or is it too oldschool? > > This workaround didn't work in my cases. There's another compile-time created fstream.h file with the same contents. One might need to handle that as well in order to go on... (In reply to Attila Tóth from comment #10) > There's another compile-time created fstream.h file with the same contents. > One might need to handle that as well in order to go on... It didn't help too. 'cause later there is /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/dist/system_wrappers/fstrem which causes the break. (In reply to Perfect Gentleman from comment #6) > 0:46.15 In file included from > /tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/mozglue/ > baseprofiler/core/shared-libraries-linux.cc:16: > 0:46.15 In file included from > /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > system_wrappers/fstream:3: > 0:46.15 In file included from /usr/include/c++/v1/fstream:193: > 0:46.16 In file included from /usr/include/c++/v1/filesystem:244: > 0:46.16 /usr/include/c++/v1/__filesystem/directory_iterator.h:32:7: error: > visibility does not match previous declaration > 0:46.16 class _LIBCPP_HIDDEN __dir_stream; > 0:46.16 ^ > 0:46.16 /usr/include/c++/v1/__config:688:44: note: expanded from macro > '_LIBCPP_HIDDEN' > 0:46.16 # define _LIBCPP_HIDDEN __attribute__ > ((__visibility__("hidden"))) > 0:46.16 ^ > 0:46.16 > /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > system_wrappers/fstream:2:13: note: previous attribute is here > 0:46.16 #pragma GCC visibility push(default) > 0:46.16 ^ > 0:46.16 1 error generated. > 0:46.16 make[4]: *** > [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/rules.mk: > 660: shared-libraries-linux.o] Error 1 > 0:46.16 make[4]: Leaving directory > '/tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/ > mozglue/baseprofiler' > 0:46.16 make[3]: *** > [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/recurse. > mk:72: mozglue/baseprofiler/target-objects] Error 2 > 0:46.16 make[3]: *** Waiting for unfinished jobs... It's a libc++ issue, fixed in upstream: https://github.com/llvm/llvm-project/commit/7ab1ab0db40158e6f0794637054c98376e236a6d See also: https://bugzilla.mozilla.org/show_bug.cgi?id=1761560 https://bugzilla.mozilla.org/show_bug.cgi?id=1754469 (In reply to 12101111 from comment #12) > (In reply to Perfect Gentleman from comment #6) > > 0:46.15 In file included from > > /tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/mozglue/ > > baseprofiler/core/shared-libraries-linux.cc:16: > > 0:46.15 In file included from > > /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > > system_wrappers/fstream:3: > > 0:46.15 In file included from /usr/include/c++/v1/fstream:193: > > 0:46.16 In file included from /usr/include/c++/v1/filesystem:244: > > 0:46.16 /usr/include/c++/v1/__filesystem/directory_iterator.h:32:7: error: > > visibility does not match previous declaration > > 0:46.16 class _LIBCPP_HIDDEN __dir_stream; > > 0:46.16 ^ > > 0:46.16 /usr/include/c++/v1/__config:688:44: note: expanded from macro > > '_LIBCPP_HIDDEN' > > 0:46.16 # define _LIBCPP_HIDDEN __attribute__ > > ((__visibility__("hidden"))) > > 0:46.16 ^ > > 0:46.16 > > /tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/dist/ > > system_wrappers/fstream:2:13: note: previous attribute is here > > 0:46.16 #pragma GCC visibility push(default) > > 0:46.16 ^ > > 0:46.16 1 error generated. > > 0:46.16 make[4]: *** > > [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/rules.mk: > > 660: shared-libraries-linux.o] Error 1 > > 0:46.16 make[4]: Leaving directory > > '/tmp/portage/www-client/firefox-98.0.2/work/firefox_build/instrumented/ > > mozglue/baseprofiler' > > 0:46.16 make[3]: *** > > [/tmp/portage/www-client/firefox-98.0.2/work/firefox-98.0.2/config/recurse. > > mk:72: mozglue/baseprofiler/target-objects] Error 2 > > 0:46.16 make[3]: *** Waiting for unfinished jobs... > > It's a libc++ issue, fixed in upstream: > https://github.com/llvm/llvm-project/commit/ > 7ab1ab0db40158e6f0794637054c98376e236a6d > > See also: > https://bugzilla.mozilla.org/show_bug.cgi?id=1761560 > https://bugzilla.mozilla.org/show_bug.cgi?id=1754469 Tried with this patch and FreeBSD patch, and when was finalizing building, I got ld.lld error. Using Clang/LLVM/lld/Musl globally here. Created attachment 768770 [details]
ld.lld: error
Can the fix for libcxx please be pused to the tree? (In reply to tt_1 from comment #15) > Can the fix for libcxx please be pused to the tree? It was only posted here a few hours ago and llvm@ isn't CC'd. Created attachment 769898 [details]
firefox-99.0 build log
It still fails with 99.0. I hope this gets fixed as it's really annoying.
(In reply to Mamadou Babaei from comment #17) > Created attachment 769898 [details] > firefox-99.0 build log > > It still fails with 99.0. I hope this gets fixed as it's really annoying. I don't think comments like this are very helpful. People are doing the best they can but ultimately libcxx is an odd configuration and most developers aren't even using it. (In reply to Sam James from comment #18) > (In reply to Mamadou Babaei from comment #17) > > Created attachment 769898 [details] > > firefox-99.0 build log > > > > It still fails with 99.0. I hope this gets fixed as it's really annoying. > > I don't think comments like this are very helpful. People are doing the best > they can but ultimately libcxx is an odd configuration and most developers > aren't even using it. Sorry did not want to offend you. Just wanted to post the new build log. (In reply to Mamadou Babaei from comment #19) No worries, I get it, I just wanted to emphasise that libcxx is a bit odd so we're not all experts in it. But I'm trying to get that commit backported to LLVM 14 so we can apply it in Gentoo: https://github.com/llvm/llvm-project/issues/54841. Then I think we can go from there. Thank you very much for the effort you put into this. I acknowledge my setup on building clang with libcxx might seem weird. I need it for building certain libraries for a few of my own projects. I actually thought this fix was already included in llvm-14. But yes libcxx is a bit annoying to test, since AFAIK you need your whole system built with it, and last I tried that wasn't exactly the easiest or fastest task. Still nice to see the root cause has been identified. We'll progress from there! freebsd patch works for me Still hitting this bug with firefox-99.0.1. However the patch no longer solves the problem: nditionVariable_posix.o.pp -fcolor-diagnostics /var/tmp/portage/www-client/firefox-99.0.1/work/firefox-99.0.1/mozglue/misc/ConditionVariable_posix.cpp 0:05.36 In file included from /var/tmp/portage/www-client/firefox-99.0.1/work/firefox-99.0.1/mozglue/baseprofiler/core/shared-libraries-linux.cc:16: 0:05.36 In file included from /var/tmp/portage/www-client/firefox-99.0.1/work/firefox_build/dist/system_wrappers/fstream:3: 0:05.36 In file included from /usr/include/c++/v1/fstream:193: 0:05.36 In file included from /usr/include/c++/v1/filesystem:244: 0:05.36 /usr/include/c++/v1/__filesystem/directory_iterator.h:32:7: error: visibility does not match previous declaration 0:05.36 class _LIBCPP_HIDDEN __dir_stream; 0:05.36 ^ 0:05.36 /usr/include/c++/v1/__config:688:44: note: expanded from macro '_LIBCPP_HIDDEN' 0:05.36 # define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) 0:05.36 ^ 0:05.36 /var/tmp/portage/www-client/firefox-99.0.1/work/firefox_build/dist/system_wrappers/fstream:2:13: note: previous attribute is here 0:05.36 #pragma GCC visibility push(default) 0:05.36 ^ 0:05.91 1 error generated. (In reply to Attila Tóth from comment #24) > Still hitting this bug with firefox-99.0.1. However the patch no longer > solves the problem: What version of clang and libcxx? It should be in 14.0.1. please provide new emerge --info, and new build log as well Oh, how ignorant I was! I didn't realize till now that www-client/firefox ebuild comes with a clang useflag and optionally can be built with gcc. I just did: echo 'www-client/firefox -clang' > /etc/portage/package.use/www-client_firefox and, as long as I have the latest www-client/firefox built, I really don't mind much if firefox is built with gcc instead of clang unless there's a significant difference in terms of performance or binary size. I'd appreciate any hints or information on that. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7eabfefdf3e45a2d47c90df65e9d5973009077c commit b7eabfefdf3e45a2d47c90df65e9d5973009077c Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2022-06-20 19:29:34 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-06-20 19:32:35 +0000 www-client/firefox: attempt to fix libc++ issue on 101.0.1 - probably doesn't solve all issues with libc++ and clang-14, but at least some! Closes: https://bugs.gentoo.org/853142 Bug: https://bugs.gentoo.org/836219 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-client/firefox/Manifest | 2 +- www-client/firefox/firefox-101.0.1-r11.ebuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) |