https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657
Bug ID: 105657 Summary: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zarniwhoop at ntlworld dot com Target Milestone: --- With gcc-12 (12.1.0 up to the 20220514 snapshot) I am unable to build firefox-101.0 (beta) if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS. The same problem was reported to mozilla a while back from fedora, https://bugzilla.mozilla.org/show_bug.cgi?id=1758005 and after analysis regarded as a gcc issue. Searching has found no follow-ups, maybe I'm looking in the wrong places. This is a regression, with gcc-11.2.0 it builds fine. Output: 62:00.38 toolkit/library/build/libxul.so 62:00.38 rm -f libxul.so 62:00.38 /opt/gcc/bin/g++ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wall -Wempty-body -Wignored-qualifiers -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wno-invalid-offsetof -Wc++2a-compat -Wduplicated-cond -Wimplicit-fallthrough -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=coverage-mismatch -Wno-error=free-nonheap-object -Wno-multistatement-macros -Wno-error=class-memaccess -Wno-error=deprecated-copy -Wformat -Wformat-overflow=2 -Wno-psabi -fno-sized-deallocation -fno-aligned-new -O2 -march=native -fstack-clash-protection -D_FORTIFY_SOURCE=2 -fstack-protector-strong -D_GLIBCXX_ASSERTIONS -fno-exceptions -fPIC -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -freorder-blocks -O2 -fomit-frame-pointer -funwind-tables -shared -Wl,-z,defs -Wl,--gc-sections -Wl,-h,libxul.so -o libxul.so /scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/libxul_so.list -lpthread -Wl,-z,noexecstack -Wl,-z,text -Wl,-z,relro -Wl,-z,nocopyreloc -Wl,-Bsymbolic-functions -Wl,--build-id=sha1 -fstack-protector-strong -Wl,-rpath-link,/scratch/working/firefox-101.0/firefox-build-dir/dist/bin -Wl,-rpath-link,/opt/firefox/lib ../../../js/src/build/libjs_static.a /scratch/working/firefox-101.0/firefox-build-dir/x86_64-unknown-linux-gnu/release/libgkrust.a ../../../security/sandbox/linux/libmozsandbox.so ../../../config/external/lgpllibs/liblgpllibs.so ../../../config/external/sqlite/libmozsqlite3.so ../../../widget/gtk/mozgtk/libmozgtk.so ../../../widget/gtk/mozwayland/libmozwayland.so -Wl,--version-script,symverscript -licui18n -licuuc -licudata -lasound -lrt -lm -ldl -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender -lXtst -lpthread -lc -L/usr/lib/../lib -lffi -lplds4 -lplc4 -lnspr4 -lz -lnss3 -lnssutil3 -lsmime3 -lssl3 -lsoftokn3 -lfreetype -lfontconfig -lgtk-3 -lgdk-3 -lpangocairo-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 -lpng16 -lwebpdemux -lwebp -levent -lvpx -lpixman-1 -ldbus-glib-1 -ldbus-1 -lxcb-shm -lX11-xcb -lxcb -lXcursor -lXi 62:00.38 /usr/bin/ld: /scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../security/sandbox/linux/broker/Unified_cpp_linux_broker0.o: in function `mozilla::SandboxBrokerPolicyFactory::InitContentPolicy()': 62:00.38 Unified_cpp_linux_broker0.cpp:(.text._ZN7mozilla26SandboxBrokerPolicyFactory17InitContentPolicyEv+0x1dc5): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' 62:00.38 /usr/bin/ld: /scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../security/sandbox/linux/launch/Unified_cpp_linux_launch0.o: in function `std::__cxx11::to_string(int)': 62:00.38 Unified_cpp_linux_launch0.cpp:(.text._ZNSt7__cxx119to_stringEi[_ZNSt7__cxx119to_stringEi]+0x23a): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' 62:00.38 Unified_cpp_linux_launch0.cpp:(.text._ZNSt6vectorISt4pairIiiESaIS1_EE12emplace_backIJS1_EEERS1_DpOT_.isra.0+0x6b): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' 62:00.38 /usr/bin/ld: /scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../xpcom/base/Unified_cpp_xpcom_base0.o: in function `mozilla::CycleCollectedJSContext::PerformDebuggerMicroTaskCheckpoint()': 62:00.38 Unified_cpp_xpcom_base0.cpp:(.text._ZN7mozilla23CycleCollectedJSContext34PerformDebuggerMicroTaskCheckpointEv+0x1fb): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' 62:00.38 /usr/bin/ld: /scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../xpcom/base/Unified_cpp_xpcom_base0.o: in function `RefPtr<mozilla::MicroTaskRunnable>& std::deque<RefPtr<mozilla::MicroTaskRunnable>, std::allocator<RefPtr<mozilla::MicroTaskRunnable> > >::emplace_back<RefPtr<mozilla::MicroTaskRunnable> >(RefPtr<mozilla::MicroTaskRunnable>&&) [clone .isra.0]': 62:00.38 Unified_cpp_xpcom_base0.cpp:(.text._ZNSt5dequeI6RefPtrIN7mozilla17MicroTaskRunnableEESaIS3_EE12emplace_backIJS3_EEERS3_DpOT_.isra.0+0x11b): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' 62:00.38 /usr/bin/ld: /scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build/../../../xpcom/base/Unified_cpp_xpcom_base0.o:Unified_cpp_xpcom_base0.cpp:(.text._ZN7mozilla23CycleCollectedJSContext26PerformMicroTaskCheckPointEb+0x50b): more undefined references to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)' follow 62:00.38 collect2: error: ld returned 1 exit status 62:00.38 make[4]: *** [/scratch/working/firefox-101.0/config/rules.mk:531: libxul.so] Error 1 62:00.38 make[4]: Leaving directory '/scratch/working/firefox-101.0/firefox-build-dir/toolkit/library/build' 62:00.38 make[3]: *** [/scratch/working/firefox-101.0/config/recurse.mk:72: toolkit/library/build/target] Error 2 62:00.38 make[3]: *** Waiting for unfinished jobs.... System is recent linuxfromscratch, gcc details from the latest snapshot: ~ $/opt/gcc/bin/gcc -v Using built-in specs. COLLECT_GCC=/opt/gcc/bin/gcc COLLECT_LTO_WRAPPER=/opt/gcc/libexec/gcc/x86_64-pc-linux-gnu/12.1.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/opt/gcc --disable-multilib --with-system-zlib --enable-languages=c,c++ Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.1.1 20220514 (GCC)