]>
Commit | Line | Data |
---|---|---|
dff8da6b | 1 | # Copyright (C) 1999-2024 Free Software Foundation, Inc. |
da1067a9 UD |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
da1067a9 UD |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
da1067a9 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | # License along with the GNU C Library; if not, see |
5a82c748 | 16 | # <https://www.gnu.org/licenses/>. |
da1067a9 UD |
17 | |
18 | # | |
19 | # Sub-makefile for conform portion of the library. | |
20 | # | |
21 | subdir := conform | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
54ee292d JM |
25 | conformtest-headers-data := $(wildcard data/*.h-data) \ |
26 | $(wildcard data/*/*.h-data) | |
27 | ||
06e51f4d CD |
28 | conformtest-standards := \ |
29 | ISO \ | |
30 | ISO11 \ | |
31 | ISO99 \ | |
32 | POSIX \ | |
33 | POSIX2008 \ | |
34 | UNIX98 \ | |
35 | XOPEN2K \ | |
36 | XOPEN2K8 \ | |
37 | XPG4 \ | |
38 | XPG42 \ | |
39 | # conformtest-standards | |
40 | conformtest-headers-ISO := \ | |
41 | assert.h \ | |
42 | ctype.h \ | |
43 | errno.h \ | |
44 | float.h \ | |
45 | limits.h \ | |
46 | locale.h \ | |
47 | math.h \ | |
48 | setjmp.h \ | |
49 | signal.h \ | |
50 | stdarg.h \ | |
51 | stddef.h \ | |
52 | stdio.h \ | |
53 | stdlib.h \ | |
54 | string.h \ | |
55 | time.h \ | |
56 | # conformtest-headers-ISO | |
57 | conformtest-headers-ISO99 := \ | |
58 | $(conformtest-headers-ISO) \ | |
59 | complex.h \ | |
60 | fenv.h \ | |
61 | inttypes.h \ | |
62 | iso646.h \ | |
63 | stdbool.h \ | |
64 | stdint.h \ | |
65 | tgmath.h \ | |
66 | wchar.h \ | |
67 | wctype.h \ | |
68 | # conformtest-headers-ISO99 | |
ce7528f6 | 69 | # Missing ISO11 expectations for: stdatomic.h |
06e51f4d CD |
70 | conformtest-headers-ISO11 := \ |
71 | $(conformtest-headers-ISO99) \ | |
72 | stdalign.h \ | |
73 | stdnoreturn.h \ | |
74 | threads.h \ | |
75 | uchar.h \ | |
76 | # conformtest-headers-ISO11 | |
77 | conformtest-headers-POSIX := \ | |
78 | $(conformtest-headers-ISO) \ | |
79 | aio.h \ | |
80 | dirent.h \ | |
81 | fcntl.h \ | |
82 | fnmatch.h \ | |
83 | glob.h \ | |
84 | grp.h \ | |
85 | mqueue.h \ | |
86 | pthread.h \ | |
87 | pwd.h \ | |
88 | regex.h \ | |
89 | sched.h \ | |
90 | semaphore.h \ | |
91 | sys/mman.h \ | |
92 | sys/stat.h \ | |
93 | sys/times.h \ | |
94 | sys/types.h \ | |
95 | sys/utsname.h \ | |
96 | sys/wait.h \ | |
97 | tar.h \ | |
98 | termios.h \ | |
99 | unistd.h \ | |
100 | utime.h \ | |
101 | wordexp.h \ | |
102 | # conformtest-headers-POSIX | |
0516e24d | 103 | # Missing XPG4 expectations for: regexp.h wchar.h. |
06e51f4d CD |
104 | conformtest-headers-XPG4 := \ |
105 | $(conformtest-headers-ISO) \ | |
106 | cpio.h \ | |
107 | dirent.h \ | |
108 | fcntl.h \ | |
109 | fnmatch.h \ | |
110 | ftw.h \ | |
111 | glob.h \ | |
112 | grp.h \ | |
113 | iconv.h \ | |
114 | langinfo.h \ | |
115 | monetary.h \ | |
116 | nl_types.h \ | |
117 | pwd.h \ | |
118 | regex.h \ | |
119 | search.h \ | |
120 | sys/ipc.h \ | |
121 | sys/msg.h \ | |
122 | sys/sem.h \ | |
123 | sys/shm.h \ | |
124 | sys/stat.h \ | |
125 | sys/times.h \ | |
126 | sys/types.h \ | |
127 | sys/utsname.h \ | |
128 | sys/wait.h \ | |
129 | tar.h \ | |
130 | termios.h \ | |
131 | ulimit.h \ | |
132 | unistd.h \ | |
133 | utime.h \ | |
134 | varargs.h \ | |
135 | wordexp.h \ | |
136 | # conformtest-headers-XPG4 | |
137 | # Missing XPG42 expectations for: | |
138 | # re_comp.h | |
139 | # regexp.h | |
140 | # wchar.h | |
a0a0dc83 | 141 | # XPG42 includes XTI and STREAMS, but those are not implemented by glibc. |
06e51f4d CD |
142 | conformtest-headers-XPG42 := \ |
143 | $(conformtest-headers-XPG4) \ | |
144 | arpa/inet.h \ | |
145 | fmtmsg.h \ | |
146 | libgen.h \ | |
147 | ndbm.h \ | |
148 | netdb.h \ | |
149 | netinet/in.h \ | |
150 | poll.h \ | |
151 | strings.h \ | |
152 | sys/mman.h \ | |
153 | sys/resource.h \ | |
154 | sys/socket.h \ | |
155 | sys/statvfs.h \ | |
156 | sys/time.h \ | |
157 | sys/timeb.h \ | |
158 | sys/uio.h \ | |
159 | sys/un.h \ | |
160 | syslog.h \ | |
161 | ucontext.h \ | |
162 | utmpx.h \ | |
163 | # conformtest-headers-XPG42 | |
164 | # Missing UNIX98 expectations for: | |
165 | # inttypes.h | |
166 | # re_comp.h | |
167 | # regexp.h | |
54ee292d JM |
168 | # The online UNIX98 includes XCURSES, but curses.h, term.h and |
169 | # unctrl.h are outside the scope of these tests. It also includes | |
a0a0dc83 | 170 | # XTI and STREAMS, but those are not implemented by glibc. |
06e51f4d CD |
171 | conformtest-headers-UNIX98 := \ |
172 | $(conformtest-headers-POSIX) \ | |
173 | arpa/inet.h \ | |
174 | cpio.h \ | |
175 | dlfcn.h \ | |
176 | fmtmsg.h \ | |
177 | ftw.h \ | |
178 | iconv.h \ | |
179 | iso646.h \ | |
180 | langinfo.h \ | |
181 | libgen.h \ | |
182 | monetary.h \ | |
183 | ndbm.h \ | |
184 | netdb.h \ | |
185 | netinet/in.h \ | |
186 | nl_types.h \ | |
187 | poll.h \ | |
188 | search.h \ | |
189 | strings.h \ | |
190 | sys/ipc.h \ | |
191 | sys/msg.h \ | |
192 | sys/resource.h \ | |
193 | sys/sem.h \ | |
194 | sys/shm.h \ | |
195 | sys/socket.h \ | |
196 | sys/statvfs.h \ | |
197 | sys/time.h \ | |
198 | sys/timeb.h \ | |
199 | sys/uio.h \ | |
200 | sys/un.h \ | |
201 | syslog.h \ | |
202 | ucontext.h \ | |
203 | ulimit.h \ | |
204 | utmpx.h \ | |
205 | varargs.h \ | |
206 | wchar.h \ | |
207 | wctype.h \ | |
208 | # conformtest-headers-UNIX98 | |
209 | # Missing XOPEN2K expectations for: | |
210 | # trace.h | |
211 | # stropts.h | |
212 | conformtest-headers-XOPEN2K := \ | |
213 | $(conformtest-headers-POSIX) \ | |
214 | arpa/inet.h \ | |
215 | complex.h \ | |
216 | cpio.h \ | |
217 | dlfcn.h \ | |
218 | fenv.h \ | |
219 | fmtmsg.h \ | |
220 | ftw.h \ | |
221 | iconv.h \ | |
222 | inttypes.h \ | |
223 | iso646.h \ | |
224 | langinfo.h \ | |
225 | libgen.h \ | |
226 | monetary.h \ | |
227 | ndbm.h \ | |
228 | net/if.h \ | |
229 | netdb.h \ | |
230 | netinet/in.h \ | |
231 | netinet/tcp.h \ | |
232 | nl_types.h \ | |
233 | poll.h \ | |
234 | search.h \ | |
235 | spawn.h \ | |
236 | stdbool.h \ | |
237 | stdint.h \ | |
238 | strings.h \ | |
239 | sys/ipc.h \ | |
240 | sys/msg.h \ | |
241 | sys/resource.h \ | |
242 | sys/select.h \ | |
243 | sys/sem.h \ | |
244 | sys/shm.h \ | |
245 | sys/socket.h \ | |
246 | sys/statvfs.h \ | |
247 | sys/time.h \ | |
248 | sys/timeb.h \ | |
249 | sys/uio.h \ | |
250 | sys/un.h \ | |
251 | syslog.h \ | |
252 | tgmath.h \ | |
253 | ucontext.h \ | |
254 | ulimit.h \ | |
255 | utmpx.h \ | |
256 | wchar.h \ | |
257 | wctype.h \ | |
258 | # conformtest-headers-XOPEN2K | |
259 | # Missing POSIX2008 expectations for: | |
260 | # trace.h | |
261 | # stropts.h | |
262 | conformtest-headers-POSIX2008 := \ | |
263 | $(conformtest-headers-POSIX) \ | |
264 | arpa/inet.h \ | |
265 | complex.h \ | |
266 | cpio.h \ | |
267 | dlfcn.h \ | |
268 | fenv.h \ | |
269 | iconv.h \ | |
270 | inttypes.h \ | |
271 | iso646.h \ | |
272 | langinfo.h \ | |
273 | monetary.h \ | |
274 | net/if.h \ | |
275 | netdb.h \ | |
276 | netinet/in.h \ | |
277 | netinet/tcp.h \ | |
278 | nl_types.h \ | |
279 | poll.h \ | |
280 | spawn.h \ | |
281 | stdbool.h \ | |
282 | stdint.h \ | |
283 | strings.h \ | |
284 | sys/select.h \ | |
285 | sys/socket.h \ | |
286 | sys/statvfs.h \ | |
287 | sys/un.h \ | |
288 | tgmath.h \ | |
289 | wchar.h \ | |
290 | wctype.h \ | |
291 | # conformtest-headers-POSIX2008 | |
292 | # Missing XOPEN2K8 expectations for: | |
293 | # trace.h | |
294 | conformtest-headers-XOPEN2K8 := \ | |
295 | $(conformtest-headers-POSIX2008) \ | |
296 | fmtmsg.h \ | |
297 | ftw.h \ | |
298 | libgen.h \ | |
299 | ndbm.h \ | |
300 | search.h \ | |
301 | sys/ipc.h \ | |
302 | sys/msg.h \ | |
303 | sys/resource.h \ | |
304 | sys/sem.h \ | |
305 | sys/shm.h \ | |
306 | sys/time.h \ | |
307 | sys/uio.h \ | |
308 | syslog.h \ | |
309 | ulimit.h \ | |
310 | utmpx.h \ | |
311 | # conformtest-headers-XOPEN2K8 | |
54ee292d JM |
312 | |
313 | conformtest-header-list-base := $(foreach std,$(conformtest-standards),\ | |
314 | header-list-$(std).out) | |
315 | conformtest-header-list-tests := $(addprefix $(objpfx),\ | |
316 | $(conformtest-header-list-base)) | |
317 | tests-special += $(conformtest-header-list-tests) | |
318 | generated += $(conformtest-header-list-base) | |
319 | ||
320 | conformtest-header-base := $(foreach std,\ | |
321 | $(conformtest-standards),\ | |
322 | $(foreach h,\ | |
323 | $(conformtest-headers-$(std)),\ | |
324 | $(std)/$(h)/conform.out)) | |
325 | conformtest-header-tests := $(addprefix $(objpfx),$(conformtest-header-base)) | |
ba63ba08 | 326 | ifneq (yes,$(fast-check)) |
54ee292d JM |
327 | tests-special += $(conformtest-header-tests) |
328 | generated += $(conformtest-header-base) | |
ba63ba08 | 329 | endif |
31341567 | 330 | |
24f4f825 JM |
331 | linknamespace-symlists-base := $(foreach std,$(conformtest-standards),\ |
332 | symlist-$(std)) | |
333 | linknamespace-symlists-tests := $(addprefix $(objpfx),\ | |
334 | $(linknamespace-symlists-base)) | |
335 | tests-special += $(linknamespace-symlists-tests) | |
336 | ||
0e7e69ba JM |
337 | linknamespace-symlist-stdlibs-base := $(foreach std,$(conformtest-standards),\ |
338 | symlist-stdlibs-$(std)) | |
339 | linknamespace-symlist-stdlibs-tests := \ | |
340 | $(addprefix $(objpfx),\ | |
341 | $(linknamespace-symlist-stdlibs-base)) | |
342 | ||
343 | tests-special += $(linknamespace-symlist-stdlibs-tests) | |
24f4f825 JM |
344 | |
345 | linknamespace-header-base := $(foreach std,\ | |
346 | $(conformtest-standards),\ | |
347 | $(foreach h,\ | |
348 | $(conformtest-headers-$(std)),\ | |
349 | $(std)/$(h)/linknamespace.out)) | |
350 | linknamespace-header-tests := $(addprefix $(objpfx),\ | |
351 | $(linknamespace-header-base)) | |
352 | tests-special += $(linknamespace-header-tests) | |
353 | ||
f214606a JM |
354 | include ../Rules |
355 | ||
54ee292d JM |
356 | $(conformtest-header-list-tests): $(objpfx)header-list-%.out: \ |
357 | check-header-lists.sh \ | |
358 | $(conformtest-headers-data) | |
359 | $(SHELL) $< "$*" "$(CC)" "$(strip $(conformtest-headers-$*))" \ | |
360 | "$(conformtest-headers-data)" > $@; \ | |
f0881698 | 361 | $(evaluate-test) |
31341567 | 362 | |
54ee292d JM |
363 | # Pre-standard C feature no longer supported by GCC (obsoleted in |
364 | # newer POSIX standards). | |
54ee292d | 365 | test-xfail-XPG4/varargs.h/conform = yes |
0516e24d | 366 | test-xfail-XPG42/varargs.h/conform = yes |
54ee292d JM |
367 | test-xfail-UNIX98/varargs.h/conform = yes |
368 | ||
369 | # Header not provided by glibc. | |
0516e24d | 370 | test-xfail-XPG42/ndbm.h/conform = yes |
54ee292d JM |
371 | test-xfail-UNIX98/ndbm.h/conform = yes |
372 | test-xfail-XOPEN2K/ndbm.h/conform = yes | |
373 | test-xfail-XOPEN2K8/ndbm.h/conform = yes | |
374 | ||
4d8965f1 | 375 | conformtest-cc-flags = -I../include $(+sysdep-includes) $(sysincludes) -I.. $(no-file-offset-bits-source) $(no-time-bits-source) |
33c02810 JM |
376 | # conformtest-xfail-conds may be set by a sysdeps Makefile fragment to |
377 | # a list of conditions that are considered to be true when encountered | |
378 | # in xfail[cond]- lines in test expectations. | |
379 | conformtest-xfail = $(if $(conformtest-xfail-conds),\ | |
380 | --xfail='$(conformtest-xfail-conds)') | |
c33eac51 JM |
381 | ifeq (no,$(cross-compiling)) |
382 | conformtest-cross = | |
383 | else | |
384 | conformtest-cross = --cross | |
385 | endif | |
54ee292d | 386 | $(conformtest-header-tests): $(objpfx)%/conform.out: \ |
c3ec0972 | 387 | conformtest.py $(conformtest-headers-data) |
54ee292d | 388 | (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \ |
91faaa93 | 389 | mkdir -p $(@D); \ |
885762aa JM |
390 | $(PYTHON) $< --cc='$(CC) $(pie-default)' \ |
391 | --flags='$(conformtest-cc-flags)' \ | |
f3eef963 JM |
392 | --ldflags='$(+link-tests-before-inputs)' \ |
393 | --libs='$(+link-tests-after-inputs)' \ | |
394 | --run-program-prefix='$(run-program-prefix)' \ | |
c3ec0972 JM |
395 | --standard=$$std --header=$$hdr $(conformtest-xfail) \ |
396 | $(conformtest-cross) \ | |
397 | > $@ 2>&1); \ | |
54ee292d | 398 | $(evaluate-test) |
24f4f825 | 399 | |
2bbd06bc JM |
400 | $(linknamespace-symlists-tests): $(objpfx)symlist-%: list-header-symbols.py |
401 | $(PYTHON) $< --cc='$(CC)' --flags='$(conformtest-cc-flags)' \ | |
402 | --standard=$* --headers="$(strip $(conformtest-headers-$*))" \ | |
403 | > $@ 2> $@.err; \ | |
24f4f825 JM |
404 | $(evaluate-test) |
405 | ||
0e7e69ba | 406 | linknamespace-libs-isoc = $(common-objpfx)libc.a $(common-objpfx)math/libm.a |
85d31921 | 407 | linknamespace-libs-thr = $(linknamespace-libs-isoc) \ |
9446e02b ST |
408 | $(common-objpfx)rt/librt.a \ |
409 | $(filter-out %_syms.a,$(static-thread-library)) | |
85d31921 JM |
410 | linknamespace-libs-posix = $(linknamespace-libs-thr) \ |
411 | $(common-objpfx)dlfcn/libdl.a | |
e69d994a | 412 | linknamespace-libs-xsi = $(linknamespace-libs-posix) |
0e7e69ba JM |
413 | linknamespace-libs-ISO = $(linknamespace-libs-isoc) |
414 | linknamespace-libs-ISO99 = $(linknamespace-libs-isoc) | |
ce7528f6 | 415 | linknamespace-libs-ISO11 = $(linknamespace-libs-isoc) \ |
9446e02b | 416 | $(filter-out %_syms.a,$(static-thread-library)) |
9faaf938 | 417 | linknamespace-libs-XPG4 = $(linknamespace-libs-isoc) |
0516e24d | 418 | linknamespace-libs-XPG42 = $(linknamespace-libs-XPG4) |
85d31921 JM |
419 | linknamespace-libs-POSIX = $(linknamespace-libs-thr) |
420 | linknamespace-libs-UNIX98 = $(linknamespace-libs-xsi) | |
421 | linknamespace-libs-XOPEN2K = $(linknamespace-libs-xsi) | |
422 | linknamespace-libs-POSIX2008 = $(linknamespace-libs-posix) | |
423 | linknamespace-libs-XOPEN2K8 = $(linknamespace-libs-xsi) | |
4283b387 AS |
424 | linknamespace-libs = $(foreach std,$(conformtest-standards),\ |
425 | $(linknamespace-libs-$(std))) | |
24f4f825 | 426 | |
0e7e69ba JM |
427 | $(linknamespace-symlist-stdlibs-tests): $(objpfx)symlist-stdlibs-%: \ |
428 | $(linknamespace-libs) | |
429 | LC_ALL=C $(READELF) -W -s $(linknamespace-libs-$*) > $@; \ | |
24f4f825 JM |
430 | $(evaluate-test) |
431 | ||
432 | $(linknamespace-header-tests): $(objpfx)%/linknamespace.out: \ | |
3ca235ed | 433 | linknamespace.py \ |
6c50bb53 | 434 | $(linknamespace-symlists-tests) \ |
0e7e69ba | 435 | $(linknamespace-symlist-stdlibs-tests) |
24f4f825 | 436 | (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \ |
91faaa93 | 437 | mkdir -p $(@D); \ |
3ca235ed JM |
438 | $(PYTHON) $< --cc='$(CC)' --flags='$(conformtest-cc-flags)' \ |
439 | --standard=$$std --stdsyms=$(objpfx)symlist-$$std \ | |
440 | --header=$$hdr --libsyms=$(objpfx)symlist-stdlibs-$$std \ | |
441 | --readelf='$(READELF)' \ | |
442 | > $@ 2>&1); \ | |
24f4f825 JM |
443 | $(evaluate-test) |
444 | ||
445 | # Pre-standard C feature no longer supported by GCC (obsoleted in | |
446 | # newer POSIX standards). | |
24f4f825 | 447 | test-xfail-XPG4/varargs.h/linknamespace = yes |
0516e24d | 448 | test-xfail-XPG42/varargs.h/linknamespace = yes |
24f4f825 JM |
449 | test-xfail-UNIX98/varargs.h/linknamespace = yes |
450 | ||
451 | # Header not provided by glibc. | |
0516e24d | 452 | test-xfail-XPG42/ndbm.h/linknamespace = yes |
24f4f825 JM |
453 | test-xfail-UNIX98/ndbm.h/linknamespace = yes |
454 | test-xfail-XOPEN2K/ndbm.h/linknamespace = yes | |
455 | test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes |