]>
Commit | Line | Data |
---|---|---|
688903eb | 1 | # Copyright (C) 1991-2018 Free Software Foundation, Inc. |
28f540f4 RM |
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. | |
28f540f4 RM |
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. |
28f540f4 | 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/>. | |
28f540f4 RM |
17 | |
18 | # | |
19 | # Sub-makefile for string portion of library. | |
20 | # | |
21 | subdir := string | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
09a596cc ZW |
25 | headers := string.h bits/string_fortified.h \ |
26 | strings.h bits/strings_fortified.h \ | |
0d40d0ec | 27 | byteswap.h bits/byteswap.h \ |
09a596cc ZW |
28 | endian.h bits/endian.h bits/uintn-identity.h \ |
29 | memory.h argz.h envz.h | |
28f540f4 | 30 | |
0501d603 UD |
31 | routines := strcat strchr strcmp strcoll strcpy strcspn \ |
32 | strverscmp strdup strndup \ | |
310b3460 | 33 | strerror _strerror strlen strnlen \ |
8d71c7b0 | 34 | strncat strncmp strncpy \ |
28f540f4 | 35 | strrchr strpbrk strsignal strspn strstr strtok \ |
59dd8641 | 36 | strtok_r strxfrm memchr memcmp memmove memset \ |
bdd421cc | 37 | mempcpy bcopy bzero ffs ffsll stpcpy stpncpy \ |
0501d603 | 38 | strcasecmp strncase strcasecmp_l strncase_l \ |
f4017d20 | 39 | memccpy memcpy wordcopy strsep strcasestr \ |
c4563d2d | 40 | swab strfry memfrob memmem rawmemchr strchrnul \ |
7a12c6bb | 41 | $(addprefix argz-,append count create ctsep next \ |
dbc676d4 | 42 | delete extract insert stringify \ |
d705269e | 43 | addsep replace) \ |
c84142e8 | 44 | envz basename \ |
61645263 | 45 | strcoll_l strxfrm_l string-inlines memrchr \ |
ea1bd74d | 46 | xpg-strerror strerror_l explicit_bzero |
28f540f4 | 47 | |
762011fe | 48 | strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \ |
cd94eda9 | 49 | stpcpy stpncpy strcat strchr strcmp strcpy strcspn \ |
dbc676d4 | 50 | strlen strncmp strncpy strpbrk strrchr strspn memmem \ |
6f0eec67 | 51 | strstr strcasestr strnlen strcasecmp strncasecmp \ |
ea1bd74d ZW |
52 | strncat rawmemchr strchrnul bcopy bzero memrchr \ |
53 | explicit_bzero | |
61eb22d3 | 54 | tests := tester inl-tester noinl-tester testcopy test-ffs \ |
9c3b1ceb | 55 | tst-strlen stratcliff tst-svc tst-inlcall \ |
b716cb4e | 56 | bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \ |
806bc96a | 57 | tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \ |
9009e8f8 | 58 | bug-strtok1 $(addprefix test-,$(strop-tests)) \ |
67a67b95 | 59 | bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \ |
6a1cefac | 60 | tst-strtok_r bug-strcoll2 tst-cmp tst-xbzero-opt \ |
0d40d0ec JM |
61 | test-endian-types test-endian-file-scope \ |
62 | test-endian-sign-conversion | |
28f540f4 | 63 | |
5653ab12 | 64 | # This test allocates a lot of memory and can run for a long time. |
303e567a SP |
65 | xtests = tst-strcoll-overflow |
66 | ||
198bfee8 AJ |
67 | # This test needs libdl. |
68 | ifeq (yes,$(build-shared)) | |
69 | tests += test-strerror-errno | |
70 | LDLIBS-test-strerror-errno = $(libdl) | |
71 | endif | |
72 | ||
f214606a JM |
73 | ifeq ($(run-built-tests),yes) |
74 | tests-special += $(objpfx)tst-svc-cmp.out | |
75 | endif | |
76 | ||
28f540f4 | 77 | include ../Rules |
59dd8641 | 78 | |
e70c6fee L |
79 | CFLAGS-inl-tester.c += -fno-builtin |
80 | CFLAGS-noinl-tester.c += -fno-builtin | |
81 | CFLAGS-tst-strlen.c += -fno-builtin | |
82 | CFLAGS-stratcliff.c += -fno-builtin | |
83 | CFLAGS-test-ffs.c += -fno-builtin | |
84 | CFLAGS-tst-inlcall.c += -fno-builtin | |
85 | CFLAGS-tst-xbzero-opt.c += -O3 | |
0d40d0ec | 86 | CFLAGS-test-endian-sign-conversion.c += -Werror -Wsign-conversion |
570c4433 SL |
87 | # BZ 21006: Resolve all functions but at least explicit_bzero at startup. |
88 | # Otherwise the test fails on s390x as the memcpy in prepare_test_buffer is | |
89 | # done by loading r4 / r5 with the test_pattern and using store multiple | |
90 | # instruction to store r4 / r5 to buf. If explicit_bzero would be resolved in | |
91 | # setup_explicit_clear, r4 / r5 would be stored to stack by _dl_runtime_resolve | |
92 | # and the call to memmem in count_test_patterns will find a hit of the | |
93 | # test_pattern on the stack. | |
94 | LDFLAGS-tst-xbzero-opt = -z now | |
1f205a47 | 95 | |
10c85e76 | 96 | # Called during TLS initialization. |
e70c6fee L |
97 | CFLAGS-memcpy.c += $(no-stack-protector) |
98 | CFLAGS-wordcopy.c += $(no-stack-protector) | |
10c85e76 | 99 | |
03ac099f | 100 | ifeq ($(run-built-tests),yes) |
6e89caf1 | 101 | $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out |
f0881698 JM |
102 | cmp $^ > $@; \ |
103 | $(evaluate-test) | |
60cf80f0 MS |
104 | |
105 | LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \ | |
02018629 | 106 | tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \ |
5653ab12 | 107 | da_DK.ISO-8859-1 en_GB.UTF-8 |
60cf80f0 MS |
108 | include ../gen-locales.mk |
109 | ||
110 | $(objpfx)test-strcasecmp.out: $(gen-locales) | |
111 | $(objpfx)test-strncasecmp.out: $(gen-locales) | |
112 | $(objpfx)tst-strxfrm.out: $(gen-locales) | |
113 | $(objpfx)tst-strxfrm2.out: $(gen-locales) | |
facdd9ea CD |
114 | # bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1. |
115 | $(objpfx)bug-strcoll2.out: $(gen-locales) | |
5653ab12 | 116 | $(objpfx)tst-strcoll-overflow.out: $(gen-locales) |
60cf80f0 | 117 | |
e7a95dc6 | 118 | endif |