[gold][patch][testsuite] Fix nonexisting .c default _SOURCES

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[gold][patch][testsuite] Fix nonexisting .c default _SOURCES

Jan Kratochvil-2
Hi,

as posted by Jiang Jilin in
        [PATCH] Fix the TAGS object
        http://sourceware.org/ml/gdb-patches/2010-09/msg00320.html

`make tags' currently:
        make[1]: Entering directory `.../gold/testsuite'
        make[1]: *** No rule to make target `basic_pic_test.c', needed by `TAGS'.  Stop.

due to automake `Default _SOURCES'.

OK to check-in?

On x86_64-fedora14snapshot-linux-gnu the testsuite `make -j1 -k check' output
is the same (although ld-new cannot find libstdc++ in both cases).


Thanks,
Jan


gold/
2010-10-10  Jan Kratochvil  <[hidden email]>
            Jiang Jilin  <[hidden email]>

        * testsuite/Makefile.am (icf_virtual_function_folding_test_SOURCES)
        (basic_test_SOURCES basic_static_test_SOURCES basic_pic_test_SOURCES)
        (basic_static_pic_test_SOURCES basic_pie_test_SOURCES)
        (two_file_pie_test_SOURCES two_file_mixed_pie_test_SOURCES)
        (two_file_strip_test_SOURCES weak_plt_SOURCES tls_pie_test_SOURCES)
        (tls_pie_pic_test_SOURCES many_sections_r_test_SOURCES)
        (flagstest_o_specialfile_SOURCES)
        (flagstest_compress_debug_sections_SOURCES)
        (flagstest_o_specialfile_and_compress_debug_sections_SOURCES)
        (script_test_3_SOURCES plugin_test_1_SOURCES plugin_test_2_SOURCES)
        (plugin_test_3_SOURCES plugin_test_4_SOURCES plugin_test_5_SOURCES)
        (plugin_test_6_SOURCES plugin_test_7_SOURCES plugin_test_8_SOURCES)
        (local_labels_test_SOURCES permission_test_SOURCES)
        (ifuncmain1picstatic_SOURCES ifuncmain1pic_SOURCES)
        (ifuncmain1vispic_SOURCES ifuncmain1staticpic_SOURCES)
        (ifuncmain1pie_SOURCES ifuncmain1vispie_SOURCES)
        (ifuncmain1staticpie_SOURCES ifuncmain2picstatic_SOURCES)
        (ifuncmain2pic_SOURCES ifuncmain4picstatic_SOURCES)
        (ifuncmain5picstatic_SOURCES ifuncmain5pic_SOURCES)
        (ifuncmain5staticpic_SOURCES ifuncmain5pie_SOURCES)
        (ifuncmain7picstatic_SOURCES ifuncmain7pic_SOURCES)
        (ifuncmain7pie_SOURCES start_lib_test_SOURCES): New as empty.
        * testsuite/Makefile.in: Regenerate.

--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -206,6 +206,7 @@ final_layout.stdout: final_layout
  $(TEST_NM) final_layout > final_layout.stdout
 
 check_PROGRAMS += icf_virtual_function_folding_test
+icf_virtual_function_folding_test_SOURCES =
 MOSTLYCLEANFILES += icf_virtual_function_folding_test
 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
@@ -245,9 +246,13 @@ 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
+basic_test_SOURCES =
 check_PROGRAMS += basic_static_test
+basic_static_test_SOURCES =
 check_PROGRAMS += basic_pic_test
+basic_pic_test_SOURCES =
 check_PROGRAMS += basic_static_pic_test
+basic_static_pic_test_SOURCES =
 basic_test.o: basic_test.cc
  $(CXXCOMPILE) -O0 -c -o $@ $<
 basic_test: basic_test.o gcctestdir/ld
@@ -263,6 +268,7 @@ basic_static_pic_test: basic_pic_test.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
 
 check_PROGRAMS += basic_pie_test
+basic_pie_test_SOURCES =
 basic_pie_test.o: basic_test.cc
  $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
 basic_pie_test: basic_pie_test.o gcctestdir/ld
@@ -377,6 +383,7 @@ two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_f
  gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
 
 check_PROGRAMS += two_file_pie_test
+two_file_pie_test_SOURCES =
 two_file_test_1_pie.o: two_file_test_1.cc
  $(CXXCOMPILE) -c -fpie -o $@ $<
 two_file_test_1b_pie.o: two_file_test_1b.cc
@@ -462,6 +469,7 @@ two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
 
 check_PROGRAMS += two_file_mixed_pie_test
+two_file_mixed_pie_test_SOURCES =
 two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
  two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so
@@ -469,6 +477,7 @@ two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
 endif FN_PTRS_IN_SO_WITHOUT_PIC
 
 check_PROGRAMS += two_file_strip_test
+two_file_strip_test_SOURCES =
 two_file_strip_test: two_file_test
  $(TEST_STRIP) -o two_file_strip_test two_file_test
 
@@ -630,6 +639,7 @@ weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
 
 check_SCRIPTS += weak_plt.sh
 check_PROGRAMS += weak_plt
+weak_plt_SOURCES =
 check_DATA += weak_plt_shared.so
 weak_plt_main_pic.o: weak_plt_main.cc
  $(CXXCOMPILE) -c -fpic -o $@ $<
@@ -659,7 +669,9 @@ if TLS
 check_PROGRAMS += tls_test
 check_PROGRAMS += tls_pic_test
 check_PROGRAMS += tls_pie_test
+tls_pie_test_SOURCES =
 check_PROGRAMS += tls_pie_pic_test
+tls_pie_pic_test_SOURCES =
 check_PROGRAMS += tls_shared_test
 check_PROGRAMS += tls_shared_ie_test
 check_PROGRAMS += tls_shared_gd_to_ie_test
@@ -817,6 +829,7 @@ many_sections_check.h:
  mv -f $@.tmp $@
 
 check_PROGRAMS += many_sections_r_test
+many_sections_r_test_SOURCES =
 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
  gcctestdir/ld -r -o $@ many_sections_test.o
 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
@@ -912,6 +925,7 @@ undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
 
 # Test -o when emitting to a special file (such as something in /dev).
 check_PROGRAMS += flagstest_o_specialfile
+flagstest_o_specialfile_SOURCES =
 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
  chmod a+x $@
@@ -921,6 +935,7 @@ if HAVE_ZLIB
 
 # Test --compress-debug-sections.  FIXME: check we actually compress.
 check_PROGRAMS += flagstest_compress_debug_sections
+flagstest_compress_debug_sections_SOURCES =
 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
  test -s $@
@@ -929,6 +944,7 @@ flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
 # The specialfile output has a tricky case when we also compress debug
 # sections, because it requires output-file resizing.
 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
+flagstest_o_specialfile_and_compress_debug_sections_SOURCES =
 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
  gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
@@ -1142,6 +1158,7 @@ ver_matching_test.stdout: ver_matching_def.so
  $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
 
 check_PROGRAMS += script_test_3
+script_test_3_SOURCES =
 check_SCRIPTS += script_test_3.sh
 check_DATA += script_test_3.stdout
 MOSTLYCLEANFILES += script_test_3.stdout
@@ -1270,6 +1287,7 @@ alt/thin_archive_test_4.o: thin_archive_test_4.cc
 if PLUGINS
 
 check_PROGRAMS += plugin_test_1
+plugin_test_1_SOURCES =
 check_SCRIPTS += plugin_test_1.sh
 check_DATA += plugin_test_1.err
 MOSTLYCLEANFILES += plugin_test_1.err
@@ -1279,6 +1297,7 @@ plugin_test_1.err: plugin_test_1
  @touch plugin_test_1.err
 
 check_PROGRAMS += plugin_test_2
+plugin_test_2_SOURCES =
 check_SCRIPTS += plugin_test_2.sh
 check_DATA += plugin_test_2.err
 MOSTLYCLEANFILES += plugin_test_2.err
@@ -1288,6 +1307,7 @@ plugin_test_2.err: plugin_test_2
  @touch plugin_test_2.err
 
 check_PROGRAMS += plugin_test_3
+plugin_test_3_SOURCES =
 check_SCRIPTS += plugin_test_3.sh
 check_DATA += plugin_test_3.err
 MOSTLYCLEANFILES += plugin_test_3.err
@@ -1297,6 +1317,7 @@ plugin_test_3.err: plugin_test_3
  @touch plugin_test_3.err
 
 check_PROGRAMS += plugin_test_4
+plugin_test_4_SOURCES =
 check_SCRIPTS += plugin_test_4.sh
 check_DATA += plugin_test_4.err
 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
@@ -1309,10 +1330,12 @@ plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
  $(TEST_AR) cr $@ $^
 
 check_PROGRAMS += plugin_test_5
+plugin_test_5_SOURCES =
 plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so
  $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms
 
 check_PROGRAMS += plugin_test_6
+plugin_test_6_SOURCES =
 check_SCRIPTS += plugin_test_6.sh
 check_DATA += plugin_test_6.err
 MOSTLYCLEANFILES += plugin_test_6.err
@@ -1322,6 +1345,7 @@ plugin_test_6.err: plugin_test_6
  @touch plugin_test_6.err
 
 check_PROGRAMS += plugin_test_7
+plugin_test_7_SOURCES =
 check_SCRIPTS += plugin_test_7.sh
 check_DATA += plugin_test_7.err plugin_test_7.syms
 MOSTLYCLEANFILES += plugin_test_7.err
