unistd: Improve fortify with clang
[glibc.git] / sysdeps / x86_64 / Makefile
blob145f25e7f69cc814e0b6b2d81903c26818d698de
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 += features-offsets.sym 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 endif # $(subdir) == elf
216 ifeq ($(subdir),csu)
217 gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
218 endif
220 ifeq ($(subdir),wcsmbs)
222 sysdep_routines += \
223 wcpcpy-generic \
224 wcpncpy-generic \
225 wcscat-generic \
226 wcscpy-generic \
227 wcsncat-generic \
228 wcsncmp-generic \
229 wcsncpy-generic \
230 wcsnlen-generic \
231 # sysdep_routines
233 tests += \
234 tst-rsi-wcslen \
235 # tests
236 endif
239 ifeq ($(subdir),setjmp)
240 ifneq ($(enable-cet),no)
241 tests += \
242 tst-setjmp-cet \
243 # tests
244 tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
245 endif
246 endif
249 ifneq ($(enable-cet),no)
250 ifeq ($(subdir),elf)
251 sysdep-dl-routines += dl-cet
253 tests += \
254 tst-cet-legacy-1 \
255 tst-cet-legacy-10 \
256 tst-cet-legacy-10-static \
257 tst-cet-legacy-10a \
258 tst-cet-legacy-10a-static \
259 tst-cet-legacy-1a \
260 tst-cet-legacy-2 \
261 tst-cet-legacy-2a \
262 tst-cet-legacy-3 \
263 tst-cet-legacy-4 \
264 tst-cet-legacy-5a \
265 tst-cet-legacy-6a \
266 tst-cet-legacy-7 \
267 tst-cet-legacy-8 \
268 tst-cet-legacy-9 \
269 tst-cet-legacy-9-static \
270 # tests
271 tests-static += \
272 tst-cet-legacy-10-static \
273 tst-cet-legacy-10a-static \
274 tst-cet-legacy-9-static \
275 # tests-static
276 tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
278 tests += \
279 tst-shstk-legacy-1a \
280 tst-shstk-legacy-1a-static \
281 tst-shstk-legacy-1b \
282 tst-shstk-legacy-1b-static \
283 tst-shstk-legacy-1c \
284 tst-shstk-legacy-1c-static \
285 tst-shstk-legacy-1d \
286 tst-shstk-legacy-1d-static \
287 tst-shstk-legacy-1e \
288 tst-shstk-legacy-1e-static \
289 tst-shstk-legacy-1f \
290 tst-shstk-legacy-1g \
291 # tests
292 modules-names += \
293 tst-shstk-legacy-mod-1 \
294 # modules-names
295 tests-static += \
296 tst-shstk-legacy-1a-static \
297 tst-shstk-legacy-1b-static \
298 tst-shstk-legacy-1c-static \
299 tst-shstk-legacy-1d-static \
300 tst-shstk-legacy-1e-static \
301 # tests-static
302 extra-objs += \
303 tst-shstk-legacy-1-extra.o \
304 # extra-objs
306 tests += \
307 tst-cet-legacy-4a \
308 tst-cet-legacy-4b \
309 tst-cet-legacy-4c \
310 tst-cet-legacy-5b \
311 tst-cet-legacy-6b \
312 # tests
313 modules-names += \
314 tst-cet-legacy-mod-1 \
315 tst-cet-legacy-mod-2 \
316 tst-cet-legacy-mod-4 \
317 tst-cet-legacy-mod-5a \
318 tst-cet-legacy-mod-5b \
319 tst-cet-legacy-mod-5c \
320 tst-cet-legacy-mod-6a \
321 tst-cet-legacy-mod-6b \
322 tst-cet-legacy-mod-6c \
323 # modules-names
325 CFLAGS-tst-cet-legacy-2.c += -fcf-protection=none -fcf-protection=branch
326 CFLAGS-tst-cet-legacy-2a.c += -fcf-protection
327 CFLAGS-tst-cet-legacy-mod-1.c += -fcf-protection=none
328 CFLAGS-tst-cet-legacy-mod-2.c += -fcf-protection=none
329 CFLAGS-tst-cet-legacy-3.c += -fcf-protection=none
330 CFLAGS-tst-cet-legacy-4.c += -fcf-protection=none -fcf-protection=branch
331 CPPFLAGS-tst-cet-legacy-4a.c += -DCET_IS_PERMISSIVE=1
332 CFLAGS-tst-cet-legacy-4a.c += -fcf-protection
333 CFLAGS-tst-cet-legacy-4b.c += -fcf-protection
334 CFLAGS-tst-cet-legacy-mod-4.c += -fcf-protection=none
335 CFLAGS-tst-cet-legacy-5a.c += -fcf-protection -mshstk
336 ifeq ($(enable-cet),permissive)
337 CPPFLAGS-tst-cet-legacy-5a.c += -DCET_IS_PERMISSIVE=1
338 endif
339 CFLAGS-tst-cet-legacy-5b.c += -fcf-protection -mshstk
340 CPPFLAGS-tst-cet-legacy-5b.c += -DCET_DISABLED_BY_ENV=1
341 CFLAGS-tst-cet-legacy-mod-5a.c += -fcf-protection=none -fcf-protection=branch
342 CFLAGS-tst-cet-legacy-mod-5b.c += -fcf-protection
343 CFLAGS-tst-cet-legacy-mod-5c.c += -fcf-protection
344 CFLAGS-tst-cet-legacy-6a.c += -fcf-protection -mshstk
345 ifeq ($(enable-cet),permissive)
346 CPPFLAGS-tst-cet-legacy-6a.c += -DCET_IS_PERMISSIVE=1
347 endif
348 CFLAGS-tst-cet-legacy-6b.c += -fcf-protection -mshstk
349 CPPFLAGS-tst-cet-legacy-6b.c += -DCET_DISABLED_BY_ENV=1
350 CFLAGS-tst-cet-legacy-mod-6a.c += -fcf-protection=none -fcf-protection=branch
351 CFLAGS-tst-cet-legacy-mod-6b.c += -fcf-protection
352 CFLAGS-tst-cet-legacy-mod-6c.c += -fcf-protection
353 CFLAGS-tst-cet-legacy-7.c += -fcf-protection=none
354 CFLAGS-tst-cet-legacy-10.c += -mshstk
355 CFLAGS-tst-cet-legacy-10-static.c += -mshstk
356 CFLAGS-tst-cet-legacy-10a.c += -fcf-protection=none
357 CFLAGS-tst-cet-legacy-10a-static.c += -fcf-protection=none
359 tst-cet-legacy-4-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
360 tst-cet-legacy-6-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
361 tst-cet-legacy-10-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
362 tst-cet-legacy-10-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
363 tst-cet-legacy-10a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
364 tst-cet-legacy-10a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
366 CFLAGS-tst-shstk-legacy-1a.c += -fcf-protection=none
367 CFLAGS-tst-shstk-legacy-1a-static.c += -fcf-protection=none
368 CFLAGS-tst-shstk-legacy-1d.c += -fcf-protection=none
369 CFLAGS-tst-shstk-legacy-1d-static.c += -fcf-protection=none
370 CFLAGS-tst-shstk-legacy-1f.c += -fcf-protection=none
372 $(objpfx)tst-cet-legacy-1: $(objpfx)tst-cet-legacy-mod-1.so \
373 $(objpfx)tst-cet-legacy-mod-2.so
374 $(objpfx)tst-cet-legacy-1a: $(objpfx)tst-cet-legacy-mod-1.so \
375 $(objpfx)tst-cet-legacy-mod-2.so
376 $(objpfx)tst-cet-legacy-2: $(objpfx)tst-cet-legacy-mod-2.so
377 $(objpfx)tst-cet-legacy-2.out: $(objpfx)tst-cet-legacy-mod-1.so
378 $(objpfx)tst-cet-legacy-2a: $(objpfx)tst-cet-legacy-mod-2.so
379 $(objpfx)tst-cet-legacy-2a.out: $(objpfx)tst-cet-legacy-mod-1.so
380 $(objpfx)tst-cet-legacy-4.out: $(objpfx)tst-cet-legacy-mod-4.so
381 $(objpfx)tst-cet-legacy-5a.out: $(objpfx)tst-cet-legacy-mod-5a.so \
382 $(objpfx)tst-cet-legacy-mod-5b.so
383 $(objpfx)tst-cet-legacy-mod-5a.so: $(objpfx)tst-cet-legacy-mod-5c.so
384 $(objpfx)tst-cet-legacy-mod-5b.so: $(objpfx)tst-cet-legacy-mod-5c.so
385 $(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
386 $(objpfx)tst-cet-legacy-mod-6b.so
387 $(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
388 $(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
389 LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
390 $(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
391 tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
392 $(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
393 tst-cet-legacy-4b-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=on
394 $(objpfx)tst-cet-legacy-4c.out: $(objpfx)tst-cet-legacy-mod-4.so
395 tst-cet-legacy-4c-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=off
396 $(objpfx)tst-cet-legacy-5b.out: $(objpfx)tst-cet-legacy-mod-5a.so \
397 $(objpfx)tst-cet-legacy-mod-5b.so
398 tst-cet-legacy-5b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
399 $(objpfx)tst-cet-legacy-6b.out: $(objpfx)tst-cet-legacy-mod-6a.so \
400 $(objpfx)tst-cet-legacy-mod-6b.so
401 tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
402 tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
403 tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
405 tst-shstk-legacy-1a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
406 tst-shstk-legacy-1a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
407 $(objpfx)tst-shstk-legacy-1a: $(objpfx)tst-shstk-legacy-1-extra.o
408 $(objpfx)tst-shstk-legacy-1a-static: $(objpfx)tst-shstk-legacy-1-extra.o
409 tst-shstk-legacy-1b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
410 tst-shstk-legacy-1b-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
411 $(objpfx)tst-shstk-legacy-1b: $(objpfx)tst-shstk-legacy-1-extra.o
412 $(objpfx)tst-shstk-legacy-1b-static: $(objpfx)tst-shstk-legacy-1-extra.o
413 tst-shstk-legacy-1c-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
414 tst-shstk-legacy-1c-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
415 $(objpfx)tst-shstk-legacy-1c: $(objpfx)tst-shstk-legacy-1-extra.o
416 $(objpfx)tst-shstk-legacy-1c-static: $(objpfx)tst-shstk-legacy-1-extra.o
417 tst-shstk-legacy-1d-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
418 tst-shstk-legacy-1d-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
419 $(objpfx)tst-shstk-legacy-1d: $(objpfx)tst-shstk-legacy-1-extra.o
420 $(objpfx)tst-shstk-legacy-1d-static: $(objpfx)tst-shstk-legacy-1-extra.o
421 $(objpfx)tst-shstk-legacy-1e: $(objpfx)tst-shstk-legacy-1-extra.o
422 $(objpfx)tst-shstk-legacy-1e-static: $(objpfx)tst-shstk-legacy-1-extra.o
423 $(objpfx)tst-shstk-legacy-1e.out: \
424 $(..)/sysdeps/x86_64/tst-shstk-legacy-1e.sh $(objpfx)tst-shstk-legacy-1e
425 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
426 $(evaluate-test)
427 $(objpfx)tst-shstk-legacy-1e-static.out: \
428 $(..)/sysdeps/x86_64/tst-shstk-legacy-1e-static.sh \
429 $(objpfx)tst-shstk-legacy-1e-static
430 $(SHELL) $< $(common-objpfx) 2> $@; \
431 $(evaluate-test)
432 tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
433 $(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
434 $(objpfx)tst-shstk-legacy-mod-1.so: \
435 $(objpfx)tst-shstk-legacy-mod-1.os \
436 $(objpfx)tst-shstk-legacy-1-extra.os
437 $(objpfx)tst-shstk-legacy-1g: $(objpfx)tst-shstk-legacy-mod-1.so
438 $(objpfx)tst-shstk-legacy-1g.out: \
439 $(..)/sysdeps/x86_64/tst-shstk-legacy-1g.sh $(objpfx)tst-shstk-legacy-1g
440 $(SHELL) $< $(common-objpfx) '$(test-program-prefix)' 2> $@; \
441 $(evaluate-test)
442 endif
444 # Add -fcf-protection to CFLAGS when CET is enabled.
445 CFLAGS-.o += -fcf-protection
446 CFLAGS-.os += -fcf-protection
447 CFLAGS-.op += -fcf-protection
448 CFLAGS-.oS += -fcf-protection
450 # Compile assembly codes with <cet.h> when CET is enabled.
451 asm-CPPFLAGS += -fcf-protection -include cet.h
453 ifeq ($(subdir),elf)
454 ifeq (yes,$(build-shared))
455 tests-special += $(objpfx)check-cet.out
456 endif
458 # FIXME: Can't use all-built-dso in elf/Makefile since this file is
459 # processed before elf/Makefile. Duplicate it here.
460 cet-built-dso := $(common-objpfx)elf/ld.so $(common-objpfx)libc.so \
461 $(filter-out $(common-objpfx)linkobj/libc.so, \
462 $(sort $(wildcard $(addprefix $(common-objpfx), \
463 */lib*.so \
464 iconvdata/*.so))))
466 $(cet-built-dso:=.note): %.note: %
467 @rm -f $@T
468 LC_ALL=C $(READELF) -n $< > $@T
469 test -s $@T
470 mv -f $@T $@
471 common-generated += $(cet-built-dso:$(common-objpfx)%=%.note)
473 $(objpfx)check-cet.out: $(..)sysdeps/x86_64/check-cet.awk \
474 $(cet-built-dso:=.note)
475 LC_ALL=C $(AWK) -f $^ > $@; \
476 $(evaluate-test)
477 generated += check-cet.out
478 endif # $(subdir) == elf
479 endif # $(enable) != no
481 do-tests-clean common-mostlyclean: tst-x86_64-1-clean
483 .PHONY: tst-x86_64-1-clean
484 tst-x86_64-1-clean:
485 -rm -rf $(objpfx)x86_64
487 $(objpfx)x86_64/tst-platformmod-2.os: $(objpfx)tst-platformmod-2.os
488 $(make-target-directory)
489 rm -f $@
490 ln $< $@