Fix parallel check//% rule in gdb for non-VPATH build.
[deliverable/binutils-gdb.git] / gold / testsuite / Makefile.am
CommitLineData
5a6f7e2d
ILT
1# Process this file with automake to generate Makefile.in
2
537b5f51
ILT
3# As far as I can tell automake testing support assumes that the build
4# system and the host system are the same. So these tests will not
5# work when building with a cross-compiler.
6
14ec8efd
RW
7# Ignore warning about AM_PROG_CC_C_O due to large_CFLAGS
8AUTOMAKE_OPTIONS = foreign -Wno-portability
5a6f7e2d 9
f958d5fc
ILT
10# The two_file_test tests -fmerge-constants, so we simply always turn
11# it on. This may need to be controlled by a configure option
12# eventually.
89fc3421 13AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants
494e05f4 14AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants
5a6f7e2d 15
14ec8efd 16AM_CPPFLAGS = \
5a6f7e2d 17 -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \
155a0dd7 18 -I$(srcdir)/../../elfcpp -I.. \
5a6f7e2d
ILT
19 -DLOCALEDIR="\"$(datadir)/locale\"" \
20 @INCINTL@
21
6835af53
ILT
22TEST_READELF = $(top_builddir)/../binutils/readelf
23TEST_OBJDUMP = $(top_builddir)/../binutils/objdump
24TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt
25TEST_STRIP = $(top_builddir)/../binutils/strip-new
fbd8a257 26TEST_AR = $(top_builddir)/../binutils/ar
531813ad 27TEST_NM = $(top_builddir)/../binutils/nm-new
6835af53 28
89fc3421
CC
29if PLUGINS
30LIBDL = -ldl
31endif
32
fe9a4c12
ILT
33if THREADS
34THREADSLIB = -lpthread
35endif
36
155a0dd7
ILT
37if OMP_SUPPORT
38TLS_TEST_C_CFLAGS = -fopenmp
39endif
40
351a8000
ILT
41# 'make clean' is good about deleting some intermediate files (such as
42# .o's), but not all of them (such as .so's and .err files). We
43# improve on that here. automake-1.9 info docs say "mostlyclean" is
44# the right choice for files 'make' builds that people rebuild.
45MOSTLYCLEANFILES = *.so
6eee141f 46
6eee141f 47
351a8000
ILT
48# We will add to these later, for each individual test. Note
49# that we add each test under check_SCRIPTS or check_PROGRAMS;
50# the TESTS variable is automatically populated from these.
51check_SCRIPTS =
52check_DATA =
53check_PROGRAMS =
d491d34e
ILT
54BUILT_SOURCES =
55
351a8000 56TESTS = $(check_SCRIPTS) $(check_PROGRAMS)
22dc1b09 57
351a8000
ILT
58# ---------------------------------------------------------------------
59# These tests test the internals of gold (unittests).
5a6f7e2d 60
351a8000 61# Infrastucture needed for the unittests
5a6f7e2d
ILT
62check_LIBRARIES = libgoldtest.a
63libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc
64
ad2d6943
ILT
65DEPENDENCIES = \
66 libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP)
fe9a4c12 67LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \
89fc3421 68 $(THREADSLIB) $(LIBDL)
5a6f7e2d 69
5a6f7e2d 70
351a8000
ILT
71# The unittests themselves
72check_PROGRAMS += object_unittest
5a6f7e2d 73object_unittest_SOURCES = object_unittest.cc
22dc1b09 74
bc644c6c
ILT
75check_PROGRAMS += binary_unittest
76binary_unittest_SOURCES = binary_unittest.cc
77
351a8000
ILT
78
79# ---------------------------------------------------------------------
80# These tests test the output of gold (end-to-end tests). In
81# particular, they make sure that gold can link "difficult" object
82# files, and the resulting object files run correctly. These can only
83# run if we've built ld-new for the native architecture (that is,
84# we're not cross-compiling it), since we run ld-new as part of these
85# tests. We use the gcc-specific flag '-B' to use our linker instead
86# of the default linker, which is why we only run our tests under gcc.
a360aedd 87
e2827e5f 88if NATIVE_LINKER
351a8000 89if GCC
e2827e5f 90
351a8000
ILT
91# Infrastucture needed for the unittests: a directory where the linker
92# is named 'ld'. This is because the -B flag appends 'ld' to its arg.
e2827e5f
ILT
93gcctestdir/ld: ../ld-new
94 test -d gcctestdir || mkdir -p gcctestdir
95 rm -f gcctestdir/ld
96 (cd gcctestdir && $(LN_S) ../../ld-new ld)
97
351a8000
ILT
98# Each of these .o's is a useful, small complete program. They're
99# particularly useful for making sure ld-new's flags do what they're
100# supposed to (hence their names), but are used for many tests that
101# don't actually involve analyzing input data.
43771f76
ILT
102flagstest_debug.o: constructor_test.cc
103 $(CXXCOMPILE) -O0 -g -c -o $@ $<
104flagstest_ndebug.o: constructor_test.cc
105 $(CXXCOMPILE) -O0 -c -o $@ $<
106
43771f76 107
531813ad
ST
108check_SCRIPTS += gc_comdat_test.sh
109check_DATA += gc_comdat_test.stdout
110gc_comdat_test_1.o: gc_comdat_test_1.cc
4daadc0d 111 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
531813ad 112gc_comdat_test_2.o: gc_comdat_test_2.cc
4daadc0d 113 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
531813ad 114gc_comdat_test: gc_comdat_test_1.o gc_comdat_test_2.o gcctestdir/ld
4daadc0d 115 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_comdat_test_1.o gc_comdat_test_2.o
531813ad
ST
116gc_comdat_test.stdout: gc_comdat_test
117 $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout
118
27721062
ST
119check_SCRIPTS += gc_tls_test.sh
120check_DATA += gc_tls_test.stdout
121gc_tls_test.o: gc_tls_test.cc
122 $(CXXCOMPILE) -O0 -c -g -o $@ $<
123gc_tls_test:gc_tls_test.o gcctestdir/ld
124 $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o
125gc_tls_test.stdout: gc_tls_test
126 $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout
127
ef15dade
ST
128check_SCRIPTS += icf_test.sh
129check_DATA += icf_test.stdout
130icf_test.o: icf_test.cc
131 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
132icf_test: icf_test.o gcctestdir/ld
133 $(CXXLINK) -Bgcctestdir/ -Wl,--icf icf_test.o
134icf_test.stdout: icf_test
135 $(TEST_NM) -C icf_test > icf_test.stdout
136
48c187ce
ST
137check_SCRIPTS += icf_keep_unique_test.sh
138check_DATA += icf_keep_unique_test.stdout
139icf_keep_unique_test.o: icf_keep_unique_test.cc
140 $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $<
141icf_keep_unique_test: icf_keep_unique_test.o gcctestdir/ld
142 $(CXXLINK) -Bgcctestdir/ -Wl,--icf -Wl,--keep-unique,_Z11unique_funcv icf_keep_unique_test.o
143icf_keep_unique_test.stdout: icf_keep_unique_test
144 $(TEST_NM) -C icf_keep_unique_test > icf_keep_unique_test.stdout
531813ad 145
351a8000
ILT
146check_PROGRAMS += basic_test
147check_PROGRAMS += basic_static_test
148check_PROGRAMS += basic_pic_test
149check_PROGRAMS += basic_static_pic_test
56ba9a23 150basic_test.o: basic_test.cc
22dc1b09 151 $(CXXCOMPILE) -O0 -c -o $@ $<
56ba9a23
ILT
152basic_test: basic_test.o gcctestdir/ld
153 $(CXXLINK) -Bgcctestdir/ basic_test.o
154basic_static_test: basic_test.o gcctestdir/ld
155 $(CXXLINK) -Bgcctestdir/ -static basic_test.o
22dc1b09 156
56ba9a23 157basic_pic_test.o: basic_test.cc
22dc1b09 158 $(CXXCOMPILE) -O0 -c -fpic -o $@ $<
56ba9a23
ILT
159basic_pic_test: basic_pic_test.o gcctestdir/ld
160 $(CXXLINK) -Bgcctestdir/ basic_pic_test.o
161basic_static_pic_test: basic_pic_test.o gcctestdir/ld
162 $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o
22dc1b09 163
351a8000
ILT
164
165check_PROGRAMS += constructor_test
166check_PROGRAMS += constructor_static_test
d5026652
ILT
167constructor_test_SOURCES = constructor_test.cc
168constructor_test_DEPENDENCIES = gcctestdir/ld
169constructor_test_LDFLAGS = -Bgcctestdir/
170
351a8000
ILT
171constructor_static_test_SOURCES = $(constructor_test_SOURCES)
172constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES)
173constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static
cb615bc1 174
351a8000
ILT
175
176check_PROGRAMS += two_file_test
177check_PROGRAMS += two_file_static_test
178check_PROGRAMS += two_file_pic_test
3bd52c28
ILT
179two_file_test_SOURCES = \
180 two_file_test_1.cc \
03e8f2b2 181 two_file_test_1b.cc \
3bd52c28
ILT
182 two_file_test_2.cc \
183 two_file_test_main.cc \
184 two_file_test.h
185two_file_test_DEPENDENCIES = gcctestdir/ld
186two_file_test_LDFLAGS = -Bgcctestdir/
187
351a8000
ILT
188two_file_static_test_SOURCES = $(two_file_test_SOURCES)
189two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES)
190two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static
f958d5fc
ILT
191
192two_file_pic_test_SOURCES = two_file_test_main.cc
193two_file_pic_test_DEPENDENCIES = \
03e8f2b2 194 gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 195two_file_pic_test_LDFLAGS = -Bgcctestdir/
03e8f2b2 196two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
f958d5fc 197
351a8000
ILT
198
199check_PROGRAMS += two_file_shared_1_test
200check_PROGRAMS += two_file_shared_2_test
201check_PROGRAMS += two_file_shared_1_pic_2_test
202check_PROGRAMS += two_file_shared_2_pic_1_test
203check_PROGRAMS += two_file_same_shared_test
204check_PROGRAMS += two_file_separate_shared_12_test
205check_PROGRAMS += two_file_separate_shared_21_test
206two_file_test_1_pic.o: two_file_test_1.cc
207 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
208two_file_test_1b_pic.o: two_file_test_1b.cc
209 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000
ILT
210two_file_test_2_pic.o: two_file_test_2.cc
211 $(CXXCOMPILE) -c -fpic -o $@ $<
03e8f2b2
ILT
212two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld
213 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o
351a8000
ILT
214two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld
215 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o
03e8f2b2
ILT
216two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld
217 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o
351a8000 218
3bd52c28
ILT
219two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc
220two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so
221two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
222two_file_shared_1_test_LDADD = two_file_shared_1.so
223
03e8f2b2 224two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
225two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so
226two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
227two_file_shared_2_test_LDADD = two_file_shared_2.so
228
386c048c
ILT
229two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc
230two_file_shared_1_pic_2_test_DEPENDENCIES = \
03e8f2b2 231 gcctestdir/ld two_file_shared_1.so two_file_test_1_pic.o two_file_test_1b_pic.o
386c048c 232two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
03e8f2b2 233two_file_shared_1_pic_2_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_shared_2.so
386c048c
ILT
234
235two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc
236two_file_shared_2_pic_1_test_DEPENDENCIES = \
237 gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o
238two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
239two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so
240
3bd52c28
ILT
241two_file_same_shared_test_SOURCES = two_file_test_main.cc
242two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so
243two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
244two_file_same_shared_test_LDADD = two_file_shared.so
245
246two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc
247two_file_separate_shared_12_test_DEPENDENCIES = \
248 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
249two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
250two_file_separate_shared_12_test_LDADD = \
251 two_file_shared_1.so two_file_shared_2.so
252
253two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc
254two_file_separate_shared_21_test_DEPENDENCIES = \
255 gcctestdir/ld two_file_shared_1.so two_file_shared_2.so
256two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
257two_file_separate_shared_21_test_LDADD = \
258 two_file_shared_2.so two_file_shared_1.so
259
6a74a719
ILT
260check_PROGRAMS += two_file_relocatable_test
261two_file_relocatable_test_SOURCES = two_file_test_main.cc
262two_file_relocatable_test_DEPENDENCIES = \
263 gcctestdir/ld two_file_relocatable.o
264two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
265two_file_relocatable_test_LDADD = two_file_relocatable.o
266two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o
267 gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o
268
031cdbed
ILT
269check_SCRIPTS += two_file_shared.sh
270check_DATA += two_file_shared.dbg
271two_file_shared.dbg: two_file_shared.so
272 $(TEST_READELF) -w $< >$@ 2>/dev/null
273
63402fe4
ILT
274# The nonpic tests will fail on platforms which can not put non-PIC
275# code into shared libraries, so we just don't run them in that case.
63402fe4 276if FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 277
351a8000
ILT
278check_PROGRAMS += two_file_shared_1_nonpic_test
279check_PROGRAMS += two_file_shared_2_nonpic_test
280check_PROGRAMS += two_file_same_shared_nonpic_test
281check_PROGRAMS += two_file_separate_shared_12_nonpic_test
282check_PROGRAMS += two_file_separate_shared_21_nonpic_test
03e8f2b2
ILT
283check_PROGRAMS += two_file_mixed_shared_test
284check_PROGRAMS += two_file_mixed_2_shared_test
351a8000 285two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld
03e8f2b2 286 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o
351a8000
ILT
287two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld
288 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o
03e8f2b2
ILT
289two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld
290 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o
291two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld
292 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o
293two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld
294 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so
351a8000 295
3bd52c28
ILT
296two_file_shared_1_nonpic_test_SOURCES = \
297 two_file_test_2.cc two_file_test_main.cc
298two_file_shared_1_nonpic_test_DEPENDENCIES = \
299 gcctestdir/ld two_file_shared_1_nonpic.so
300two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
301two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so
302
303two_file_shared_2_nonpic_test_SOURCES = \
03e8f2b2 304 two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc
3bd52c28
ILT
305two_file_shared_2_nonpic_test_DEPENDENCIES = \
306 gcctestdir/ld two_file_shared_2_nonpic.so
307two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
308two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so
309
310two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc
311two_file_same_shared_nonpic_test_DEPENDENCIES = \
312 gcctestdir/ld two_file_shared_nonpic.so
313two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
314two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so
315
316two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc
317two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \
318 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
319two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
320two_file_separate_shared_12_nonpic_test_LDADD = \
321 two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
322
323two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc
324two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \
325 gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so
326two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
327two_file_separate_shared_21_nonpic_test_LDADD = \
328 two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so
329
03e8f2b2
ILT
330two_file_mixed_shared_test_SOURCES = two_file_test_main.cc
331two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so
332two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
333two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so
334
335two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc
336two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so
337two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
338two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so
339
351a8000 340endif FN_PTRS_IN_SO_WITHOUT_PIC
3bd52c28 341
6835af53
ILT
342check_PROGRAMS += two_file_strip_test
343two_file_strip_test: two_file_test
344 $(TEST_STRIP) -o two_file_strip_test two_file_test
345
346check_PROGRAMS += two_file_same_shared_strip_test
347two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc
348two_file_same_shared_strip_test_DEPENDENCIES = \
349 gcctestdir/ld two_file_shared_strip.so
350two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R.
351two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so
352two_file_shared_strip.so: two_file_shared.so
353 $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so
354
49bdd526
ILT
355check_PROGRAMS += common_test_1
356common_test_1_SOURCES = common_test_1.c
357common_test_1_DEPENDENCIES = gcctestdir/ld
358common_test_1_LDFLAGS = -Bgcctestdir/
351a8000
ILT
359
360check_PROGRAMS += exception_test
361check_PROGRAMS += exception_static_test
362check_PROGRAMS += exception_shared_1_test
363check_PROGRAMS += exception_shared_2_test
364check_PROGRAMS += exception_same_shared_test
365check_PROGRAMS += exception_separate_shared_12_test
366check_PROGRAMS += exception_separate_shared_21_test
367exception_test_1_pic.o: exception_test_1.cc
368 $(CXXCOMPILE) -c -fpic -o $@ $<
369exception_test_2_pic.o: exception_test_2.cc
370 $(CXXCOMPILE) -c -fpic -o $@ $<
371exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld
372 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o
373exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld
374 $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o
375exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld
376 $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o
63402fe4 377
3151305a
ILT
378exception_test_SOURCES = \
379 exception_test_main.cc \
380 exception_test_1.cc \
381 exception_test_2.cc \
382 exception_test.h
383exception_test_DEPENDENCIES = gcctestdir/ld
384exception_test_LDFLAGS = -Bgcctestdir/
385
351a8000
ILT
386exception_static_test_SOURCES = $(exception_test_SOURCES)
387exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES)
388exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static
3151305a
ILT
389
390exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc
391exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so
392exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
393exception_shared_1_test_LDADD = exception_shared_1.so
394
395exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc
396exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so
397exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
398exception_shared_2_test_LDADD = exception_shared_2.so
399
400exception_same_shared_test_SOURCES = exception_test_main.cc
401exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so
402exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
403exception_same_shared_test_LDADD = exception_shared.so
404
405exception_separate_shared_12_test_SOURCES = exception_test_main.cc
406exception_separate_shared_12_test_DEPENDENCIES = \
407 gcctestdir/ld exception_shared_1.so exception_shared_2.so
408exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
409exception_separate_shared_12_test_LDADD = \
410 exception_shared_1.so exception_shared_2.so
411
412exception_separate_shared_21_test_SOURCES = exception_test_main.cc
413exception_separate_shared_21_test_DEPENDENCIES = \
414 gcctestdir/ld exception_shared_1.so exception_shared_2.so
415exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
416exception_separate_shared_21_test_LDADD = \
417 exception_shared_2.so exception_shared_1.so
418
3151305a 419
351a8000 420check_PROGRAMS += weak_test
a360aedd 421weak_test_SOURCES = weak_test.cc
0e470e5c 422weak_test_DEPENDENCIES = gcctestdir/ld
a360aedd
ILT
423weak_test_LDFLAGS = -Bgcctestdir/
424
86925eef
CC
425check_PROGRAMS += weak_undef_test
426weak_undef_test_SOURCES = weak_undef_test.cc
427weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so
428weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
429weak_undef_test_LDADD = -L . weak_undef_lib.so
430weak_undef_file1.o: weak_undef_file1.cc
431 $(CXXCOMPILE) -c -fpic -o $@ $<
432weak_undef_file2.o: weak_undef_file2.cc
433 $(CXXCOMPILE) -c -fpic -o $@ $<
434weak_undef_lib.so: weak_undef_file1.o
435 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o
436alt/weak_undef_lib.so: weak_undef_file2.o
437 test -d alt || mkdir -p alt
438 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o
351a8000 439
f3c69fca
CC
440if FN_PTRS_IN_SO_WITHOUT_PIC
441check_PROGRAMS += weak_undef_nonpic_test
442weak_undef_nonpic_test_SOURCES = weak_undef_test.cc
443weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so
444weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt
445weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so
446weak_undef_file1_nonpic.o: weak_undef_file1.cc
447 $(CXXCOMPILE) -c -o $@ $<
448weak_undef_file2_nonpic.o: weak_undef_file2.cc
449 $(CXXCOMPILE) -c -o $@ $<
450weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o
451 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o
452alt/weak_undef_lib_nonpic.so: weak_undef_file2_nonpic.o
453 test -d alt || mkdir -p alt
454 $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2_nonpic.o
455endif FN_PTRS_IN_SO_WITHOUT_PIC
456
457
99a37bfd
ILT
458check_PROGRAMS += weak_alias_test
459weak_alias_test_SOURCES = weak_alias_test_main.cc
460weak_alias_test_DEPENDENCIES = \
461 gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \
462 weak_alias_test_3.o weak_alias_test_4.so
463weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
464weak_alias_test_LDADD = \
465 weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \
466 weak_alias_test_4.so
467weak_alias_test_1_pic.o: weak_alias_test_1.cc
468 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 469weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld
99a37bfd
ILT
470 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o
471weak_alias_test_2_pic.o: weak_alias_test_2.cc
472 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 473weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld
99a37bfd
ILT
474 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o
475weak_alias_test_3.o: weak_alias_test_3.cc
476 $(CXXCOMPILE) -c -o $@ $<
477weak_alias_test_4_pic.o: weak_alias_test_4.cc
478 $(CXXCOMPILE) -c -fpic -o $@ $<
de4c45bd 479weak_alias_test_4.so: weak_alias_test_4_pic.o gcctestdir/ld
99a37bfd
ILT
480 $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o
481
de4c45bd
ILT
482check_SCRIPTS += weak_plt.sh
483check_PROGRAMS += weak_plt
484check_DATA += weak_plt_shared.so
485weak_plt_main_pic.o: weak_plt_main.cc
486 $(CXXCOMPILE) -c -fpic -o $@ $<
487weak_plt: weak_plt_main_pic.o gcctestdir/ld
488 $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o
489weak_plt_shared_pic.o: weak_plt_shared.cc
490 $(CXXCOMPILE) -c -fpic -o $@ $<
491weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld
492 $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o
493
f34787f8
ILT
494check_PROGRAMS += copy_test
495copy_test_SOURCES = copy_test.cc
496copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so
497copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
498copy_test_LDADD = copy_test_1.so copy_test_2.so
499copy_test_1_pic.o: copy_test_1.cc
500 $(CXXCOMPILE) -c -fpic -o $@ $<
501copy_test_1.so: gcctestdir/ld copy_test_1_pic.o
502 $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o
503copy_test_2_pic.o: copy_test_2.cc
504 $(CXXCOMPILE) -c -fpic -o $@ $<
505copy_test_2.so: gcctestdir/ld copy_test_2_pic.o
506 $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o
507
6eee141f
ILT
508if TLS
509
351a8000
ILT
510check_PROGRAMS += tls_test
511check_PROGRAMS += tls_pic_test
512check_PROGRAMS += tls_shared_test
c03c7692 513check_PROGRAMS += tls_shared_ie_test
c2b45e22 514check_PROGRAMS += tls_shared_gd_to_ie_test
351a8000
ILT
515tls_test_pic.o: tls_test.cc
516 $(CXXCOMPILE) -c -fpic -o $@ $<
517tls_test_file2_pic.o: tls_test_file2.cc
518 $(CXXCOMPILE) -c -fpic -o $@ $<
155a0dd7
ILT
519tls_test_c_pic.o: tls_test_c.c
520 $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $<
521tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o gcctestdir/ld
9c2d0ef9 522 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o -Wl,-z,defs
c2b45e22
CC
523tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld
524 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o
351a8000 525
c03c7692
ILT
526tls_test_pic_ie.o: tls_test.cc
527 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
528tls_test_file2_pic_ie.o: tls_test_file2.cc
529 $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $<
155a0dd7
ILT
530tls_test_c_pic_ie.o: tls_test_c.c
531 $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $<
532tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o gcctestdir/ld
533 $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o tls_test_c_pic_ie.o
c03c7692 534
e0374858 535tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h
155a0dd7 536tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o
6eee141f 537tls_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
538tls_test_LDADD = tls_test_c.o -lpthread
539tls_test_c.o: tls_test_c.c
540 $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $<
6eee141f
ILT
541
542tls_pic_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
543tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \
544 tls_test_c_pic.o
6eee141f 545tls_pic_test_LDFLAGS = -Bgcctestdir/
155a0dd7
ILT
546tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \
547 -lpthread
6eee141f 548
6eee141f
ILT
549tls_shared_test_SOURCES = tls_test_main.cc
550tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so
551tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
552tls_shared_test_LDADD = tls_test_shared.so -lpthread
553
c03c7692
ILT
554tls_shared_ie_test_SOURCES = tls_test_main.cc
555tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so
556tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
557tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread
558
c2b45e22 559tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
560tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \
561 tls_test_c_pic.o tls_test_shared2.so
c2b45e22 562tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
563tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \
564 tls_test_shared2.so -lpthread
c2b45e22
CC
565
566if TLS_GNU2_DIALECT
567
568check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test
569
570tls_test_gnu2.o: tls_test.cc
571 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
572tls_test_file2_gnu2.o: tls_test_file2.cc
573 $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $<
155a0dd7
ILT
574tls_test_c_gnu2.o: tls_test_c.c
575 $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $<
c2b45e22
CC
576tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld
577 $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o
578
579tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc
155a0dd7
ILT
580tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2.o \
581 tls_test_c_gnu2.o tls_test_gnu2_shared2.so
c2b45e22 582tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
155a0dd7
ILT
583tls_shared_gnu2_gd_to_ie_test_LDADD = tls_test_gnu2.o tls_test_c_gnu2.o \
584 tls_test_gnu2_shared2.so -lpthread
c2b45e22
CC
585
586if TLS_DESCRIPTORS
587
588check_PROGRAMS += tls_shared_gnu2_test
589
155a0dd7
ILT
590tls_test_gnu2_shared.so: tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o gcctestdir/ld
591 $(CXXLINK) -Bgcctestdir/ -shared tls_test_gnu2.o tls_test_file2_gnu2.o tls_test_c_gnu2.o
c2b45e22
CC
592
593tls_shared_gnu2_test_SOURCES = tls_test_main.cc
594tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so
595tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
596tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread
597
598endif TLS_DESCRIPTORS
599
600endif TLS_GNU2_DIALECT
601
351a8000
ILT
602if STATIC_TLS
603check_PROGRAMS += tls_static_test
604check_PROGRAMS += tls_static_pic_test
605
606tls_static_test_SOURCES = $(tls_test_SOURCES)
607tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES)
608tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static
609tls_static_test_LDADD = $(tls_test_LDADD)
610
611tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES)
612tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES)
613tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static
614tls_static_pic_test_LDADD = $(tls_pic_test_LDADD)
615endif
6eee141f
ILT
616
617if FN_PTRS_IN_SO_WITHOUT_PIC
351a8000 618check_PROGRAMS += tls_shared_nonpic_test
155a0dd7
ILT
619tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o tls_test_c.o gcctestdir/ld
620 $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o tls_test_c.o
6eee141f
ILT
621
622tls_shared_nonpic_test_SOURCES = tls_test_main.cc
623tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so
624tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
625tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread
351a8000 626endif FN_PTRS_IN_SO_WITHOUT_PIC
6eee141f 627
351a8000 628endif TLS
6eee141f 629
d491d34e
ILT
630check_PROGRAMS += many_sections_test
631many_sections_test_SOURCES = many_sections_test.cc
632many_sections_test_DEPENDENCIES = gcctestdir/ld
633many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic
634
635BUILT_SOURCES += many_sections_define.h
636many_sections_define.h:
637 (for i in `seq 1 70000`; do \
638 echo "int var_$$i __attribute__((section(\"section_$$i\"))) = $$i;"; \
639 done) > $@.tmp
640 mv -f $@.tmp $@
641
642BUILT_SOURCES += many_sections_check.h
643many_sections_check.h:
4c94d6ae 644 (for i in `seq 1 1000 70000`; do \
d491d34e
ILT
645 echo "assert(var_$$i == $$i);"; \
646 done) > $@.tmp
647 mv -f $@.tmp $@
648
649check_PROGRAMS += many_sections_r_test
d491d34e
ILT
650many_sections_r_test.o: many_sections_test.o gcctestdir/ld
651 gcctestdir/ld -r -o $@ many_sections_test.o
7bc3e21a
ILT
652many_sections_r_test: many_sections_r_test.o gcctestdir/ld
653 $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS)
6eee141f 654
2fd32231
ILT
655if CONSTRUCTOR_PRIORITY
656
657check_PROGRAMS += initpri1
658initpri1_SOURCES = initpri1.c
659initpri1_DEPENDENCIES = gcctestdir/ld
660initpri1_LDFLAGS = -Bgcctestdir/
661
662endif
663
664
351a8000
ILT
665# Test --detect-odr-violations
666check_SCRIPTS += debug_msg.sh
6eee141f 667
351a8000
ILT
668# Create the data files that debug_msg.sh analyzes.
669check_DATA += debug_msg.err
670MOSTLYCLEANFILES += debug_msg.err
671debug_msg.o: debug_msg.cc
672 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc
673odr_violation1.o: odr_violation1.cc
674 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc
675odr_violation2.o: odr_violation2.cc
676 $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc
677debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld
678 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@"
679 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \
680 then \
681 echo 1>&2 "Link of debug_msg should have failed"; \
682 rm -f $@; \
683 exit 1; \
684 fi
685
686# See if we can also detect problems when we're linking .so's, not .o's.
687check_DATA += debug_msg_so.err
688MOSTLYCLEANFILES += debug_msg_so.err
689debug_msg.so: debug_msg.cc gcctestdir/ld
690 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
691odr_violation1.so: odr_violation1.cc gcctestdir/ld
692 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
693odr_violation2.so: odr_violation2.cc gcctestdir/ld
694 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
695debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld
696 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@"
697 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \
698 then \
699 echo 1>&2 "Link of debug_msg_so should have failed"; \
700 rm -f $@; \
701 exit 1; \
702 fi
703
704# We also want to make sure we do something reasonable when there's no
705# debug info available. For the best test, we use .so's.
706check_DATA += debug_msg_ndebug.err
707MOSTLYCLEANFILES += debug_msg_ndebug.err
708debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld
709 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc
710odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld
711 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc
712odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld
713 $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc
714debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld
715 @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@"
716 @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \
717 then \
718 echo 1>&2 "Link of debug_msg_ndebug should have failed"; \
719 rm -f $@; \
720 exit 1; \
721 fi
722
723
724# Similar to --detect-odr-violations: check for undefined symbols in .so's
725check_SCRIPTS += undef_symbol.sh
726check_DATA += undef_symbol.err
727MOSTLYCLEANFILES += undef_symbol.err
728undef_symbol.o: undef_symbol.cc
729 $(CXXCOMPILE) -O0 -g -c -fPIC $<
730undef_symbol.so: undef_symbol.o gcctestdir/ld
731 $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o
732undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld
733 @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@"
734 @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \
735 then \
736 echo 1>&2 "Link of undef_symbol_test should have failed"; \
737 rm -f $@; \
738 exit 1; \
739 fi
740
741
351a8000
ILT
742# Test -o when emitting to a special file (such as something in /dev).
743check_PROGRAMS += flagstest_o_specialfile
0e470e5c 744flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld
351a8000
ILT
745 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@
746 chmod a+x $@
747 test -s $@
748
7fcd0256
ILT
749if HAVE_ZLIB
750
751# Test --compress-debug-sections. FIXME: check we actually compress.
752check_PROGRAMS += flagstest_compress_debug_sections
753flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld
754 $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib
755 test -s $@
756
757
351a8000
ILT
758# The specialfile output has a tricky case when we also compress debug
759# sections, because it requires output-file resizing.
760check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections
0e470e5c
ILT
761flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \
762 gcctestdir/ld
126f3ece 763 $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@
351a8000
ILT
764 chmod a+x $@
765 test -s $@
766
7fcd0256
ILT
767endif HAVE_ZLIB
768
99f8faca
ILT
769# Test symbol versioning.
770check_PROGRAMS += ver_test
771ver_test_SOURCES = ver_test_main.cc
772ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so
773ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
774ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so
775ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld
776 $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so
09124467
ILT
777ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld
778 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so
779ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld
780 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o
99f8faca
ILT
781ver_test_1.o: ver_test_1.cc
782 $(CXXCOMPILE) -c -fpic -o $@ $<
783ver_test_2.o: ver_test_2.cc
784 $(CXXCOMPILE) -c -fpic -o $@ $<
785ver_test_3.o: ver_test_3.cc
786 $(CXXCOMPILE) -c -fpic -o $@ $<
787ver_test_4.o: ver_test_4.cc
788 $(CXXCOMPILE) -c -fpic -o $@ $<
351a8000 789
0602e05a
ILT
790check_SCRIPTS += ver_test_1.sh
791check_DATA += ver_test_1.syms
792ver_test_1.syms: ver_test_1.so
793 $(TEST_READELF) -s $< >$@ 2>/dev/null
794
be3e6201
ILT
795check_PROGRAMS += ver_test_2
796ver_test_2_SOURCES = ver_test_main_2.cc
797ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so
798ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
799ver_test_2_LDADD = ver_test_4.so ver_test_2.so
800
be3e6201
ILT
801check_SCRIPTS += ver_test_2.sh
802check_DATA += ver_test_2.syms
803ver_test_2.syms: ver_test_2
6835af53 804 $(TEST_READELF) -s $< >$@ 2>/dev/null
be3e6201 805
686c8caf
ILT
806check_SCRIPTS += ver_test_4.sh
807check_DATA += ver_test_4.syms
808ver_test_4.syms: ver_test_4.so
6835af53 809 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f
ILT
810
811ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld
812 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so
813ver_test_5.o: ver_test_5.cc
814 $(CXXCOMPILE) -c -fpic -o $@ $<
815check_SCRIPTS += ver_test_5.sh
816check_DATA += ver_test_5.syms
817ver_test_5.syms: ver_test_5.so
6835af53 818 $(TEST_READELF) -s $< >$@ 2>/dev/null
5871526f 819
18e6b24e
ILT
820check_PROGRAMS += ver_test_6
821ver_test_6_SOURCES = ver_test_6.c
822ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so
823ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
824ver_test_6_LDADD = ver_test_2.so
825
479f6503
ILT
826ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld
827 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o
828ver_test_7.o: ver_test_7.cc
829 $(CXXCOMPILE) -c -fpic -o $@ $<
830check_SCRIPTS += ver_test_7.sh
831check_DATA += ver_test_7.syms
832ver_test_7.syms: ver_test_7.so
6835af53 833 $(TEST_READELF) -s $< >$@ 2>/dev/null
479f6503 834
75517b77
ILT
835check_PROGRAMS += ver_test_8
836ver_test_8_SOURCES = two_file_test_main.cc
837ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so
838ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
839ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so
840ver_test_8_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so gcctestdir/ld
841 $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o ver_test_8_2.so
842ver_test_8_2.so: two_file_test_2_pic.o $(srcdir)/ver_test_8.script gcctestdir/ld
843 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_8.script two_file_test_2_pic.o
844
95d14cd3
ILT
845check_PROGRAMS += ver_test_9
846ver_test_9_SOURCES = ver_test_main.cc
847ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so
848ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
849ver_test_9_LDADD = ver_test_9.so
850ver_test_9.so: ver_test_9.o ver_test_4.so ver_test_5.so gcctestdir/ld
851 $(CXXLINK) -Bgcctestdir/ -shared ver_test_9.o ver_test_5.so ver_test_4.so
852ver_test_9.o: ver_test_9.cc
853 $(CXXCOMPILE) -c -fpic -o $@ $<
854
057ead22
ILT
855check_SCRIPTS += ver_test_10.sh
856check_DATA += ver_test_10.syms
857ver_test_10.syms: ver_test_10.so
858 $(TEST_READELF) -s $< >$@ 2>/dev/null
859ver_test_10.so: gcctestdir/ld ver_test_2.o ver_test_10.script
860 $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_10.script ver_test_2.o
861
9c5b8369
ILT
862check_PROGRAMS += ver_test_11
863ver_test_11_SOURCES = ver_test_main_2.cc
864ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a
865ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
866ver_test_11_LDADD = ver_test_11.a
867ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o
868 $(TEST_AR) rc $@ $^
869
8bdcdf2c
ILT
870check_PROGRAMS += protected_1
871protected_1_SOURCES = \
872 protected_main_1.cc protected_main_2.cc protected_main_3.cc
873protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so
874protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
875protected_1_LDADD = protected_1.so
876
877protected_1.so: gcctestdir/ld protected_1_pic.o protected_2_pic.o protected_3_pic.o
878 $(CXXLINK) -Bgcctestdir/ -shared protected_1_pic.o protected_2_pic.o protected_3_pic.o
879protected_1_pic.o: protected_1.cc
880 $(CXXCOMPILE) -c -fpic -o $@ $<
881protected_2_pic.o: protected_2.cc
882 $(CXXCOMPILE) -c -fpic -o $@ $<
883protected_3_pic.o: protected_3.cc
884 $(CXXCOMPILE) -c -fpic -o $@ $<
885
886check_PROGRAMS += protected_2
887protected_2_SOURCES = protected_main_1.cc protected_3.cc
888protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so
889protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
890protected_2_LDADD = protected_1.so
891
9f1d377b
ILT
892check_PROGRAMS += relro_test
893relro_test_SOURCES = relro_test_main.cc
894relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so
895relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
896relro_test_LDADD = relro_test.so
897relro_test.so: gcctestdir/ld relro_test_pic.o
898 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o
899relro_test_pic.o: relro_test.cc
900 $(CXXCOMPILE) -c -fpic -o $@ $<
901
2d924fd9
ILT
902check_PROGRAMS += relro_script_test
903relro_script_test_SOURCES = relro_test_main.cc
904relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so
905relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,.
906relro_script_test_LDADD = relro_script_test.so
907relro_script_test.so: gcctestdir/ld relro_script_test.t relro_test_pic.o
908 $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro -T $(srcdir)/relro_script_test.t relro_test_pic.o
909
e5756efb
ILT
910check_PROGRAMS += script_test_1
911script_test_1_SOURCES = script_test_1.cc
912script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t
913script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t
914
a445fddf
ILT
915check_PROGRAMS += script_test_2
916script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc
917script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t
918script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t
919
88dd47ac
ILT
920check_PROGRAMS += justsyms
921justsyms_SOURCES = justsyms_1.cc
922justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o
923justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o
924justsyms_2.o: justsyms_2.cc
925 $(CXXCOMPILE) -c -o $@ $<
83bfb6b7 926justsyms_2r.o: justsyms_2.o gcctestdir/ld $(srcdir)/justsyms.t
88dd47ac
ILT
927 gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o
928
bc644c6c
ILT
929check_PROGRAMS += binary_test
930binary_test_SOURCES = binary_test.cc
931binary_test_DEPENDENCIES = gcctestdir/ld binary.txt
932binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf
933# Copy the file to the build directory to avoid worrying about the
934# full pathname in the generated symbols.
935binary.txt: $(srcdir)/binary.in
936 rm -f $@
937 $(LN_S) $< $@
938
09124467
ILT
939check_SCRIPTS += ver_matching_test.sh
940check_DATA += ver_matching_test.stdout
941MOSTLYCLEANFILES += ver_matching_test.stdout
942ver_matching_def.so: ver_matching_def.cc gcctestdir/ld
943 $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map
944ver_matching_test.stdout: ver_matching_def.so
6835af53 945 $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout
1c4f3631
ILT
946
947check_PROGRAMS += script_test_3
948check_SCRIPTS += script_test_3.sh
949check_DATA += script_test_3.stdout
950MOSTLYCLEANFILES += script_test_3.stdout
951script_test_3: basic_test.o gcctestdir/ld script_test_3.t
952 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t
953script_test_3.stdout: script_test_3
2cefc357 954 $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout
09124467 955
e6188289
ILT
956check_SCRIPTS += script_test_4.sh
957check_DATA += script_test_4.stdout
958MOSTLYCLEANFILES += script_test_4.stdout
959script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t
960 $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t
961script_test_4.stdout: script_test_4
962 $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout
963
401a9a73
CC
964check_SCRIPTS += script_test_5.sh
965check_DATA += script_test_5.stdout
966MOSTLYCLEANFILES += script_test_5.stdout
967script_test_5: script_test_5.o gcctestdir/ld $(srcdir)/script_test_5.t
968 $(CXXLINK) -Bgcctestdir/ script_test_5.o -T $(srcdir)/script_test_5.t
969script_test_5.stdout: script_test_5
970 $(TEST_READELF) -SW script_test_5 > script_test_5.stdout
971
c82fbeee
CS
972# Test --dynamic-list, --dynamic-list-data, --dynamic-list-cpp-new,
973# and --dynamic-list-cpp-typeinfo
974
975check_SCRIPTS += dynamic_list.sh
976check_DATA += dynamic_list.stdout
977MOSTLYCLEANFILES += dynamic_list.stdout
978dynamic_list: basic_test.o gcctestdir/ld $(srcdir)/dynamic_list.t
979 $(CXXLINK) -Bgcctestdir/ basic_test.o \
980 -Wl,--dynamic-list $(srcdir)/dynamic_list.t \
981 -Wl,--dynamic-list-data \
982 -Wl,--dynamic-list-cpp-new \
983 -Wl,--dynamic-list-cpp-typeinfo
984dynamic_list.stdout: dynamic_list
985 $(TEST_READELF) -DWs dynamic_list > dynamic_list.stdout
986
fbd8a257
CC
987check_PROGRAMS += thin_archive_test_1
988thin_archive_test_1_SOURCES = thin_archive_main.cc
989thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a
990thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt
991thin_archive_test_1_LDADD = libthin1.a -lthin2
992
993check_PROGRAMS += thin_archive_test_2
994thin_archive_test_2_SOURCES = thin_archive_main.cc
995thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a
996thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L.
997thin_archive_test_2_LDADD = -lthinall
998
999libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o
1000 rm -f $@
1001 $(TEST_AR) crT $@ $^
1002alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o
1003 rm -f $@
1004 $(TEST_AR) crT $@ $^
1005libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o
1006 rm -f $@
1007 $(TEST_AR) crT $@ $^
1008alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o
1009 rm -f $@
1010 $(TEST_AR) crT $@ $^
1011libthinall.a: libthin3.a alt/libthin4.a
1012 rm -f $@
1013 $(TEST_AR) crT $@ $^
1014alt/thin_archive_test_2.o: thin_archive_test_2.cc
1015 test -d alt || mkdir -p alt
1016 $(CXXCOMPILE) -c -o $@ $<
1017alt/thin_archive_test_4.o: thin_archive_test_4.cc
1018 test -d alt || mkdir -p alt
1019 $(CXXCOMPILE) -c -o $@ $<
1020
89fc3421
CC
1021if PLUGINS
1022
1023check_PROGRAMS += plugin_test_1
1024check_SCRIPTS += plugin_test_1.sh
1025check_DATA += plugin_test_1.err
1026MOSTLYCLEANFILES += plugin_test_1.err
abc8dcba
CC
1027plugin_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
1028 $(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
89fc3421
CC
1029plugin_test_1.err: plugin_test_1
1030 @touch plugin_test_1.err
1031
1032check_PROGRAMS += plugin_test_2
1033check_SCRIPTS += plugin_test_2.sh
1034check_DATA += plugin_test_2.err
1035MOSTLYCLEANFILES += plugin_test_2.err
1036plugin_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
1037 $(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
1038plugin_test_2.err: plugin_test_2
1039 @touch plugin_test_2.err
1040
d66a9eb3
CC
1041check_PROGRAMS += plugin_test_3
1042check_SCRIPTS += plugin_test_3.sh
1043check_DATA += plugin_test_3.err
1044MOSTLYCLEANFILES += plugin_test_3.err
1045plugin_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
1046 $(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
1047plugin_test_3.err: plugin_test_3
1048 @touch plugin_test_3.err
1049
0f7c0701
CC
1050check_PROGRAMS += plugin_test_4
1051check_SCRIPTS += plugin_test_4.sh
1052check_DATA += plugin_test_4.err
1053MOSTLYCLEANFILES += plugin_test_4.err
1054plugin_test_4: two_file_test_main.o plugin_test_4.a gcctestdir/ld plugin_test.so
1055 $(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
1056plugin_test_4.err: plugin_test_4
1057 @touch plugin_test_4.err
1058
1059plugin_test_4.a: two_file_test_1.syms two_file_test_1b.syms two_file_test_2.syms
1060 $(TEST_AR) cr $@ $^
1061
89fc3421
CC
1062plugin_test.so: plugin_test.o
1063 $(LINK) -Bgcctestdir/ -shared plugin_test.o
1064plugin_test.o: plugin_test.c
1065 $(COMPILE) -O0 -c -fpic -o $@ $<
1066
1067two_file_test_main.syms: two_file_test_main.o
1068 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1069two_file_test_1.syms: two_file_test_1.o
1070 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1071two_file_test_1b.syms: two_file_test_1b.o
1072 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1073two_file_test_2.syms: two_file_test_2.o
1074 $(TEST_READELF) -sW $< >$@ 2>/dev/null
abc8dcba
CC
1075empty.syms:
1076 @echo "" >empty.syms
1077 @echo "Symbol table" >>empty.syms
89fc3421
CC
1078
1079endif PLUGINS
1080
65514900
CC
1081check_PROGRAMS += exclude_libs_test
1082check_SCRIPTS += exclude_libs_test.sh
1083check_DATA += exclude_libs_test.syms
1084MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \
2fdd743f 1085 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
65514900
CC
1086exclude_libs_test_SOURCES = exclude_libs_test.c
1087exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \
2fdd743f
DK
1088 libexclude_libs_test_2.a alt/libexclude_libs_test_3.a
1089exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \
1090 -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \
1091 -Wl,--exclude-libs,libexclude_libs_test_3
1092exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \
1093 alt/libexclude_libs_test_3.a
65514900
CC
1094exclude_libs_test.syms: exclude_libs_test
1095 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1096libexclude_libs_test_1.a: exclude_libs_test_1.o
1097 $(TEST_AR) rc $@ $^
1098libexclude_libs_test_2.a: exclude_libs_test_2.o
1099 $(TEST_AR) rc $@ $^
2fdd743f
DK
1100alt/libexclude_libs_test_3.a: exclude_libs_test_3.o
1101 test -d alt || mkdir -p alt
1102 $(TEST_AR) rc $@ $^
65514900 1103
805bb01c
DK
1104check_PROGRAMS += local_labels_test
1105local_labels_test.o: ver_test_6.c
1106 $(COMPILE) -g -c -Wa,-L -o $@ $<
1107local_labels_test: local_labels_test.o
1108 $(LINK) -Bgcctestdir/ local_labels_test.o
1109
bb04269c
DK
1110check_PROGRAMS += discard_locals_test
1111check_SCRIPTS += discard_locals_test.sh
1112check_DATA += discard_locals_test.syms
1113MOSTLYCLEANFILES += discard_locals_test.syms
1114discard_locals_test_SOURCES = discard_locals_test.c
1115discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals
1116discard_locals_test.syms: discard_locals_test
1117 $(TEST_READELF) -sW $< >$@ 2>/dev/null
1118# '-Wa,-L' is required to preserve the local label used for testing.
1119discard_locals_test.o: discard_locals_test.c
1120 $(COMPILE) -c -Wa,-L -o $@ $<
1121
8a5e3e08
ILT
1122if MCMODEL_MEDIUM
1123check_PROGRAMS += large
1124large_SOURCES = large.c
1125large_CFLAGS = -mcmodel=medium
1126large_DEPENDENCIES = gcctestdir/ld
1127large_LDFLAGS = -Bgcctestdir/
1128endif MCMODEL_MEDIUM
1129
645afe0c
CC
1130# Test that hidden and internal symbols in the main program cannot be
1131# referenced by a shared library.
1132check_SCRIPTS += hidden_test.sh
1133check_DATA += hidden_test.err
1134MOSTLYCLEANFILES += hidden_test hidden_test.err
1135libhidden.so: hidden_test_1.c gcctestdir/ld
1136 $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c
1137hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld
1138 $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err
1139hidden_test.err: hidden_test
1140 @touch hidden_test.err
1141
351a8000
ILT
1142endif GCC
1143endif NATIVE_LINKER
This page took 0.181484 seconds and 4 git commands to generate.