@@ -1341,6 +1365,7 @@ plugin_test_7.err: plugin_test_7
 
 # Test plugins with -r.
 check_PROGRAMS += plugin_test_8
+plugin_test_8_SOURCES =
 plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so
  ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o
 plugin_test_8: plugin_test_8.o gcctestdir/ld
@@ -1424,6 +1449,7 @@ alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
  $(TEST_AR) rc $@ $^
 
 check_PROGRAMS += local_labels_test
+local_labels_test_SOURCES =
 local_labels_test.o: ver_test_6.c
  $(COMPILE) -g -c -Wa,-L -o $@ $<
 local_labels_test: local_labels_test.o
@@ -1500,6 +1526,7 @@ retain_symbols_file_test.stdout: retain_symbols_file_test.so
 # Test that if the output file already exists and is empty,
 # it will get execute permission.
 check_PROGRAMS += permission_test
+permission_test_SOURCES =
 permission_test: basic_test.o gcctestdir/ld
  umask 022; \
  rm -f $@; \
@@ -1558,6 +1585,7 @@ ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
 ifuncmain1static_LDADD = ifuncdep1.o
 
 check_PROGRAMS += ifuncmain1picstatic
+ifuncmain1picstatic_SOURCES =
 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
 
@@ -1568,6 +1596,7 @@ ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain1_LDADD = ifuncmod1.so
 
 check_PROGRAMS += ifuncmain1pic
+ifuncmain1pic_SOURCES =
 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 
@@ -1578,26 +1607,31 @@ ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain1vis_LDADD = ifuncmod1.so
 
 check_PROGRAMS += ifuncmain1vispic
+ifuncmain1vispic_SOURCES =
 ifuncmain1vispic.o: ifuncmain1vis.c
  $(COMPILE) -c -fpic -o $@ $<
 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1staticpic
+ifuncmain1staticpic_SOURCES =
 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
 
 check_PROGRAMS += ifuncmain1pie
+ifuncmain1pie_SOURCES =
 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1vispie
+ifuncmain1vispie_SOURCES =
 ifuncmain1vispie.o: ifuncmain1vis.c
  $(COMPILE) -c -fpie -o $@ $<
 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1staticpie
+ifuncmain1staticpie_SOURCES =
 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
 
@@ -1613,6 +1647,7 @@ ifuncmain2static_DEPENDENCIES = gcctestdir/ld
 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain2picstatic
+ifuncmain2picstatic_SOURCES =
 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
 
@@ -1622,6 +1657,7 @@ ifuncmain2_DEPENDENCIES = gcctestdir/ld
 ifuncmain2_LDFLAGS = -Bgcctestdir/
 
 check_PROGRAMS += ifuncmain2pic
+ifuncmain2pic_SOURCES =
 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
 
@@ -1645,6 +1681,7 @@ ifuncmain4static_DEPENDENCIES = gcctestdir/ld
 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain4picstatic
+ifuncmain4picstatic_SOURCES =
 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
 
@@ -1674,6 +1711,7 @@ ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
 ifuncmain5static_LDADD = ifuncdep5.o
 
 check_PROGRAMS += ifuncmain5picstatic
+ifuncmain5picstatic_SOURCES =
 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
 
@@ -1684,14 +1722,17 @@ ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain5_LDADD = ifuncmod5.so
 
 check_PROGRAMS += ifuncmain5pic
+ifuncmain5pic_SOURCES =
 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain5staticpic
+ifuncmain5staticpic_SOURCES =
 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
 
 check_PROGRAMS += ifuncmain5pie
+ifuncmain5pie_SOURCES =
 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
 
@@ -1719,6 +1760,7 @@ ifuncmain7static_DEPENDENCIES = gcctestdir/ld
 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain7picstatic
+ifuncmain7picstatic_SOURCES =
 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
 
@@ -1728,10 +1770,12 @@ ifuncmain7_DEPENDENCIES = gcctestdir/ld
 ifuncmain7_LDFLAGS = -Bgcctestdir/
 
 check_PROGRAMS += ifuncmain7pic
+ifuncmain7pic_SOURCES =
 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain7pic.o
 
 check_PROGRAMS += ifuncmain7pie
+ifuncmain7pie_SOURCES =
 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
 
@@ -1777,6 +1821,7 @@ dyn_weak_ref.stdout: dyn_weak_ref_1.so
 
 # Test that --start-lib and --end-lib function correctly.
 check_PROGRAMS += start_lib_test
+start_lib_test_SOURCES =
 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
  gcctestdir/ld
  $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
Reply | Threaded
Open this post in threaded view
|

Re: [gold][patch][testsuite] Fix nonexisting .c default _SOURCES

Ralf Wildenhues
Hi Jan,

* Jan Kratochvil wrote on Sun, Oct 10, 2010 at 07:54:39PM CEST:
> as posted by Jiang Jilin in
> [PATCH] Fix the TAGS object
> http://sourceware.org/ml/gdb-patches/2010-09/msg00320.html
>
> `make tags' currently:
> make[1]: Entering directory `.../gold/testsuite'
> make[1]: *** No rule to make target `basic_pic_test.c', needed by `TAGS'.  Stop.
>
> due to automake `Default _SOURCES'.

The patch can be simplified to this line (untested):
  AM_DEFAULT_SOURCE_EXT = .cc

for all sources ending in .cc at least.

Cheers,
Ralf
Reply | Threaded
Open this post in threaded view
|

Re: [gold][patch][testsuite] Fix nonexisting .c default _SOURCES

Jan Kratochvil-2
Hi Ralf,

On Sun, 10 Oct 2010 20:01:51 +0200, Ralf Wildenhues wrote:
> The patch can be simplified to this line (untested):
>   AM_DEFAULT_SOURCE_EXT = .cc
>
> for all sources ending in .cc at least.

the rules are more complicated; but you are right *_SOURCES in fact should
list the real sources, so that `make tags' index really all the files there.

There is a problem that for unsatisfied AM_CONDITIONALs the files are not
listed for `make tags'.  But moving all the *_SOURCES definitions out of their
conditional parts complicates it a lot.

`make tags' now lists all the persent *.{cc,c,h} files.  I did not intend to
create such patch first.

Some Makefile.in rules now contain $(CXXLINK) instead of $(LINK) but those
rules are always overriden by Makefile.am anyway (which uses $(CXXLINK)).

OK to check it this one?


Thanks,
Jan


gold/
2010-10-10  Jan Kratochvil  <[hidden email]>

        * testsuite/Makefile.am (TAGS_FILES): New.
        (libgoldtest_a_SOURCES): Add test.h and testfile.h.
        (icf_virtual_function_folding_test_SOURCES basic_test_SOURCES)
        (basic_static_test_SOURCES basic_pic_test_SOURCES)
        (basic_static_pic_test_SOURCES basic_pie_test_SOURCES)
        (two_file_pie_test_SOURCES two_file_mixed_pie_test_SOURCES)
        (two_file_strip_test_SOURCES EXTRA_common_test_2_SOURCES): New.
        (weak_undef_test_SOURCES): Add weak_undef.h.
        (EXTRA_weak_undef_test_SOURCES EXTRA_weak_alias_test_SOURCES)
        (weak_plt_SOURCES EXTRA_copy_test_SOURCES tls_pie_test_SOURCES)
        (tls_pie_pic_test_SOURCES many_sections_r_test_SOURCES)
        (flagstest_o_specialfile_SOURCES)
        (flagstest_compress_debug_sections_SOURCES)
        (flagstest_o_specialfile_and_compress_debug_sections_SOURCES): New.
        (ver_test_SOURCES): Add ver_test.h.
        (EXTRA_ver_test_SOURCES EXTRA_ver_test_9_SOURCES)
        (EXTRA_protected_1_SOURCES EXTRA_relro_test_SOURCES)
        (EXTRA_justsyms_SOURCES script_test_3_SOURCES)
        (EXTRA_thin_archive_test_1_SOURCES plugin_test_1_SOURCES)
        (plugin_test_2_SOURCES plugin_test_3_SOURCES plugin_test_4_SOURCES)
        (plugin_test_5_SOURCES plugin_test_6_SOURCES plugin_test_7_SOURCES)
        (plugin_test_8_SOURCES local_labels_test_SOURCES)
        (permission_test_SOURCES EXTRA_searched_file_test_SOURCES)
        (ifuncmain1picstatic_SOURCES ifuncmain1pic_SOURCES)
        (ifuncmain1vispic_SOURCES ifuncmain1staticpic_SOURCES)
        (ifuncmain1pie_SOURCES ifuncmain1vispie_SOURCES)
        (ifuncmain1staticpie_SOURCES): New.
        (ifuncmain2static_SOURCES): Add ifunc-sel.h.
        (ifuncmain2picstatic_SOURCES ifuncmain2pic_SOURCES)
        (EXTRA_ifuncmain3_SOURCES ifuncmain4picstatic_SOURCES)
        (ifuncmain5picstatic_SOURCES ifuncmain5pic_SOURCES)
        (ifuncmain5staticpic_SOURCES ifuncmain5pie_SOURCES)
        (EXTRA_ifuncmain6pie_SOURCES ifuncmain7picstatic_SOURCES)
        (ifuncmain7pic_SOURCES ifuncmain7pie_SOURCES start_lib_test_SOURCES):
        New.
        * testsuite/Makefile.in: Regenerate.

