1 # Copyright (C) 1991-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 misc portion of the library.
78 bits
/types
/struct_iovec.h \
81 sys
/single_threaded.h \
210 # Exclude fortified routines from being built with _FORTIFY_SOURCE
211 routines_no_fortify
+= \
215 # routines_no_fortify
217 ifeq ($(run-built-tests
),yes
)
218 ifeq (yes
,$(build-shared
))
221 tst-allocate_once-mem.out \
222 tst-allocate_once.mtrace \
231 install-lib
:= libg.a
256 tst-mntent-blank-corrupt \
257 tst-mntent-blank-passno \
265 tst-preadvwritev64v2 \
279 # Tests which need libdl.
280 ifeq (yes
,$(build-shared
))
281 tests
+= tst-gethostid
289 tests-static
:= tst-empty
291 # Test for the internal, non-exported __fd_to_filename function.
292 tests-internal
+= tst-fd_to_filename
293 tests-static
+= tst-fd_to_filename
295 # Tests with long run times.
298 tst-mkstemp-fuse-parallel \
301 ifeq ($(run-built-tests
),yes
)
302 ifeq (yes
,$(build-shared
))
305 $(objpfx
)tst-allocate_once-mem.out \
306 $(objpfx
)tst-error1-mem.out \
314 tst-syslog-long-progname \
317 CFLAGS-select.c
+= -fexceptions
-fasynchronous-unwind-tables
318 CFLAGS-tsearch.c
+= $(uses-callbacks
)
319 CFLAGS-lsearch.c
+= $(uses-callbacks
)
320 CFLAGS-pselect.c
+= -fexceptions
321 CFLAGS-readv.c
+= -fexceptions
-fasynchronous-unwind-tables
322 CFLAGS-writev.c
+= -fexceptions
-fasynchronous-unwind-tables
323 CFLAGS-preadv.c
+= -fexceptions
-fasynchronous-unwind-tables
324 CFLAGS-preadv64.c
+= -fexceptions
-fasynchronous-unwind-tables
325 CFLAGS-pwritev.c
+= -fexceptions
-fasynchronous-unwind-tables
326 CFLAGS-pwritev64.c
+= -fexceptions
-fasynchronous-unwind-tables
327 CFLAGS-preadv2.c
+= -fexceptions
-fasynchronous-unwind-tables
328 CFLAGS-preadv64v2.c
+= -fexceptions
-fasynchronous-unwind-tables
329 CFLAGS-pwritev2.c
+= -fexceptions
-fasynchronous-unwind-tables
330 CFLAGS-pwritev64v2.c
+= -fexceptions
-fasynchronous-unwind-tables
331 CFLAGS-usleep.c
+= -fexceptions
332 CFLAGS-syslog.c
+= -fexceptions
333 CFLAGS-error.c
+= -fexceptions
334 CFLAGS-getpass.c
+= -fexceptions
335 CFLAGS-mkstemp.c
+= -fexceptions
336 CFLAGS-mkstemp64.c
+= -fexceptions
337 CFLAGS-getsysstats.c
+= -fexceptions
338 CFLAGS-getusershell.c
+= -fexceptions
339 CFLAGS-err.c
+= -fexceptions
340 CFLAGS-tst-tsearch.c
+= $(stack-align-test-flags
)
341 CFLAGS-msync.c
+= -fexceptions
-fasynchronous-unwind-tables
342 CFLAGS-fdatasync.c
+= -fexceptions
-fasynchronous-unwind-tables
343 CFLAGS-fsync.c
+= -fexceptions
-fasynchronous-unwind-tables
344 CFLAGS-makedev.c
+= $(config-cflags-wno-ignored-attributes
)
345 CFLAGS-mmap64.c
+= $(config-cflags-wno-ignored-attributes
)
347 # Called during static library initialization, so turn stack-protection
348 # off for non-shared builds.
349 CFLAGS-sbrk.o
= $(no-stack-protector
)
350 CFLAGS-sbrk.op
= $(no-stack-protector
)
351 CFLAGS-brk.o
= $(no-stack-protector
)
352 CFLAGS-brk.op
= $(no-stack-protector
)
353 CFLAGS-mmap.o
= $(no-stack-protector
)
354 CFLAGS-mmap.op
= $(no-stack-protector
)
355 CFLAGS-mmap64.o
= $(no-stack-protector
)
356 CFLAGS-mmap64.op
= $(no-stack-protector
)
360 $(objpfx
)libg.a
: $(dep-dummy-lib
); $(make-dummy-lib
)
362 $(objpfx
)tst-tsearch
: $(libm
)
364 tst-error1-ENV
= MALLOC_TRACE
=$(objpfx
)tst-error1.mtrace \
365 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
366 tst-error1-ARGS
= $(objpfx
)tst-error1.out
367 $(objpfx
)tst-error1-mem.out
: $(objpfx
)tst-error1.out
368 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-error1.mtrace
> $@
; \
371 tst-allocate_once-ENV
= MALLOC_TRACE
=$(objpfx
)tst-allocate_once.mtrace \
372 LD_PRELOAD
=$(common-objpfx
)/malloc
/libc_malloc_debug.so
373 $(objpfx
)tst-allocate_once-mem.out
: $(objpfx
)tst-allocate_once.out
374 $(common-objpfx
)malloc
/mtrace
$(objpfx
)tst-allocate_once.mtrace
> $@
; \
377 tst-syslog-long-progname-ENV
= GLIBC_TUNABLES
=glibc.malloc.
check=3 \
378 LD_PRELOAD
=libc_malloc_debug.so
.0
380 $(objpfx
)tst-select
: $(librt
)
381 $(objpfx
)tst-select-time64
: $(librt
)
382 $(objpfx
)tst-pselect
: $(librt
)
383 $(objpfx
)tst-pselect-time64
: $(librt
)
384 $(objpfx
)tst-mkstemp-fuse-parallel
: $(shared-thread-library
)