]> git.ipfire.org Git - thirdparty/glibc.git/blame - conform/Makefile
Tweak realloc/MREMAP comment to be more accurate.
[thirdparty/glibc.git] / conform / Makefile
CommitLineData
bfff8b1b 1# Copyright (C) 1999-2017 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
PE
15# License along with the GNU C Library; if not, see
16# <http://www.gnu.org/licenses/>.
da1067a9
UD
17
18#
19# Sub-makefile for conform portion of the library.
20#
21subdir := conform
22
a5f891ac
JM
23include ../Makeconfig
24
54ee292d
JM
25conformtest-headers-data := $(wildcard data/*.h-data) \
26 $(wildcard data/*/*.h-data)
27
0516e24d 28conformtest-standards := ISO ISO99 ISO11 POSIX XPG4 XPG42 UNIX98 XOPEN2K \
54ee292d
JM
29 POSIX2008 XOPEN2K8
30
31conformtest-headers-ISO := assert.h ctype.h errno.h float.h limits.h locale.h \
32 math.h setjmp.h signal.h stdarg.h stddef.h stdio.h \
33 stdlib.h string.h time.h
34conformtest-headers-ISO99 := $(conformtest-headers-ISO) complex.h fenv.h \
35 inttypes.h iso646.h stdbool.h stdint.h tgmath.h \
36 wchar.h wctype.h
37# Missing ISO11 expectations for: stdatomic.h threads.h.
38conformtest-headers-ISO11 := $(conformtest-headers-ISO99) stdalign.h \
39 stdnoreturn.h uchar.h
40conformtest-headers-POSIX := $(conformtest-headers-ISO) aio.h dirent.h \
41 fcntl.h fnmatch.h glob.h grp.h mqueue.h \
42 pthread.h pwd.h regex.h sched.h semaphore.h \
43 sys/mman.h sys/stat.h sys/times.h sys/types.h \
44 sys/utsname.h sys/wait.h tar.h termios.h \
45 unistd.h utime.h wordexp.h
0516e24d
JM
46# Missing XPG4 expectations for: regexp.h wchar.h.
47conformtest-headers-XPG4 := $(conformtest-headers-ISO) cpio.h dirent.h \
54ee292d
JM
48 fcntl.h fnmatch.h ftw.h glob.h grp.h iconv.h \
49 langinfo.h monetary.h nl_types.h pwd.h regex.h \
50 search.h sys/ipc.h sys/msg.h sys/sem.h sys/shm.h \
51 sys/stat.h sys/times.h sys/types.h sys/utsname.h \
52 sys/wait.h tar.h termios.h ulimit.h unistd.h \
53 utime.h varargs.h wordexp.h
0516e24d
JM
54# Missing XPG42 expectations for: re_comp.h regexp.h wchar.h.
55# XPG42 includes XTI, but xti.h is outside the scope of these tests.
56conformtest-headers-XPG42 := $(conformtest-headers-XPG4) arpa/inet.h fmtmsg.h \
54ee292d
JM
57 libgen.h ndbm.h netdb.h netinet/in.h poll.h \
58 strings.h stropts.h sys/mman.h sys/resource.h \
59 sys/socket.h sys/statvfs.h sys/time.h sys/timeb.h \
60 sys/uio.h sys/un.h syslog.h ucontext.h utmpx.h
61# Missing UNIX98 expectations for: inttypes.h re_comp.h regexp.h.
62# The online UNIX98 includes XCURSES, but curses.h, term.h and
63# unctrl.h are outside the scope of these tests. It also includes
64# XTI, but xti.h is outside the scope of these tests.
65conformtest-headers-UNIX98 := $(conformtest-headers-POSIX) arpa/inet.h cpio.h \
66 dlfcn.h fmtmsg.h ftw.h iconv.h iso646.h \
67 langinfo.h libgen.h monetary.h ndbm.h netdb.h \
68 netinet/in.h nl_types.h poll.h search.h \
69 strings.h stropts.h sys/ipc.h sys/msg.h \
70 sys/resource.h sys/sem.h sys/shm.h sys/socket.h \
71 sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
72 sys/un.h syslog.h ucontext.h ulimit.h utmpx.h \
73 varargs.h wchar.h wctype.h
74# Missing XOPEN2K expectations for: trace.h.
75conformtest-headers-XOPEN2K := $(conformtest-headers-POSIX) arpa/inet.h \
76 complex.h cpio.h dlfcn.h fenv.h fmtmsg.h ftw.h \
77 iconv.h inttypes.h iso646.h langinfo.h \
78 libgen.h monetary.h ndbm.h net/if.h netdb.h \
79 netinet/in.h netinet/tcp.h nl_types.h poll.h \
80 search.h spawn.h stdbool.h stdint.h strings.h \
81 stropts.h sys/ipc.h sys/msg.h sys/resource.h \
82 sys/select.h sys/sem.h sys/shm.h sys/socket.h \
83 sys/statvfs.h sys/time.h sys/timeb.h sys/uio.h \
84 sys/un.h syslog.h tgmath.h ucontext.h ulimit.h \
85 utmpx.h wchar.h wctype.h
86# Missing POSIX2008 expectations for: trace.h.
87conformtest-headers-POSIX2008 := $(conformtest-headers-POSIX) arpa/inet.h \
88 complex.h cpio.h dlfcn.h fenv.h iconv.h \
89 inttypes.h iso646.h langinfo.h monetary.h \
90 net/if.h netdb.h netinet/in.h netinet/tcp.h \
91 nl_types.h poll.h spawn.h stdbool.h stdint.h \
92 strings.h stropts.h sys/select.h \
93 sys/socket.h sys/statvfs.h sys/un.h tgmath.h \
94 wchar.h wctype.h
95# Missing XOPEN2K8 expectations for: trace.h.
96conformtest-headers-XOPEN2K8 := $(conformtest-headers-POSIX2008) fmtmsg.h \
97 ftw.h libgen.h ndbm.h search.h sys/ipc.h \
98 sys/msg.h sys/resource.h sys/sem.h sys/shm.h \
99 sys/time.h sys/uio.h syslog.h ulimit.h utmpx.h
100
101conformtest-header-list-base := $(foreach std,$(conformtest-standards),\
102 header-list-$(std).out)
103conformtest-header-list-tests := $(addprefix $(objpfx),\
104 $(conformtest-header-list-base))
105tests-special += $(conformtest-header-list-tests)
106generated += $(conformtest-header-list-base)
107
108conformtest-header-base := $(foreach std,\
109 $(conformtest-standards),\
110 $(foreach h,\
111 $(conformtest-headers-$(std)),\
112 $(std)/$(h)/conform.out))
113conformtest-header-tests := $(addprefix $(objpfx),$(conformtest-header-base))
ba63ba08 114ifneq (yes,$(fast-check))
54ee292d
JM
115tests-special += $(conformtest-header-tests)
116generated += $(conformtest-header-base)
ba63ba08 117endif
31341567 118
24f4f825
JM
119linknamespace-symlists-base := $(foreach std,$(conformtest-standards),\
120 symlist-$(std))
121linknamespace-symlists-tests := $(addprefix $(objpfx),\
122 $(linknamespace-symlists-base))
123tests-special += $(linknamespace-symlists-tests)
124
0e7e69ba
JM
125linknamespace-symlist-stdlibs-base := $(foreach std,$(conformtest-standards),\
126 symlist-stdlibs-$(std))
127linknamespace-symlist-stdlibs-tests := \
128 $(addprefix $(objpfx),\
129 $(linknamespace-symlist-stdlibs-base))
130
131tests-special += $(linknamespace-symlist-stdlibs-tests)
24f4f825
JM
132
133linknamespace-header-base := $(foreach std,\
134 $(conformtest-standards),\
135 $(foreach h,\
136 $(conformtest-headers-$(std)),\
137 $(std)/$(h)/linknamespace.out))
138linknamespace-header-tests := $(addprefix $(objpfx),\
139 $(linknamespace-header-base))
140tests-special += $(linknamespace-header-tests)
141
f214606a
JM
142include ../Rules
143
54ee292d
JM
144$(conformtest-header-list-tests): $(objpfx)header-list-%.out: \
145 check-header-lists.sh \
146 $(conformtest-headers-data)
147 $(SHELL) $< "$*" "$(CC)" "$(strip $(conformtest-headers-$*))" \
148 "$(conformtest-headers-data)" > $@; \
f0881698 149 $(evaluate-test)
31341567 150
54ee292d
JM
151# Pre-standard C feature no longer supported by GCC (obsoleted in
152# newer POSIX standards).
54ee292d 153test-xfail-XPG4/varargs.h/conform = yes
0516e24d 154test-xfail-XPG42/varargs.h/conform = yes
54ee292d
JM
155test-xfail-UNIX98/varargs.h/conform = yes
156
157# Header not provided by glibc.
0516e24d 158test-xfail-XPG42/ndbm.h/conform = yes
54ee292d
JM
159test-xfail-UNIX98/ndbm.h/conform = yes
160test-xfail-XOPEN2K/ndbm.h/conform = yes
161test-xfail-XOPEN2K8/ndbm.h/conform = yes
162
163# Unsorted expected failures.
54ee292d 164test-xfail-XPG4/signal.h/conform = yes
54ee292d 165test-xfail-XPG4/sys/wait.h/conform = yes
0516e24d
JM
166test-xfail-XPG42/arpa/inet.h/conform = yes
167test-xfail-XPG42/netdb.h/conform = yes
168test-xfail-XPG42/netinet/in.h/conform = yes
169test-xfail-XPG42/signal.h/conform = yes
170test-xfail-XPG42/sys/wait.h/conform = yes
171test-xfail-XPG42/ucontext.h/conform = yes
a75d3b02 172test-xfail-POSIX/sys/wait.h/conform = yes
54ee292d 173test-xfail-UNIX98/arpa/inet.h/conform = yes
54ee292d
JM
174test-xfail-UNIX98/netdb.h/conform = yes
175test-xfail-UNIX98/netinet/in.h/conform = yes
54ee292d 176test-xfail-UNIX98/signal.h/conform = yes
54ee292d
JM
177test-xfail-UNIX98/sys/wait.h/conform = yes
178test-xfail-UNIX98/ucontext.h/conform = yes
54ee292d 179test-xfail-XOPEN2K/signal.h/conform = yes
54ee292d 180test-xfail-XOPEN2K/sys/wait.h/conform = yes
54ee292d 181test-xfail-XOPEN2K/ucontext.h/conform = yes
54ee292d 182test-xfail-POSIX2008/signal.h/conform = yes
54ee292d 183test-xfail-POSIX2008/sys/wait.h/conform = yes
54ee292d 184test-xfail-XOPEN2K8/signal.h/conform = yes
54ee292d 185test-xfail-XOPEN2K8/sys/wait.h/conform = yes
54ee292d
JM
186
187conformtest-cc-flags = -I../include $(+sysdep-includes) $(sysincludes) -I..
33c02810
JM
188# conformtest-xfail-conds may be set by a sysdeps Makefile fragment to
189# a list of conditions that are considered to be true when encountered
190# in xfail[cond]- lines in test expectations.
191conformtest-xfail = $(if $(conformtest-xfail-conds),\
192 --xfail='$(conformtest-xfail-conds)')
c33eac51
JM
193ifeq (no,$(cross-compiling))
194conformtest-cross =
195else
196conformtest-cross = --cross
197endif
54ee292d
JM
198$(conformtest-header-tests): $(objpfx)%/conform.out: \
199 conformtest.pl $(conformtest-headers-data)
200 (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \
201 mkdir -p $(@D)/scratch; \
6d533621 202 $(PERL) -I. conformtest.pl --tmpdir=$(@D)/scratch --cc='$(CC)' \
54ee292d 203 --flags='$(conformtest-cc-flags)' --standard=$$std \
c33eac51
JM
204 --headers=$$hdr $(conformtest-xfail) $(conformtest-cross) \
205 > $@); \
54ee292d 206 $(evaluate-test)
24f4f825
JM
207
208$(linknamespace-symlists-tests): $(objpfx)symlist-%: list-header-symbols.pl
6d533621 209 $(PERL) -I. -w $< --tmpdir=$(objpfx) --cc='$(CC)' \
24f4f825
JM
210 --flags='$(conformtest-cc-flags)' --standard=$* \
211 --headers="$(strip $(conformtest-headers-$*))" \
212 > $@ 2> $@.err; \
213 $(evaluate-test)
214
0e7e69ba 215linknamespace-libs-isoc = $(common-objpfx)libc.a $(common-objpfx)math/libm.a
85d31921
JM
216linknamespace-libs-thr = $(linknamespace-libs-isoc) \
217 $(common-objpfx)rt/librt.a $(static-thread-library)
218linknamespace-libs-posix = $(linknamespace-libs-thr) \
219 $(common-objpfx)dlfcn/libdl.a
220linknamespace-libs-xsi = $(linknamespace-libs-posix) \
221 $(common-objpfx)crypt/libcrypt.a
0e7e69ba
JM
222linknamespace-libs-ISO = $(linknamespace-libs-isoc)
223linknamespace-libs-ISO99 = $(linknamespace-libs-isoc)
224linknamespace-libs-ISO11 = $(linknamespace-libs-isoc)
0516e24d 225linknamespace-libs-XPG4 = $(linknamespace-libs-isoc) \
85d31921 226 $(common-objpfx)crypt/libcrypt.a
0516e24d 227linknamespace-libs-XPG42 = $(linknamespace-libs-XPG4)
85d31921
JM
228linknamespace-libs-POSIX = $(linknamespace-libs-thr)
229linknamespace-libs-UNIX98 = $(linknamespace-libs-xsi)
230linknamespace-libs-XOPEN2K = $(linknamespace-libs-xsi)
231linknamespace-libs-POSIX2008 = $(linknamespace-libs-posix)
232linknamespace-libs-XOPEN2K8 = $(linknamespace-libs-xsi)
4283b387
AS
233linknamespace-libs = $(foreach std,$(conformtest-standards),\
234 $(linknamespace-libs-$(std)))
24f4f825 235
0e7e69ba
JM
236$(linknamespace-symlist-stdlibs-tests): $(objpfx)symlist-stdlibs-%: \
237 $(linknamespace-libs)
238 LC_ALL=C $(READELF) -W -s $(linknamespace-libs-$*) > $@; \
24f4f825
JM
239 $(evaluate-test)
240
241$(linknamespace-header-tests): $(objpfx)%/linknamespace.out: \
0e7e69ba 242 linknamespace.pl \
6c50bb53 243 $(linknamespace-symlists-tests) \
0e7e69ba 244 $(linknamespace-symlist-stdlibs-tests)
24f4f825
JM
245 (set -e; std_hdr=$*; std=$${std_hdr%%/*}; hdr=$${std_hdr#*/}; \
246 mkdir -p $(@D)/scratch; \
6d533621 247 $(PERL) -I. -w $< --tmpdir=$(@D)/scratch --cc='$(CC)' \
24f4f825
JM
248 --flags='$(conformtest-cc-flags)' --standard=$$std \
249 --stdsyms=$(objpfx)symlist-$$std --header=$$hdr \
0e7e69ba
JM
250 --libsyms=$(objpfx)symlist-stdlibs-$$std \
251 --readelf='$(READELF)' \
24f4f825
JM
252 > $@ 2>&1); \
253 $(evaluate-test)
254
255# Pre-standard C feature no longer supported by GCC (obsoleted in
256# newer POSIX standards).
24f4f825 257test-xfail-XPG4/varargs.h/linknamespace = yes
0516e24d 258test-xfail-XPG42/varargs.h/linknamespace = yes
24f4f825
JM
259test-xfail-UNIX98/varargs.h/linknamespace = yes
260
261# Header not provided by glibc.
0516e24d 262test-xfail-XPG42/ndbm.h/linknamespace = yes
24f4f825
JM
263test-xfail-UNIX98/ndbm.h/linknamespace = yes
264test-xfail-XOPEN2K/ndbm.h/linknamespace = yes
265test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes