public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS
@ 2022-05-19  9:22 zarniwhoop at ntlworld dot com
  2022-05-19  9:37 ` [Bug c++/105657] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: zarniwhoop at ntlworld dot com @ 2022-05-19  9:22 UTC (permalink / raw)
  To: gcc-bugs

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS
  2022-05-19  9:22 [Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS zarniwhoop at ntlworld dot com
@ 2022-05-19  9:37 ` redi at gcc dot gnu.org
  2022-05-19  9:41 ` [Bug libstdc++/105657] " redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-05-19  9:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That symbol is in libstdc++.so.6.0.30 so I assume you're linking to the wrong
libstdc++.so, which is probably caused by -L/usr/lib/../lib

Try adding -Wl,--trace to the g++ linker command and see which libstdc++.so is
being used.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS
  2022-05-19  9:22 [Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS zarniwhoop at ntlworld dot com
  2022-05-19  9:37 ` [Bug c++/105657] " redi at gcc dot gnu.org
@ 2022-05-19  9:41 ` redi at gcc dot gnu.org
  2022-05-19 13:15 ` zarniwhoop at ntlworld dot com
  2022-05-19 13:33 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-05-19  9:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Keywords|                            |link-failure
             Status|UNCONFIRMED                 |WAITING
          Component|c++                         |libstdc++
   Last reconfirmed|                            |2022-05-19

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS
  2022-05-19  9:22 [Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS zarniwhoop at ntlworld dot com
  2022-05-19  9:37 ` [Bug c++/105657] " redi at gcc dot gnu.org
  2022-05-19  9:41 ` [Bug libstdc++/105657] " redi at gcc dot gnu.org
@ 2022-05-19 13:15 ` zarniwhoop at ntlworld dot com
  2022-05-19 13:33 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: zarniwhoop at ntlworld dot com @ 2022-05-19 13:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

--- Comment #2 from Ken Moffat <zarniwhoop at ntlworld dot com> ---
Jonathan,

many thinks for your time and and explanation. It seems that when the desired
version of gcc is in /opt/gcc, the mach build system used by firefox needs
LDFLAGS=" -L/opt/gcc/lib" - that allowed it to build.

I'm not sure how to close this as 'invalid' or 'user error' - I could mark it
as 'resolved' but that would be misleading.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug libstdc++/105657] Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS
  2022-05-19  9:22 [Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS zarniwhoop at ntlworld dot com
                   ` (2 preceding siblings ...)
  2022-05-19 13:15 ` zarniwhoop at ntlworld dot com
@ 2022-05-19 13:33 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-05-19 13:33 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105657

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks for confirming the solution. Closing as invalid then :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-19 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-19  9:22 [Bug c++/105657] New: Build failure in firefox libxul.so if -DGLIBCXX_ASSERTIONS is in my CXXFLAGS zarniwhoop at ntlworld dot com
2022-05-19  9:37 ` [Bug c++/105657] " redi at gcc dot gnu.org
2022-05-19  9:41 ` [Bug libstdc++/105657] " redi at gcc dot gnu.org
2022-05-19 13:15 ` zarniwhoop at ntlworld dot com
2022-05-19 13:33 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).