glibc/include
H.J. Lu e9eea05986 Redirect mempcpy and stpcpy only in libc.a
The mempcpy and stpcpy redirections to __mempcpy and __stpcpy were added
by

commit 939da41143
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Nov 12 22:36:34 2014 +0000

    Fix stpcpy / mempcpy namespace (bug 17573).

to fix the namespace bug since __mempcpy and __stpcpy were defined as
macros in <bits/string2.h>.  These macros call __builtin_mempcpy and
__builtin_stpcpy which may end up calling the C functions mempcpy
and stpcpy.  In libc.so, libc_hidden_builtin_proto ensures that calls
to mempcpy and stpcpy are in turn mapped to call __GI_mempcpy and
__GI_stpcpy.  The redirections were applied outside of libc.so, including
libc.a, to map mempcpy and stpcpy to __mempcpy and __stpcpy.  Since

commit 18b10de7ce
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date:   Mon Jun 12 15:19:38 2017 +0100

    2017-06-12  Wilco Dijkstra  <wdijkstr@arm.com>

    There is no longer a need for string2.h, so remove it and all mention of it.
    Move the redirect for __stpcpy to include/string.h since it is
still required
    until all internal uses have been renamed.
    This fixes several linknamespace/localplt failures when building with -Os.

removed the __mempcpy and __stpcpy macros from the public header file,
limit these redirections to libc.a to avoid Clang error:

In file included from tst-iconv-sticky-input-error.c:22:
In file included from ./gconv_int.h:24:
../include/string.h:182:44: error: attribute declaration must precede definition [-Werror,-Wignored-attributes]
  182 | extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");
      |                                            ^
../string/bits/string_fortified.h:42:8: note: previous definition is here
   42 | __NTH (mempcpy (void *__restrict __dest, const void *__restrict __src,
      |        ^

when testing with Clang for fortify build.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
2025-01-03 05:30:44 +08:00
..
arpa Fix all the remaining misspellings -- BZ 25337 2023-06-02 01:39:48 +00:00
bits Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
gnu Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
net
netinet
programs Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
protocols
rpc
rpcsvc
sys Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
aio.h
aliases.h Move 'aliases' routines from 'inet' into 'nss' 2023-10-24 12:30:59 +02:00
alloc_buffer.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
alloca.h
allocate_once.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ar.h
argp-fmtstream.h
argp.h
argz.h
array_length.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
assert.h
atomic.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
atomic_wide_counter.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
byteswap.h
clone_internal.h posix: Add pidfd_spawn and pidfd_spawnp (BZ 30349) 2023-09-05 13:08:59 -03:00
complex.h
cpio.h
ctype.h
des.h
dirent.h
dlfcn.h arm: Use _dl_find_object on __gnu_Unwind_Find_exidx (BZ 31405) 2024-02-23 08:50:00 -03:00
dso_handle.h
elf.h
endian.h
envz.h
err.h
errno.h stdlib: Do not use GLIBC_PRIVATE ABI for errno in libc_nonshared.a 2024-09-06 14:07:00 +02:00
error.h
execinfo.h
fcntl.h
features-time64.h
features.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
fenv.h
file_change_detection.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
filename.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
float.h
fmtmsg.h
fnmatch.h
fpu_control.h
fstab.h
fts.h
ftw.h
gconv.h
getopt.h
getopt_int.h
glob.h
gmp.h
gnu-versions.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
grp-merge.h Remove 'grp' and merge into 'nss' and 'posix' 2023-10-24 12:30:59 +02:00
grp.h Remove 'grp' and merge into 'nss' and 'posix' 2023-10-24 12:30:59 +02:00
gshadow.h Remove 'gshadow' and merge into 'nss' 2023-10-24 12:30:59 +02:00
iconv.h
idx.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
ifaddrs.h nscd: Do not rebuild getaddrinfo (bug 30709) 2023-08-11 10:10:16 +02:00
ifreq.h
ifunc-impl-list.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inline-hashtab.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
intprops.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
inttypes.h
langinfo.h
lastlog.h
libc-diag.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-internal.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-misc.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-pointer-arith.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libc-symbols.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
libgen.h
libintl.h
limits.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
link.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
list.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
list_t.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
locale.h
loop_unroll.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
malloc.h
math-narrow-eval.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
math.h math: Remove __XXX math functions from installed math.h [BZ #32418] 2024-12-12 16:17:54 +08:00
mcheck.h
memory.h
mntent.h
monetary.h
mqueue.h
netdb.h Move 'netgroup' routines from 'inet' into 'nss' 2023-10-24 12:30:59 +02:00
netgroup.h Move 'netgroup' routines from 'inet' into 'nss' 2023-10-24 12:30:59 +02:00
nl_types.h
nss.h
nss_dns.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
nss_files.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
nsswitch.h
obstack.h
plural-exp.h
poll.h
printf.h
printf_buffer.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
pthread.h
pty.h
pwd.h Remove 'pwd' and merge into 'nss' 2023-10-24 12:30:59 +02:00
random-bits.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
re_comp.h
regex.h
regexp.h
register-atfork.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
resolv.h
rounding-mode.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
rtld-malloc.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
sched.h
scratch_buffer.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
search.h
set-freeres.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
setjmp.h chk: Add and fix hidden builtin definitions for *_chk 2023-08-03 22:46:48 +02:00
sgtty.h
shadow.h Remove 'shadow' and merge into 'nss' 2023-10-24 12:30:59 +02:00
shlib-compat.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
shm-directory.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
signal.h
spawn.h
stab.h
stackinfo.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
stap-probe.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
stdbit.h Implement C23 <stdbit.h> 2024-01-03 12:07:14 +00:00
stdc-predef.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
stdint.h
stdio.h posix: Sync tempname with gnulib 2024-04-10 14:53:39 -03:00
stdio_ext.h
stdlib.h stdlib: Make abort/_Exit AS-safe (BZ 26275) 2024-10-08 14:40:12 -03:00
string.h Redirect mempcpy and stpcpy only in libc.a 2025-01-03 05:30:44 +08:00
strings.h
struct___timeb64.h
struct___timespec64.h
struct___timeval64.h
stubs-prologue.h
syscall.h
sysexits.h
syslog.h
tar.h
termios.h
tgmath.h Don't use glibc <tgmath.h> when testing with Clang 2024-12-21 05:24:07 +08:00
time.h
ttyent.h
uchar.h
ucontext.h
ulimit.h
unistd.h unistd: Avoid PLT entries with _FORTIFY_SOURCE 2023-07-05 16:59:48 +02:00
unistd_ext.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
utime.h
utmp.h
values.h Update copyright dates with scripts/update-copyrights 2025-01-01 11:22:09 -08:00
verify.h
wait.h
wchar.h Refer to C23 in place of C2X in glibc 2024-02-01 11:02:01 +00:00
wctype.h
wordexp.h