[Bug librt/33732] glibc-2.43 fails to build, clang, i486 and x86-64, undefined reference to `__memcpy_chk'

dilfridge at gentoo dot org sourceware-bugzilla@sourceware.org
Wed Jan 7 23:02:25 GMT 2026


https://sourceware.org/bugzilla/show_bug.cgi?id=33732

--- Comment #6 from Andreas K. Huettel <dilfridge at gentoo dot org> ---
A few data points:

0) It's still possible this is Gentoo-specific. Investigating this still.

1) Poking with nm, the unresolved symbol __memcpy_chk comes from elf/rtld.os

2) A gcc-15 build shows no such symbol in elf/rtld.os

3) The build log with clang displays a lot of warnings regarding attribute
declarations, including at this specific file, which look relevant.

 clang -m64 -O2 -pipe -ggdb3 -Wno-unused-command-line-argument -Wl,-O1
-Wl,--as-needed -Wl,-z,pack-relative-relocs rtld.c -c -std=gnu11 -fgnu89-inline
 -O2 -pipe -ggdb3 -Wno-unused-command-line-argument -Wall -Wwrite-strings
-Wundef -Wimplicit-fallthrough -fmerge-all-constants -frounding-math
-ftrapping-math -fstack-protector-strong -fno-common -U_FORTIFY_SOURCE
-Wstrict-prototypes -Wold-style-definition   -fmath-errno    -fPIC   
-fno-stack-protector -DSTACK_PROTECTOR_LEVEL=0  -mno-mmx -fcf-protection   
-D'SYSCONFDIR="/etc"'  -ftls-model=initial-exec     -I../include
-I/var/tmp/portage/sys-libs/glibc-9999/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf

-I/var/tmp/portage/sys-libs/glibc-9999/work/build-amd64-x86_64-pc-linux-gnu-nptl
 -I../sysdeps/unix/sysv/linux/x86_64/64  -I../sysdeps/x86_64/64/nptl 
-I../sysdeps/unix/sysv/linux/x86_64/include -I../sysdeps/unix/sysv/linux/x86_64
 -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86 
-I../sysdeps/x86/nptl  -I../sysdeps/unix/sysv/linux/wordsize-64 
-I../sysdeps/x86_64/nptl  -I../sysdeps/unix/sysv/linux/include
-I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread 
-I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv 
-I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix 
-I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch 
-I../sysdeps/x86_64/fpu  -I../sysdeps/x86/fpu  -I../sysdeps/x86_64/multiarch 
-I../sysdeps/x86_64  -I../sysdeps/x86/include -I../sysdeps/x86 
-I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include
-I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64 
-I../sysdeps/ieee754/flt-32  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754 
-I../sysdeps/generic  -I.. -I../libio -I. -nostdinc -isystem
/usr/lib/llvm/20/bin/../../../../lib/clang/20/include -isystem /usr/include
-D_LIBC_REENTRANT -include
/var/tmp/portage/sys-libs/glibc-9999/work/build-amd64-x86_64-pc-linux-gnu-nptl/libc-modules.h
-DMODULE_NAME=rtld -include ../include/libc-symbols.h  -DPIC -DSHARED    
-DTOP_NAMESPACE=glibc -o
/var/tmp/portage/sys-libs/glibc-9999/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/rtld.os
-MD -MP -MF
/var/tmp/portage/sys-libs/glibc-9999/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/rtld.os.dt
-MT
/var/tmp/portage/sys-libs/glibc-9999/work/build-amd64-x86_64-pc-linux-gnu-nptl/elf/rtld.os
In file included from rtld.c:20:
In file included from ../include/dlfcn.h:4:
In file included from ../include/link.h:51:
In file included from ../sysdeps/x86_64/nptl/tls.h:118:
In file included from ../nptl/descr.h:26:
In file included from ../sysdeps/x86/hp-timing.h:53:
In file included from ../sysdeps/generic/hp-timing-common.h:37:
../include/string.h:175:33: warning: attribute declaration must precede
definition [-Wignored-attributes]
  175 | extern __typeof (memcpy) memcpy attribute_hidden;
      |                                 ^
./../include/libc-symbols.h:366:43: note: expanded from macro
'attribute_hidden'
  366 | # define attribute_hidden __attribute__ ((visibility ("hidden")))
      |                                           ^
../string/bits/string_fortified.h:26:8: note: previous definition is here
   26 | __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
      |        ^
In file included from rtld.c:20:
In file included from ../include/dlfcn.h:4:
In file included from ../include/link.h:51:
In file included from ../sysdeps/x86_64/nptl/tls.h:118:
In file included from ../nptl/descr.h:26:
In file included from ../sysdeps/x86/hp-timing.h:53:
In file included from ../sysdeps/generic/hp-timing-common.h:37:
../include/string.h:176:35: warning: attribute declaration must precede
definition [-Wignored-attributes]
  176 | extern __typeof (memmove) memmove attribute_hidden;
      |                                   ^
./../include/libc-symbols.h:366:43: note: expanded from macro
'attribute_hidden'
  366 | # define attribute_hidden __attribute__ ((visibility ("hidden")))
      |                                           ^
../string/bits/string_fortified.h:34:8: note: previous definition is here
   34 | __NTH (memmove (void *__dest, const void *__src, size_t __len))
      |        ^
In file included from rtld.c:20:
In file included from ../include/dlfcn.h:4:
In file included from ../include/link.h:51:
In file included from ../sysdeps/x86_64/nptl/tls.h:118:
In file included from ../nptl/descr.h:26:
In file included from ../sysdeps/x86/hp-timing.h:53:
In file included from ../sysdeps/generic/hp-timing-common.h:37:
../include/string.h:177:33: warning: attribute declaration must precede
definition [-Wignored-attributes]
  177 | extern __typeof (memset) memset attribute_hidden;
      |                                 ^
./../include/libc-symbols.h:366:43: note: expanded from macro
'attribute_hidden'
  366 | # define attribute_hidden __attribute__ ((visibility ("hidden")))
      |                                           ^
../string/bits/string_fortified.h:57:8: note: previous definition is here
   57 | __NTH (memset (void *__dest, int __ch, size_t __len))
      |        ^
3 warnings generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list