]>
Commit | Line | Data |
---|---|---|
1 | # Copyright (C) 1992-2024 Free Software Foundation, Inc. | |
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 | |
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. | |
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 | |
12 | # Lesser General Public License for more details. | |
13 | ||
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/>. | |
17 | ||
18 | # | |
19 | # Sub-makefile for I/O portion of the library. | |
20 | # | |
21 | subdir := io | |
22 | ||
23 | include ../Makeconfig | |
24 | ||
25 | headers := \ | |
26 | bits/fcntl.h \ | |
27 | bits/fcntl2.h \ | |
28 | bits/poll.h \ | |
29 | bits/poll2.h \ | |
30 | bits/stat.h \ | |
31 | bits/statfs.h \ | |
32 | bits/statvfs.h \ | |
33 | bits/statx-generic.h \ | |
34 | bits/statx.h \ | |
35 | bits/types/struct_statx.h \ | |
36 | bits/types/struct_statx_timestamp.h \ | |
37 | fcntl.h \ | |
38 | fts.h \ | |
39 | ftw.h \ | |
40 | poll.h \ | |
41 | sys/fcntl.h \ | |
42 | sys/poll.h \ | |
43 | sys/sendfile.h \ | |
44 | sys/stat.h \ | |
45 | sys/statfs.h \ | |
46 | sys/statvfs.h \ | |
47 | sys/vfs.h \ | |
48 | utime.h \ | |
49 | # headers | |
50 | ||
51 | routines := \ | |
52 | access \ | |
53 | chdir \ | |
54 | chmod \ | |
55 | chown \ | |
56 | close \ | |
57 | close_range \ | |
58 | closefrom \ | |
59 | copy_file_range \ | |
60 | creat \ | |
61 | creat64 \ | |
62 | dup \ | |
63 | dup2 \ | |
64 | dup3 \ | |
65 | euidaccess \ | |
66 | faccessat \ | |
67 | fchdir \ | |
68 | fchmod \ | |
69 | fchmodat \ | |
70 | fchown \ | |
71 | fchownat \ | |
72 | fcntl \ | |
73 | fcntl64 \ | |
74 | file_change_detection \ | |
75 | flock \ | |
76 | fstat \ | |
77 | fstat64 \ | |
78 | fstatat \ | |
79 | fstatat64 \ | |
80 | fstatfs \ | |
81 | fstatfs64 \ | |
82 | fstatvfs \ | |
83 | fstatvfs64 \ | |
84 | fts \ | |
85 | fts64 \ | |
86 | fts64-time64 \ | |
87 | ftw \ | |
88 | ftw64 \ | |
89 | ftw64-time64 \ | |
90 | futimens \ | |
91 | getcwd \ | |
92 | getdirname \ | |
93 | getwd \ | |
94 | isatty \ | |
95 | lchmod \ | |
96 | lchown \ | |
97 | link \ | |
98 | linkat \ | |
99 | lockf \ | |
100 | lockf64 \ | |
101 | lseek \ | |
102 | lseek64 \ | |
103 | lstat \ | |
104 | lstat64 \ | |
105 | mkdir \ | |
106 | mkdirat \ | |
107 | mkfifo \ | |
108 | mkfifoat \ | |
109 | mknod \ | |
110 | mknodat \ | |
111 | open \ | |
112 | open64 \ | |
113 | open64_2 \ | |
114 | open_2 \ | |
115 | openat \ | |
116 | openat64 \ | |
117 | openat64_2 \ | |
118 | openat_2 \ | |
119 | pipe \ | |
120 | pipe2 \ | |
121 | poll \ | |
122 | posix_fadvise \ | |
123 | posix_fadvise64 \ | |
124 | posix_fallocate \ | |
125 | posix_fallocate64 \ | |
126 | ppoll \ | |
127 | read \ | |
128 | readlink \ | |
129 | readlinkat \ | |
130 | rmdir \ | |
131 | sendfile \ | |
132 | sendfile64 \ | |
133 | stat \ | |
134 | stat64 \ | |
135 | statfs \ | |
136 | statfs64 \ | |
137 | statvfs \ | |
138 | statvfs64 \ | |
139 | statx \ | |
140 | symlink \ | |
141 | symlinkat \ | |
142 | ttyname \ | |
143 | ttyname_r \ | |
144 | umask \ | |
145 | unlink \ | |
146 | unlinkat \ | |
147 | utime \ | |
148 | utimensat \ | |
149 | write \ | |
150 | # routines | |
151 | ||
152 | # Exclude fortified routines from being built with _FORTIFY_SOURCE | |
153 | routines_no_fortify += \ | |
154 | getcwd \ | |
155 | getwd \ | |
156 | open \ | |
157 | open64 \ | |
158 | openat \ | |
159 | openat64 \ | |
160 | poll \ | |
161 | ppoll \ | |
162 | read \ | |
163 | readlink \ | |
164 | readlinkat \ | |
165 | ttyname_r \ | |
166 | # routines_no_fortify | |
167 | ||
168 | others := \ | |
169 | pwd \ | |
170 | # others | |
171 | ||
172 | test-srcs := \ | |
173 | ftwtest \ | |
174 | ftwtest-time64 \ | |
175 | # test-srcs | |
176 | ||
177 | tests := \ | |
178 | bug-ftw1 \ | |
179 | bug-ftw2 \ | |
180 | bug-ftw3 \ | |
181 | bug-ftw4 \ | |
182 | bug-ftw5 \ | |
183 | test-lfs \ | |
184 | test-stat \ | |
185 | test-stat2 \ | |
186 | test-utime \ | |
187 | tst-close_range \ | |
188 | tst-closefrom \ | |
189 | tst-copy_file_range \ | |
190 | tst-faccessat \ | |
191 | tst-fchmodat \ | |
192 | tst-fchownat \ | |
193 | tst-fcntl \ | |
194 | tst-fcntl-lock \ | |
195 | tst-fcntl-lock-lfs \ | |
196 | tst-fstatat \ | |
197 | tst-fts \ | |
198 | tst-fts-lfs \ | |
199 | tst-ftw-bz26353 \ | |
200 | tst-ftw-bz28126 \ | |
201 | tst-ftw-lnk \ | |
202 | tst-futimens \ | |
203 | tst-futimes \ | |
204 | tst-futimesat \ | |
205 | tst-getcwd \ | |
206 | tst-getcwd-abspath \ | |
207 | tst-lchmod \ | |
208 | tst-linkat \ | |
209 | tst-lockf \ | |
210 | tst-lutimes \ | |
211 | tst-mkdirat \ | |
212 | tst-mkfifoat \ | |
213 | tst-mknodat \ | |
214 | tst-open-tmpfile \ | |
215 | tst-openat \ | |
216 | tst-posix_fallocate \ | |
217 | tst-posix_fallocate64 \ | |
218 | tst-read-zero \ | |
219 | tst-readlinkat \ | |
220 | tst-renameat \ | |
221 | tst-stat \ | |
222 | tst-stat-lfs \ | |
223 | tst-statvfs \ | |
224 | tst-symlinkat \ | |
225 | tst-ttyname_r \ | |
226 | tst-unlinkat \ | |
227 | tst-utime \ | |
228 | tst-utimensat \ | |
229 | tst-utimes \ | |
230 | # tests | |
231 | ||
232 | tests-time64 := \ | |
233 | tst-fcntl-time64 \ | |
234 | tst-fts-time64 \ | |
235 | tst-futimens-time64 \ | |
236 | tst-futimes-time64\ | |
237 | tst-futimesat-time64 \ | |
238 | tst-lchmod-time64 \ | |
239 | tst-lutimes-time64 \ | |
240 | tst-stat-time64 \ | |
241 | tst-utime-time64 \ | |
242 | tst-utimensat-time64 \ | |
243 | tst-utimes-time64 \ | |
244 | # tests-time64 | |
245 | ||
246 | # Likewise for statx, but we do not need static linking here. | |
247 | tests-internal += \ | |
248 | tst-file_change_detection \ | |
249 | tst-statx \ | |
250 | # tests-internal | |
251 | ||
252 | tests-static += \ | |
253 | tst-statx \ | |
254 | # tests-static | |
255 | ||
256 | ifeq ($(run-built-tests),yes) | |
257 | tests-special += \ | |
258 | $(objpfx)ftwtest-time64.out \ | |
259 | $(objpfx)ftwtest.out \ | |
260 | # tests-special | |
261 | endif | |
262 | ||
263 | include ../Rules | |
264 | ||
265 | CFLAGS-open.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) | |
266 | CFLAGS-openat.c += $(config-cflags-wno-ignored-attributes) | |
267 | CFLAGS-open64.c += -fexceptions -fasynchronous-unwind-tables | |
268 | CFLAGS-creat.c += -fexceptions -fasynchronous-unwind-tables | |
269 | CFLAGS-creat64.c += -fexceptions -fasynchronous-unwind-tables | |
270 | CFLAGS-fcntl.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) | |
271 | CFLAGS-fcntl64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) | |
272 | CFLAGS-poll.c += -fexceptions -fasynchronous-unwind-tables | |
273 | CFLAGS-ppoll.c += -fexceptions -fasynchronous-unwind-tables | |
274 | CFLAGS-lockf.c += -fexceptions -fasynchronous-unwind-tables | |
275 | CFLAGS-lockf64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) | |
276 | CFLAGS-statfs.c += -fexceptions | |
277 | CFLAGS-fstatfs.c += -fexceptions | |
278 | CFLAGS-statvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes) | |
279 | CFLAGS-fstatvfs.c += -fexceptions $(config-cflags-wno-ignored-attributes) | |
280 | CFLAGS-fts.c += -Wno-uninitialized $(uses-callbacks) -fexceptions | |
281 | CFLAGS-fts64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions | |
282 | CFLAGS-fts64-time64.c += -Wno-uninitialized $(uses-callbacks) -fexceptions | |
283 | CFLAGS-ftw.c += $(uses-callbacks) -fexceptions | |
284 | CFLAGS-ftw64.c += $(uses-callbacks) -fexceptions | |
285 | CFLAGS-ftw64-time64.c += $(uses-callbacks) -fexceptions | |
286 | CFLAGS-posix_fallocate.c += -fexceptions | |
287 | CFLAGS-posix_fallocate64.c += -fexceptions | |
288 | CFLAGS-fallocate.c += -fexceptions | |
289 | CFLAGS-fallocate64.c += -fexceptions | |
290 | CFLAGS-read.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) | |
291 | CFLAGS-write.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) | |
292 | CFLAGS-close.c += -fexceptions -fasynchronous-unwind-tables | |
293 | CFLAGS-lseek64.c += $(config-cflags-wno-ignored-attributes) | |
294 | CFLAGS-tst-read-zero.c += $(no-fortify-source),-D_FORTIFY_SOURCE=$(supported-fortify) | |
295 | ||
296 | CFLAGS-test-stat.c += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE | |
297 | CFLAGS-test-lfs.c += -D_LARGEFILE64_SOURCE | |
298 | CFLAGS-tst-lchmod.c += -D_FILE_OFFSET_BITS=64 | |
299 | ||
300 | test-stat2-ARGS = Makefile . $(objpfx)test-stat2 | |
301 | ||
302 | tst-statvfs-ARGS = $(objpfx)tst-statvfs tst-statvfs.c /tmp | |
303 | ||
304 | tst-open-tmpfile-ARGS = --test-dir=$(objpfx) | |
305 | ||
306 | CFLAGS-ftwtest-time64.c += -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 | |
307 | ||
308 | ifeq ($(run-built-tests),yes) | |
309 | $(objpfx)ftwtest.out: ftwtest-sh $(objpfx)ftwtest | |
310 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ | |
311 | $(evaluate-test) | |
312 | ||
313 | $(objpfx)ftwtest-time64.out: ftwtest-sh $(objpfx)ftwtest-time64 | |
314 | $(SHELL) $< $(common-objpfx) '$(test-program-cmd)' > $@; \ | |
315 | $(evaluate-test) | |
316 | endif |