1 # Copyright (C) 1999-2024 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
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.
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
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <https://www.gnu.org/licenses/>.
19 # Sub-makefile for conform portion of the library.
25 conformtest-headers-data
:= $(wildcard data
/*.h-data
) \
26 $(wildcard data
/*/*.h-data
)
28 conformtest-standards
:= \
39 # conformtest-standards
40 conformtest-headers-ISO
:= \
56 # conformtest-headers-ISO
57 conformtest-headers-ISO99
:= \
58 $(conformtest-headers-ISO
) \
68 # conformtest-headers-ISO99
69 # Missing ISO11 expectations for: stdatomic.h
70 conformtest-headers-ISO11
:= \
71 $(conformtest-headers-ISO99
) \
76 # conformtest-headers-ISO11
77 conformtest-headers-POSIX
:= \
78 $(conformtest-headers-ISO
) \
102 # conformtest-headers-POSIX
103 # Missing XPG4 expectations for: regexp.h wchar.h.
104 conformtest-headers-XPG4
:= \
105 $(conformtest-headers-ISO
) \
136 # conformtest-headers-XPG4
137 # Missing XPG42 expectations for:
141 # XPG42 includes XTI and STREAMS, but those are not implemented by glibc.
142 conformtest-headers-XPG42
:= \
143 $(conformtest-headers-XPG4
) \
163 # conformtest-headers-XPG42
164 # Missing UNIX98 expectations for:
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
170 # XTI and STREAMS, but those are not implemented by glibc.
171 conformtest-headers-UNIX98
:= \
172 $(conformtest-headers-POSIX
) \
208 # conformtest-headers-UNIX98
209 # Missing XOPEN2K expectations for:
212 conformtest-headers-XOPEN2K
:= \
213 $(conformtest-headers-POSIX
) \
258 # conformtest-headers-XOPEN2K
259 # Missing POSIX2008 expectations for:
262 conformtest-headers-POSIX2008
:= \
263 $(conformtest-headers-POSIX
) \
291 # conformtest-headers-POSIX2008
292 # Missing XOPEN2K8 expectations for:
294 conformtest-headers-XOPEN2K8
:= \
295 $(conformtest-headers-POSIX2008
) \
311 # conformtest-headers-XOPEN2K8
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
)
320 conformtest-header-base
:= $(foreach std
,\
321 $(conformtest-standards
),\
323 $(conformtest-headers-
$(std
)),\
324 $(std
)/$(h
)/conform.out
))
325 conformtest-header-tests
:= $(addprefix $(objpfx
),$(conformtest-header-base
))
326 ifneq (yes
,$(fast-check
))
327 tests-special
+= $(conformtest-header-tests
)
328 generated
+= $(conformtest-header-base
)
331 linknamespace-symlists-base
:= $(foreach std
,$(conformtest-standards
),\
333 linknamespace-symlists-tests
:= $(addprefix $(objpfx
),\
334 $(linknamespace-symlists-base
))
335 tests-special
+= $(linknamespace-symlists-tests
)
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
))
343 tests-special
+= $(linknamespace-symlist-stdlibs-tests
)
345 linknamespace-header-base
:= $(foreach std
,\
346 $(conformtest-standards
),\
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
)
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)" > $@
; \
363 # Pre-standard C feature no longer supported by GCC (obsoleted in
364 # newer POSIX standards).
365 test-xfail-XPG4
/varargs.h
/conform
= yes
366 test-xfail-XPG42
/varargs.h
/conform
= yes
367 test-xfail-UNIX98
/varargs.h
/conform
= yes
369 # Header not provided by glibc.
370 test-xfail-XPG42
/ndbm.h
/conform
= yes
371 test-xfail-UNIX98
/ndbm.h
/conform
= yes
372 test-xfail-XOPEN2K
/ndbm.h
/conform
= yes
373 test-xfail-XOPEN2K8
/ndbm.h
/conform
= yes
375 conformtest-cc-flags
= -I..
/include $(+sysdep-includes
) $(sysincludes
) -I..
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)')
381 ifeq (no
,$(cross-compiling
))
384 conformtest-cross
= --cross
386 $(conformtest-header-tests
): $(objpfx
)%/conform.out
: \
387 conformtest.py
$(conformtest-headers-data
)
388 (set
-e
; std_hdr
=$*; std
=$${std_hdr
%%/*}; hdr
=$${std_hdr
#*/}; \
390 $(PYTHON
) $< --cc='$(CC) $(pie-default)' \
391 --flags
='$(conformtest-cc-flags)' \
392 --ldflags='$(+link-tests-before-inputs)' \
393 --libs
='$(+link-tests-after-inputs)' \
394 --run-program-prefix
='$(run-program-prefix)' \
395 --standard
=$$std --header
=$$hdr $(conformtest-xfail
) \
396 $(conformtest-cross
) \
400 $(linknamespace-symlists-tests
): $(objpfx
)symlist-
%: list-header-symbols.py
401 $(PYTHON
) $< --cc='$(CC)' --flags
='$(conformtest-cc-flags)' \
402 --standard
=$* --headers
="$(strip $(conformtest-headers-$*))" \
406 linknamespace-libs-isoc
= $(common-objpfx
)libc.a
$(common-objpfx
)math
/libm.a
407 linknamespace-libs-thr
= $(linknamespace-libs-isoc
) \
408 $(common-objpfx
)rt
/librt.a \
409 $(filter-out %_syms.a
,$(static-thread-library
))
410 linknamespace-libs-posix
= $(linknamespace-libs-thr
) \
411 $(common-objpfx
)dlfcn
/libdl.a
412 linknamespace-libs-xsi
= $(linknamespace-libs-posix
)
413 linknamespace-libs-ISO
= $(linknamespace-libs-isoc
)
414 linknamespace-libs-ISO99
= $(linknamespace-libs-isoc
)
415 linknamespace-libs-ISO11
= $(linknamespace-libs-isoc
) \
416 $(filter-out %_syms.a
,$(static-thread-library
))
417 linknamespace-libs-XPG4
= $(linknamespace-libs-isoc
)
418 linknamespace-libs-XPG42
= $(linknamespace-libs-XPG4
)
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
)
424 linknamespace-libs
= $(foreach std
,$(conformtest-standards
),\
425 $(linknamespace-libs-
$(std
)))
427 $(linknamespace-symlist-stdlibs-tests
): $(objpfx
)symlist-stdlibs-
%: \
428 $(linknamespace-libs
)
429 LC_ALL
=C
$(READELF
) -W
-s
$(linknamespace-libs-
$*) > $@
; \
432 $(linknamespace-header-tests
): $(objpfx
)%/linknamespace.out
: \
434 $(linknamespace-symlists-tests
) \
435 $(linknamespace-symlist-stdlibs-tests
)
436 (set
-e
; std_hdr
=$*; std
=$${std_hdr
%%/*}; hdr
=$${std_hdr
#*/}; \
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)' \
445 # Pre-standard C feature no longer supported by GCC (obsoleted in
446 # newer POSIX standards).
447 test-xfail-XPG4
/varargs.h
/linknamespace
= yes
448 test-xfail-XPG42
/varargs.h
/linknamespace
= yes
449 test-xfail-UNIX98
/varargs.h
/linknamespace
= yes
451 # Header not provided by glibc.
452 test-xfail-XPG42
/ndbm.h
/linknamespace
= yes
453 test-xfail-UNIX98
/ndbm.h
/linknamespace
= yes
454 test-xfail-XOPEN2K
/ndbm.h
/linknamespace
= yes
455 test-xfail-XOPEN2K8
/ndbm.h
/linknamespace
= yes