public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH]: force compatible linker flags for gold test suite
@ 2011-07-14 18:46 Per Øyvind Karlsen
  2011-07-15  1:47 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Per Øyvind Karlsen @ 2011-07-14 18:46 UTC (permalink / raw)
  To: binutils

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

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

* Re: [PATCH]: force compatible linker flags for gold test suite
  2011-07-14 18:46 [PATCH]: force compatible linker flags for gold test suite Per Øyvind Karlsen
@ 2011-07-15  1:47 ` Ian Lance Taylor
  2011-07-15  2:38   ` Per Øyvind Karlsen
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2011-07-15  1:47 UTC (permalink / raw)
  To: Per Øyvind Karlsen; +Cc: binutils

Per Øyvind Karlsen <peroyvind@mandriva.org> writes:

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

Thanks, but are you changing the defaults in the gold source code?  If
so, I'm not interested in applying this patch to the main sources; it
should be part of the patch which changes the defaults.

Ian

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

* Re: [PATCH]: force compatible linker flags for gold test suite
  2011-07-15  1:47 ` Ian Lance Taylor
@ 2011-07-15  2:38   ` Per Øyvind Karlsen
  0 siblings, 0 replies; 3+ messages in thread
From: Per Øyvind Karlsen @ 2011-07-15  2:38 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: binutils

2011/7/14 Ian Lance Taylor <iant@google.com>:
> Per Øyvind Karlsen <peroyvind@mandriva.org> writes:
>
>> 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.
>
> Thanks, but are you changing the defaults in the gold source code?  If
I'm changing the defaults in gold/options.h, for now I'm mostly playing around
with it, but what I'm aiming at is to enable the linker flags we
already (should)
pass by policy to packages by default, this due to a lot of packagers either
being unaware of being advised to do so, unable to do so, hard time do
it in a clean fashion for some software, and there's also the matter of
positional flags such as --as-needed which very often ends up being passed
"too late" due to LDFLAGS in make files not being in the most optimal
position..

So the idea is that it's more desired to enforce the policy by default
and rather
disable whatever it might break when it happens, than the opposite..

> so, I'm not interested in applying this patch to the main sources; it
> should be part of the patch which changes the defaults.
I'm considering the patch for this to be more the kind of locallu customized
settings for our toolchain (you'll find the patch in our svn), and less likely
to be of that great interest to others, while the patch for the test suite
is more of general usefulness to others while also ensuring some sanity
for the tests to be run..  :)

--
Regards,
Per Øyvind

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

end of thread, other threads:[~2011-07-14 22:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-14 18:46 [PATCH]: force compatible linker flags for gold test suite Per Øyvind Karlsen
2011-07-15  1:47 ` Ian Lance Taylor
2011-07-15  2:38   ` Per Øyvind Karlsen

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