1# The i387 `long double' is a distinct type we support.
2long-double-fcts = yes
3
4ifeq ($(subdir),csu)
5gen-as-const-headers += link-defines.sym
6endif
7
8ifeq ($(subdir),gmon)
9sysdep_routines += _mcount
10# We cannot compile _mcount.S with -pg because that would create
11# recursive calls when ENTRY is used.  Just copy the normal static
12# object.
13sysdep_noprof += _mcount
14endif
15
16ifeq ($(subdir),string)
17sysdep_routines += strcasecmp_l-nonascii strncase_l-nonascii
18gen-as-const-headers += locale-defines.sym
19tests += \
20  tst-rsi-strlen
21endif
22
23ifeq ($(subdir),elf)
24# There is no good reason to use MMX in x86-64 ld.so with GCC.
25CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
26		   -mno-mmx)
27
28sysdep-dl-routines += tlsdesc dl-tlsdesc tls_get_addr
29
30tests += ifuncmain8
31modules-names += ifuncmod8
32
33$(objpfx)ifuncmain8: $(objpfx)ifuncmod8.so
34
35tests += tst-quad1 tst-quad2
36modules-names += tst-quadmod1 tst-quadmod2
37
38$(objpfx)tst-quad1: $(objpfx)tst-quadmod1.so
39$(objpfx)tst-quad2: $(objpfx)tst-quadmod2.so
40
41quad-pie-test += tst-quad1pie tst-quad2pie
42tests += $(quad-pie-test)
43tests-pie += $(quad-pie-test)
44test-extras += tst-quadmod1pie tst-quadmod2pie
45extra-test-objs += tst-quadmod1pie.o tst-quadmod2pie.o
46
47$(objpfx)tst-quad1pie: $(objpfx)tst-quadmod1pie.o
48$(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
49
50CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
51CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
52
53tests += tst-x86_64-1
54modules-names += x86_64/tst-x86_64mod-1
55LDFLAGS-tst-x86_64mod-1.so = -Wl,-soname,tst-x86_64mod-1.so
56ifneq (no,$(have-tunables))
57# Test the state size for XSAVE when XSAVEC is disabled.
58tst-x86_64-1-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-XSAVEC
59endif
60
61$(objpfx)tst-x86_64-1: $(objpfx)x86_64/tst-x86_64mod-1.so
62
63ifneq (no,$(have-tunables))
64tests += tst-platform-1
65modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
66CFLAGS-tst-platform-1.c = -mno-avx
67CFLAGS-tst-platformmod-1.c = -mno-avx
68CFLAGS-tst-platformmod-2.c = -mno-avx
69LDFLAGS-tst-platformmod-2.so = -Wl,-soname,tst-platformmod-2.so
70$(objpfx)tst-platform-1: $(objpfx)tst-platformmod-1.so
71$(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
72# Turn off AVX512F and AVX2 so that GLRO(dl_platform) is
73# always set to x86_64.
74tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
75	GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
76endif
77
78tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
79	 tst-audit10 tst-sse tst-avx tst-avx512
80test-extras += tst-audit4-aux tst-audit10-aux \
81	       tst-avx-aux tst-avx512-aux
82extra-test-objs += tst-audit4-aux.o tst-audit10-aux.o \
83		   tst-avx-aux.o tst-avx512-aux.o
84
85ifeq ($(have-insert),yes)
86tests += tst-split-dynreloc
87LDFLAGS-tst-split-dynreloc = -Wl,-T,$(..)sysdeps/x86_64/tst-split-dynreloc.lds
88tst-split-dynreloc-ENV = LD_BIND_NOW=1
89endif
90
91modules-names += tst-auditmod3a tst-auditmod3b \
92		tst-auditmod4a tst-auditmod4b \
93		tst-auditmod5a tst-auditmod5b \
94		tst-auditmod6a tst-auditmod6b tst-auditmod6c \
95		tst-auditmod7a tst-auditmod7b \
96		tst-auditmod10a tst-auditmod10b \
97		tst-ssemod tst-avxmod tst-avx512mod
98
99$(objpfx)tst-audit3: $(objpfx)tst-auditmod3a.so
100$(objpfx)tst-audit3.out: $(objpfx)tst-auditmod3b.so
101tst-audit3-ENV = LD_AUDIT=$(objpfx)tst-auditmod3b.so
102
103$(objpfx)tst-audit4: $(objpfx)tst-audit4-aux.o $(objpfx)tst-auditmod4a.so
104$(objpfx)tst-audit4.out: $(objpfx)tst-auditmod4b.so
105tst-audit4-ENV = LD_AUDIT=$(objpfx)tst-auditmod4b.so
106
107$(objpfx)tst-audit5: $(objpfx)tst-auditmod5a.so
108$(objpfx)tst-audit5.out: $(objpfx)tst-auditmod5b.so
109tst-audit5-ENV = LD_AUDIT=$(objpfx)tst-auditmod5b.so
110
111$(objpfx)tst-audit6: $(objpfx)tst-auditmod6a.so
112$(objpfx)tst-audit6.out: $(objpfx)tst-auditmod6b.so \
113			 $(objpfx)tst-auditmod6c.so
114tst-audit6-ENV = LD_AUDIT=$(objpfx)tst-auditmod6b.so:$(objpfx)tst-auditmod6c.so
115
116$(objpfx)tst-audit7: $(objpfx)tst-auditmod7a.so
117$(objpfx)tst-audit7.out: $(objpfx)tst-auditmod7b.so
118tst-audit7-ENV = LD_AUDIT=$(objpfx)tst-auditmod7b.so
119
120$(objpfx)tst-audit10: $(objpfx)tst-audit10-aux.o $(objpfx)tst-auditmod10a.so
121$(objpfx)tst-audit10.out: $(objpfx)tst-auditmod10b.so
122tst-audit10-ENV = LD_AUDIT=$(objpfx)tst-auditmod10b.so
123
124$(objpfx)tst-sse: $(objpfx)tst-ssemod.so
125$(objpfx)tst-avx: $(objpfx)tst-avx-aux.o $(objpfx)tst-avxmod.so
126$(objpfx)tst-avx512: $(objpfx)tst-avx512-aux.o $(objpfx)tst-avx512mod.so
127
128AVX-CFLAGS=-mavx -mno-vzeroupper
129CFLAGS-tst-audit4-aux.c += $(AVX-CFLAGS)
130CFLAGS-tst-auditmod4a.c += $(AVX-CFLAGS)
131CFLAGS-tst-auditmod4b.c += $(AVX-CFLAGS)
132CFLAGS-tst-auditmod6b.c += $(AVX-CFLAGS)
133CFLAGS-tst-auditmod6c.c += $(AVX-CFLAGS)
134CFLAGS-tst-auditmod7b.c += $(AVX-CFLAGS)
135CFLAGS-tst-avx-aux.c += $(AVX-CFLAGS)
136CFLAGS-tst-avxmod.c += $(AVX-CFLAGS)
137AVX512-CFLAGS = -mavx512f
138CFLAGS-tst-audit10-aux.c += $(AVX512-CFLAGS)
139CFLAGS-tst-auditmod10a.c += $(AVX512-CFLAGS)
140CFLAGS-tst-auditmod10b.c += $(AVX512-CFLAGS)
141CFLAGS-tst-avx512-aux.c += $(AVX512-CFLAGS)
142CFLAGS-tst-avx512mod.c += $(AVX512-CFLAGS)
143
144$(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
145  $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
146$(objpfx)tst-glibc-hwcaps.out: \
147  $(objpfx)libmarkermod2.so \
148    $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so \
149  $(objpfx)libmarkermod3.so \
150    $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so \
151    $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so \
152  $(objpfx)libmarkermod4.so \
153    $(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so \
154    $(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so \
155    $(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so \
156
157$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod2.so: $(objpfx)libmarkermod2-2.so
158	$(make-target-directory)
159	cp $< $@
160$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod3.so: $(objpfx)libmarkermod3-2.so
161	$(make-target-directory)
162	cp $< $@
163$(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod3.so: $(objpfx)libmarkermod3-3.so
164	$(make-target-directory)
165	cp $< $@
166$(objpfx)glibc-hwcaps/x86-64-v2/libmarkermod4.so: $(objpfx)libmarkermod4-2.so
167	$(make-target-directory)
168	cp $< $@
169$(objpfx)glibc-hwcaps/x86-64-v3/libmarkermod4.so: $(objpfx)libmarkermod4-3.so
170	$(make-target-directory)
171	cp $< $@
172$(objpfx)glibc-hwcaps/x86-64-v4/libmarkermod4.so: $(objpfx)libmarkermod4-4.so
173	$(make-target-directory)
174	cp $< $@
175
176ifeq (no,$(build-hardcoded-path-in-tests))
177# This is an ld.so.cache test, and RPATH/RUNPATH in the executable
178# interferes with its test objectives.
179tests-container += tst-glibc-hwcaps-cache
180endif
181
182tests-internal += tst-x86-64-tls-1
183
184endif # $(subdir) == elf
185
186ifeq ($(subdir),csu)
187gen-as-const-headers += tlsdesc.sym rtld-offsets.sym
188endif
189
190ifeq ($(subdir),wcsmbs)
191tests += \
192  tst-rsi-wcslen
193endif
194
195$(objpfx)x86_64/tst-x86_64mod-1.os: $(objpfx)tst-x86_64mod-1.os
196	$(make-target-directory)
197	rm -f $@
198	ln $< $@
199
200do-tests-clean common-mostlyclean: tst-x86_64-1-clean
201
202.PHONY: tst-x86_64-1-clean
203tst-x86_64-1-clean:
204	-rm -rf $(objpfx)x86_64
205
206$(objpfx)x86_64/tst-platformmod-2.os: $(objpfx)tst-platformmod-2.os
207	$(make-target-directory)
208	rm -f $@
209	ln $< $@
210