--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -53,6 +53,7 @@ check_SCRIPTS =
 check_DATA =
 check_PROGRAMS =
 BUILT_SOURCES =
+TAGS_FILES =
 
 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 
@@ -61,7 +62,7 @@ TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 
 # Infrastucture needed for the unittests
 check_LIBRARIES = libgoldtest.a
-libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
+libgoldtest_a_SOURCES = test.cc test.h testmain.cc testfile.cc testfile.h
 
 DEPENDENCIES = \
  libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
@@ -108,6 +109,7 @@ flagstest_ndebug.o: constructor_test.cc
 check_SCRIPTS += incremental_test.sh
 check_DATA += incremental_test.stdout
 MOSTLYCLEANFILES += incremental_test
+TAGS_FILES += incremental_test_1.c incremental_test_2.c
 incremental_test_1.o: incremental_test_1.c
  $(COMPILE) -O0 -c -ffunction-sections -g -o $@ $<
 incremental_test_2.o: incremental_test_2.c
@@ -120,6 +122,7 @@ incremental_test.stdout: incremental_test ../incremental-dump
 check_SCRIPTS += gc_comdat_test.sh
 check_DATA += gc_comdat_test.stdout
 MOSTLYCLEANFILES += gc_comdat_test
+TAGS_FILES += gc_comdat_test_1.cc gc_comdat_test_2.cc
 gc_comdat_test_1.o: gc_comdat_test_1.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
 gc_comdat_test_2.o: gc_comdat_test_2.cc
@@ -132,6 +135,7 @@ gc_comdat_test.stdout: gc_comdat_test
 check_SCRIPTS += gc_tls_test.sh
 check_DATA += gc_tls_test.stdout
 MOSTLYCLEANFILES += gc_tls_test
+TAGS_FILES += gc_tls_test.cc
 gc_tls_test.o: gc_tls_test.cc
  $(CXXCOMPILE) -O0 -c -g -o $@ $<
 gc_tls_test:gc_tls_test.o gcctestdir/ld
@@ -142,6 +146,7 @@ gc_tls_test.stdout: gc_tls_test
 check_SCRIPTS += gc_orphan_section_test.sh
 check_DATA += gc_orphan_section_test.stdout
 MOSTLYCLEANFILES += gc_orphan_section_test
+TAGS_FILES += gc_orphan_section_test.cc
 gc_orphan_section_test.o: gc_orphan_section_test.cc
  $(CXXCOMPILE) -O0 -c -g -o $@ $<
 gc_orphan_section_test:gc_orphan_section_test.o gcctestdir/ld
@@ -152,6 +157,7 @@ gc_orphan_section_test.stdout: gc_orphan_section_test
 check_SCRIPTS += icf_test.sh
 check_DATA += icf_test.stdout
 MOSTLYCLEANFILES += icf_test
+TAGS_FILES += icf_test.cc
 icf_test.o: icf_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
 icf_test: icf_test.o gcctestdir/ld
@@ -162,6 +168,7 @@ icf_test.stdout: icf_test
 check_SCRIPTS += icf_keep_unique_test.sh
 check_DATA += icf_keep_unique_test.stdout
 MOSTLYCLEANFILES += icf_keep_unique_test
+TAGS_FILES += icf_keep_unique_test.cc
 icf_keep_unique_test.o: icf_keep_unique_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
 icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
@@ -172,6 +179,7 @@ icf_keep_unique_test.stdout: icf_keep_unique_test
 check_SCRIPTS += icf_safe_test.sh
 check_DATA += icf_safe_test_1.stdout icf_safe_test_2.stdout
 MOSTLYCLEANFILES += icf_safe_test
+TAGS_FILES += icf_safe_test.cc
 icf_safe_test.o: icf_safe_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
 icf_safe_test: icf_safe_test.o gcctestdir/ld
@@ -184,6 +192,7 @@ icf_safe_test_2.stdout: icf_safe_test
 check_SCRIPTS += icf_safe_so_test.sh
 check_DATA += icf_safe_so_test_1.stdout icf_safe_so_test_2.stdout
 MOSTLYCLEANFILES += icf_safe_so_test
+TAGS_FILES += icf_safe_so_test.cc
 icf_safe_so_test.o: icf_safe_so_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
 icf_safe_so_test: icf_safe_so_test.o gcctestdir/ld
@@ -196,6 +205,7 @@ icf_safe_so_test_2.stdout: icf_safe_so_test
 check_SCRIPTS += final_layout.sh
 check_DATA += final_layout.stdout
 MOSTLYCLEANFILES += final_layout
+TAGS_FILES += final_layout.cc
 final_layout.o: final_layout.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections  -fdata-sections -g -o $@ $<
 final_layout_sequence.txt:
@@ -206,6 +216,7 @@ final_layout.stdout: final_layout
  $(TEST_NM) final_layout > final_layout.stdout
 
 check_PROGRAMS += icf_virtual_function_folding_test
+icf_virtual_function_folding_test_SOURCES = icf_virtual_function_folding_test.cc
 MOSTLYCLEANFILES += icf_virtual_function_folding_test
 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
@@ -215,6 +226,7 @@ icf_virtual_function_folding_test: icf_virtual_function_folding_test.o gcctestdi
 check_SCRIPTS += icf_preemptible_functions_test.sh
 check_DATA += icf_preemptible_functions_test.stdout
 MOSTLYCLEANFILES += icf_preemptible_functions_test
+TAGS_FILES += icf_preemptible_functions_test.cc
 icf_preemptible_functions_test.o: icf_preemptible_functions_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
 icf_preemptible_functions_test: icf_preemptible_functions_test.o gcctestdir/ld
@@ -225,6 +237,7 @@ icf_preemptible_functions_test.stdout: icf_preemptible_functions_test
 check_SCRIPTS += icf_string_merge_test.sh
 check_DATA += icf_string_merge_test.stdout
 MOSTLYCLEANFILES += icf_string_merge_test
+TAGS_FILES += icf_string_merge_test.cc
 icf_string_merge_test.o: icf_string_merge_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
 icf_string_merge_test: icf_string_merge_test.o gcctestdir/ld
@@ -235,6 +248,7 @@ icf_string_merge_test.stdout: icf_string_merge_test
 check_SCRIPTS += icf_sht_rel_addend_test.sh
 check_DATA += icf_sht_rel_addend_test.stdout
 MOSTLYCLEANFILES += icf_sht_rel_addend_test
+TAGS_FILES += icf_sht_rel_addend_test_1.cc icf_sht_rel_addend_test_2.cc
 icf_sht_rel_addend_test_1.o: icf_sht_rel_addend_test_1.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIC -g -o $@ $<
 icf_sht_rel_addend_test_2.o: icf_sht_rel_addend_test_2.cc
@@ -245,9 +259,13 @@ 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
+basic_test_SOURCES = basic_test.cc
 check_PROGRAMS += basic_static_test
+basic_static_test_SOURCES = basic_test.cc
 check_PROGRAMS += basic_pic_test
+basic_pic_test_SOURCES = basic_test.cc
 check_PROGRAMS += basic_static_pic_test
+basic_static_pic_test_SOURCES = basic_test.cc
 basic_test.o: basic_test.cc
  $(CXXCOMPILE) -O0 -c -o $@ $<
 basic_test: basic_test.o gcctestdir/ld
@@ -263,6 +281,7 @@ basic_static_pic_test: basic_pic_test.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
 
 check_PROGRAMS += basic_pie_test
+basic_pie_test_SOURCES = basic_test.cc
 basic_pie_test.o: basic_test.cc
  $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
 basic_pie_test: basic_pie_test.o gcctestdir/ld
@@ -377,6 +396,8 @@ two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_f
  gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
 
 check_PROGRAMS += two_file_pie_test
+two_file_pie_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc \
+ two_file_test_2.cc two_file_test_main.cc
 two_file_test_1_pie.o: two_file_test_1.cc
  $(CXXCOMPILE) -c -fpie -o $@ $<
 two_file_test_1b_pie.o: two_file_test_1b.cc
@@ -462,6 +483,8 @@ two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
 
 check_PROGRAMS += two_file_mixed_pie_test
+two_file_mixed_pie_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc \
+ two_file_test_main.cc two_file_test_2.cc
 two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
  two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so
@@ -469,6 +492,7 @@ two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
 endif FN_PTRS_IN_SO_WITHOUT_PIC
 
 check_PROGRAMS += two_file_strip_test
+two_file_strip_test_SOURCES = $(two_file_test_SOURCES)
 two_file_strip_test: two_file_test
  $(TEST_STRIP) -o two_file_strip_test two_file_test
 
@@ -489,6 +513,7 @@ common_test_1_LDADD =
 
 check_PROGRAMS += common_test_2
 common_test_2_SOURCES = common_test_1.c
+EXTRA_common_test_2_SOURCES = common_test_2.c common_test_3.c
 common_test_2_DEPENDENCIES = common_test_2.so common_test_3.so gcctestdir/ld
 common_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 common_test_2_LDADD = common_test_2.so common_test_3.so
@@ -571,7 +596,8 @@ weak_test_LDADD =
 
 check_PROGRAMS += weak_undef_test
 MOSTLYCLEANFILES += alt/weak_undef_lib.so
