build-many-glibcs.py: Add openrisc hard float glibc variant
[glibc.git] / sysdeps / x86_64 / Makefile
blobce949dba27eede5c11a03f8e09efe70ccd541277
1 # The i387 `long double' is a distinct type we support.
2 long-double-fcts = yes
4 ifeq (yes,$(have-z-mark-plt))
5 # Always generate DT_X86_64_PLT* tags.
6 sysdep-LDFLAGS += -Wl,-z,mark-plt
7 # Never generate DT_X86_64_PLT* tags on ld.so to avoid changing its own
8 # PLT.
9 LDFLAGS-rtld += -Wl,-z,nomark-plt
10 endif
12 ifeq ($(subdir),csu)
13 gen-as-const-headers += link-defines.sym
14 endif
16 ifeq ($(subdir),gmon)
17 sysdep_routines += _mcount
18 # We cannot compile _mcount.S with -pg because that would create
19 # recursive calls when ENTRY is used. Just copy the normal static
20 # object.
21 sysdep_noprof += _mcount
22 endif
24 ifeq ($(subdir),string)
25 sysdep_routines += \
26 strcasecmp_l-nonascii \
27 strcspn-generic \
28 strncase_l-nonascii \
29 strpbrk-generic \
30 strspn-generic \
31 varshift \
32 # sysdep_routines
33 gen-as-const-headers += locale-defines.sym
34 tests += \
35 tst-rsi-strlen \
36 # tests
37 endif
39 ifeq ($(subdir),elf)
40 # There is no good reason to use MMX in x86-64 ld.so with GCC.
41 CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
42 -mno-mmx)
44 sysdep-dl-routines += tlsdesc dl-tlsdesc tls_get_addr
46 tests += ifuncmain8
47 modules-names += ifuncmod8
49 $(objpfx)ifuncmain8: $(objpfx)ifuncmod8.so
51 tests += tst-quad1 tst-quad2
52 modules-names += tst-quadmod1 tst-quadmod2
54 $(objpfx)tst-quad1: $(objpfx)tst-quadmod1.so
55 $(objpfx)tst-quad2: $(objpfx)tst-quadmod2.so
57 quad-pie-test += tst-quad1pie tst-quad2pie
58 tests += $(quad-pie-test)
59 tests-pie += $(quad-pie-test)
60 test-extras += tst-quadmod1pie tst-quadmod2pie
61 extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
63 $(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
64 $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
66 CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
67 CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
69 tests += tst-platform-1
70 modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
71 extra-test-objs += tst-platformmod-2.o
72 CFLAGS-tst-platform-1.c = -mno-avx
73 CFLAGS-tst-platformmod-1.c = -mno-avx
74 CFLAGS-tst-platformmod-2.c = -mno-avx
75 LDFLAGS-tst-platformmod-2.so = -Wl,-soname,tst-platformmod-2.so
76 $(objpfx)tst-platform-1: $(objpfx)tst-platformmod-1.so
77 $(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
78 # Turn off AVX512F and AVX2 so that GLRO(dl_platform) is
79 # always set to x86_64.
80 tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
81 GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
83 tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
84 tst-audit10 tst-sse tst-avx tst-avx512
85 test-extras += tst-audit4-aux tst-audit10-aux \
86 tst-avx-aux tst-avx512-aux
87 extra-test-objs += tst-audit4-aux.o tst-audit10-aux.o \
88 tst-avx-aux.o tst-avx512-aux.o
90 ifeq ($(have-insert),yes)
91 tests += tst-split-dynreloc
92 LDFLAGS-tst-split-dynreloc = -Wl,-T,$(..)sysdeps/x86_64/tst-split-dynreloc.lds
93 tst-split-dynreloc-ENV = LD_BIND_NOW=1
94 endif
96 modules-names += tst-auditmod3a tst-auditmod3b \
97 tst-auditmod4a tst-auditmod4b \
98 tst-auditmod5a tst-auditmod5b \
99 tst-auditmod6a tst-auditmod6b tst-auditmod6c \
100 tst-auditmod7a tst-auditmod7b \
101 tst-auditmod10a tst-auditmod10b \
102 tst-ssemod tst-avxmod tst-avx512mod
104 $(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
105 $(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
106 tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
108 $(objpfx)tst-audit4: $(objpfx)tst-audit4-aux.o $(objpfx)tst-auditmod4a.so
109 $(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
110 tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
112 $(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so
113 $(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so
114 tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so
116 $(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so
117 $(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \
118 $(objpfx)tst-auditmod6c.so
119 tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so
121 $(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
122 $(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
123 tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
125 $(objpfx)tst-audit10: $(objpfx)tst-audit10-aux.o $(objpfx)tst-auditmod10a.so
126 $(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so
127 tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so
129 $(objpfx)tst-sse: $(objpfx)tst-ssemod.so
130 $(objpfx)tst-avx: $(objpfx)tst-avx-aux.o $(objpfx)tst-avxmod.so
131 $(objpfx)tst-avx512: $(objpfx)tst-avx512-aux.o $(objpfx)tst-avx512mod.so
133 AVX-CFLAGS=-mavx -mno-vzeroupper
134 CFLAGS-tst-audit4-aux.c += $(AVX-CFLAGS)
135 CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
136 CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
137 CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
138 CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
139 CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
140 CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
141 CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
142 AVX512-CFLAGS = -mavx512f
143 CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
144 CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
145 CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS)
146 CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
147 CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
149 $(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
150 $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
151 $(objpfx)tst-glibc-hwcaps.out: \
152 $(objpfx)libmarkermod2.so \
153 $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so \
154 $(objpfx)libmarkermod3.so \
155 $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so \
156 $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so \
157 $(objpfx)libmarkermod4.so \
158 $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so \
159 $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so \
160 $(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so \
162 $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so: $(objpfx)libmarkermod2-2.so
163 $(make-target-directory)
164 cp $< $@
165 $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so: $(objpfx)libmarkermod3-2.so
166 $(make-target-directory)
167 cp $< $@
168 $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so: $(objpfx)libmarkermod3-3.so
169 $(make-target-directory)
170 cp $< $@
171 $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so: $(objpfx)libmarkermod4-2.so
172 $(make-target-directory)
173 cp $< $@
174 $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so: $(objpfx)libmarkermod4-3.so
175 $(make-target-directory)
176 cp $< $@
177 $(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so: $(objpfx)libmarkermod4-4.so
178 $(make-target-directory)
179 cp $< $@
181 ifeq (no,$(build-hardcoded-path-in-tests))
182 # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
183 # interferes with its test objectives.
184 tests-container += tst-glibc-hwcaps-cache
185 endif
187 ifeq (yes,$(have-z-mark-plt))
188 tests += \
189 tst-plt-rewrite1 \
190 tst-plt-rewrite2 \
191 # tests
192 modules-names += \
193 tst-plt-rewritemod1 \
194 tst-plt-rewritemod2 \
195 # modules-names
197 tst-plt-rewrite1-no-pie = yes
198 LDFLAGS-tst-plt-rewrite1 = -Wl,-z,now
199 LDFLAGS-tst-plt-rewritemod1.so = -Wl,-z,now
200 tst-plt-rewrite1-ENV = GLIBC_TUNABLES=glibc.cpu.plt_rewrite=1 LD_DEBUG=files:bindings
201 $(objpfx)tst-plt-rewrite1: $(objpfx)tst-plt-rewritemod1.so
202 $(objpfx)tst-plt-rewrite1.out: /dev/null $(objpfx)tst-plt-rewrite1
203 $(tst-plt-rewrite1-ENV) $(make-test-out) > $@ 2>&1; \
204 grep -q -E "changing 'bar' PLT entry in .*/elf/tst-plt-rewritemod1.so' to direct branch" $@; \
205 $(evaluate-test)
207 tst-plt-rewrite2-no-pie = yes
208 LDFLAGS-tst-plt-rewrite2 = -Wl,-z,now
209 LDFLAGS-tst-plt-rewritemod2.so = -Wl,-z,now,-z,undefs
210 tst-plt-rewrite2-ENV = GLIBC_TUNABLES=glibc.cpu.plt_rewrite=2
211 $(objpfx)tst-plt-rewrite2: $(objpfx)tst-plt-rewritemod2.so
212 endif
214 test-internal-extras += tst-gnu2-tls2mod1
215 endif # $(subdir) == elf
217 ifeq ($(subdir),csu)
218 gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
219 endif
221 ifeq ($(subdir),wcsmbs)
223 sysdep_routines += \
224 wcpcpy-generic \
225 wcpncpy-generic \
226 wcscat-generic \
227 wcscpy-generic \
228 wcsncat-generic \
229 wcsncmp-generic \
230 wcsncpy-generic \
231 wcsnlen-generic \
232 # sysdep_routines
234 tests += \
235 tst-rsi-wcslen \
236 # tests
237 endif
240 ifeq ($(subdir),setjmp)
241 ifneq ($(enable-cet),no)
242 tests += \
243 tst-setjmp-cet \
244 # tests
245 tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
246 endif
247 endif
250 ifneq ($(enable-cet),no)
251 ifeq ($(subdir),elf)
252 sysdep-dl-routines += dl-cet
254 tests += \
255 tst-cet-legacy-1 \
256 tst-cet-legacy-10 \
257 tst-cet-legacy-10-static \
258 tst-cet-legacy-10a \
259 tst-cet-legacy-10a-static \
260 tst-cet-legacy-1a \
261 tst-cet-legacy-2 \
262 tst-cet-legacy-2a \
263 tst-cet-legacy-3 \
264 tst-cet-legacy-4 \
265 tst-cet-legacy-5a \
266 tst-cet-legacy-6a \
267 tst-cet-legacy-7 \
268 tst-cet-legacy-8 \
269 tst-cet-legacy-9 \
270 tst-cet-legacy-9-static \
271 # tests
272 tests-static += \
273 tst-cet-legacy-10-static \
274 tst-cet-legacy-10a-static \
275 tst-cet-legacy-9-static \
276 # tests-static
277 tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
279 tests += \
280 tst-shstk-legacy-1a \
281 tst-shstk-legacy-1a-static \
282 tst-shstk-legacy-1b \
283 tst-shstk-legacy-1b-static \
284 tst-shstk-legacy-1c \
285 tst-shstk-legacy-1c-static \
286 tst-shstk-legacy-1d \
287 tst-shstk-legacy-1d-static \
288 tst-shstk-legacy-1e \
289 tst-shstk-legacy-1e-static \
290 tst-shstk-legacy-1f \
291 tst-shstk-legacy-1g \
292 # tests
293 modules-names += \
294 tst-shstk-legacy-mod-1 \
295 # modules-names
296 tests-static += \
297 tst-shstk-legacy-1a-static \
298 tst-shstk-legacy-1b-static \
299 tst-shstk-legacy-1c-static \
300 tst-shstk-legacy-1d-static \
301 tst-shstk-legacy-1e-static \
302 # tests-static
303 extra-objs += \
304 tst-shstk-legacy-1-extra.o \
305 # extra-objs
307 tests += \
308 tst-cet-legacy-4a \
309 tst-cet-legacy-4b \
310 tst-cet-legacy-4c \
311 tst-cet-legacy-5b \
312 tst-cet-legacy-6b \
313 # tests
314 modules-names += \
315 tst-cet-legacy-mod-1 \
316 tst-cet-legacy-mod-2 \
317 tst-cet-legacy-mod-4 \
318 tst-cet-legacy-mod-5a \
319 tst-cet-legacy-mod-5b \
320 tst-cet-legacy-mod-5c \
321 tst-cet-legacy-mod-6a \
322 tst-cet-legacy-mod-6b \
323 tst-cet-legacy-mod-6c \
324 # modules-names
326 CFLAGS-tst-cet-legacy-2.c += -fcf-protection=none -fcf-protection=branch
327 CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
328 CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
329 CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
330 CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
331 CFLAGS-tst-cet-legacy-4.c += -fcf-protection=none -fcf-protection=branch
332 CPPFLAGS-tst-cet-legacy-4a.c += -DCET_IS_PERMISSIVE=1
333 CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
334 CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
335 CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
336 CFLAGS-tst-cet-legacy-5a.c += -fcf-protection -mshstk
337 ifeq ($(enable-cet),permissive)
338 CPPFLAGS-tst-cet-legacy-5a.c += -DCET_IS_PERMISSIVE=1
339 endif
340 CFLAGS-tst-cet-legacy-5b.c += -fcf-protection -mshstk
341 CPPFLAGS-tst-cet-legacy-5b.c += -DCET_DISABLED_BY_ENV=1
342 CFLAGS-tst-cet-legacy-mod-5a.c += -fcf-protection=none -fcf-protection=branch
343 CFLAGS-tst-cet-legacy-mod-5b.c += -fcf-protection
344 CFLAGS-tst-cet-legacy-mod-5c.c += -fcf-protection
345 CFLAGS-tst-cet-legacy-6a.c += -fcf-protection -mshstk
346 ifeq ($(enable-cet),permissive)
347 CPPFLAGS-tst-cet-legacy-6a.c += -DCET_IS_PERMISSIVE=1
348 endif
349 CFLAGS-tst-cet-legacy-6b.c += -fcf-protection -mshstk
350 CPPFLAGS-tst-cet-legacy-6b.c += -DCET_DISABLED_BY_ENV=1
351 CFLAGS-tst-cet-legacy-mod-6a.c += -fcf-protection=none -fcf-protection=branch
352 CFLAGS-tst-cet-legacy-mod-6b.c += -fcf-protection
353 CFLAGS-tst-cet-legacy-mod-6c.c += -fcf-protection
354 CFLAGS-tst-cet-legacy-7.c += -fcf-protection=none
355 CFLAGS-tst-cet-legacy-10.c += -mshstk
356 CFLAGS-tst-cet-legacy-10-static.c += -mshstk
357 CFLAGS-tst-cet-legacy-10a.c += -fcf-protection=none
358 CFLAGS-tst-cet-legacy-10a-static.c += -fcf-protection=none
360 tst-cet-legacy-4-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
361 tst-cet-legacy-6-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
362 tst-cet-legacy-10-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
363 tst-cet-legacy-10-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
364 tst-cet-legacy-10a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
365 tst-cet-legacy-10a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
367 CFLAGS-tst-shstk-legacy-1a.c += -fcf-protection=none
368 CFLAGS-tst-shstk-legacy-1a-static.c += -fcf-protection=none
369 CFLAGS-tst-shstk-legacy-1d.c += -fcf-protection=none
370 CFLAGS-tst-shstk-legacy-1d-static.c += -fcf-protection=none
371 CFLAGS-tst-shstk-legacy-1f.c += -fcf-protection=none
373 $(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
374 $(objpfx)tst-cet-legacy-mod-2.so
375 $(objpfx)tst-cet-legacy-1a: $(objpfx)tst-cet-legacy-mod-1.so \
376 $(objpfx)tst-cet-legacy-mod-2.so
377 $(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so
378 $(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
379 $(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so
380 $(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
381 $(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
382 $(objpfx)tst-cet-legacy-5a.out: $(objpfx)tst-cet-legacy-mod-5a.so \
383 $(objpfx)tst-cet-legacy-mod-5b.so
384 $(objpfx)tst-cet-legacy-mod-5a.so: $(objpfx)tst-cet-legacy-mod-5c.so
385 $(objpfx)tst-cet-legacy-mod-5b.so: $(objpfx)tst-cet-legacy-mod-5c.so
386 $(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
387 $(objpfx)tst-cet-legacy-mod-6b.so
388 $(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
389 $(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
390 LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
391 $(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
392 tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
393 $(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
394 tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=on
395 $(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
396 tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=off
397 $(objpfx)tst-cet-legacy-5b.out: $(objpfx)tst-cet-legacy-mod-5a.so \
398 $(objpfx)tst-cet-legacy-mod-5b.so
399 tst-cet-legacy-5b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
400 $(objpfx)tst-cet-legacy-6b.out: $(objpfx)tst-cet-legacy-mod-6a.so \
401 $(objpfx)tst-cet-legacy-mod-6b.so
402 tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
403 tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
404 tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
406 tst-shstk-legacy-1a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
407 tst-shstk-legacy-1a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
408 $(objpfx)tst-shstk-legacy-1a: $(objpfx)tst-shstk-legacy-1-extra.o
409 $(objpfx)tst-shstk-legacy-1a-static: $(objpfx)tst-shstk-legacy-1-extra.o
410 tst-shstk-legacy-1b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
411 tst-shstk-legacy-1b-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
412 $(objpfx)tst-shstk-legacy-1b: $(objpfx)tst-shstk-legacy-1-extra.o
413 $(objpfx)tst-shstk-legacy-1b-static: $(objpfx)tst-shstk-legacy-1-extra.o
414 tst-shstk-legacy-1c-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
415 tst-shstk-legacy-1c-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
416 $(objpfx)tst-shstk-legacy-1c: $(objpfx)tst-shstk-legacy-1-extra.o
417 $(objpfx)tst-shstk-legacy-1c-static: $(objpfx)tst-shstk-legacy-1-extra.o
418 tst-shstk-legacy-1d-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
419 tst-shstk-legacy-1d-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
420 $(objpfx)tst-shstk-legacy-1d: $(objpfx)tst-shstk-legacy-1-extra.o
421 $(objpfx)tst-shstk-legacy-1d-static: $(objpfx)tst-shstk-legacy-1-extra.o
422 $(objpfx)tst-shstk-legacy-1e: $(objpfx)tst-shstk-legacy-1-extra.o
423 $(objpfx)tst-shstk-legacy-1e-static: $(objpfx)tst-shstk-legacy-1-extra.o
424 $(objpfx)tst-shstk-legacy-1e.out: \
425 $(..)/sysdeps/x86_64/tst-shstk-legacy-1e.sh $(objpfx)tst-shstk-legacy-1e
426 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
427 $(evaluate-test)
428 $(objpfx)tst-shstk-legacy-1e-static.out: \
429 $(..)/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh \
430 $(objpfx)tst-shstk-legacy-1e-static
431 $(SHELL) $< $(common-objpfx) 2> $@; \
432 $(evaluate-test)
433 tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
434 $(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
435 $(objpfx)tst-shstk-legacy-mod-1.so: \
436 $(objpfx)tst-shstk-legacy-mod-1.os \
437 $(objpfx)tst-shstk-legacy-1-extra.os
438 $(objpfx)tst-shstk-legacy-1g: $(objpfx)tst-shstk-legacy-mod-1.so
439 $(objpfx)tst-shstk-legacy-1g.out: \
440 $(..)/sysdeps/x86_64/tst-shstk-legacy-1g.sh $(objpfx)tst-shstk-legacy-1g
441 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
442 $(evaluate-test)
443 endif
445 # Add -fcf-protection to CFLAGS when CET is enabled.
446 CFLAGS-.o += -fcf-protection
447 CFLAGS-.os += -fcf-protection
448 CFLAGS-.op += -fcf-protection
449 CFLAGS-.oS += -fcf-protection
451 # Compile assembly codes with <cet.h> when CET is enabled.
452 asm-CPPFLAGS += -fcf-protection -include cet.h
454 ifeq ($(subdir),elf)
455 ifeq (yes,$(build-shared))
456 tests-special += $(objpfx)check-cet.out
457 endif
459 # FIXME: Can't use all-built-dso in elf/Makefile since this file is
460 # processed before elf/Makefile. Duplicate it here.
461 cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
462 $(filter-out $(common-objpfx)linkobj/libc.so, \
463 $(sort $(wildcard $(addprefix $(common-objpfx), \
464 */lib*.so \
465 iconvdata/*.so))))
467 $(cet-built-dso:=.note): %.note: %
468 @rm -f $@T
469 LC_ALL=C $(READELF) -n $< > $@T
470 test -s $@T
471 mv -f $@T $@
472 common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
474 $(objpfx)check-cet.out: $(..)sysdeps/x86_64/check-cet.awk \
475 $(cet-built-dso:=.note)
476 LC_ALL=C $(AWK) -f $^ > $@; \
477 $(evaluate-test)
478 generated += check-cet.out
479 endif # $(subdir) == elf
480 endif # $(enable) != no
482 do-tests-clean common-mostlyclean: tst-x86_64-1-clean
484 .PHONY: tst-x86_64-1-clean
485 tst-x86_64-1-clean:
486 -rm -rf $(objpfx)x86_64
488 $(objpfx)x86_64/tst-platformmod-2.os: $(objpfx)tst-platformmod-2.os
489 $(make-target-directory)
490 rm -f $@
491 ln $< $@