Commit | Line | Data |
---|---|---|
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 |
8 | AUTOMAKE_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 | 13 | AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) -fmerge-constants |
494e05f4 | 14 | AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants |
5a6f7e2d | 15 | |
14ec8efd | 16 | AM_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 |
22 | TEST_READELF = $(top_builddir)/../binutils/readelf |
23 | TEST_OBJDUMP = $(top_builddir)/../binutils/objdump | |
24 | TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt | |
25 | TEST_STRIP = $(top_builddir)/../binutils/strip-new | |
fbd8a257 | 26 | TEST_AR = $(top_builddir)/../binutils/ar |
531813ad | 27 | TEST_NM = $(top_builddir)/../binutils/nm-new |
6835af53 | 28 | |
89fc3421 CC |
29 | if PLUGINS |
30 | LIBDL = -ldl | |
31 | endif | |
32 | ||
fe9a4c12 ILT |
33 | if THREADS |
34 | THREADSLIB = -lpthread | |
35 | endif | |
36 | ||
155a0dd7 ILT |
37 | if OMP_SUPPORT |
38 | TLS_TEST_C_CFLAGS = -fopenmp | |
39 | endif | |
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. | |
45 | MOSTLYCLEANFILES = *.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. | |
51 | check_SCRIPTS = | |
52 | check_DATA = | |
53 | check_PROGRAMS = | |
d491d34e ILT |
54 | BUILT_SOURCES = |
55 | ||
351a8000 | 56 | TESTS = $(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 |
62 | check_LIBRARIES = libgoldtest.a |
63 | libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc | |
64 | ||
ad2d6943 ILT |
65 | DEPENDENCIES = \ |
66 | libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP) | |
fe9a4c12 | 67 | LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ |
89fc3421 | 68 | $(THREADSLIB) $(LIBDL) |
5a6f7e2d | 69 | |
5a6f7e2d | 70 | |
351a8000 ILT |
71 | # The unittests themselves |
72 | check_PROGRAMS += object_unittest | |
5a6f7e2d | 73 | object_unittest_SOURCES = object_unittest.cc |
22dc1b09 | 74 | |
bc644c6c ILT |
75 | check_PROGRAMS += binary_unittest |
76 | binary_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 | 88 | if NATIVE_LINKER |
351a8000 | 89 | if 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 |
93 | gcctestdir/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 |
102 | flagstest_debug.o: constructor_test.cc |
103 | $(CXXCOMPILE) -O0 -g -c -o $@ $< | |
104 | flagstest_ndebug.o: constructor_test.cc | |
105 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
106 | ||
43771f76 | 107 | |
531813ad ST |
108 | check_SCRIPTS += gc_comdat_test.sh |
109 | check_DATA += gc_comdat_test.stdout | |
110 | gc_comdat_test_1.o: gc_comdat_test_1.cc | |
4daadc0d | 111 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
531813ad | 112 | gc_comdat_test_2.o: gc_comdat_test_2.cc |
4daadc0d | 113 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< |
531813ad | 114 | gc_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 |
116 | gc_comdat_test.stdout: gc_comdat_test |
117 | $(TEST_NM) -C gc_comdat_test > gc_comdat_test.stdout | |
118 | ||
27721062 ST |
119 | check_SCRIPTS += gc_tls_test.sh |
120 | check_DATA += gc_tls_test.stdout | |
121 | gc_tls_test.o: gc_tls_test.cc | |
122 | $(CXXCOMPILE) -O0 -c -g -o $@ $< | |
123 | gc_tls_test:gc_tls_test.o gcctestdir/ld | |
124 | $(CXXLINK) -Bgcctestdir/ -Wl,--gc-sections gc_tls_test.o | |
125 | gc_tls_test.stdout: gc_tls_test | |
126 | $(TEST_NM) -C gc_tls_test > gc_tls_test.stdout | |
127 | ||
ef15dade ST |
128 | check_SCRIPTS += icf_test.sh |
129 | check_DATA += icf_test.stdout | |
130 | icf_test.o: icf_test.cc | |
131 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
132 | icf_test: icf_test.o gcctestdir/ld | |
133 | $(CXXLINK) -Bgcctestdir/ -Wl,--icf icf_test.o | |
134 | icf_test.stdout: icf_test | |
135 | $(TEST_NM) -C icf_test > icf_test.stdout | |
136 | ||
48c187ce ST |
137 | check_SCRIPTS += icf_keep_unique_test.sh |
138 | check_DATA += icf_keep_unique_test.stdout | |
139 | icf_keep_unique_test.o: icf_keep_unique_test.cc | |
140 | $(CXXCOMPILE) -O0 -c -ffunction-sections -g -o $@ $< | |
141 | icf_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 | |
143 | icf_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 |
146 | check_PROGRAMS += basic_test |
147 | check_PROGRAMS += basic_static_test | |
148 | check_PROGRAMS += basic_pic_test | |
149 | check_PROGRAMS += basic_static_pic_test | |
56ba9a23 | 150 | basic_test.o: basic_test.cc |
22dc1b09 | 151 | $(CXXCOMPILE) -O0 -c -o $@ $< |
56ba9a23 ILT |
152 | basic_test: basic_test.o gcctestdir/ld |
153 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
154 | basic_static_test: basic_test.o gcctestdir/ld | |
155 | $(CXXLINK) -Bgcctestdir/ -static basic_test.o | |
22dc1b09 | 156 | |
56ba9a23 | 157 | basic_pic_test.o: basic_test.cc |
22dc1b09 | 158 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
56ba9a23 ILT |
159 | basic_pic_test: basic_pic_test.o gcctestdir/ld |
160 | $(CXXLINK) -Bgcctestdir/ basic_pic_test.o | |
161 | basic_static_pic_test: basic_pic_test.o gcctestdir/ld | |
162 | $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o | |
22dc1b09 | 163 | |
351a8000 ILT |
164 | |
165 | check_PROGRAMS += constructor_test | |
166 | check_PROGRAMS += constructor_static_test | |
d5026652 ILT |
167 | constructor_test_SOURCES = constructor_test.cc |
168 | constructor_test_DEPENDENCIES = gcctestdir/ld | |
169 | constructor_test_LDFLAGS = -Bgcctestdir/ | |
170 | ||
351a8000 ILT |
171 | constructor_static_test_SOURCES = $(constructor_test_SOURCES) |
172 | constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) | |
173 | constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static | |
cb615bc1 | 174 | |
351a8000 ILT |
175 | |
176 | check_PROGRAMS += two_file_test | |
177 | check_PROGRAMS += two_file_static_test | |
178 | check_PROGRAMS += two_file_pic_test | |
3bd52c28 ILT |
179 | two_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 | |
185 | two_file_test_DEPENDENCIES = gcctestdir/ld | |
186 | two_file_test_LDFLAGS = -Bgcctestdir/ | |
187 | ||
351a8000 ILT |
188 | two_file_static_test_SOURCES = $(two_file_test_SOURCES) |
189 | two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) | |
190 | two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static | |
f958d5fc ILT |
191 | |
192 | two_file_pic_test_SOURCES = two_file_test_main.cc | |
193 | two_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 | 195 | two_file_pic_test_LDFLAGS = -Bgcctestdir/ |
03e8f2b2 | 196 | two_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 | |
199 | check_PROGRAMS += two_file_shared_1_test | |
200 | check_PROGRAMS += two_file_shared_2_test | |
201 | check_PROGRAMS += two_file_shared_1_pic_2_test | |
202 | check_PROGRAMS += two_file_shared_2_pic_1_test | |
203 | check_PROGRAMS += two_file_same_shared_test | |
204 | check_PROGRAMS += two_file_separate_shared_12_test | |
205 | check_PROGRAMS += two_file_separate_shared_21_test | |
206 | two_file_test_1_pic.o: two_file_test_1.cc | |
207 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
208 | two_file_test_1b_pic.o: two_file_test_1b.cc |
209 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 ILT |
210 | two_file_test_2_pic.o: two_file_test_2.cc |
211 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
212 | two_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 |
214 | two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld |
215 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o | |
03e8f2b2 ILT |
216 | two_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 |
219 | two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc |
220 | two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so | |
221 | two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
222 | two_file_shared_1_test_LDADD = two_file_shared_1.so | |
223 | ||
03e8f2b2 | 224 | two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
225 | two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so |
226 | two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
227 | two_file_shared_2_test_LDADD = two_file_shared_2.so | |
228 | ||
386c048c ILT |
229 | two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc |
230 | two_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 | 232 | two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
03e8f2b2 | 233 | two_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 | |
235 | two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc | |
236 | two_file_shared_2_pic_1_test_DEPENDENCIES = \ | |
237 | gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o | |
238 | two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
239 | two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so | |
240 | ||
3bd52c28 ILT |
241 | two_file_same_shared_test_SOURCES = two_file_test_main.cc |
242 | two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so | |
243 | two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
244 | two_file_same_shared_test_LDADD = two_file_shared.so | |
245 | ||
246 | two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc | |
247 | two_file_separate_shared_12_test_DEPENDENCIES = \ | |
248 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
249 | two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
250 | two_file_separate_shared_12_test_LDADD = \ | |
251 | two_file_shared_1.so two_file_shared_2.so | |
252 | ||
253 | two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc | |
254 | two_file_separate_shared_21_test_DEPENDENCIES = \ | |
255 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
256 | two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
257 | two_file_separate_shared_21_test_LDADD = \ | |
258 | two_file_shared_2.so two_file_shared_1.so | |
259 | ||
6a74a719 ILT |
260 | check_PROGRAMS += two_file_relocatable_test |
261 | two_file_relocatable_test_SOURCES = two_file_test_main.cc | |
262 | two_file_relocatable_test_DEPENDENCIES = \ | |
263 | gcctestdir/ld two_file_relocatable.o | |
264 | two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
265 | two_file_relocatable_test_LDADD = two_file_relocatable.o | |
266 | two_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 |
269 | check_SCRIPTS += two_file_shared.sh |
270 | check_DATA += two_file_shared.dbg | |
271 | two_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 | 276 | if FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 277 | |
351a8000 ILT |
278 | check_PROGRAMS += two_file_shared_1_nonpic_test |
279 | check_PROGRAMS += two_file_shared_2_nonpic_test | |
280 | check_PROGRAMS += two_file_same_shared_nonpic_test | |
281 | check_PROGRAMS += two_file_separate_shared_12_nonpic_test | |
282 | check_PROGRAMS += two_file_separate_shared_21_nonpic_test | |
03e8f2b2 ILT |
283 | check_PROGRAMS += two_file_mixed_shared_test |
284 | check_PROGRAMS += two_file_mixed_2_shared_test | |
351a8000 | 285 | two_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 |
287 | two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld |
288 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o | |
03e8f2b2 ILT |
289 | two_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 | |
291 | two_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 | |
293 | two_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 |
296 | two_file_shared_1_nonpic_test_SOURCES = \ |
297 | two_file_test_2.cc two_file_test_main.cc | |
298 | two_file_shared_1_nonpic_test_DEPENDENCIES = \ | |
299 | gcctestdir/ld two_file_shared_1_nonpic.so | |
300 | two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
301 | two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so | |
302 | ||
303 | two_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 |
305 | two_file_shared_2_nonpic_test_DEPENDENCIES = \ |
306 | gcctestdir/ld two_file_shared_2_nonpic.so | |
307 | two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
308 | two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so | |
309 | ||
310 | two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc | |
311 | two_file_same_shared_nonpic_test_DEPENDENCIES = \ | |
312 | gcctestdir/ld two_file_shared_nonpic.so | |
313 | two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
314 | two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so | |
315 | ||
316 | two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc | |
317 | two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \ | |
318 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
319 | two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
320 | two_file_separate_shared_12_nonpic_test_LDADD = \ | |
321 | two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
322 | ||
323 | two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc | |
324 | two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \ | |
325 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
326 | two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
327 | two_file_separate_shared_21_nonpic_test_LDADD = \ | |
328 | two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so | |
329 | ||
03e8f2b2 ILT |
330 | two_file_mixed_shared_test_SOURCES = two_file_test_main.cc |
331 | two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so | |
332 | two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
333 | two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so | |
334 | ||
335 | two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc | |
336 | two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so | |
337 | two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
338 | two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so | |
339 | ||
351a8000 | 340 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 341 | |
6835af53 ILT |
342 | check_PROGRAMS += two_file_strip_test |
343 | two_file_strip_test: two_file_test | |
344 | $(TEST_STRIP) -o two_file_strip_test two_file_test | |
345 | ||
346 | check_PROGRAMS += two_file_same_shared_strip_test | |
347 | two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc | |
348 | two_file_same_shared_strip_test_DEPENDENCIES = \ | |
349 | gcctestdir/ld two_file_shared_strip.so | |
350 | two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R. | |
351 | two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so | |
352 | two_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 |
355 | check_PROGRAMS += common_test_1 |
356 | common_test_1_SOURCES = common_test_1.c | |
357 | common_test_1_DEPENDENCIES = gcctestdir/ld | |
358 | common_test_1_LDFLAGS = -Bgcctestdir/ | |
351a8000 ILT |
359 | |
360 | check_PROGRAMS += exception_test | |
361 | check_PROGRAMS += exception_static_test | |
362 | check_PROGRAMS += exception_shared_1_test | |
363 | check_PROGRAMS += exception_shared_2_test | |
364 | check_PROGRAMS += exception_same_shared_test | |
365 | check_PROGRAMS += exception_separate_shared_12_test | |
366 | check_PROGRAMS += exception_separate_shared_21_test | |
367 | exception_test_1_pic.o: exception_test_1.cc | |
368 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
369 | exception_test_2_pic.o: exception_test_2.cc | |
370 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
371 | exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld | |
372 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o | |
373 | exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld | |
374 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o | |
375 | exception_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 |
378 | exception_test_SOURCES = \ |
379 | exception_test_main.cc \ | |
380 | exception_test_1.cc \ | |
381 | exception_test_2.cc \ | |
382 | exception_test.h | |
383 | exception_test_DEPENDENCIES = gcctestdir/ld | |
384 | exception_test_LDFLAGS = -Bgcctestdir/ | |
385 | ||
351a8000 ILT |
386 | exception_static_test_SOURCES = $(exception_test_SOURCES) |
387 | exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) | |
388 | exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static | |
3151305a ILT |
389 | |
390 | exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc | |
391 | exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so | |
392 | exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
393 | exception_shared_1_test_LDADD = exception_shared_1.so | |
394 | ||
395 | exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc | |
396 | exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so | |
397 | exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
398 | exception_shared_2_test_LDADD = exception_shared_2.so | |
399 | ||
400 | exception_same_shared_test_SOURCES = exception_test_main.cc | |
401 | exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so | |
402 | exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
403 | exception_same_shared_test_LDADD = exception_shared.so | |
404 | ||
405 | exception_separate_shared_12_test_SOURCES = exception_test_main.cc | |
406 | exception_separate_shared_12_test_DEPENDENCIES = \ | |
407 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
408 | exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
409 | exception_separate_shared_12_test_LDADD = \ | |
410 | exception_shared_1.so exception_shared_2.so | |
411 | ||
412 | exception_separate_shared_21_test_SOURCES = exception_test_main.cc | |
413 | exception_separate_shared_21_test_DEPENDENCIES = \ | |
414 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
415 | exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
416 | exception_separate_shared_21_test_LDADD = \ | |
417 | exception_shared_2.so exception_shared_1.so | |
418 | ||
3151305a | 419 | |
351a8000 | 420 | check_PROGRAMS += weak_test |
a360aedd | 421 | weak_test_SOURCES = weak_test.cc |
0e470e5c | 422 | weak_test_DEPENDENCIES = gcctestdir/ld |
a360aedd ILT |
423 | weak_test_LDFLAGS = -Bgcctestdir/ |
424 | ||
86925eef CC |
425 | check_PROGRAMS += weak_undef_test |
426 | weak_undef_test_SOURCES = weak_undef_test.cc | |
427 | weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so | |
428 | weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
429 | weak_undef_test_LDADD = -L . weak_undef_lib.so | |
430 | weak_undef_file1.o: weak_undef_file1.cc | |
431 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
432 | weak_undef_file2.o: weak_undef_file2.cc | |
433 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
434 | weak_undef_lib.so: weak_undef_file1.o | |
435 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o | |
436 | alt/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 |
440 | if FN_PTRS_IN_SO_WITHOUT_PIC |
441 | check_PROGRAMS += weak_undef_nonpic_test | |
442 | weak_undef_nonpic_test_SOURCES = weak_undef_test.cc | |
443 | weak_undef_nonpic_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib_nonpic.so alt/weak_undef_lib_nonpic.so | |
444 | weak_undef_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
445 | weak_undef_nonpic_test_LDADD = -L . weak_undef_lib_nonpic.so | |
446 | weak_undef_file1_nonpic.o: weak_undef_file1.cc | |
447 | $(CXXCOMPILE) -c -o $@ $< | |
448 | weak_undef_file2_nonpic.o: weak_undef_file2.cc | |
449 | $(CXXCOMPILE) -c -o $@ $< | |
450 | weak_undef_lib_nonpic.so: weak_undef_file1_nonpic.o | |
451 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1_nonpic.o | |
452 | alt/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 | |
455 | endif FN_PTRS_IN_SO_WITHOUT_PIC | |
456 | ||
457 | ||
99a37bfd ILT |
458 | check_PROGRAMS += weak_alias_test |
459 | weak_alias_test_SOURCES = weak_alias_test_main.cc | |
460 | weak_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 | |
463 | weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
464 | weak_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 | |
467 | weak_alias_test_1_pic.o: weak_alias_test_1.cc | |
468 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 469 | weak_alias_test_1.so: weak_alias_test_1_pic.o gcctestdir/ld |
99a37bfd ILT |
470 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o |
471 | weak_alias_test_2_pic.o: weak_alias_test_2.cc | |
472 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 473 | weak_alias_test_2.so: weak_alias_test_2_pic.o gcctestdir/ld |
99a37bfd ILT |
474 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o |
475 | weak_alias_test_3.o: weak_alias_test_3.cc | |
476 | $(CXXCOMPILE) -c -o $@ $< | |
477 | weak_alias_test_4_pic.o: weak_alias_test_4.cc | |
478 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
de4c45bd | 479 | weak_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 |
482 | check_SCRIPTS += weak_plt.sh |
483 | check_PROGRAMS += weak_plt | |
484 | check_DATA += weak_plt_shared.so | |
485 | weak_plt_main_pic.o: weak_plt_main.cc | |
486 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
487 | weak_plt: weak_plt_main_pic.o gcctestdir/ld | |
488 | $(CXXLINK) -Bgcctestdir/ weak_plt_main_pic.o | |
489 | weak_plt_shared_pic.o: weak_plt_shared.cc | |
490 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
491 | weak_plt_shared.so: weak_plt_shared_pic.o gcctestdir/ld | |
492 | $(CXXLINK) -Bgcctestdir/ -shared weak_plt_shared_pic.o | |
493 | ||
f34787f8 ILT |
494 | check_PROGRAMS += copy_test |
495 | copy_test_SOURCES = copy_test.cc | |
496 | copy_test_DEPENDENCIES = gcctestdir/ld copy_test_1.so copy_test_2.so | |
497 | copy_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
498 | copy_test_LDADD = copy_test_1.so copy_test_2.so | |
499 | copy_test_1_pic.o: copy_test_1.cc | |
500 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
501 | copy_test_1.so: gcctestdir/ld copy_test_1_pic.o | |
502 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_1_pic.o | |
503 | copy_test_2_pic.o: copy_test_2.cc | |
504 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
505 | copy_test_2.so: gcctestdir/ld copy_test_2_pic.o | |
506 | $(CXXLINK) -Bgcctestdir/ -shared copy_test_2_pic.o | |
507 | ||
6eee141f ILT |
508 | if TLS |
509 | ||
351a8000 ILT |
510 | check_PROGRAMS += tls_test |
511 | check_PROGRAMS += tls_pic_test | |
512 | check_PROGRAMS += tls_shared_test | |
c03c7692 | 513 | check_PROGRAMS += tls_shared_ie_test |
c2b45e22 | 514 | check_PROGRAMS += tls_shared_gd_to_ie_test |
351a8000 ILT |
515 | tls_test_pic.o: tls_test.cc |
516 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
517 | tls_test_file2_pic.o: tls_test_file2.cc | |
518 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
155a0dd7 ILT |
519 | tls_test_c_pic.o: tls_test_c.c |
520 | $(COMPILE) -c -fpic $(TLS_TEST_C_CFLAGS) -o $@ $< | |
521 | tls_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 |
523 | tls_test_shared2.so: tls_test_file2_pic.o gcctestdir/ld |
524 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_pic.o | |
351a8000 | 525 | |
c03c7692 ILT |
526 | tls_test_pic_ie.o: tls_test.cc |
527 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
528 | tls_test_file2_pic_ie.o: tls_test_file2.cc | |
529 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
155a0dd7 ILT |
530 | tls_test_c_pic_ie.o: tls_test_c.c |
531 | $(COMPILE) -c -fpic -ftls-model=initial-exec $(TLS_TEST_C_CFLAGS) -o $@ $< | |
532 | tls_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 | 535 | tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h |
155a0dd7 | 536 | tls_test_DEPENDENCIES = gcctestdir/ld tls_test_c.o |
6eee141f | 537 | tls_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
538 | tls_test_LDADD = tls_test_c.o -lpthread |
539 | tls_test_c.o: tls_test_c.c | |
540 | $(COMPILE) -c $(TLS_TEST_C_CFLAGS) -o $@ $< | |
6eee141f ILT |
541 | |
542 | tls_pic_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
543 | tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o \ |
544 | tls_test_c_pic.o | |
6eee141f | 545 | tls_pic_test_LDFLAGS = -Bgcctestdir/ |
155a0dd7 ILT |
546 | tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o tls_test_c_pic.o \ |
547 | -lpthread | |
6eee141f | 548 | |
6eee141f ILT |
549 | tls_shared_test_SOURCES = tls_test_main.cc |
550 | tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so | |
551 | tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
552 | tls_shared_test_LDADD = tls_test_shared.so -lpthread | |
553 | ||
c03c7692 ILT |
554 | tls_shared_ie_test_SOURCES = tls_test_main.cc |
555 | tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so | |
556 | tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
557 | tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread | |
558 | ||
c2b45e22 | 559 | tls_shared_gd_to_ie_test_SOURCES = tls_test_main.cc |
155a0dd7 ILT |
560 | tls_shared_gd_to_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o \ |
561 | tls_test_c_pic.o tls_test_shared2.so | |
c2b45e22 | 562 | tls_shared_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
563 | tls_shared_gd_to_ie_test_LDADD = tls_test_pic.o tls_test_c_pic.o \ |
564 | tls_test_shared2.so -lpthread | |
c2b45e22 CC |
565 | |
566 | if TLS_GNU2_DIALECT | |
567 | ||
568 | check_PROGRAMS += tls_shared_gnu2_gd_to_ie_test | |
569 | ||
570 | tls_test_gnu2.o: tls_test.cc | |
571 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
572 | tls_test_file2_gnu2.o: tls_test_file2.cc | |
573 | $(CXXCOMPILE) -c -fpic -mtls-dialect=gnu2 -o $@ $< | |
155a0dd7 ILT |
574 | tls_test_c_gnu2.o: tls_test_c.c |
575 | $(COMPILE) -c -fpic -mtls-dialect=gnu2 $(TLS_TEST_C_CFLAGS) -o $@ $< | |
c2b45e22 CC |
576 | tls_test_gnu2_shared2.so: tls_test_file2_gnu2.o gcctestdir/ld |
577 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_file2_gnu2.o | |
578 | ||
579 | tls_shared_gnu2_gd_to_ie_test_SOURCES = tls_test_main.cc | |
155a0dd7 ILT |
580 | tls_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 | 582 | tls_shared_gnu2_gd_to_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
155a0dd7 ILT |
583 | tls_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 | |
586 | if TLS_DESCRIPTORS | |
587 | ||
588 | check_PROGRAMS += tls_shared_gnu2_test | |
589 | ||
155a0dd7 ILT |
590 | tls_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 | |
593 | tls_shared_gnu2_test_SOURCES = tls_test_main.cc | |
594 | tls_shared_gnu2_test_DEPENDENCIES = gcctestdir/ld tls_test_gnu2_shared.so | |
595 | tls_shared_gnu2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
596 | tls_shared_gnu2_test_LDADD = tls_test_gnu2_shared.so -lpthread | |
597 | ||
598 | endif TLS_DESCRIPTORS | |
599 | ||
600 | endif TLS_GNU2_DIALECT | |
601 | ||
351a8000 ILT |
602 | if STATIC_TLS |
603 | check_PROGRAMS += tls_static_test | |
604 | check_PROGRAMS += tls_static_pic_test | |
605 | ||
606 | tls_static_test_SOURCES = $(tls_test_SOURCES) | |
607 | tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) | |
608 | tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static | |
609 | tls_static_test_LDADD = $(tls_test_LDADD) | |
610 | ||
611 | tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES) | |
612 | tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) | |
613 | tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static | |
614 | tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) | |
615 | endif | |
6eee141f ILT |
616 | |
617 | if FN_PTRS_IN_SO_WITHOUT_PIC | |
351a8000 | 618 | check_PROGRAMS += tls_shared_nonpic_test |
155a0dd7 ILT |
619 | tls_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 | |
622 | tls_shared_nonpic_test_SOURCES = tls_test_main.cc | |
623 | tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so | |
624 | tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
625 | tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread | |
351a8000 | 626 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
6eee141f | 627 | |
351a8000 | 628 | endif TLS |
6eee141f | 629 | |
d491d34e ILT |
630 | check_PROGRAMS += many_sections_test |
631 | many_sections_test_SOURCES = many_sections_test.cc | |
632 | many_sections_test_DEPENDENCIES = gcctestdir/ld | |
633 | many_sections_test_LDFLAGS = -Bgcctestdir/ -rdynamic | |
634 | ||
635 | BUILT_SOURCES += many_sections_define.h | |
636 | many_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 | ||
642 | BUILT_SOURCES += many_sections_check.h | |
643 | many_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 | ||
649 | check_PROGRAMS += many_sections_r_test | |
d491d34e ILT |
650 | many_sections_r_test.o: many_sections_test.o gcctestdir/ld |
651 | gcctestdir/ld -r -o $@ many_sections_test.o | |
7bc3e21a ILT |
652 | many_sections_r_test: many_sections_r_test.o gcctestdir/ld |
653 | $(CXXLINK) -Bgcctestdir/ many_sections_r_test.o $(LIBS) | |
6eee141f | 654 | |
2fd32231 ILT |
655 | if CONSTRUCTOR_PRIORITY |
656 | ||
657 | check_PROGRAMS += initpri1 | |
658 | initpri1_SOURCES = initpri1.c | |
659 | initpri1_DEPENDENCIES = gcctestdir/ld | |
660 | initpri1_LDFLAGS = -Bgcctestdir/ | |
661 | ||
662 | endif | |
663 | ||
664 | ||
351a8000 ILT |
665 | # Test --detect-odr-violations |
666 | check_SCRIPTS += debug_msg.sh | |
6eee141f | 667 | |
351a8000 ILT |
668 | # Create the data files that debug_msg.sh analyzes. |
669 | check_DATA += debug_msg.err | |
670 | MOSTLYCLEANFILES += debug_msg.err | |
671 | debug_msg.o: debug_msg.cc | |
672 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc | |
673 | odr_violation1.o: odr_violation1.cc | |
674 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc | |
675 | odr_violation2.o: odr_violation2.cc | |
676 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc | |
677 | debug_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. | |
687 | check_DATA += debug_msg_so.err | |
688 | MOSTLYCLEANFILES += debug_msg_so.err | |
689 | debug_msg.so: debug_msg.cc gcctestdir/ld | |
690 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
691 | odr_violation1.so: odr_violation1.cc gcctestdir/ld | |
692 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
693 | odr_violation2.so: odr_violation2.cc gcctestdir/ld | |
694 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc | |
695 | debug_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. | |
706 | check_DATA += debug_msg_ndebug.err | |
707 | MOSTLYCLEANFILES += debug_msg_ndebug.err | |
708 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld | |
709 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
710 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld | |
711 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
712 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld | |
713 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc | |
714 | debug_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 | |
725 | check_SCRIPTS += undef_symbol.sh | |
726 | check_DATA += undef_symbol.err | |
727 | MOSTLYCLEANFILES += undef_symbol.err | |
728 | undef_symbol.o: undef_symbol.cc | |
729 | $(CXXCOMPILE) -O0 -g -c -fPIC $< | |
730 | undef_symbol.so: undef_symbol.o gcctestdir/ld | |
731 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o | |
732 | undef_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). |
743 | check_PROGRAMS += flagstest_o_specialfile | |
0e470e5c | 744 | flagstest_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 |
749 | if HAVE_ZLIB |
750 | ||
751 | # Test --compress-debug-sections. FIXME: check we actually compress. | |
752 | check_PROGRAMS += flagstest_compress_debug_sections | |
753 | flagstest_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. | |
760 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections | |
0e470e5c ILT |
761 | flagstest_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 |
767 | endif HAVE_ZLIB |
768 | ||
99f8faca ILT |
769 | # Test symbol versioning. |
770 | check_PROGRAMS += ver_test | |
771 | ver_test_SOURCES = ver_test_main.cc | |
772 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
773 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
774 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
775 | ver_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 |
777 | ver_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 | |
779 | ver_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 |
781 | ver_test_1.o: ver_test_1.cc |
782 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
783 | ver_test_2.o: ver_test_2.cc | |
784 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
785 | ver_test_3.o: ver_test_3.cc | |
786 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
787 | ver_test_4.o: ver_test_4.cc | |
788 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 789 | |
0602e05a ILT |
790 | check_SCRIPTS += ver_test_1.sh |
791 | check_DATA += ver_test_1.syms | |
792 | ver_test_1.syms: ver_test_1.so | |
793 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
794 | ||
be3e6201 ILT |
795 | check_PROGRAMS += ver_test_2 |
796 | ver_test_2_SOURCES = ver_test_main_2.cc | |
797 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
798 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
799 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
800 | ||
be3e6201 ILT |
801 | check_SCRIPTS += ver_test_2.sh |
802 | check_DATA += ver_test_2.syms | |
803 | ver_test_2.syms: ver_test_2 | |
6835af53 | 804 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 805 | |
686c8caf ILT |
806 | check_SCRIPTS += ver_test_4.sh |
807 | check_DATA += ver_test_4.syms | |
808 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 809 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
810 | |
811 | ver_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 | |
813 | ver_test_5.o: ver_test_5.cc | |
814 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
815 | check_SCRIPTS += ver_test_5.sh | |
816 | check_DATA += ver_test_5.syms | |
817 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 818 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 819 | |
18e6b24e ILT |
820 | check_PROGRAMS += ver_test_6 |
821 | ver_test_6_SOURCES = ver_test_6.c | |
822 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
823 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
824 | ver_test_6_LDADD = ver_test_2.so | |
825 | ||
479f6503 ILT |
826 | ver_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 | |
828 | ver_test_7.o: ver_test_7.cc | |
829 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
830 | check_SCRIPTS += ver_test_7.sh | |
831 | check_DATA += ver_test_7.syms | |
832 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 833 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 834 | |
75517b77 ILT |
835 | check_PROGRAMS += ver_test_8 |
836 | ver_test_8_SOURCES = two_file_test_main.cc | |
837 | ver_test_8_DEPENDENCIES = gcctestdir/ld ver_test_8_1.so ver_test_8_2.so | |
838 | ver_test_8_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
839 | ver_test_8_LDADD = ver_test_8_1.so ver_test_8_2.so | |
840 | ver_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 | |
842 | ver_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 |
845 | check_PROGRAMS += ver_test_9 |
846 | ver_test_9_SOURCES = ver_test_main.cc | |
847 | ver_test_9_DEPENDENCIES = gcctestdir/ld ver_test_9.so | |
848 | ver_test_9_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
849 | ver_test_9_LDADD = ver_test_9.so | |
850 | ver_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 | |
852 | ver_test_9.o: ver_test_9.cc | |
853 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
854 | ||
057ead22 ILT |
855 | check_SCRIPTS += ver_test_10.sh |
856 | check_DATA += ver_test_10.syms | |
857 | ver_test_10.syms: ver_test_10.so | |
858 | $(TEST_READELF) -s $< >$@ 2>/dev/null | |
859 | ver_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 |
862 | check_PROGRAMS += ver_test_11 |
863 | ver_test_11_SOURCES = ver_test_main_2.cc | |
864 | ver_test_11_DEPENDENCIES = gcctestdir/ld ver_test_11.a | |
865 | ver_test_11_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
866 | ver_test_11_LDADD = ver_test_11.a | |
867 | ver_test_11.a: ver_test_1.o ver_test_2.o ver_test_4.o | |
868 | $(TEST_AR) rc $@ $^ | |
869 | ||
8bdcdf2c ILT |
870 | check_PROGRAMS += protected_1 |
871 | protected_1_SOURCES = \ | |
872 | protected_main_1.cc protected_main_2.cc protected_main_3.cc | |
873 | protected_1_DEPENDENCIES = gcctestdir/ld protected_1.so | |
874 | protected_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
875 | protected_1_LDADD = protected_1.so | |
876 | ||
877 | protected_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 | |
879 | protected_1_pic.o: protected_1.cc | |
880 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
881 | protected_2_pic.o: protected_2.cc | |
882 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
883 | protected_3_pic.o: protected_3.cc | |
884 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
885 | ||
886 | check_PROGRAMS += protected_2 | |
887 | protected_2_SOURCES = protected_main_1.cc protected_3.cc | |
888 | protected_2_DEPENDENCIES = gcctestdir/ld protected_1.so | |
889 | protected_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
890 | protected_2_LDADD = protected_1.so | |
891 | ||
9f1d377b ILT |
892 | check_PROGRAMS += relro_test |
893 | relro_test_SOURCES = relro_test_main.cc | |
894 | relro_test_DEPENDENCIES = gcctestdir/ld relro_test.so | |
895 | relro_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
896 | relro_test_LDADD = relro_test.so | |
897 | relro_test.so: gcctestdir/ld relro_test_pic.o | |
898 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,-z,relro relro_test_pic.o | |
899 | relro_test_pic.o: relro_test.cc | |
900 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
901 | ||
2d924fd9 ILT |
902 | check_PROGRAMS += relro_script_test |
903 | relro_script_test_SOURCES = relro_test_main.cc | |
904 | relro_script_test_DEPENDENCIES = gcctestdir/ld relro_script_test.so | |
905 | relro_script_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
906 | relro_script_test_LDADD = relro_script_test.so | |
907 | relro_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 |
910 | check_PROGRAMS += script_test_1 |
911 | script_test_1_SOURCES = script_test_1.cc | |
912 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t | |
913 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t | |
914 | ||
a445fddf ILT |
915 | check_PROGRAMS += script_test_2 |
916 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
917 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
918 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t | |
919 | ||
88dd47ac ILT |
920 | check_PROGRAMS += justsyms |
921 | justsyms_SOURCES = justsyms_1.cc | |
922 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
923 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
924 | justsyms_2.o: justsyms_2.cc | |
925 | $(CXXCOMPILE) -c -o $@ $< | |
83bfb6b7 | 926 | justsyms_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 |
929 | check_PROGRAMS += binary_test |
930 | binary_test_SOURCES = binary_test.cc | |
931 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
932 | binary_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. | |
935 | binary.txt: $(srcdir)/binary.in | |
936 | rm -f $@ | |
937 | $(LN_S) $< $@ | |
938 | ||
09124467 ILT |
939 | check_SCRIPTS += ver_matching_test.sh |
940 | check_DATA += ver_matching_test.stdout | |
941 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
942 | ver_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 | |
944 | ver_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 | |
947 | check_PROGRAMS += script_test_3 | |
948 | check_SCRIPTS += script_test_3.sh | |
949 | check_DATA += script_test_3.stdout | |
950 | MOSTLYCLEANFILES += script_test_3.stdout | |
951 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
952 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t | |
953 | script_test_3.stdout: script_test_3 | |
2cefc357 | 954 | $(TEST_READELF) -SlW script_test_3 > script_test_3.stdout |
09124467 | 955 | |
e6188289 ILT |
956 | check_SCRIPTS += script_test_4.sh |
957 | check_DATA += script_test_4.stdout | |
958 | MOSTLYCLEANFILES += script_test_4.stdout | |
959 | script_test_4: basic_test.o gcctestdir/ld $(srcdir)/script_test_4.t | |
960 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_4.t | |
961 | script_test_4.stdout: script_test_4 | |
962 | $(TEST_READELF) -SlW script_test_4 > script_test_4.stdout | |
963 | ||
401a9a73 CC |
964 | check_SCRIPTS += script_test_5.sh |
965 | check_DATA += script_test_5.stdout | |
966 | MOSTLYCLEANFILES += script_test_5.stdout | |
967 | script_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 | |
969 | script_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 | ||
975 | check_SCRIPTS += dynamic_list.sh | |
976 | check_DATA += dynamic_list.stdout | |
977 | MOSTLYCLEANFILES += dynamic_list.stdout | |
978 | dynamic_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 | |
984 | dynamic_list.stdout: dynamic_list | |
985 | $(TEST_READELF) -DWs dynamic_list > dynamic_list.stdout | |
986 | ||
fbd8a257 CC |
987 | check_PROGRAMS += thin_archive_test_1 |
988 | thin_archive_test_1_SOURCES = thin_archive_main.cc | |
989 | thin_archive_test_1_DEPENDENCIES = gcctestdir/ld libthin1.a alt/libthin2.a | |
990 | thin_archive_test_1_LDFLAGS = -Bgcctestdir/ -Lalt | |
991 | thin_archive_test_1_LDADD = libthin1.a -lthin2 | |
992 | ||
993 | check_PROGRAMS += thin_archive_test_2 | |
994 | thin_archive_test_2_SOURCES = thin_archive_main.cc | |
995 | thin_archive_test_2_DEPENDENCIES = gcctestdir/ld libthinall.a | |
996 | thin_archive_test_2_LDFLAGS = -Bgcctestdir/ -L. | |
997 | thin_archive_test_2_LDADD = -lthinall | |
998 | ||
999 | libthin1.a: thin_archive_test_1.o alt/thin_archive_test_2.o | |
1000 | rm -f $@ | |
1001 | $(TEST_AR) crT $@ $^ | |
1002 | alt/libthin2.a: thin_archive_test_3.o alt/thin_archive_test_4.o | |
1003 | rm -f $@ | |
1004 | $(TEST_AR) crT $@ $^ | |
1005 | libthin3.a: thin_archive_test_1.o alt/thin_archive_test_4.o | |
1006 | rm -f $@ | |
1007 | $(TEST_AR) crT $@ $^ | |
1008 | alt/libthin4.a: alt/thin_archive_test_2.o thin_archive_test_3.o | |
1009 | rm -f $@ | |
1010 | $(TEST_AR) crT $@ $^ | |
1011 | libthinall.a: libthin3.a alt/libthin4.a | |
1012 | rm -f $@ | |
1013 | $(TEST_AR) crT $@ $^ | |
1014 | alt/thin_archive_test_2.o: thin_archive_test_2.cc | |
1015 | test -d alt || mkdir -p alt | |
1016 | $(CXXCOMPILE) -c -o $@ $< | |
1017 | alt/thin_archive_test_4.o: thin_archive_test_4.cc | |
1018 | test -d alt || mkdir -p alt | |
1019 | $(CXXCOMPILE) -c -o $@ $< | |
1020 | ||
89fc3421 CC |
1021 | if PLUGINS |
1022 | ||
1023 | check_PROGRAMS += plugin_test_1 | |
1024 | check_SCRIPTS += plugin_test_1.sh | |
1025 | check_DATA += plugin_test_1.err | |
1026 | MOSTLYCLEANFILES += plugin_test_1.err | |
abc8dcba CC |
1027 | 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 |
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 |
1029 | plugin_test_1.err: plugin_test_1 |
1030 | @touch plugin_test_1.err | |
1031 | ||
1032 | check_PROGRAMS += plugin_test_2 | |
1033 | check_SCRIPTS += plugin_test_2.sh | |
1034 | check_DATA += plugin_test_2.err | |
1035 | MOSTLYCLEANFILES += plugin_test_2.err | |
1036 | 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 | |
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 | |
1038 | plugin_test_2.err: plugin_test_2 | |
1039 | @touch plugin_test_2.err | |
1040 | ||
d66a9eb3 CC |
1041 | check_PROGRAMS += plugin_test_3 |
1042 | check_SCRIPTS += plugin_test_3.sh | |
1043 | check_DATA += plugin_test_3.err | |
1044 | MOSTLYCLEANFILES += plugin_test_3.err | |
1045 | 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 | |
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 | |
1047 | plugin_test_3.err: plugin_test_3 | |
1048 | @touch plugin_test_3.err | |
1049 | ||
0f7c0701 CC |
1050 | check_PROGRAMS += plugin_test_4 |
1051 | check_SCRIPTS += plugin_test_4.sh | |
1052 | check_DATA += plugin_test_4.err | |
1053 | MOSTLYCLEANFILES += plugin_test_4.err | |
1054 | plugin_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 | |
1056 | plugin_test_4.err: plugin_test_4 | |
1057 | @touch plugin_test_4.err | |
1058 | ||
1059 | plugin_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 |
1062 | plugin_test.so: plugin_test.o |
1063 | $(LINK) -Bgcctestdir/ -shared plugin_test.o | |
1064 | plugin_test.o: plugin_test.c | |
1065 | $(COMPILE) -O0 -c -fpic -o $@ $< | |
1066 | ||
1067 | two_file_test_main.syms: two_file_test_main.o | |
1068 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1069 | two_file_test_1.syms: two_file_test_1.o | |
1070 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1071 | two_file_test_1b.syms: two_file_test_1b.o | |
1072 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1073 | two_file_test_2.syms: two_file_test_2.o | |
1074 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
abc8dcba CC |
1075 | empty.syms: |
1076 | @echo "" >empty.syms | |
1077 | @echo "Symbol table" >>empty.syms | |
89fc3421 CC |
1078 | |
1079 | endif PLUGINS | |
1080 | ||
65514900 CC |
1081 | check_PROGRAMS += exclude_libs_test |
1082 | check_SCRIPTS += exclude_libs_test.sh | |
1083 | check_DATA += exclude_libs_test.syms | |
1084 | MOSTLYCLEANFILES += exclude_libs_test.syms libexclude_libs_test_1.a \ | |
2fdd743f | 1085 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
65514900 CC |
1086 | exclude_libs_test_SOURCES = exclude_libs_test.c |
1087 | exclude_libs_test_DEPENDENCIES = gcctestdir/ld libexclude_libs_test_1.a \ | |
2fdd743f DK |
1088 | libexclude_libs_test_2.a alt/libexclude_libs_test_3.a |
1089 | exclude_libs_test_LDFLAGS = -Bgcctestdir/ -L. -Lalt \ | |
1090 | -Wl,--exclude-libs,dummy:libexclude_libs_test_1 \ | |
1091 | -Wl,--exclude-libs,libexclude_libs_test_3 | |
1092 | exclude_libs_test_LDADD = -lexclude_libs_test_1 -lexclude_libs_test_2 \ | |
1093 | alt/libexclude_libs_test_3.a | |
65514900 CC |
1094 | exclude_libs_test.syms: exclude_libs_test |
1095 | $(TEST_READELF) -sW $< >$@ 2>/dev/null | |
1096 | libexclude_libs_test_1.a: exclude_libs_test_1.o | |
1097 | $(TEST_AR) rc $@ $^ | |
1098 | libexclude_libs_test_2.a: exclude_libs_test_2.o | |
1099 | $(TEST_AR) rc $@ $^ | |
2fdd743f DK |
1100 | alt/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 |
1104 | check_PROGRAMS += local_labels_test |
1105 | local_labels_test.o: ver_test_6.c | |
1106 | $(COMPILE) -g -c -Wa,-L -o $@ $< | |
1107 | local_labels_test: local_labels_test.o | |
1108 | $(LINK) -Bgcctestdir/ local_labels_test.o | |
1109 | ||
bb04269c DK |
1110 | check_PROGRAMS += discard_locals_test |
1111 | check_SCRIPTS += discard_locals_test.sh | |
1112 | check_DATA += discard_locals_test.syms | |
1113 | MOSTLYCLEANFILES += discard_locals_test.syms | |
1114 | discard_locals_test_SOURCES = discard_locals_test.c | |
1115 | discard_locals_test_LDFLAGS = -Bgcctestdir/ -Wl,--discard-locals | |
1116 | discard_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. | |
1119 | discard_locals_test.o: discard_locals_test.c | |
1120 | $(COMPILE) -c -Wa,-L -o $@ $< | |
1121 | ||
8a5e3e08 ILT |
1122 | if MCMODEL_MEDIUM |
1123 | check_PROGRAMS += large | |
1124 | large_SOURCES = large.c | |
1125 | large_CFLAGS = -mcmodel=medium | |
1126 | large_DEPENDENCIES = gcctestdir/ld | |
1127 | large_LDFLAGS = -Bgcctestdir/ | |
1128 | endif MCMODEL_MEDIUM | |
1129 | ||
645afe0c CC |
1130 | # Test that hidden and internal symbols in the main program cannot be |
1131 | # referenced by a shared library. | |
1132 | check_SCRIPTS += hidden_test.sh | |
1133 | check_DATA += hidden_test.err | |
1134 | MOSTLYCLEANFILES += hidden_test hidden_test.err | |
1135 | libhidden.so: hidden_test_1.c gcctestdir/ld | |
1136 | $(COMPILE) -Bgcctestdir/ -g -shared -fPIC -w -o $@ $(srcdir)/hidden_test_1.c | |
1137 | hidden_test: hidden_test_main.o libhidden.so gcctestdir/ld | |
1138 | $(LINK) -Bgcctestdir/ -Wl,-R,. hidden_test_main.o libhidden.so 2>hidden_test.err | |
1139 | hidden_test.err: hidden_test | |
1140 | @touch hidden_test.err | |
1141 | ||
351a8000 ILT |
1142 | endif GCC |
1143 | endif NATIVE_LINKER |