-weak_undef_test_SOURCES = weak_undef_test.cc
+weak_undef_test_SOURCES = weak_undef_test.cc weak_undef.h
+EXTRA_weak_undef_test_SOURCES = weak_undef_file1.cc weak_undef_file2.cc
 weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
 weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
 weak_undef_test_LDADD = -L . weak_undef_lib.so
@@ -606,6 +632,8 @@ endif FN_PTRS_IN_SO_WITHOUT_PIC
 
 check_PROGRAMS += weak_alias_test
 weak_alias_test_SOURCES = weak_alias_test_main.cc
+EXTRA_weak_alias_test_SOURCES = weak_alias_test_1.cc weak_alias_test_2.cc \
+ weak_alias_test_3.cc weak_alias_test_4.cc
 weak_alias_test_DEPENDENCIES = \
  gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
  weak_alias_test_3.o weak_alias_test_4.so
@@ -630,7 +658,9 @@ weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
 
 check_SCRIPTS += weak_plt.sh
 check_PROGRAMS += weak_plt
+weak_plt_SOURCES = weak_plt_main.cc
 check_DATA += weak_plt_shared.so
+TAGS_FILES += weak_plt_shared.cc
 weak_plt_main_pic.o: weak_plt_main.cc
  $(CXXCOMPILE) -c -fpic -o $@ $<
 weak_plt: weak_plt_main_pic.o gcctestdir/ld
@@ -642,6 +672,7 @@ weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
 
 check_PROGRAMS += copy_test
 copy_test_SOURCES = copy_test.cc
+EXTRA_copy_test_SOURCES = copy_test_1.cc copy_test_2.cc
 copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
 copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 copy_test_LDADD = copy_test_1.so copy_test_2.so
@@ -659,7 +690,11 @@ if TLS
 check_PROGRAMS += tls_test
 check_PROGRAMS += tls_pic_test
 check_PROGRAMS += tls_pie_test
+tls_pie_test_SOURCES = tls_test_main.cc tls_test.h tls_test.cc \
+ tls_test_file2.cc tls_test_c.c
 check_PROGRAMS += tls_pie_pic_test
+tls_pie_pic_test_SOURCES = tls_test_main.cc tls_test.h tls_test.cc \
+ tls_test_file2.cc tls_test_c.c
 check_PROGRAMS += tls_shared_test
 check_PROGRAMS += tls_shared_ie_test
 check_PROGRAMS += tls_shared_gd_to_ie_test
@@ -817,6 +852,8 @@ many_sections_check.h:
  mv -f $@.tmp $@
 
 check_PROGRAMS += many_sections_r_test
+many_sections_r_test_SOURCES = many_sections_test.cc many_sections_check.h \
+ many_sections_define.h
 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
  gcctestdir/ld -r -o $@ many_sections_test.o
 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
@@ -839,6 +876,7 @@ check_SCRIPTS += debug_msg.sh
 # Create the data files that debug_msg.sh analyzes.
 check_DATA += debug_msg.err
 MOSTLYCLEANFILES += debug_msg.err
+TAGS_FILES += debug_msg.cc
 debug_msg.o: debug_msg.cc
  $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
 odr_violation1.o: odr_violation1.cc
@@ -857,6 +895,7 @@ debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
 # See if we can also detect problems when we're linking .so's, not .o's.
 check_DATA += debug_msg_so.err
 MOSTLYCLEANFILES += debug_msg_so.err
+TAGS_FILES += odr_violation1.cc odr_violation2.cc
 debug_msg.so: debug_msg.cc gcctestdir/ld
  $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
 odr_violation1.so: odr_violation1.cc gcctestdir/ld
@@ -896,6 +935,7 @@ debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation
 check_SCRIPTS += undef_symbol.sh
 check_DATA += undef_symbol.err
 MOSTLYCLEANFILES += undef_symbol.err
+TAGS_FILES += undef_symbol.cc undef_symbol_main.cc
 undef_symbol.o: undef_symbol.cc
  $(CXXCOMPILE) -O0 -g -c -fPIC $<
 undef_symbol.so: undef_symbol.o gcctestdir/ld
@@ -912,6 +952,7 @@ undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
 
 # Test -o when emitting to a special file (such as something in /dev).
 check_PROGRAMS += flagstest_o_specialfile
+flagstest_o_specialfile_SOURCES = constructor_test.cc
 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
  chmod a+x $@
@@ -921,6 +962,7 @@ if HAVE_ZLIB
 
 # Test --compress-debug-sections.  FIXME: check we actually compress.
 check_PROGRAMS += flagstest_compress_debug_sections
+flagstest_compress_debug_sections_SOURCES = constructor_test.cc
 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
  test -s $@
@@ -929,6 +971,8 @@ flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
 # The specialfile output has a tricky case when we also compress debug
 # sections, because it requires output-file resizing.
 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
+flagstest_o_specialfile_and_compress_debug_sections_SOURCES = \
+ constructor_test.cc
 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
  gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
@@ -939,7 +983,9 @@ endif HAVE_ZLIB
 
 # Test symbol versioning.
 check_PROGRAMS += ver_test
-ver_test_SOURCES = ver_test_main.cc
+ver_test_SOURCES = ver_test_main.cc ver_test.h
+EXTRA_ver_test_SOURCES = ver_test_1.cc ver_test_2.cc ver_test_3.cc \
+ ver_test_4.cc
 ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
 ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
@@ -985,6 +1031,7 @@ ver_test_5.o: ver_test_5.cc
  $(CXXCOMPILE) -c -fpic -o $@ $<
 check_SCRIPTS += ver_test_5.sh
 check_DATA += ver_test_5.syms
+TAGS_FILES += ver_test_5.cc
 ver_test_5.syms: ver_test_5.so
  $(TEST_READELF) -s $< >$@ 2>/dev/null
 
@@ -1000,6 +1047,7 @@ ver_test_7.o: ver_test_7.cc
  $(CXXCOMPILE) -c -fpic -o $@ $<
 check_SCRIPTS += ver_test_7.sh
 check_DATA += ver_test_7.syms
+TAGS_FILES += ver_test_7.cc
 ver_test_7.syms: ver_test_7.so
  $(TEST_READELF) -s $< >$@ 2>/dev/null
 
@@ -1015,6 +1063,7 @@ ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
 
 check_PROGRAMS += ver_test_9
 ver_test_9_SOURCES = ver_test_main.cc
+EXTRA_ver_test_9_SOURCES = ver_test_9.cc
 ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
 ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ver_test_9_LDADD = ver_test_9.so
@@ -1042,6 +1091,7 @@ ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
 check_PROGRAMS += protected_1
 protected_1_SOURCES = \
  protected_main_1.cc protected_main_2.cc protected_main_3.cc
+EXTRA_protected_1_SOURCES = protected_1.cc protected_2.cc
 protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
 protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 protected_1_LDADD = protected_1.so
@@ -1063,6 +1113,7 @@ protected_2_LDADD = protected_1.so
 
 check_DATA += protected_3.err
 MOSTLYCLEANFILES += protected_3.err
+TAGS_FILES += protected_4.cc
 protected_4_pic.o: protected_4.cc
  $(CXXCOMPILE) -c -fpic -o $@ $<
 protected_3.err: protected_4_pic.o gcctestdir/ld
@@ -1075,6 +1126,7 @@ protected_3.err: protected_4_pic.o gcctestdir/ld
 
 check_PROGRAMS += relro_test
 relro_test_SOURCES = relro_test_main.cc
+EXTRA_relro_test_SOURCES = relro_test.cc
 relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
 relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 relro_test_LDADD = relro_test.so
@@ -1113,6 +1165,7 @@ script_test_2_LDADD =
 
 check_PROGRAMS += justsyms
 justsyms_SOURCES = justsyms_1.cc
+EXTRA_justsyms_SOURCES = justsyms_2.cc
 justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
 justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
 justsyms_LDADD =
@@ -1136,12 +1189,14 @@ binary.txt: $(srcdir)/binary.in
 check_SCRIPTS += ver_matching_test.sh
 check_DATA += ver_matching_test.stdout
 MOSTLYCLEANFILES += ver_matching_test.stdout
+TAGS_FILES += ver_matching_def.cc
 ver_matching_def.so: ver_matching_def.cc $(srcdir)/version_script.map gcctestdir/ld
  $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
 ver_matching_test.stdout: ver_matching_def.so
  $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
 
 check_PROGRAMS += script_test_3
+script_test_3_SOURCES = basic_test.cc
 check_SCRIPTS += script_test_3.sh
 check_DATA += script_test_3.stdout
 MOSTLYCLEANFILES += script_test_3.stdout
@@ -1173,6 +1228,7 @@ tls_script_test_LDADD = $(tls_test_LDADD)
 check_SCRIPTS += script_test_5.sh
 check_DATA += script_test_5.stdout
 MOSTLYCLEANFILES += script_test_5
+TAGS_FILES += script_test_5.cc
 script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
  $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t
 script_test_5.stdout: script_test_5
@@ -1207,6 +1263,7 @@ script_test_8.stdout: script_test_8
 
 check_SCRIPTS += script_test_9.sh
 check_DATA += script_test_9.stdout
+TAGS_FILES += script_test_9.cc
 script_test_9.o: script_test_9.cc
  $(CXXCOMPILE) -O0 -c -o $@ $<
 script_test_9: gcctestdir/ld $(srcdir)/script_test_9.t script_test_9.o
