1 # Copyright (C) 1991-2023 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 string portion of library.
30 bits/string_fortified.h \
31 bits/strings_fortified.h \
32 bits/uintn-identity.h \
132 test-endian-file-scope \
133 test-endian-sign-conversion \
135 test-explicit_bzero \
176 tst-memmove-overflow \
188 # Both tests require the .mo translation files generated by msgfmt.
189 tests-translation := \
194 tests-container += $(tests-translation)
196 tests-unsupported += $(tests-translation)
199 # This test allocates a lot of memory and can run for a long time.
200 xtests = tst-strcoll-overflow
202 # This test needs libdl.
203 ifeq (yes,$(build-shared))
204 tests += test-strerror-errno
207 ifeq ($(run-built-tests),yes)
208 tests-special += $(objpfx)tst-svc-cmp.out
213 CFLAGS-inl-tester.c += -fno-builtin
214 CFLAGS-noinl-tester.c += -fno-builtin
215 CFLAGS-tst-strlen.c += -fno-builtin
216 CFLAGS-stratcliff.c += -fno-builtin
217 CFLAGS-test-ffs.c += -fno-builtin
218 CFLAGS-tst-inlcall.c += -fno-builtin
219 CFLAGS-tst-xbzero-opt.c += -O3
220 CFLAGS-test-endian-sign-conversion.c += -Werror -Wsign-conversion
221 # BZ 21006: Resolve all functions but at least explicit_bzero at startup.
222 # Otherwise the test fails on s390x as the memcpy in prepare_test_buffer is
223 # done by loading r4 / r5 with the test_pattern and using store multiple
224 # instruction to store r4 / r5 to buf. If explicit_bzero would be resolved in
225 # setup_explicit_clear, r4 / r5 would be stored to stack by _dl_runtime_resolve
226 # and the call to memmem in count_test_patterns will find a hit of the
227 # test_pattern on the stack.
228 LDFLAGS-tst-xbzero-opt = -z now
230 # Called during TLS initialization.
231 CFLAGS-memcpy.c += $(no-stack-protector)
232 CFLAGS-wordcopy.c += $(no-stack-protector)
233 # Called during static initialization
234 CFLAGS-strncmp.c += $(no-stack-protector)
236 CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
237 CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
238 CFLAGS-ffs.c += $(config-cflags-wno-ignored-attributes)
239 CFLAGS-memmem.c += $(config-cflags-wno-ignored-attributes)
240 CFLAGS-memchr.c += $(config-cflags-wno-ignored-attributes)
241 CFLAGS-mempcpy.c += $(config-cflags-wno-ignored-attributes)
242 CFLAGS-stpcpy.c += $(config-cflags-wno-ignored-attributes)
243 CFLAGS-strnlen.c += $(config-cflags-wno-ignored-attributes)
245 ifeq ($(run-built-tests),yes)
246 $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
250 LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \
251 tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \
252 da_DK.ISO-8859-1 en_GB.UTF-8 pt_BR.UTF-8
253 include ../gen-locales.mk
255 $(objpfx)test-strcasecmp.out: $(gen-locales)
256 $(objpfx)test-strncasecmp.out: $(gen-locales)
257 $(objpfx)tst-strxfrm.out: $(gen-locales)
258 $(objpfx)tst-strxfrm2.out: $(gen-locales)
259 # bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1.
260 $(objpfx)bug-strcoll2.out: $(gen-locales)
261 $(objpfx)tst-strcoll-overflow.out: $(gen-locales)
262 $(objpfx)tst-strsignal.out: $(gen-locales)
263 $(objpfx)tst-strerror.out: $(gen-locales)