]>
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. | |
494e05f4 | 12 | AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) -fmerge-constants |
5a6f7e2d | 13 | |
fa99aa09 | 14 | INCLUDES = \ |
5a6f7e2d ILT |
15 | -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../../include \ |
16 | -I$(srcdir)/../../elfcpp \ | |
17 | -DLOCALEDIR="\"$(datadir)/locale\"" \ | |
18 | @INCINTL@ | |
19 | ||
6835af53 ILT |
20 | TEST_READELF = $(top_builddir)/../binutils/readelf |
21 | TEST_OBJDUMP = $(top_builddir)/../binutils/objdump | |
22 | TEST_CXXFILT = $(top_builddir)/../binutils/cxxfilt | |
23 | TEST_STRIP = $(top_builddir)/../binutils/strip-new | |
24 | ||
fe9a4c12 ILT |
25 | if THREADS |
26 | THREADSLIB = -lpthread | |
27 | endif | |
28 | ||
351a8000 ILT |
29 | # 'make clean' is good about deleting some intermediate files (such as |
30 | # .o's), but not all of them (such as .so's and .err files). We | |
31 | # improve on that here. automake-1.9 info docs say "mostlyclean" is | |
32 | # the right choice for files 'make' builds that people rebuild. | |
33 | MOSTLYCLEANFILES = *.so | |
6eee141f | 34 | |
6eee141f | 35 | |
351a8000 ILT |
36 | # We will add to these later, for each individual test. Note |
37 | # that we add each test under check_SCRIPTS or check_PROGRAMS; | |
38 | # the TESTS variable is automatically populated from these. | |
39 | check_SCRIPTS = | |
40 | check_DATA = | |
41 | check_PROGRAMS = | |
42 | TESTS = $(check_SCRIPTS) $(check_PROGRAMS) | |
22dc1b09 | 43 | |
351a8000 ILT |
44 | # --------------------------------------------------------------------- |
45 | # These tests test the internals of gold (unittests). | |
5a6f7e2d | 46 | |
351a8000 | 47 | # Infrastucture needed for the unittests |
5a6f7e2d ILT |
48 | check_LIBRARIES = libgoldtest.a |
49 | libgoldtest_a_SOURCES = test.cc testmain.cc testfile.cc | |
50 | ||
ad2d6943 ILT |
51 | DEPENDENCIES = \ |
52 | libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL_DEP) | |
fe9a4c12 ILT |
53 | LDADD = libgoldtest.a ../libgold.a ../../libiberty/libiberty.a $(LIBINTL) \ |
54 | $(THREADSLIB) | |
5a6f7e2d | 55 | |
5a6f7e2d | 56 | |
351a8000 ILT |
57 | # The unittests themselves |
58 | check_PROGRAMS += object_unittest | |
5a6f7e2d | 59 | object_unittest_SOURCES = object_unittest.cc |
22dc1b09 | 60 | |
bc644c6c ILT |
61 | check_PROGRAMS += binary_unittest |
62 | binary_unittest_SOURCES = binary_unittest.cc | |
63 | ||
351a8000 ILT |
64 | |
65 | # --------------------------------------------------------------------- | |
66 | # These tests test the output of gold (end-to-end tests). In | |
67 | # particular, they make sure that gold can link "difficult" object | |
68 | # files, and the resulting object files run correctly. These can only | |
69 | # run if we've built ld-new for the native architecture (that is, | |
70 | # we're not cross-compiling it), since we run ld-new as part of these | |
71 | # tests. We use the gcc-specific flag '-B' to use our linker instead | |
72 | # of the default linker, which is why we only run our tests under gcc. | |
a360aedd | 73 | |
e2827e5f | 74 | if NATIVE_LINKER |
351a8000 | 75 | if GCC |
e2827e5f | 76 | |
351a8000 ILT |
77 | # Infrastucture needed for the unittests: a directory where the linker |
78 | # is named 'ld'. This is because the -B flag appends 'ld' to its arg. | |
e2827e5f ILT |
79 | gcctestdir/ld: ../ld-new |
80 | test -d gcctestdir || mkdir -p gcctestdir | |
81 | rm -f gcctestdir/ld | |
82 | (cd gcctestdir && $(LN_S) ../../ld-new ld) | |
83 | ||
351a8000 ILT |
84 | # Each of these .o's is a useful, small complete program. They're |
85 | # particularly useful for making sure ld-new's flags do what they're | |
86 | # supposed to (hence their names), but are used for many tests that | |
87 | # don't actually involve analyzing input data. | |
43771f76 ILT |
88 | flagstest_debug.o: constructor_test.cc |
89 | $(CXXCOMPILE) -O0 -g -c -o $@ $< | |
90 | flagstest_ndebug.o: constructor_test.cc | |
91 | $(CXXCOMPILE) -O0 -c -o $@ $< | |
92 | ||
43771f76 | 93 | |
351a8000 ILT |
94 | check_PROGRAMS += basic_test |
95 | check_PROGRAMS += basic_static_test | |
96 | check_PROGRAMS += basic_pic_test | |
97 | check_PROGRAMS += basic_static_pic_test | |
56ba9a23 | 98 | basic_test.o: basic_test.cc |
22dc1b09 | 99 | $(CXXCOMPILE) -O0 -c -o $@ $< |
56ba9a23 ILT |
100 | basic_test: basic_test.o gcctestdir/ld |
101 | $(CXXLINK) -Bgcctestdir/ basic_test.o | |
102 | basic_static_test: basic_test.o gcctestdir/ld | |
103 | $(CXXLINK) -Bgcctestdir/ -static basic_test.o | |
22dc1b09 | 104 | |
56ba9a23 | 105 | basic_pic_test.o: basic_test.cc |
22dc1b09 | 106 | $(CXXCOMPILE) -O0 -c -fpic -o $@ $< |
56ba9a23 ILT |
107 | basic_pic_test: basic_pic_test.o gcctestdir/ld |
108 | $(CXXLINK) -Bgcctestdir/ basic_pic_test.o | |
109 | basic_static_pic_test: basic_pic_test.o gcctestdir/ld | |
110 | $(CXXLINK) -Bgcctestdir/ -static basic_pic_test.o | |
22dc1b09 | 111 | |
351a8000 ILT |
112 | |
113 | check_PROGRAMS += constructor_test | |
114 | check_PROGRAMS += constructor_static_test | |
d5026652 ILT |
115 | constructor_test_SOURCES = constructor_test.cc |
116 | constructor_test_DEPENDENCIES = gcctestdir/ld | |
117 | constructor_test_LDFLAGS = -Bgcctestdir/ | |
118 | ||
351a8000 ILT |
119 | constructor_static_test_SOURCES = $(constructor_test_SOURCES) |
120 | constructor_static_test_DEPENDENCIES = $(constructor_test_DEPENDENCIES) | |
121 | constructor_static_test_LDFLAGS = $(constructor_test_LDFLAGS) -static | |
cb615bc1 | 122 | |
351a8000 ILT |
123 | |
124 | check_PROGRAMS += two_file_test | |
125 | check_PROGRAMS += two_file_static_test | |
126 | check_PROGRAMS += two_file_pic_test | |
3bd52c28 ILT |
127 | two_file_test_SOURCES = \ |
128 | two_file_test_1.cc \ | |
03e8f2b2 | 129 | two_file_test_1b.cc \ |
3bd52c28 ILT |
130 | two_file_test_2.cc \ |
131 | two_file_test_main.cc \ | |
132 | two_file_test.h | |
133 | two_file_test_DEPENDENCIES = gcctestdir/ld | |
134 | two_file_test_LDFLAGS = -Bgcctestdir/ | |
135 | ||
351a8000 ILT |
136 | two_file_static_test_SOURCES = $(two_file_test_SOURCES) |
137 | two_file_static_test_DEPENDENCIES = $(two_file_test_DEPENDENCIES) | |
138 | two_file_static_test_LDFLAGS = $(two_file_test_LDFLAGS) -static | |
f958d5fc ILT |
139 | |
140 | two_file_pic_test_SOURCES = two_file_test_main.cc | |
141 | two_file_pic_test_DEPENDENCIES = \ | |
03e8f2b2 | 142 | gcctestdir/ld two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 143 | two_file_pic_test_LDFLAGS = -Bgcctestdir/ |
03e8f2b2 | 144 | two_file_pic_test_LDADD = two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o |
f958d5fc | 145 | |
351a8000 ILT |
146 | |
147 | check_PROGRAMS += two_file_shared_1_test | |
148 | check_PROGRAMS += two_file_shared_2_test | |
149 | check_PROGRAMS += two_file_shared_1_pic_2_test | |
150 | check_PROGRAMS += two_file_shared_2_pic_1_test | |
151 | check_PROGRAMS += two_file_same_shared_test | |
152 | check_PROGRAMS += two_file_separate_shared_12_test | |
153 | check_PROGRAMS += two_file_separate_shared_21_test | |
154 | two_file_test_1_pic.o: two_file_test_1.cc | |
155 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
156 | two_file_test_1b_pic.o: two_file_test_1b.cc |
157 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 ILT |
158 | two_file_test_2_pic.o: two_file_test_2.cc |
159 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
03e8f2b2 ILT |
160 | two_file_shared_1.so: two_file_test_1_pic.o two_file_test_1b_pic.o gcctestdir/ld |
161 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o | |
351a8000 ILT |
162 | two_file_shared_2.so: two_file_test_2_pic.o gcctestdir/ld |
163 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2_pic.o | |
03e8f2b2 ILT |
164 | two_file_shared.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o gcctestdir/ld |
165 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2_pic.o | |
351a8000 | 166 | |
3bd52c28 ILT |
167 | two_file_shared_1_test_SOURCES = two_file_test_2.cc two_file_test_main.cc |
168 | two_file_shared_1_test_DEPENDENCIES = gcctestdir/ld two_file_shared_1.so | |
169 | two_file_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
170 | two_file_shared_1_test_LDADD = two_file_shared_1.so | |
171 | ||
03e8f2b2 | 172 | two_file_shared_2_test_SOURCES = two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
173 | two_file_shared_2_test_DEPENDENCIES = gcctestdir/ld two_file_shared_2.so |
174 | two_file_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
175 | two_file_shared_2_test_LDADD = two_file_shared_2.so | |
176 | ||
386c048c ILT |
177 | two_file_shared_1_pic_2_test_SOURCES = two_file_test_main.cc |
178 | two_file_shared_1_pic_2_test_DEPENDENCIES = \ | |
03e8f2b2 | 179 | gcctestdir/ld two_file_shared_1.so two_file_test_1_pic.o two_file_test_1b_pic.o |
386c048c | 180 | two_file_shared_1_pic_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. |
03e8f2b2 | 181 | 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 |
182 | |
183 | two_file_shared_2_pic_1_test_SOURCES = two_file_test_main.cc | |
184 | two_file_shared_2_pic_1_test_DEPENDENCIES = \ | |
185 | gcctestdir/ld two_file_shared_2.so two_file_test_2_pic.o | |
186 | two_file_shared_2_pic_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
187 | two_file_shared_2_pic_1_test_LDADD = two_file_test_2_pic.o two_file_shared_1.so | |
188 | ||
3bd52c28 ILT |
189 | two_file_same_shared_test_SOURCES = two_file_test_main.cc |
190 | two_file_same_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared.so | |
191 | two_file_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
192 | two_file_same_shared_test_LDADD = two_file_shared.so | |
193 | ||
194 | two_file_separate_shared_12_test_SOURCES = two_file_test_main.cc | |
195 | two_file_separate_shared_12_test_DEPENDENCIES = \ | |
196 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
197 | two_file_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
198 | two_file_separate_shared_12_test_LDADD = \ | |
199 | two_file_shared_1.so two_file_shared_2.so | |
200 | ||
201 | two_file_separate_shared_21_test_SOURCES = two_file_test_main.cc | |
202 | two_file_separate_shared_21_test_DEPENDENCIES = \ | |
203 | gcctestdir/ld two_file_shared_1.so two_file_shared_2.so | |
204 | two_file_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
205 | two_file_separate_shared_21_test_LDADD = \ | |
206 | two_file_shared_2.so two_file_shared_1.so | |
207 | ||
6a74a719 ILT |
208 | check_PROGRAMS += two_file_relocatable_test |
209 | two_file_relocatable_test_SOURCES = two_file_test_main.cc | |
210 | two_file_relocatable_test_DEPENDENCIES = \ | |
211 | gcctestdir/ld two_file_relocatable.o | |
212 | two_file_relocatable_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
213 | two_file_relocatable_test_LDADD = two_file_relocatable.o | |
214 | two_file_relocatable.o: gcctestdir/ld two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
215 | gcctestdir/ld -r -o $@ two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
216 | ||
63402fe4 ILT |
217 | # The nonpic tests will fail on platforms which can not put non-PIC |
218 | # code into shared libraries, so we just don't run them in that case. | |
63402fe4 | 219 | if FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 220 | |
351a8000 ILT |
221 | check_PROGRAMS += two_file_shared_1_nonpic_test |
222 | check_PROGRAMS += two_file_shared_2_nonpic_test | |
223 | check_PROGRAMS += two_file_same_shared_nonpic_test | |
224 | check_PROGRAMS += two_file_separate_shared_12_nonpic_test | |
225 | check_PROGRAMS += two_file_separate_shared_21_nonpic_test | |
03e8f2b2 ILT |
226 | check_PROGRAMS += two_file_mixed_shared_test |
227 | check_PROGRAMS += two_file_mixed_2_shared_test | |
351a8000 | 228 | two_file_shared_1_nonpic.so: two_file_test_1.o gcctestdir/ld |
03e8f2b2 | 229 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o |
351a8000 ILT |
230 | two_file_shared_2_nonpic.so: two_file_test_2.o gcctestdir/ld |
231 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_2.o | |
03e8f2b2 ILT |
232 | two_file_shared_nonpic.so: two_file_test_1.o two_file_test_1b.o two_file_test_2.o gcctestdir/ld |
233 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b.o two_file_test_2.o | |
234 | two_file_shared_mixed.so: two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o gcctestdir/ld | |
235 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1_pic.o two_file_test_1b_pic.o two_file_test_2.o | |
236 | two_file_shared_mixed_1.so: two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so gcctestdir/ld | |
237 | $(CXXLINK) -Bgcctestdir/ -shared two_file_test_1.o two_file_test_1b_pic.o two_file_shared_2.so | |
351a8000 | 238 | |
3bd52c28 ILT |
239 | two_file_shared_1_nonpic_test_SOURCES = \ |
240 | two_file_test_2.cc two_file_test_main.cc | |
241 | two_file_shared_1_nonpic_test_DEPENDENCIES = \ | |
242 | gcctestdir/ld two_file_shared_1_nonpic.so | |
243 | two_file_shared_1_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
244 | two_file_shared_1_nonpic_test_LDADD = two_file_shared_1_nonpic.so | |
245 | ||
246 | two_file_shared_2_nonpic_test_SOURCES = \ | |
03e8f2b2 | 247 | two_file_test_1.cc two_file_test_1b.cc two_file_test_main.cc |
3bd52c28 ILT |
248 | two_file_shared_2_nonpic_test_DEPENDENCIES = \ |
249 | gcctestdir/ld two_file_shared_2_nonpic.so | |
250 | two_file_shared_2_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
251 | two_file_shared_2_nonpic_test_LDADD = two_file_shared_2_nonpic.so | |
252 | ||
253 | two_file_same_shared_nonpic_test_SOURCES = two_file_test_main.cc | |
254 | two_file_same_shared_nonpic_test_DEPENDENCIES = \ | |
255 | gcctestdir/ld two_file_shared_nonpic.so | |
256 | two_file_same_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
257 | two_file_same_shared_nonpic_test_LDADD = two_file_shared_nonpic.so | |
258 | ||
259 | two_file_separate_shared_12_nonpic_test_SOURCES = two_file_test_main.cc | |
260 | two_file_separate_shared_12_nonpic_test_DEPENDENCIES = \ | |
261 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
262 | two_file_separate_shared_12_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
263 | two_file_separate_shared_12_nonpic_test_LDADD = \ | |
264 | two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
265 | ||
266 | two_file_separate_shared_21_nonpic_test_SOURCES = two_file_test_main.cc | |
267 | two_file_separate_shared_21_nonpic_test_DEPENDENCIES = \ | |
268 | gcctestdir/ld two_file_shared_1_nonpic.so two_file_shared_2_nonpic.so | |
269 | two_file_separate_shared_21_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
270 | two_file_separate_shared_21_nonpic_test_LDADD = \ | |
271 | two_file_shared_2_nonpic.so two_file_shared_1_nonpic.so | |
272 | ||
03e8f2b2 ILT |
273 | two_file_mixed_shared_test_SOURCES = two_file_test_main.cc |
274 | two_file_mixed_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed.so | |
275 | two_file_mixed_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
276 | two_file_mixed_shared_test_LDADD = two_file_shared_mixed.so | |
277 | ||
278 | two_file_mixed_2_shared_test_SOURCES = two_file_test_main.cc | |
279 | two_file_mixed_2_shared_test_DEPENDENCIES = gcctestdir/ld two_file_shared_mixed_1.so two_file_shared_2.so | |
280 | two_file_mixed_2_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
281 | two_file_mixed_2_shared_test_LDADD = two_file_shared_mixed_1.so two_file_shared_2.so | |
282 | ||
351a8000 | 283 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
3bd52c28 | 284 | |
6835af53 ILT |
285 | check_PROGRAMS += two_file_strip_test |
286 | two_file_strip_test: two_file_test | |
287 | $(TEST_STRIP) -o two_file_strip_test two_file_test | |
288 | ||
289 | check_PROGRAMS += two_file_same_shared_strip_test | |
290 | two_file_same_shared_strip_test_SOURCES = two_file_test_main.cc | |
291 | two_file_same_shared_strip_test_DEPENDENCIES = \ | |
292 | gcctestdir/ld two_file_shared_strip.so | |
293 | two_file_same_shared_strip_test_LDFLAGS = -Bgcctestdir/ -Wl,-R. | |
294 | two_file_same_shared_strip_test_LDADD = two_file_shared_strip.so | |
295 | two_file_shared_strip.so: two_file_shared.so | |
296 | $(TEST_STRIP) -S -o two_file_shared_strip.so two_file_shared.so | |
297 | ||
49bdd526 ILT |
298 | check_PROGRAMS += common_test_1 |
299 | common_test_1_SOURCES = common_test_1.c | |
300 | common_test_1_DEPENDENCIES = gcctestdir/ld | |
301 | common_test_1_LDFLAGS = -Bgcctestdir/ | |
351a8000 ILT |
302 | |
303 | check_PROGRAMS += exception_test | |
304 | check_PROGRAMS += exception_static_test | |
305 | check_PROGRAMS += exception_shared_1_test | |
306 | check_PROGRAMS += exception_shared_2_test | |
307 | check_PROGRAMS += exception_same_shared_test | |
308 | check_PROGRAMS += exception_separate_shared_12_test | |
309 | check_PROGRAMS += exception_separate_shared_21_test | |
310 | exception_test_1_pic.o: exception_test_1.cc | |
311 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
312 | exception_test_2_pic.o: exception_test_2.cc | |
313 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
314 | exception_shared_1.so: exception_test_1_pic.o gcctestdir/ld | |
315 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o | |
316 | exception_shared_2.so: exception_test_2_pic.o gcctestdir/ld | |
317 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_2_pic.o | |
318 | exception_shared.so: exception_test_1_pic.o exception_test_2_pic.o gcctestdir/ld | |
319 | $(CXXLINK) -Bgcctestdir/ -shared exception_test_1_pic.o exception_test_2_pic.o | |
63402fe4 | 320 | |
3151305a ILT |
321 | exception_test_SOURCES = \ |
322 | exception_test_main.cc \ | |
323 | exception_test_1.cc \ | |
324 | exception_test_2.cc \ | |
325 | exception_test.h | |
326 | exception_test_DEPENDENCIES = gcctestdir/ld | |
327 | exception_test_LDFLAGS = -Bgcctestdir/ | |
328 | ||
351a8000 ILT |
329 | exception_static_test_SOURCES = $(exception_test_SOURCES) |
330 | exception_static_test_DEPENDENCIES = $(exception_test_DEPENDENCIES) | |
331 | exception_static_test_LDFLAGS = $(exception_test_LDFLAGS) -static | |
3151305a ILT |
332 | |
333 | exception_shared_1_test_SOURCES = exception_test_2.cc exception_test_main.cc | |
334 | exception_shared_1_test_DEPENDENCIES = gcctestdir/ld exception_shared_1.so | |
335 | exception_shared_1_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
336 | exception_shared_1_test_LDADD = exception_shared_1.so | |
337 | ||
338 | exception_shared_2_test_SOURCES = exception_test_1.cc exception_test_main.cc | |
339 | exception_shared_2_test_DEPENDENCIES = gcctestdir/ld exception_shared_2.so | |
340 | exception_shared_2_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
341 | exception_shared_2_test_LDADD = exception_shared_2.so | |
342 | ||
343 | exception_same_shared_test_SOURCES = exception_test_main.cc | |
344 | exception_same_shared_test_DEPENDENCIES = gcctestdir/ld exception_shared.so | |
345 | exception_same_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
346 | exception_same_shared_test_LDADD = exception_shared.so | |
347 | ||
348 | exception_separate_shared_12_test_SOURCES = exception_test_main.cc | |
349 | exception_separate_shared_12_test_DEPENDENCIES = \ | |
350 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
351 | exception_separate_shared_12_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
352 | exception_separate_shared_12_test_LDADD = \ | |
353 | exception_shared_1.so exception_shared_2.so | |
354 | ||
355 | exception_separate_shared_21_test_SOURCES = exception_test_main.cc | |
356 | exception_separate_shared_21_test_DEPENDENCIES = \ | |
357 | gcctestdir/ld exception_shared_1.so exception_shared_2.so | |
358 | exception_separate_shared_21_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
359 | exception_separate_shared_21_test_LDADD = \ | |
360 | exception_shared_2.so exception_shared_1.so | |
361 | ||
3151305a | 362 | |
351a8000 | 363 | check_PROGRAMS += weak_test |
a360aedd | 364 | weak_test_SOURCES = weak_test.cc |
0e470e5c | 365 | weak_test_DEPENDENCIES = gcctestdir/ld |
a360aedd ILT |
366 | weak_test_LDFLAGS = -Bgcctestdir/ |
367 | ||
86925eef CC |
368 | check_PROGRAMS += weak_undef_test |
369 | weak_undef_test_SOURCES = weak_undef_test.cc | |
370 | weak_undef_test_DEPENDENCIES = gcctestdir/ld weak_undef_lib.so alt/weak_undef_lib.so | |
371 | weak_undef_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,alt | |
372 | weak_undef_test_LDADD = -L . weak_undef_lib.so | |
373 | weak_undef_file1.o: weak_undef_file1.cc | |
374 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
375 | weak_undef_file2.o: weak_undef_file2.cc | |
376 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
377 | weak_undef_lib.so: weak_undef_file1.o | |
378 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file1.o | |
379 | alt/weak_undef_lib.so: weak_undef_file2.o | |
380 | test -d alt || mkdir -p alt | |
381 | $(CXXLINK) -Bgcctestdir/ -shared weak_undef_file2.o | |
351a8000 | 382 | |
99a37bfd ILT |
383 | check_PROGRAMS += weak_alias_test |
384 | weak_alias_test_SOURCES = weak_alias_test_main.cc | |
385 | weak_alias_test_DEPENDENCIES = \ | |
386 | gcctestdir/ld weak_alias_test_1.so weak_alias_test_2.so \ | |
387 | weak_alias_test_3.o weak_alias_test_4.so | |
388 | weak_alias_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
389 | weak_alias_test_LDADD = \ | |
390 | weak_alias_test_1.so weak_alias_test_2.so weak_alias_test_3.o \ | |
391 | weak_alias_test_4.so | |
392 | weak_alias_test_1_pic.o: weak_alias_test_1.cc | |
393 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
394 | weak_alias_test_1.so: weak_alias_test_1_pic.o | |
395 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_1_pic.o | |
396 | weak_alias_test_2_pic.o: weak_alias_test_2.cc | |
397 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
398 | weak_alias_test_2.so: weak_alias_test_2_pic.o | |
399 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_2_pic.o | |
400 | weak_alias_test_3.o: weak_alias_test_3.cc | |
401 | $(CXXCOMPILE) -c -o $@ $< | |
402 | weak_alias_test_4_pic.o: weak_alias_test_4.cc | |
403 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
404 | weak_alias_test_4.so: weak_alias_test_4_pic.o | |
405 | $(CXXLINK) -Bgcctestdir/ -shared weak_alias_test_4_pic.o | |
406 | ||
6eee141f ILT |
407 | if TLS |
408 | ||
351a8000 ILT |
409 | check_PROGRAMS += tls_test |
410 | check_PROGRAMS += tls_pic_test | |
411 | check_PROGRAMS += tls_shared_test | |
c03c7692 | 412 | check_PROGRAMS += tls_shared_ie_test |
351a8000 ILT |
413 | tls_test_pic.o: tls_test.cc |
414 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
415 | tls_test_file2_pic.o: tls_test_file2.cc | |
416 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
417 | tls_test_shared.so: tls_test_pic.o tls_test_file2_pic.o gcctestdir/ld | |
418 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic.o tls_test_file2_pic.o | |
419 | ||
c03c7692 ILT |
420 | tls_test_pic_ie.o: tls_test.cc |
421 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
422 | tls_test_file2_pic_ie.o: tls_test_file2.cc | |
423 | $(CXXCOMPILE) -c -fpic -ftls-model=initial-exec -o $@ $< | |
424 | tls_test_ie_shared.so: tls_test_pic_ie.o tls_test_file2_pic_ie.o gcctestdir/ld | |
425 | $(CXXLINK) -Bgcctestdir/ -shared tls_test_pic_ie.o tls_test_file2_pic_ie.o | |
426 | ||
e0374858 | 427 | tls_test_SOURCES = tls_test.cc tls_test_file2.cc tls_test_main.cc tls_test.h |
6eee141f ILT |
428 | tls_test_DEPENDENCIES = gcctestdir/ld |
429 | tls_test_LDFLAGS = -Bgcctestdir/ | |
430 | tls_test_LDADD = -lpthread | |
431 | ||
432 | tls_pic_test_SOURCES = tls_test_main.cc | |
e0374858 | 433 | tls_pic_test_DEPENDENCIES = gcctestdir/ld tls_test_pic.o tls_test_file2_pic.o |
6eee141f | 434 | tls_pic_test_LDFLAGS = -Bgcctestdir/ |
e0374858 | 435 | tls_pic_test_LDADD = tls_test_pic.o tls_test_file2_pic.o -lpthread |
6eee141f | 436 | |
6eee141f ILT |
437 | tls_shared_test_SOURCES = tls_test_main.cc |
438 | tls_shared_test_DEPENDENCIES = gcctestdir/ld tls_test_shared.so | |
439 | tls_shared_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
440 | tls_shared_test_LDADD = tls_test_shared.so -lpthread | |
441 | ||
c03c7692 ILT |
442 | tls_shared_ie_test_SOURCES = tls_test_main.cc |
443 | tls_shared_ie_test_DEPENDENCIES = gcctestdir/ld tls_test_ie_shared.so | |
444 | tls_shared_ie_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
445 | tls_shared_ie_test_LDADD = tls_test_ie_shared.so -lpthread | |
446 | ||
351a8000 ILT |
447 | if STATIC_TLS |
448 | check_PROGRAMS += tls_static_test | |
449 | check_PROGRAMS += tls_static_pic_test | |
450 | ||
451 | tls_static_test_SOURCES = $(tls_test_SOURCES) | |
452 | tls_static_test_DEPENDENCIES = $(tls_test_DEPENDENCIES) | |
453 | tls_static_test_LDFLAGS = $(tls_test_LDFLAGS) -static | |
454 | tls_static_test_LDADD = $(tls_test_LDADD) | |
455 | ||
456 | tls_static_pic_test_SOURCES = $(tls_pic_test_SOURCES) | |
457 | tls_static_pic_test_DEPENDENCIES = $(tls_pic_test_DEPENDENCIES) | |
458 | tls_static_pic_test_LDFLAGS = $(tls_pic_test_LDFLAGS) -static | |
459 | tls_static_pic_test_LDADD = $(tls_pic_test_LDADD) | |
460 | endif | |
6eee141f ILT |
461 | |
462 | if FN_PTRS_IN_SO_WITHOUT_PIC | |
351a8000 ILT |
463 | check_PROGRAMS += tls_shared_nonpic_test |
464 | tls_test_shared_nonpic.so: tls_test.o tls_test_file2.o gcctestdir/ld | |
465 | $(CXXLINK) -Bgcctestdir/ -shared tls_test.o tls_test_file2.o | |
6eee141f ILT |
466 | |
467 | tls_shared_nonpic_test_SOURCES = tls_test_main.cc | |
468 | tls_shared_nonpic_test_DEPENDENCIES = gcctestdir/ld tls_test_shared_nonpic.so | |
469 | tls_shared_nonpic_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
470 | tls_shared_nonpic_test_LDADD = tls_test_shared_nonpic.so -lpthread | |
351a8000 | 471 | endif FN_PTRS_IN_SO_WITHOUT_PIC |
6eee141f | 472 | |
351a8000 | 473 | endif TLS |
6eee141f | 474 | |
6eee141f | 475 | |
2fd32231 ILT |
476 | if CONSTRUCTOR_PRIORITY |
477 | ||
478 | check_PROGRAMS += initpri1 | |
479 | initpri1_SOURCES = initpri1.c | |
480 | initpri1_DEPENDENCIES = gcctestdir/ld | |
481 | initpri1_LDFLAGS = -Bgcctestdir/ | |
482 | ||
483 | endif | |
484 | ||
485 | ||
351a8000 ILT |
486 | # Test --detect-odr-violations |
487 | check_SCRIPTS += debug_msg.sh | |
6eee141f | 488 | |
351a8000 ILT |
489 | # Create the data files that debug_msg.sh analyzes. |
490 | check_DATA += debug_msg.err | |
491 | MOSTLYCLEANFILES += debug_msg.err | |
492 | debug_msg.o: debug_msg.cc | |
493 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/debug_msg.cc | |
494 | odr_violation1.o: odr_violation1.cc | |
495 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation1.cc | |
496 | odr_violation2.o: odr_violation2.cc | |
497 | $(CXXCOMPILE) -O0 -g -c -w -o $@ $(srcdir)/odr_violation2.cc | |
498 | debug_msg.err: debug_msg.o odr_violation1.o odr_violation2.o gcctestdir/ld | |
499 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o "2>$@" | |
500 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg debug_msg.o odr_violation1.o odr_violation2.o 2>$@; \ | |
501 | then \ | |
502 | echo 1>&2 "Link of debug_msg should have failed"; \ | |
503 | rm -f $@; \ | |
504 | exit 1; \ | |
505 | fi | |
506 | ||
507 | # See if we can also detect problems when we're linking .so's, not .o's. | |
508 | check_DATA += debug_msg_so.err | |
509 | MOSTLYCLEANFILES += debug_msg_so.err | |
510 | debug_msg.so: debug_msg.cc gcctestdir/ld | |
511 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
512 | odr_violation1.so: odr_violation1.cc gcctestdir/ld | |
513 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
514 | odr_violation2.so: odr_violation2.cc gcctestdir/ld | |
515 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc | |
516 | debug_msg_so.err: debug_msg.so odr_violation1.so odr_violation2.so gcctestdir/ld | |
517 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so "2>$@" | |
518 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_so debug_msg.so odr_violation1.so odr_violation2.so 2>$@; \ | |
519 | then \ | |
520 | echo 1>&2 "Link of debug_msg_so should have failed"; \ | |
521 | rm -f $@; \ | |
522 | exit 1; \ | |
523 | fi | |
524 | ||
525 | # We also want to make sure we do something reasonable when there's no | |
526 | # debug info available. For the best test, we use .so's. | |
527 | check_DATA += debug_msg_ndebug.err | |
528 | MOSTLYCLEANFILES += debug_msg_ndebug.err | |
529 | debug_msg_ndebug.so: debug_msg.cc gcctestdir/ld | |
530 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/debug_msg.cc | |
531 | odr_violation1_ndebug.so: odr_violation1.cc gcctestdir/ld | |
532 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation1.cc | |
533 | odr_violation2_ndebug.so: odr_violation2.cc gcctestdir/ld | |
534 | $(CXXCOMPILE) -Bgcctestdir/ -O0 -g0 -shared -fPIC -w -o $@ $(srcdir)/odr_violation2.cc | |
535 | debug_msg_ndebug.err: debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so gcctestdir/ld | |
536 | @echo $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so "2>$@" | |
537 | @if $(CXXLINK) -Bgcctestdir/ -Wl,--detect-odr-violations -o debug_msg_ndebug debug_msg_ndebug.so odr_violation1_ndebug.so odr_violation2_ndebug.so 2>$@; \ | |
538 | then \ | |
539 | echo 1>&2 "Link of debug_msg_ndebug should have failed"; \ | |
540 | rm -f $@; \ | |
541 | exit 1; \ | |
542 | fi | |
543 | ||
544 | ||
545 | # Similar to --detect-odr-violations: check for undefined symbols in .so's | |
546 | check_SCRIPTS += undef_symbol.sh | |
547 | check_DATA += undef_symbol.err | |
548 | MOSTLYCLEANFILES += undef_symbol.err | |
549 | undef_symbol.o: undef_symbol.cc | |
550 | $(CXXCOMPILE) -O0 -g -c -fPIC $< | |
551 | undef_symbol.so: undef_symbol.o gcctestdir/ld | |
552 | $(CXXLINK) -Bgcctestdir/ -shared undef_symbol.o | |
553 | undef_symbol.err: undef_symbol_main.o undef_symbol.so gcctestdir/ld | |
554 | @echo $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so "2>$@" | |
555 | @if $(CXXLINK) -Bgcctestdir/ -o undef_symbol_test undef_symbol_main.o undef_symbol.so 2>$@; \ | |
556 | then \ | |
557 | echo 1>&2 "Link of undef_symbol_test should have failed"; \ | |
558 | rm -f $@; \ | |
559 | exit 1; \ | |
560 | fi | |
561 | ||
562 | ||
351a8000 ILT |
563 | # Test -o when emitting to a special file (such as something in /dev). |
564 | check_PROGRAMS += flagstest_o_specialfile | |
0e470e5c | 565 | flagstest_o_specialfile: flagstest_debug.o gcctestdir/ld |
351a8000 ILT |
566 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< 2>&1 | cat > $@ |
567 | chmod a+x $@ | |
568 | test -s $@ | |
569 | ||
7fcd0256 ILT |
570 | if HAVE_ZLIB |
571 | ||
572 | # Test --compress-debug-sections. FIXME: check we actually compress. | |
573 | check_PROGRAMS += flagstest_compress_debug_sections | |
574 | flagstest_compress_debug_sections: flagstest_debug.o gcctestdir/ld | |
575 | $(CXXLINK) -Bgcctestdir/ -o $@ $< -Wl,--compress-debug-sections=zlib | |
576 | test -s $@ | |
577 | ||
578 | ||
351a8000 ILT |
579 | # The specialfile output has a tricky case when we also compress debug |
580 | # sections, because it requires output-file resizing. | |
581 | check_PROGRAMS += flagstest_o_specialfile_and_compress_debug_sections | |
0e470e5c ILT |
582 | flagstest_o_specialfile_and_compress_debug_sections: flagstest_debug.o \ |
583 | gcctestdir/ld | |
126f3ece | 584 | $(CXXLINK) -Bgcctestdir/ -o /dev/stdout $< -Wl,--compress-debug-sections=zlib 2>&1 | cat > $@ |
351a8000 ILT |
585 | chmod a+x $@ |
586 | test -s $@ | |
587 | ||
7fcd0256 ILT |
588 | endif HAVE_ZLIB |
589 | ||
99f8faca ILT |
590 | # Test symbol versioning. |
591 | check_PROGRAMS += ver_test | |
592 | ver_test_SOURCES = ver_test_main.cc | |
593 | ver_test_DEPENDENCIES = gcctestdir/ld ver_test_1.so ver_test_2.so ver_test_4.so | |
594 | ver_test_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
595 | ver_test_LDADD = ver_test_1.so ver_test_2.so ver_test_4.so | |
596 | ver_test_1.so: ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so gcctestdir/ld | |
597 | $(CXXLINK) -Bgcctestdir/ -shared ver_test_1.o ver_test_2.so ver_test_3.o ver_test_4.so | |
09124467 ILT |
598 | ver_test_2.so: ver_test_2.o $(srcdir)/ver_test_2.script ver_test_4.so gcctestdir/ld |
599 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_2.script ver_test_2.o ver_test_4.so | |
600 | ver_test_4.so: ver_test_4.o $(srcdir)/ver_test_4.script gcctestdir/ld | |
601 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o | |
99f8faca ILT |
602 | ver_test_1.o: ver_test_1.cc |
603 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
604 | ver_test_2.o: ver_test_2.cc | |
605 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
606 | ver_test_3.o: ver_test_3.cc | |
607 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
608 | ver_test_4.o: ver_test_4.cc | |
609 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
351a8000 | 610 | |
be3e6201 ILT |
611 | check_PROGRAMS += ver_test_2 |
612 | ver_test_2_SOURCES = ver_test_main_2.cc | |
613 | ver_test_2_DEPENDENCIES = gcctestdir/ld ver_test_4.so ver_test_2.so | |
614 | ver_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
615 | ver_test_2_LDADD = ver_test_4.so ver_test_2.so | |
616 | ||
be3e6201 ILT |
617 | check_SCRIPTS += ver_test_2.sh |
618 | check_DATA += ver_test_2.syms | |
619 | ver_test_2.syms: ver_test_2 | |
6835af53 | 620 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
be3e6201 | 621 | |
686c8caf ILT |
622 | check_SCRIPTS += ver_test_4.sh |
623 | check_DATA += ver_test_4.syms | |
624 | ver_test_4.syms: ver_test_4.so | |
6835af53 | 625 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f ILT |
626 | |
627 | ver_test_5.so: ver_test_5.o $(srcdir)/ver_test_5.script ver_test_4.so gcctestdir/ld | |
628 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_5.script ver_test_5.o ver_test_4.so | |
629 | ver_test_5.o: ver_test_5.cc | |
630 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
631 | check_SCRIPTS += ver_test_5.sh | |
632 | check_DATA += ver_test_5.syms | |
633 | ver_test_5.syms: ver_test_5.so | |
6835af53 | 634 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
5871526f | 635 | |
18e6b24e ILT |
636 | check_PROGRAMS += ver_test_6 |
637 | ver_test_6_SOURCES = ver_test_6.c | |
638 | ver_test_6_DEPENDENCIES = gcctestdir/ld ver_test_2.so | |
639 | ver_test_6_LDFLAGS = -Bgcctestdir/ -Wl,-R,. | |
640 | ver_test_6_LDADD = ver_test_2.so | |
641 | ||
479f6503 ILT |
642 | ver_test_7.so: ver_test_4.o $(srcdir)/ver_test_4.script ver_test_7.o gcctestdir/ld |
643 | $(CXXLINK) -Bgcctestdir/ -shared -Wl,--version-script,$(srcdir)/ver_test_4.script ver_test_4.o ver_test_7.o | |
644 | ver_test_7.o: ver_test_7.cc | |
645 | $(CXXCOMPILE) -c -fpic -o $@ $< | |
646 | check_SCRIPTS += ver_test_7.sh | |
647 | check_DATA += ver_test_7.syms | |
648 | ver_test_7.syms: ver_test_7.so | |
6835af53 | 649 | $(TEST_READELF) -s $< >$@ 2>/dev/null |
479f6503 | 650 | |
e5756efb ILT |
651 | check_PROGRAMS += script_test_1 |
652 | script_test_1_SOURCES = script_test_1.cc | |
653 | script_test_1_DEPENDENCIES = gcctestdir/ld script_test_1.t | |
654 | script_test_1_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_1.t | |
655 | ||
a445fddf ILT |
656 | check_PROGRAMS += script_test_2 |
657 | script_test_2_SOURCES = script_test_2.cc script_test_2a.cc script_test_2b.cc | |
658 | script_test_2_DEPENDENCIES = gcctestdir/ld script_test_2.t | |
659 | script_test_2_LDFLAGS = -Bgcctestdir/ -Wl,-R,. -T $(srcdir)/script_test_2.t | |
660 | ||
88dd47ac ILT |
661 | check_PROGRAMS += justsyms |
662 | justsyms_SOURCES = justsyms_1.cc | |
663 | justsyms_DEPENDENCIES = gcctestdir/ld justsyms_2r.o | |
664 | justsyms_LDFLAGS = -Bgcctestdir/ -Wl,-R,justsyms_2r.o | |
665 | justsyms_2.o: justsyms_2.cc | |
666 | $(CXXCOMPILE) -c -o $@ $< | |
667 | justsyms_2r.o: justsyms_2.o gcctestdir/ld | |
668 | gcctestdir/ld -o $@ -r -T $(srcdir)/justsyms.t justsyms_2.o | |
669 | ||
bc644c6c ILT |
670 | check_PROGRAMS += binary_test |
671 | binary_test_SOURCES = binary_test.cc | |
672 | binary_test_DEPENDENCIES = gcctestdir/ld binary.txt | |
673 | binary_test_LDFLAGS = -Bgcctestdir/ -Wl,--format,binary,binary.txt,--format,elf | |
674 | # Copy the file to the build directory to avoid worrying about the | |
675 | # full pathname in the generated symbols. | |
676 | binary.txt: $(srcdir)/binary.in | |
677 | rm -f $@ | |
678 | $(LN_S) $< $@ | |
679 | ||
09124467 ILT |
680 | check_SCRIPTS += ver_matching_test.sh |
681 | check_DATA += ver_matching_test.stdout | |
682 | MOSTLYCLEANFILES += ver_matching_test.stdout | |
683 | ver_matching_def.so: ver_matching_def.cc gcctestdir/ld | |
684 | $(CXXLINK) -O0 -Bgcctestdir/ -shared $(srcdir)/ver_matching_def.cc -Wl,--version-script=$(srcdir)/version_script.map | |
685 | ver_matching_test.stdout: ver_matching_def.so | |
6835af53 | 686 | $(TEST_OBJDUMP) -T ver_matching_def.so | $(TEST_CXXFILT) > ver_matching_test.stdout |
1c4f3631 ILT |
687 | |
688 | check_PROGRAMS += script_test_3 | |
689 | check_SCRIPTS += script_test_3.sh | |
690 | check_DATA += script_test_3.stdout | |
691 | MOSTLYCLEANFILES += script_test_3.stdout | |
692 | script_test_3: basic_test.o gcctestdir/ld script_test_3.t | |
693 | $(CXXLINK) -Bgcctestdir/ basic_test.o -T $(srcdir)/script_test_3.t | |
694 | script_test_3.stdout: script_test_3 | |
6835af53 | 695 | $(TEST_OBJDUMP) -p script_test_3 > script_test_3.stdout |
09124467 | 696 | |
351a8000 ILT |
697 | endif GCC |
698 | endif NATIVE_LINKER |