@@ -1235,6 +1292,9 @@ MOSTLYCLEANFILES += libthin1.a libthin3.a libthinall.a \
  alt/thin_archive_test_2.o alt/thin_archive_test_4.o \
  alt/libthin2.a alt/libthin4.a
 thin_archive_test_1_SOURCES = thin_archive_main.cc
+EXTRA_thin_archive_test_1_SOURCES = thin_archive_test_1.cc \
+ thin_archive_test_2.cc thin_archive_test_3.cc \
+ thin_archive_test_4.cc
 thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
 thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
 thin_archive_test_1_LDADD = libthin1.a -lthin2
@@ -1273,6 +1333,7 @@ check_PROGRAMS += plugin_test_1
 check_SCRIPTS += plugin_test_1.sh
 check_DATA += plugin_test_1.err
 MOSTLYCLEANFILES += plugin_test_1.err
+plugin_test_1_SOURCES = two_file_test_main.cc plugin_test.c
 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
 plugin_test_1.err: plugin_test_1
@@ -1282,6 +1343,7 @@ check_PROGRAMS += plugin_test_2
 check_SCRIPTS += plugin_test_2.sh
 check_DATA += plugin_test_2.err
 MOSTLYCLEANFILES += plugin_test_2.err
+plugin_test_2_SOURCES = two_file_test_main.cc two_file_test_2.cc plugin_test.c
 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
  $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,-R,.,--plugin,"./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_shared_2.so 2>plugin_test_2.err
 plugin_test_2.err: plugin_test_2
@@ -1291,6 +1353,7 @@ check_PROGRAMS += plugin_test_3
 check_SCRIPTS += plugin_test_3.sh
 check_DATA += plugin_test_3.err
 MOSTLYCLEANFILES += plugin_test_3.err
+plugin_test_3_SOURCES = two_file_test_main.cc plugin_test.c
 plugin_test_3: 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,--export-dynamic -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_3.err
 plugin_test_3.err: plugin_test_3
@@ -1300,6 +1363,7 @@ check_PROGRAMS += plugin_test_4
 check_SCRIPTS += plugin_test_4.sh
 check_DATA += plugin_test_4.err
 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
+plugin_test_4_SOURCES = two_file_test_main.cc plugin_test.c
 plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
  $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv" two_file_test_main.o -Wl,--whole-archive,plugin_test_4.a,--no-whole-archive 2>plugin_test_4.err
 plugin_test_4.err: plugin_test_4
@@ -1309,6 +1373,7 @@ plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
  $(TEST_AR) cr $@ $^
 
 check_PROGRAMS += plugin_test_5
+plugin_test_5_SOURCES = two_file_test_main.cc plugin_test.c
 plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so
  $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms
 
@@ -1316,6 +1381,8 @@ check_PROGRAMS += plugin_test_6
 check_SCRIPTS += plugin_test_6.sh
 check_DATA += plugin_test_6.err
 MOSTLYCLEANFILES += plugin_test_6.err
+plugin_test_6_SOURCES = plugin_test.c plugin_common_test_1.c \
+ plugin_common_test_2.c
 plugin_test_6: plugin_common_test_1.syms plugin_common_test_2.syms gcctestdir/ld plugin_test.so
  $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so" plugin_common_test_1.syms plugin_common_test_2.syms 2>plugin_test_6.err
 plugin_test_6.err: plugin_test_6
@@ -1325,6 +1392,7 @@ check_PROGRAMS += plugin_test_7
 check_SCRIPTS += plugin_test_7.sh
 check_DATA += plugin_test_7.err plugin_test_7.syms
 MOSTLYCLEANFILES += plugin_test_7.err
