This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: force compatible linker flags for gold test suite


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
--- 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]