public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Per Øyvind Karlsen" <peroyvind@mandriva.org>
To: binutils@sourceware.org
Subject: [PATCH]: force compatible linker flags for gold test suite
Date: Thu, 14 Jul 2011 18:46:00 -0000	[thread overview]
Message-ID: <CA+0WU1RqE62mH2VSPE0XgMO7Rrk2Zv0ShBvFWqtH1KwapZW9Tw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 201 bytes --]

This patch will enforce working linker flags to make the gold test suite
pass in case you'd modify the defaults and what the regression tests
relies on being built with.

--
Regards,
Per Øyvind

[-- Attachment #2: binutils-2.21.52.0.2-fix-overrides-for-gold-testsuite.patch --]
[-- Type: text/x-patch, Size: 10983 bytes --]

--- binutils-2.21.52.0.2/gold/testsuite/Makefile.am.gold_testsuite~	2011-06-08 15:31:01.000000000 +0200
+++ binutils-2.21.52.0.2/gold/testsuite/Makefile.am	2011-07-14 18:03:58.596458227 +0200
@@ -557,14 +557,14 @@ exception_same_shared_test_LDADD = excep
 exception_separate_shared_12_test_SOURCES = exception_test_main.cc
 exception_separate_shared_12_test_DEPENDENCIES = \
 	gcctestdir/ld exception_shared_1.so exception_shared_2.so
-exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,.
 exception_separate_shared_12_test_LDADD = \
 	exception_shared_1.so exception_shared_2.so
 
 exception_separate_shared_21_test_SOURCES = exception_test_main.cc
 exception_separate_shared_21_test_DEPENDENCIES = \
 	gcctestdir/ld exception_shared_1.so exception_shared_2.so
-exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,.
 exception_separate_shared_21_test_LDADD = \
 	exception_shared_2.so exception_shared_1.so
 
@@ -1288,7 +1288,7 @@ check_SCRIPTS += plugin_test_1.sh
 check_DATA += plugin_test_1.err
 MOSTLYCLEANFILES += plugin_test_1.err
 plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so
-	$(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err
+	$(CXXLINK) -Bgcctestdir/ -Wl,--no-as-needed -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err
 plugin_test_1.err: plugin_test_1
 	@touch plugin_test_1.err
 
@@ -1765,12 +1765,12 @@ MOSTLYCLEANFILES += strong_ref_weak_def_
 strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
 	$(COMPILE) -o $@ -c -fPIC $<
 strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
-	gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
+	gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_2.o
 strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
 	$(COMPILE) -o $@ -c -fPIC $<
 strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
 	gcctestdir/ld
-	gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
+	gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_1.o \
 		strong_ref_weak_def_2.so
 strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
 	$(TEST_READELF) -sWD $< > $@
@@ -1784,13 +1784,13 @@ MOSTLYCLEANFILES += dyn_weak_ref_1.so dy
 dyn_weak_ref_2.o: dyn_weak_ref_2.c
 	$(COMPILE) -o $@ -c -fPIC $<
 dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
-	gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
+	gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.o
 dyn_weak_ref_1.o: dyn_weak_ref_1.c
 	$(COMPILE) -o $@ -c -fPIC $<
 # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
 # so that the weak ref there goes to gold's symbol table first.
 dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
-	gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
+	gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
 dyn_weak_ref.stdout: dyn_weak_ref_1.so
 	$(TEST_READELF) -sWD $< > $@
 
@@ -1854,10 +1854,10 @@ incremental_test_4: two_file_test_1.o tw
 check_PROGRAMS += incremental_copy_test
 incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
 	cp -f copy_test_v1.o copy_test_tmp.o
-	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 	@sleep 1
 	cp -f copy_test.o copy_test_tmp.o
-	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 
 check_PROGRAMS += incremental_common_test_1
 incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
--- binutils-2.21.52.0.2/gold/testsuite/Makefile.in.gold_testsuite~	2011-06-08 15:31:01.000000000 +0200
+++ binutils-2.21.52.0.2/gold/testsuite/Makefile.in	2011-07-14 18:12:47.673606599 +0200
@@ -1996,7 +1996,7 @@ LDADD = libgoldtest.a ../libgold.a ../..
 @GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_DEPENDENCIES = \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld exception_shared_1.so exception_shared_2.so
 
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,.
 @GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_12_test_LDADD = \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	exception_shared_1.so exception_shared_2.so
 
@@ -2004,7 +2004,7 @@ LDADD = libgoldtest.a ../libgold.a ../..
 @GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_DEPENDENCIES = \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld exception_shared_1.so exception_shared_2.so
 
-@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
+@GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,.
 @GCC_TRUE@@NATIVE_LINKER_TRUE@exception_separate_shared_21_test_LDADD = \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	exception_shared_2.so exception_shared_1.so
 
@@ -4353,7 +4353,7 @@ uninstall-am:
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	test -d alt || mkdir -p alt
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -c -o $@ $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_1: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms gcctestdir/ld plugin_test.so
-@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err
+@GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	$(CXXLINK) -Bgcctestdir/ -Wl,--no-as-needed -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms empty.syms 2>plugin_test_1.err
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_1.err: plugin_test_1
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@	@touch plugin_test_1.err
 @GCC_TRUE@@NATIVE_LINKER_TRUE@@PLUGINS_TRUE@plugin_test_2: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so gcctestdir/ld plugin_test.so
@@ -4602,25 +4602,25 @@ uninstall-am:
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.o: strong_ref_weak_def_2.c
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -o $@ -c -fPIC $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_2.so: strong_ref_weak_def_2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld -shared -o $@ strong_ref_weak_def_2.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_2.o
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_1.o: strong_ref_weak_def_1.c
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -o $@ -c -fPIC $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def_1.so: strong_ref_weak_def_1.o strong_ref_weak_def_2.so \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld -shared -o $@ strong_ref_weak_def_1.o \
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld --hash-style=sysv -shared -o $@ strong_ref_weak_def_1.o \
 @GCC_TRUE@@NATIVE_LINKER_TRUE@		strong_ref_weak_def_2.so
 @GCC_TRUE@@NATIVE_LINKER_TRUE@strong_ref_weak_def.stdout: strong_ref_weak_def_1.so
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -sWD $< > $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_2.o: dyn_weak_ref_2.c
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -o $@ -c -fPIC $<
 @GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_2.so: dyn_weak_ref_2.o gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld -shared -o $@ dyn_weak_ref_2.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.o
 @GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_1.o: dyn_weak_ref_1.c
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(COMPILE) -o $@ -c -fPIC $<
 # We intentionally put dyn_weak_ref_2.so in front of dyn_weak_ref_1.o
 # so that the weak ref there goes to gold's symbol table first.
 @GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref_1.so: dyn_weak_ref_1.o dyn_weak_ref_2.so gcctestdir/ld
-@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
+@GCC_TRUE@@NATIVE_LINKER_TRUE@	gcctestdir/ld --hash-style=sysv -shared -o $@ dyn_weak_ref_2.so dyn_weak_ref_1.o
 @GCC_TRUE@@NATIVE_LINKER_TRUE@dyn_weak_ref.stdout: dyn_weak_ref_1.so
 @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(TEST_READELF) -sWD $< > $@
 @GCC_TRUE@@NATIVE_LINKER_TRUE@start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
@@ -4659,10 +4659,10 @@ uninstall-am:
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update,--incremental-base=incremental_test_4.base -Bgcctestdir/ two_file_test_1.o two_file_test_1b.o two_file_test_tmp_4.o two_file_test_main.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_copy_test: copy_test_v1.o copy_test.o copy_test_1.so copy_test_2.so
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f copy_test_v1.o copy_test_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	@sleep 1
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f copy_test.o copy_test_tmp.o
-@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
+@DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-update -Bgcctestdir/ -Wl,--no-as-needed -Wl,-R,. copy_test_tmp.o copy_test_1.so copy_test_2.so
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@incremental_common_test_1: common_test_1_v1.o common_test_1_v2.o gcctestdir/ld
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	cp -f common_test_1_v1.o common_test_1_tmp.o
 @DEFAULT_TARGET_X86_64_TRUE@@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Wl,--incremental-full -Bgcctestdir/ common_test_1_tmp.o

             reply	other threads:[~2011-07-14 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-14 18:46 Per Øyvind Karlsen [this message]
2011-07-15  1:47 ` Ian Lance Taylor
2011-07-15  2:38   ` Per Øyvind Karlsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+0WU1RqE62mH2VSPE0XgMO7Rrk2Zv0ShBvFWqtH1KwapZW9Tw@mail.gmail.com \
    --to=peroyvind@mandriva.org \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).