+plugin_test_7_SOURCES = plugin_test_7_1.c plugin_test_7_2.c plugin_test.c
 plugin_test_7: plugin_test_7_1.o plugin_test_7_1.syms plugin_test_7_2.o gcctestdir/ld plugin_test.so
  $(LINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--gc-sections,--print-gc-sections plugin_test_7_1.syms plugin_test_7_2.o 2>plugin_test_7.err
 plugin_test_7.syms: plugin_test_7
@@ -1341,6 +1409,7 @@ plugin_test_7.err: plugin_test_7
 
 # Test plugins with -r.
 check_PROGRAMS += plugin_test_8
+plugin_test_8_SOURCES = two_file_test_main.cc two_file_test_2.cc plugin_test.c
 plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so
  ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o
 plugin_test_8: plugin_test_8.o gcctestdir/ld
@@ -1405,6 +1474,8 @@ check_SCRIPTS += exclude_libs_test.sh
 check_DATA += exclude_libs_test.syms
 MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
         libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
+TAGS_FILES += exclude_libs_test_1.c exclude_libs_test_2.c \
+ exclude_libs_test_3.c
 exclude_libs_test_SOURCES = exclude_libs_test.c
 exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
  libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
@@ -1424,6 +1495,7 @@ alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
  $(TEST_AR) rc $@ $^
 
 check_PROGRAMS += local_labels_test
+local_labels_test_SOURCES = ver_test_6.c
 local_labels_test.o: ver_test_6.c
  $(COMPILE) -g -c -Wa,-L -o $@ $<
 local_labels_test: local_labels_test.o
@@ -1439,6 +1511,7 @@ MOSTLYCLEANFILES += discard_locals_test.syms \
  discard_locals_relocatable_test2.syms \
  discard_locals_relocatable_test1.out \
  discard_locals_relocatable_test2.out
+TAGS_FILES += discard_locals_relocatable_test.c
 discard_locals_test_SOURCES = discard_locals_test.c
 discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
 discard_locals_test.syms: discard_locals_test
@@ -1473,6 +1546,7 @@ endif MCMODEL_MEDIUM
 check_SCRIPTS += hidden_test.sh
 check_DATA += hidden_test.err
 MOSTLYCLEANFILES += hidden_test hidden_test.err
+TAGS_FILES += hidden_test_1.c hidden_test_main.c
 libhidden.so: hidden_test_1.c gcctestdir/ld
  $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
 hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
@@ -1500,6 +1574,7 @@ retain_symbols_file_test.stdout: retain_symbols_file_test.so
 # Test that if the output file already exists and is empty,
 # it will get execute permission.
 check_PROGRAMS += permission_test
+permission_test_SOURCES = basic_test.cc
 permission_test: basic_test.o gcctestdir/ld
  umask 022; \
  rm -f $@; \
@@ -1512,6 +1587,7 @@ check_PROGRAMS += searched_file_test
 MOSTLYCLEANFILES += searched_file_test searched_file_test_lib.o \
                     alt/searched_file_test_lib.a
 searched_file_test_SOURCES = searched_file_test.cc
+EXTRA_searched_file_test_SOURCES = searched_file_test_lib.cc
 searched_file_test_DEPENDENCIES = alt/searched_file_test_lib.a
 searched_file_test_LDFLAGS = -Bgcctestdir/ -Lalt
 searched_file_test_LDADD = -l:searched_file_test_lib.a
@@ -1526,6 +1602,7 @@ alt/searched_file_test_lib.a: searched_file_test_lib.o
 check_SCRIPTS += no_version_test.sh
 check_DATA += no_version_test.stdout
 MOSTLYCLEANFILES += libno_version_test.so no_version_test.stdout
+TAGS_FILES += no_version_test.c
 # We invoke the linker directly since gcc may include additional objects that
 # uses symbol versioning.
 libno_version_test.so: no_version_test.o gcctestdir/ld
@@ -1558,6 +1635,7 @@ ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
 ifuncmain1static_LDADD = ifuncdep1.o
 
 check_PROGRAMS += ifuncmain1picstatic
+ifuncmain1picstatic_SOURCES = ifuncmain1.c ifuncmod1.c
 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
 
@@ -1568,6 +1646,7 @@ ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain1_LDADD = ifuncmod1.so
 
 check_PROGRAMS += ifuncmain1pic
+ifuncmain1pic_SOURCES = ifuncmain1.c ifuncmod1.c
 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 
@@ -1578,26 +1657,31 @@ ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain1vis_LDADD = ifuncmod1.so
 
 check_PROGRAMS += ifuncmain1vispic
+ifuncmain1vispic_SOURCES = ifuncmain1vis.c ifuncmod1.c
 ifuncmain1vispic.o: ifuncmain1vis.c
  $(COMPILE) -c -fpic -o $@ $<
 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1staticpic
+ifuncmain1staticpic_SOURCES = ifuncmain1.c ifuncmod1.c
 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
 
 check_PROGRAMS += ifuncmain1pie
+ifuncmain1pie_SOURCES = ifuncmain1.c ifuncmod1.c
 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1vispie
+ifuncmain1vispie_SOURCES = ifuncmain1vis.c ifuncmod1.c
 ifuncmain1vispie.o: ifuncmain1vis.c
  $(COMPILE) -c -fpie -o $@ $<
 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1staticpie
+ifuncmain1staticpie_SOURCES = ifuncmain1.c ifuncmod1.c
 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
 
@@ -1608,11 +1692,12 @@ ifuncdep2pic.o: ifuncdep2.c
  $(COMPILE) -c -fpic -o $@ $<
 
 check_PROGRAMS += ifuncmain2static
-ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c
+ifuncmain2static_SOURCES = ifuncmain2.c ifuncdep2.c ifunc-sel.h
 ifuncmain2static_DEPENDENCIES = gcctestdir/ld
 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain2picstatic
+ifuncmain2picstatic_SOURCES = ifuncmain2.c ifuncdep2.c
 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
 
@@ -1622,6 +1707,7 @@ ifuncmain2_DEPENDENCIES = gcctestdir/ld
 ifuncmain2_LDFLAGS = -Bgcctestdir/
 
 check_PROGRAMS += ifuncmain2pic
+ifuncmain2pic_SOURCES = ifuncmain2.c ifuncdep2.c
 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
 
@@ -1632,6 +1718,7 @@ ifuncmod3.so: ifuncmod3.o gcctestdir/ld
 
 check_PROGRAMS += ifuncmain3
 ifuncmain3_SOURCES = ifuncmain3.c
+EXTRA_ifuncmain3_SOURCES = ifuncmod3.c
 ifuncmain3_DEPENDENCIES = gcctestdir/ld ifuncmod3.so
 ifuncmain3_LDFLAGS = -Bgcctestdir/ -Wl,--export-dynamic -Wl,-R,.
 ifuncmain3_LDADD = -ldl
@@ -1645,6 +1732,7 @@ ifuncmain4static_DEPENDENCIES = gcctestdir/ld
 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain4picstatic
+ifuncmain4picstatic_SOURCES = ifuncmain4.c
 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
 
@@ -1674,6 +1762,7 @@ ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
 ifuncmain5static_LDADD = ifuncdep5.o
 
 check_PROGRAMS += ifuncmain5picstatic
+ifuncmain5picstatic_SOURCES = ifuncmain5.c ifuncmod5.c
 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
 
@@ -1684,14 +1773,17 @@ ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain5_LDADD = ifuncmod5.so
 
 check_PROGRAMS += ifuncmain5pic
+ifuncmain5pic_SOURCES = ifuncmain5.c ifuncmod5.c
 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain5staticpic
+ifuncmain5staticpic_SOURCES = ifuncmain5.c ifuncmod5.c
 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
 
 check_PROGRAMS += ifuncmain5pie
+ifuncmain5pie_SOURCES = ifuncmain5.c ifuncmod5.c
 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
 
@@ -1704,6 +1796,7 @@ ifuncmod6.so: ifuncmod6.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -shared ifuncmod6.o
 
 check_PROGRAMS += ifuncmain6pie
+EXTRA_ifuncmain6pie_SOURCES = ifuncmod6.c
 ifuncmain6pie: ifuncmain6pie.o ifuncmod6.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain6pie.o ifuncmod6.so -Wl,-R,.
 
@@ -1719,6 +1812,7 @@ ifuncmain7static_DEPENDENCIES = gcctestdir/ld
 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain7picstatic
+ifuncmain7picstatic_SOURCES = ifuncmain7.c
 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
 
@@ -1728,10 +1822,12 @@ ifuncmain7_DEPENDENCIES = gcctestdir/ld
 ifuncmain7_LDFLAGS = -Bgcctestdir/
 
 check_PROGRAMS += ifuncmain7pic
+ifuncmain7pic_SOURCES = ifuncmain7.c
 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain7pic.o
 
 check_PROGRAMS += ifuncmain7pie
+ifuncmain7pie_SOURCES = ifuncmain7.c
 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
 
@@ -1742,6 +1838,7 @@ check_SCRIPTS += strong_ref_weak_def.sh
 check_DATA += strong_ref_weak_def.stdout
 MOSTLYCLEANFILES += strong_ref_weak_def_1.so strong_ref_weak_def_2.so \
  strong_ref_weak_def.stdout
+TAGS_FILES += strong_ref_weak_def_1.c strong_ref_weak_def_2.c
 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
@@ -1761,6 +1858,7 @@ check_SCRIPTS += dyn_weak_ref.sh
 check_DATA += dyn_weak_ref.stdout
 MOSTLYCLEANFILES += dyn_weak_ref_1.so dyn_weak_ref_2.so \
  dyn_weak_ref.stdout
+TAGS_FILES += dyn_weak_ref_1.c dyn_weak_ref_2.c
 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
@@ -1777,6 +1875,8 @@ dyn_weak_ref.stdout: dyn_weak_ref_1.so
 
 # Test that --start-lib and --end-lib function correctly.
 check_PROGRAMS += start_lib_test
+start_lib_test_SOURCES = start_lib_test_main.c start_lib_test_1.c \
+ start_lib_test_2.c start_lib_test_3.c
 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
  gcctestdir/ld
  $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \
Reply | Threaded
Open this post in threaded view
|

Re: [gold][patch][testsuite] Fix nonexisting .c default _SOURCES

Ralf Wildenhues
* Jan Kratochvil wrote on Sun, Oct 10, 2010 at 11:21:16PM CEST:

> On Sun, 10 Oct 2010 20:01:51 +0200, Ralf Wildenhues wrote:
> > The patch can be simplified to this line (untested):
> >   AM_DEFAULT_SOURCE_EXT = .cc
> >
> > for all sources ending in .cc at least.
>
> the rules are more complicated; but you are right *_SOURCES in fact should
> list the real sources, so that `make tags' index really all the files there.
>
> There is a problem that for unsatisfied AM_CONDITIONALs the files are not
> listed for `make tags'.  But moving all the *_SOURCES definitions out of their
> conditional parts complicates it a lot.

Oh.  Are you saying there is an Automake bug involved here?

> `make tags' now lists all the persent *.{cc,c,h} files.  I did not intend to
> create such patch first.

Why are you interested at all in 'make tags' being complete for test
suite files?  They are bound to have overlapping nonunique symbol names,
and fairly uninteresting for the rest of the code, no?

> Some Makefile.in rules now contain $(CXXLINK) instead of $(LINK) but those
> rules are always overriden by Makefile.am anyway (which uses $(CXXLINK)).

Erm, if the automake-generated rules appear in Makefile.in, then they
haven't been overridden by rules from Makefile.am; automake is usually
careful to not add any generated rules for which the user has written
any herself.

Cheers,
Ralf

> gold/
> 2010-10-10  Jan Kratochvil  <[hidden email]>
>
> * testsuite/Makefile.am (TAGS_FILES): New.
> (libgoldtest_a_SOURCES): Add test.h and testfile.h.
> (icf_virtual_function_folding_test_SOURCES basic_test_SOURCES)
> (basic_static_test_SOURCES basic_pic_test_SOURCES)
> (basic_static_pic_test_SOURCES basic_pie_test_SOURCES)
> (two_file_pie_test_SOURCES two_file_mixed_pie_test_SOURCES)
> (two_file_strip_test_SOURCES EXTRA_common_test_2_SOURCES): New.
> (weak_undef_test_SOURCES): Add weak_undef.h.
> (EXTRA_weak_undef_test_SOURCES EXTRA_weak_alias_test_SOURCES)
> (weak_plt_SOURCES EXTRA_copy_test_SOURCES tls_pie_test_SOURCES)
> (tls_pie_pic_test_SOURCES many_sections_r_test_SOURCES)
> (flagstest_o_specialfile_SOURCES)
> (flagstest_compress_debug_sections_SOURCES)
> (flagstest_o_specialfile_and_compress_debug_sections_SOURCES): New.
> (ver_test_SOURCES): Add ver_test.h.
> (EXTRA_ver_test_SOURCES EXTRA_ver_test_9_SOURCES)
> (EXTRA_protected_1_SOURCES EXTRA_relro_test_SOURCES)
> (EXTRA_justsyms_SOURCES script_test_3_SOURCES)
> (EXTRA_thin_archive_test_1_SOURCES plugin_test_1_SOURCES)
> (plugin_test_2_SOURCES plugin_test_3_SOURCES plugin_test_4_SOURCES)
> (plugin_test_5_SOURCES plugin_test_6_SOURCES plugin_test_7_SOURCES)
> (plugin_test_8_SOURCES local_labels_test_SOURCES)
> (permission_test_SOURCES EXTRA_searched_file_test_SOURCES)
> (ifuncmain1picstatic_SOURCES ifuncmain1pic_SOURCES)
> (ifuncmain1vispic_SOURCES ifuncmain1staticpic_SOURCES)
> (ifuncmain1pie_SOURCES ifuncmain1vispie_SOURCES)
> (ifuncmain1staticpie_SOURCES): New.
> (ifuncmain2static_SOURCES): Add ifunc-sel.h.
> (ifuncmain2picstatic_SOURCES ifuncmain2pic_SOURCES)
> (EXTRA_ifuncmain3_SOURCES ifuncmain4picstatic_SOURCES)
> (ifuncmain5picstatic_SOURCES ifuncmain5pic_SOURCES)
> (ifuncmain5staticpic_SOURCES ifuncmain5pie_SOURCES)
> (EXTRA_ifuncmain6pie_SOURCES ifuncmain7picstatic_SOURCES)
> (ifuncmain7pic_SOURCES ifuncmain7pie_SOURCES start_lib_test_SOURCES):
> New.
> * testsuite/Makefile.in: Regenerate.
Reply | Threaded
Open this post in threaded view
|

Re: [gold][patch][testsuite] Fix nonexisting .c default _SOURCES

Jan Kratochvil-2
On Mon, 11 Oct 2010 19:35:25 +0200, Ralf Wildenhues wrote:
> * Jan Kratochvil wrote on Sun, Oct 10, 2010 at 11:21:16PM CEST:
> > On Sun, 10 Oct 2010 20:01:51 +0200, Ralf Wildenhues wrote:
> > There is a problem that for unsatisfied AM_CONDITIONALs the files are not
> > listed for `make tags'.
[...]
> Oh.  Are you saying there is an Automake bug involved here?

Maybe, posted now to bug-automake as:
        Subject: even `if FALSE' *_SOURCES should be used for TAGS


> > `make tags' now lists all the persent *.{cc,c,h} files.  I did not intend to
> > create such patch first.
>
> Why are you interested at all in 'make tags' being complete for test
> suite files?

Not at all.  But currently `make tags' errors out when run from src/ .  So it
has to work some way in gold/testsuite/ .  If some file TAGS gets created
I believe it should be a correct one.  With empty *_SOURCES TAGS gets created
but TAGS is not correct/complete.


> and fairly uninteresting for the rest of the code, no?

I agree the gold/testsuite/Makefile.am simplicity should be preferred over the
gold/testsuite/TAGS completeness.  Therefore posting an alternative patch
which just disables `make tags' for gold/testsuite/ but does not error on it.


> > Some Makefile.in rules now contain $(CXXLINK) instead of $(LINK) but those
> > rules are always overriden by Makefile.am anyway (which uses $(CXXLINK)).
>
> Erm, if the automake-generated rules appear in Makefile.in, then they
> haven't been overridden by rules from Makefile.am; automake is usually
> careful to not add any generated rules for which the user has written
> any herself.

I have noticed now that still it creates the default automake rules in the
other `if' blocks (@X_FALSE@ vs. @X_TRUE@); posted now to bug-automake as:
        Subject: even @C_FALSE@ (unsatisfied) contains rule to produce binary


Thanks,
Jan


gold/
2010-10-10  Jan Kratochvil  <[hidden email]>
            Jiang Jilin  <[hidden email]>

        * testsuite/Makefile.am (ID tags TAGS ctags CTAGS)
        (icf_virtual_function_folding_test_SOURCES basic_test_SOURCES)
        (basic_static_test_SOURCES basic_pic_test_SOURCES)
        (basic_static_pic_test_SOURCES basic_pie_test_SOURCES)
        (two_file_pie_test_SOURCES two_file_mixed_pie_test_SOURCES)
        (two_file_strip_test_SOURCES weak_plt_SOURCES tls_pie_test_SOURCES)
        (tls_pie_pic_test_SOURCES many_sections_r_test_SOURCES)
        (flagstest_o_specialfile_SOURCES)
        (flagstest_compress_debug_sections_SOURCES)
        (flagstest_o_specialfile_and_compress_debug_sections_SOURCES)
        (script_test_3_SOURCES plugin_test_1_SOURCES plugin_test_2_SOURCES)
        (plugin_test_3_SOURCES plugin_test_4_SOURCES plugin_test_5_SOURCES)
        (plugin_test_6_SOURCES plugin_test_7_SOURCES plugin_test_8_SOURCES)
        (local_labels_test_SOURCES permission_test_SOURCES)
        (ifuncmain1picstatic_SOURCES ifuncmain1pic_SOURCES)
        (ifuncmain1vispic_SOURCES ifuncmain1staticpic_SOURCES)
        (ifuncmain1pie_SOURCES ifuncmain1vispie_SOURCES)
        (ifuncmain1staticpie_SOURCES ifuncmain2picstatic_SOURCES)
        (ifuncmain2pic_SOURCES ifuncmain4picstatic_SOURCES)
        (ifuncmain5picstatic_SOURCES ifuncmain5pic_SOURCES)
        (ifuncmain5staticpic_SOURCES ifuncmain5pie_SOURCES)
        (ifuncmain7picstatic_SOURCES ifuncmain7pic_SOURCES)
        (ifuncmain7pie_SOURCES start_lib_test_SOURCES): New as empty.
        * testsuite/Makefile.in: Regenerate.

--- a/gold/testsuite/Makefile.am
+++ b/gold/testsuite/Makefile.am
@@ -56,6 +56,14 @@ BUILT_SOURCES =
 
 TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
 
+
+# *_SOURCES definitions are not complete.
+ID:
+tags:
+TAGS:
+ctags:
+CTAGS:
+
 # ---------------------------------------------------------------------
 # These tests test the internals of gold (unittests).
 
@@ -206,6 +214,7 @@ final_layout.stdout: final_layout
  $(TEST_NM) final_layout > final_layout.stdout
 
 check_PROGRAMS += icf_virtual_function_folding_test
+icf_virtual_function_folding_test_SOURCES =
 MOSTLYCLEANFILES += icf_virtual_function_folding_test
 icf_virtual_function_folding_test.o: icf_virtual_function_folding_test.cc
  $(CXXCOMPILE) -O0 -c -ffunction-sections -fPIE -g -o $@ $<
@@ -245,9 +254,13 @@ 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
+basic_test_SOURCES =
 check_PROGRAMS += basic_static_test
+basic_static_test_SOURCES =
 check_PROGRAMS += basic_pic_test
+basic_pic_test_SOURCES =
 check_PROGRAMS += basic_static_pic_test
+basic_static_pic_test_SOURCES =
 basic_test.o: basic_test.cc
  $(CXXCOMPILE) -O0 -c -o $@ $<
 basic_test: basic_test.o gcctestdir/ld
@@ -263,6 +276,7 @@ basic_static_pic_test: basic_pic_test.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
 
 check_PROGRAMS += basic_pie_test
+basic_pie_test_SOURCES =
 basic_pie_test.o: basic_test.cc
  $(CXXCOMPILE) -O0 -c -fpie -o $@ $<
 basic_pie_test: basic_pie_test.o gcctestdir/ld
@@ -377,6 +391,7 @@ two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_f
  gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
 
 check_PROGRAMS += two_file_pie_test
+two_file_pie_test_SOURCES =
 two_file_test_1_pie.o: two_file_test_1.cc
  $(CXXCOMPILE) -c -fpie -o $@ $<
 two_file_test_1b_pie.o: two_file_test_1b.cc
@@ -462,6 +477,7 @@ two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
 
 check_PROGRAMS += two_file_mixed_pie_test
+two_file_mixed_pie_test_SOURCES =
 two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
  two_file_test_main_pie.o two_file_shared_2.so gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -Wl,-R,. -pie two_file_test_1.o two_file_test_1b_pie.o two_file_test_main_pie.o two_file_shared_2.so
@@ -469,6 +485,7 @@ two_file_mixed_pie_test: two_file_test_1.o two_file_test_1b_pie.o \
 endif FN_PTRS_IN_SO_WITHOUT_PIC
 
 check_PROGRAMS += two_file_strip_test
+two_file_strip_test_SOURCES =
 two_file_strip_test: two_file_test
  $(TEST_STRIP) -o two_file_strip_test two_file_test
 
@@ -630,6 +647,7 @@ weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
 
 check_SCRIPTS += weak_plt.sh
 check_PROGRAMS += weak_plt
+weak_plt_SOURCES =
 check_DATA += weak_plt_shared.so
 weak_plt_main_pic.o: weak_plt_main.cc
  $(CXXCOMPILE) -c -fpic -o $@ $<
@@ -659,7 +677,9 @@ if TLS
 check_PROGRAMS += tls_test
 check_PROGRAMS += tls_pic_test
 check_PROGRAMS += tls_pie_test
+tls_pie_test_SOURCES =
 check_PROGRAMS += tls_pie_pic_test
+tls_pie_pic_test_SOURCES =
 check_PROGRAMS += tls_shared_test
 check_PROGRAMS += tls_shared_ie_test
 check_PROGRAMS += tls_shared_gd_to_ie_test
@@ -817,6 +837,7 @@ many_sections_check.h:
  mv -f $@.tmp $@
 
 check_PROGRAMS += many_sections_r_test
+many_sections_r_test_SOURCES =
 many_sections_r_test.o: many_sections_test.o gcctestdir/ld
  gcctestdir/ld -r -o $@ many_sections_test.o
 many_sections_r_test: many_sections_r_test.o gcctestdir/ld
@@ -912,6 +933,7 @@ undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
 
 # Test -o when emitting to a special file (such as something in /dev).
 check_PROGRAMS += flagstest_o_specialfile
+flagstest_o_specialfile_SOURCES =
 flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
  chmod a+x $@
@@ -921,6 +943,7 @@ if HAVE_ZLIB
 
 # Test --compress-debug-sections.  FIXME: check we actually compress.
 check_PROGRAMS += flagstest_compress_debug_sections
+flagstest_compress_debug_sections_SOURCES =
 flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
  test -s $@
@@ -929,6 +952,7 @@ flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
 # The specialfile output has a tricky case when we also compress debug
 # sections, because it requires output-file resizing.
 check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
+flagstest_o_specialfile_and_compress_debug_sections_SOURCES =
 flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
  gcctestdir/ld
  $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
@@ -1142,6 +1166,7 @@ ver_matching_test.stdout: ver_matching_def.so
  $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
 
 check_PROGRAMS += script_test_3
+script_test_3_SOURCES =
 check_SCRIPTS += script_test_3.sh
 check_DATA += script_test_3.stdout
 MOSTLYCLEANFILES += script_test_3.stdout
@@ -1270,6 +1295,7 @@ alt/thin_archive_test_4.o: thin_archive_test_4.cc
 if PLUGINS
 
 check_PROGRAMS += plugin_test_1
+plugin_test_1_SOURCES =
 check_SCRIPTS += plugin_test_1.sh
 check_DATA += plugin_test_1.err
 MOSTLYCLEANFILES += plugin_test_1.err
@@ -1279,6 +1305,7 @@ plugin_test_1.err: plugin_test_1
  @touch plugin_test_1.err
 
 check_PROGRAMS += plugin_test_2
+plugin_test_2_SOURCES =
 check_SCRIPTS += plugin_test_2.sh
 check_DATA += plugin_test_2.err
 MOSTLYCLEANFILES += plugin_test_2.err
@@ -1288,6 +1315,7 @@ plugin_test_2.err: plugin_test_2
  @touch plugin_test_2.err
 
 check_PROGRAMS += plugin_test_3
+plugin_test_3_SOURCES =
 check_SCRIPTS += plugin_test_3.sh
 check_DATA += plugin_test_3.err
 MOSTLYCLEANFILES += plugin_test_3.err
@@ -1297,6 +1325,7 @@ plugin_test_3.err: plugin_test_3
  @touch plugin_test_3.err
 
 check_PROGRAMS += plugin_test_4
+plugin_test_4_SOURCES =
 check_SCRIPTS += plugin_test_4.sh
 check_DATA += plugin_test_4.err
 MOSTLYCLEANFILES += plugin_test_4.a plugin_test_4.err
@@ -1309,10 +1338,12 @@ plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
  $(TEST_AR) cr $@ $^
 
 check_PROGRAMS += plugin_test_5
+plugin_test_5_SOURCES =
 plugin_test_5: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms gcctestdir/ld plugin_test.so
  $(CXXLINK) -Bgcctestdir/ -Wl,--no-demangle,--plugin,"./plugin_test.so",--plugin-opt,"_Z4f13iv",--gc-sections two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms unused.syms
 
 check_PROGRAMS += plugin_test_6
+plugin_test_6_SOURCES =
 check_SCRIPTS += plugin_test_6.sh
 check_DATA += plugin_test_6.err
 MOSTLYCLEANFILES += plugin_test_6.err
@@ -1322,6 +1353,7 @@ plugin_test_6.err: plugin_test_6
  @touch plugin_test_6.err
 
 check_PROGRAMS += plugin_test_7
+plugin_test_7_SOURCES =
 check_SCRIPTS += plugin_test_7.sh
 check_DATA += plugin_test_7.err plugin_test_7.syms
 MOSTLYCLEANFILES += plugin_test_7.err
@@ -1341,6 +1373,7 @@ plugin_test_7.err: plugin_test_7
 
 # Test plugins with -r.
 check_PROGRAMS += plugin_test_8
+plugin_test_8_SOURCES =
 plugin_test_8.o: two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o ../ld-new plugin_test.so
  ../ld-new -r -o $@ --no-demangle --plugin "./plugin_test.so" two_file_test_main.o two_file_test_1.syms two_file_test_1b.syms two_file_test_2.o
 plugin_test_8: plugin_test_8.o gcctestdir/ld
@@ -1424,6 +1457,7 @@ alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
  $(TEST_AR) rc $@ $^
 
 check_PROGRAMS += local_labels_test
+local_labels_test_SOURCES =
 local_labels_test.o: ver_test_6.c
  $(COMPILE) -g -c -Wa,-L -o $@ $<
 local_labels_test: local_labels_test.o
@@ -1500,6 +1534,7 @@ retain_symbols_file_test.stdout: retain_symbols_file_test.so
 # Test that if the output file already exists and is empty,
 # it will get execute permission.
 check_PROGRAMS += permission_test
+permission_test_SOURCES =
 permission_test: basic_test.o gcctestdir/ld
  umask 022; \
  rm -f $@; \
@@ -1558,6 +1593,7 @@ ifuncmain1static_LDFLAGS = -Bgcctestdir/ -static
 ifuncmain1static_LDADD = ifuncdep1.o
 
 check_PROGRAMS += ifuncmain1picstatic
+ifuncmain1picstatic_SOURCES =
 ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o
 
@@ -1568,6 +1604,7 @@ ifuncmain1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain1_LDADD = ifuncmod1.so
 
 check_PROGRAMS += ifuncmain1pic
+ifuncmain1pic_SOURCES =
 ifuncmain1pic: ifuncmain1pic.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 
@@ -1578,26 +1615,31 @@ ifuncmain1vis_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain1vis_LDADD = ifuncmod1.so
 
 check_PROGRAMS += ifuncmain1vispic
+ifuncmain1vispic_SOURCES =
 ifuncmain1vispic.o: ifuncmain1vis.c
  $(COMPILE) -c -fpic -o $@ $<
 ifuncmain1vispic: ifuncmain1vispic.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1staticpic
+ifuncmain1staticpic_SOURCES =
 ifuncmain1staticpic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain1pic.o ifuncmod1.o
 
 check_PROGRAMS += ifuncmain1pie
+ifuncmain1pie_SOURCES =
 ifuncmain1pie: ifuncmain1pie.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1vispie
+ifuncmain1vispie_SOURCES =
 ifuncmain1vispie.o: ifuncmain1vis.c
  $(COMPILE) -c -fpie -o $@ $<
 ifuncmain1vispie: ifuncmain1vispie.o ifuncmod1.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1vispie.o ifuncmod1.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain1staticpie
+ifuncmain1staticpie_SOURCES =
 ifuncmain1staticpie: ifuncmain1pie.o ifuncmod1.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain1pie.o ifuncmod1.o
 
@@ -1613,6 +1655,7 @@ ifuncmain2static_DEPENDENCIES = gcctestdir/ld
 ifuncmain2static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain2picstatic
+ifuncmain2picstatic_SOURCES =
 ifuncmain2picstatic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain2pic.o ifuncdep2pic.o
 
@@ -1622,6 +1665,7 @@ ifuncmain2_DEPENDENCIES = gcctestdir/ld
 ifuncmain2_LDFLAGS = -Bgcctestdir/
 
 check_PROGRAMS += ifuncmain2pic
+ifuncmain2pic_SOURCES =
 ifuncmain2pic: ifuncmain2pic.o ifuncdep2pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain2pic.o ifuncdep2pic.o
 
@@ -1645,6 +1689,7 @@ ifuncmain4static_DEPENDENCIES = gcctestdir/ld
 ifuncmain4static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain4picstatic
+ifuncmain4picstatic_SOURCES =
 ifuncmain4picstatic: ifuncmain4pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain4pic.o
 
@@ -1674,6 +1719,7 @@ ifuncmain5static_LDFLAGS = -Bgcctestdir/ -static
 ifuncmain5static_LDADD = ifuncdep5.o
 
 check_PROGRAMS += ifuncmain5picstatic
+ifuncmain5picstatic_SOURCES =
 ifuncmain5picstatic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain5pic.o ifuncmod5.o
 
@@ -1684,14 +1730,17 @@ ifuncmain5_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
 ifuncmain5_LDADD = ifuncmod5.so
 
 check_PROGRAMS += ifuncmain5pic
+ifuncmain5pic_SOURCES =
 ifuncmain5pic: ifuncmain5pic.o ifuncmod5.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.so -Wl,-R,.
 
 check_PROGRAMS += ifuncmain5staticpic
+ifuncmain5staticpic_SOURCES =
 ifuncmain5staticpic: ifuncmain5pic.o ifuncmod5.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain5pic.o ifuncmod5.o
 
 check_PROGRAMS += ifuncmain5pie
+ifuncmain5pie_SOURCES =
 ifuncmain5pie: ifuncmain5pie.o ifuncmod5.so gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain5pie.o ifuncmod5.so -Wl,-R,.
 
@@ -1719,6 +1768,7 @@ ifuncmain7static_DEPENDENCIES = gcctestdir/ld
 ifuncmain7static_LDFLAGS = -Bgcctestdir/ -static
 
 check_PROGRAMS += ifuncmain7picstatic
+ifuncmain7picstatic_SOURCES =
 ifuncmain7picstatic: ifuncmain7pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -static ifuncmain7pic.o
 
@@ -1728,10 +1778,12 @@ ifuncmain7_DEPENDENCIES = gcctestdir/ld
 ifuncmain7_LDFLAGS = -Bgcctestdir/
 
 check_PROGRAMS += ifuncmain7pic
+ifuncmain7pic_SOURCES =
 ifuncmain7pic: ifuncmain7pic.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ ifuncmain7pic.o
 
 check_PROGRAMS += ifuncmain7pie
+ifuncmain7pie_SOURCES =
 ifuncmain7pie: ifuncmain7pie.o gcctestdir/ld
  $(LINK) -Bgcctestdir/ -pie ifuncmain7pie.o
 
@@ -1777,6 +1829,7 @@ dyn_weak_ref.stdout: dyn_weak_ref_1.so
 
 # Test that --start-lib and --end-lib function correctly.
 check_PROGRAMS += start_lib_test
+start_lib_test_SOURCES =
 start_lib_test: start_lib_test_main.o libstart_lib_test.a start_lib_test_2.o start_lib_test_3.o \
  gcctestdir/ld
  $(LINK) -Bgcctestdir/ -o $@ start_lib_test_main.o -L. -lstart_lib_test \