diff options
author | Ian Lance Taylor <ian@airs.com> | 2011-07-02 00:19:04 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2011-07-02 00:19:04 +0000 |
commit | 328c7c2f681aeea5792099d68349c440a5a3d663 (patch) | |
tree | 4e47b7c7f9ed8ad63a025444f7f31581cddf458e /gold/testsuite/Makefile.am | |
parent | 02d7cd4495b617a9dc356b4f5140a74d020df6f5 (diff) | |
download | gdb-328c7c2f681aeea5792099d68349c440a5a3d663.zip gdb-328c7c2f681aeea5792099d68349c440a5a3d663.tar.gz gdb-328c7c2f681aeea5792099d68349c440a5a3d663.tar.bz2 |
PR gold/12525
* configure.ac: Test whether static linking works, setting
the automake conditional HAVE_STATIC.
* testsuite/Makefile.am: Disable tests using -static if
HAVE_STATIC is not true.
* configure, testsuite/Makefile.in: Rebuild.
Diffstat (limited to 'gold/testsuite/Makefile.am')
-rw-r--r-- | gold/testsuite/Makefile.am | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am index 5cd808f..c7632c5 100644 --- a/gold/testsuite/Makefile.am +++ b/gold/testsuite/Makefile.am @@ -257,22 +257,28 @@ icf_sht_rel_addend_test.stdout: icf_sht_rel_addend_test $(TEST_NM) icf_sht_rel_addend_test > icf_sht_rel_addend_test.stdout check_PROGRAMS += basic_test -check_PROGRAMS += basic_static_test check_PROGRAMS += basic_pic_test -check_PROGRAMS += basic_static_pic_test basic_test.o: basic_test.cc $(CXXCOMPILE) -O0 -c -o $@ $< basic_test: basic_test.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ basic_test.o + +if HAVE_STATIC +check_PROGRAMS += basic_static_test basic_static_test: basic_test.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -static basic_test.o +endif basic_pic_test.o: basic_test.cc $(CXXCOMPILE) -O0 -c -fpic -o $@ $< basic_pic_test: basic_pic_test.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ basic_pic_test.o + +if HAVE_STATIC +check_PROGRAMS += basic_static_pic_test basic_static_pic_test: basic_pic_test.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o +endif check_PROGRAMS += basic_pie_test basic_pie_test.o: basic_test.cc @@ -281,20 +287,20 @@ basic_pie_test: basic_pie_test.o gcctestdir/ld $(CXXLINK) -Bgcctestdir/ -pie basic_pie_test.o check_PROGRAMS += constructor_test -check_PROGRAMS += constructor_static_test constructor_test_SOURCES = constructor_test.cc constructor_test_DEPENDENCIES = gcctestdir/ld constructor_test_LDFLAGS = -Bgcctestdir/ constructor_test_LDADD = +if HAVE_STATIC +check_PROGRAMS += constructor_static_test constructor_static_test_SOURCES = $(constructor_test_SOURCES) constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static constructor_static_test_LDADD = $(constructor_test_LDADD) - +endif check_PROGRAMS += two_file_test -check_PROGRAMS += two_file_static_test check_PROGRAMS += two_file_pic_test two_file_test_SOURCES = \ two_file_test_1.cc \ @@ -306,10 +312,13 @@ two_file_test_DEPENDENCIES = gcctestdir/ld two_file_test_LDFLAGS = -Bgcctestdir/ two_file_test_LDADD = +if HAVE_STATIC +check_PROGRAMS += two_file_static_test two_file_static_test_SOURCES = $(two_file_test_SOURCES) two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static two_file_static_test_LDADD = $(two_file_test_LDADD) +endif two_file_pic_test_SOURCES = two_file_test_main.cc two_file_pic_test_DEPENDENCIES = \ @@ -514,7 +523,6 @@ common_test_3.so: common_test_3_pic.o ver_test_2.script gcctestdir/ld $(LINK) -Bgcctestdir/ -shared common_test_3_pic.o -Wl,--version-script,$(srcdir)/ver_test_2.script check_PROGRAMS += exception_test -check_PROGRAMS += exception_static_test check_PROGRAMS += exception_shared_1_test check_PROGRAMS += exception_shared_2_test check_PROGRAMS += exception_same_shared_test @@ -540,10 +548,13 @@ exception_test_DEPENDENCIES = gcctestdir/ld exception_test_LDFLAGS = -Bgcctestdir/ exception_test_LDADD = +if HAVE_STATIC +check_PROGRAMS += exception_static_test exception_static_test_SOURCES = $(exception_test_SOURCES) exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static exception_static_test_LDADD = $(exception_test_LDADD) +endif exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so @@ -778,6 +789,7 @@ endif TLS_DESCRIPTORS endif TLS_GNU2_DIALECT +if HAVE_STATIC if STATIC_TLS check_PROGRAMS += tls_static_test check_PROGRAMS += tls_static_pic_test @@ -792,6 +804,7 @@ tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) endif +endif if FN_PTRS_IN_SO_WITHOUT_PIC check_PROGRAMS += tls_shared_nonpic_test @@ -1615,6 +1628,7 @@ ifuncmain1pic.o: ifuncmain1.c ifuncmain1pie.o: ifuncmain1.c $(COMPILE) -c -fpie -o $@ $< +if HAVE_STATIC check_PROGRAMS += ifuncmain1static ifuncmain1static_SOURCES = ifuncmain1.c ifuncmain1static_DEPENDENCIES = gcctestdir/ld ifuncdep1.o @@ -1624,6 +1638,7 @@ ifuncmain1static_LDADD = ifuncdep1.o check_PROGRAMS += ifuncmain1picstatic ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o +endif check_PROGRAMS += ifuncmain1 ifuncmain1_SOURCES = ifuncmain1.c @@ -1671,6 +1686,7 @@ ifuncmain2pic.o: ifuncmain2.c ifuncdep2pic.o: ifuncdep2.c $(COMPILE) -c -fpic -o $@ $< +if HAVE_STATIC check_PROGRAMS += ifuncmain2static ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c ifuncmain2static_DEPENDENCIES = gcctestdir/ld @@ -1680,6 +1696,7 @@ ifuncmain2static_LDADD = check_PROGRAMS += ifuncmain2picstatic ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o +endif check_PROGRAMS += ifuncmain2 ifuncmain2_SOURCES = ifuncmain2.c ifuncdep2.c @@ -1705,6 +1722,7 @@ ifuncmain3_LDADD = -ldl ifuncmain4pic.o: ifuncmain4.c $(COMPILE) -c -fpic -o $@ $< +if HAVE_STATIC check_PROGRAMS += ifuncmain4static ifuncmain4static_SOURCES = ifuncmain4.c ifuncmain4static_DEPENDENCIES = gcctestdir/ld @@ -1714,6 +1732,7 @@ ifuncmain4static_LDADD = check_PROGRAMS += ifuncmain4picstatic ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o +endif check_PROGRAMS += ifuncmain4 ifuncmain4_SOURCES = ifuncmain4.c @@ -1735,6 +1754,7 @@ ifuncmod5.so: ifuncmod5.o gcctestdir/ld ifuncdep5.o: ifuncmod5.c $(COMPILE) -c -o $@ $< +if HAVE_STATIC check_PROGRAMS += ifuncmain5static ifuncmain5static_SOURCES = ifuncmain5.c ifuncmain5static_DEPENDENCIES = gcctestdir/ld ifuncdep5.o @@ -1744,6 +1764,7 @@ ifuncmain5static_LDADD = ifuncdep5.o check_PROGRAMS += ifuncmain5picstatic ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o +endif check_PROGRAMS += ifuncmain5 ifuncmain5_SOURCES = ifuncmain5.c @@ -1781,6 +1802,7 @@ ifuncmain7pic.o: ifuncmain7.c ifuncmain7pie.o: ifuncmain7.c $(COMPILE) -c -fpie -o $@ $< +if HAVE_STATIC check_PROGRAMS += ifuncmain7static ifuncmain7static_SOURCES = ifuncmain7.c ifuncmain7static_DEPENDENCIES = gcctestdir/ld @@ -1790,6 +1812,7 @@ ifuncmain7static_LDADD = check_PROGRAMS += ifuncmain7picstatic ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o +endif check_PROGRAMS += ifuncmain7 ifuncmain7_SOURCES = ifuncmain7.c |