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