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