Fix testsuite failures caused by -static-libgcc and -static-libstdc++ options
Cary Coutant
ccoutant@google.com
Thu Dec 20 23:15:00 GMT 2012
This patch adds -shared-libgcc and -Bdynamic -lstdc++ options to
counteract the effect of the -static... options now passed in from the
top-level config. With a static libstdc++, the link of debug_msg_so
succeeds instead of printing several undefined variables, because we
suppress the printing of undefined variables when building a shared
object with unresolved DT_NEEDED entries.
Tested on x86_64. OK to commit?
-cary
gold/
* testsuite/Makefile.am (debug_msg_so.err): Add -shared-libgcc and
-Bdynamic -lstdc++ options.
(debug_msg_ndebug.err): Likewise.
* testsuite/Makefile.in: Regenerate.
-------------- next part --------------
2012-12-20 Cary Coutant <ccoutant@google.com>
gold/
* testsuite/Makefile.am (debug_msg_so.err): Add --shared-libgcc and
-Bdynamic -lstdc++ options.
(debug_msg_ndebug.err): Likewise.
* testsuite/Makefile.in: Regenerate.
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
index 745e13d..7772db2 100644
--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -982,8 +982,8 @@ odr_violation1.so: odr_violation1.cc gcctestdir/ld
odr_violation2.so: odr_violation2.cc gcctestdir/ld
$(CXXCOMPILE) -Bgcctestdir/ -O2 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
- @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
- @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
+ @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so -shared-libgcc -Bdynamic -lstdc++ "2>$@"
+ @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so -shared-libgcc -Bdynamic -lstdc++ 2>$@; \
then \
echo 1>&2 "Link of debug_msg_so should have failed"; \
rm -f $@; \
@@ -1001,8 +1001,8 @@ odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
$(CXXCOMPILE) -Bgcctestdir/ -O2 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
- @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
- @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
+ @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ "2>$@"
+ @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so -shared-libgcc -Bdynamic -lstdc++ 2>$@; \
then \
echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
rm -f $@; \
More information about the Binutils
mailing list