__mempcpy inline/builtin emitting mempcpy ref

Samuel Thibault samuel.thibault@gnu.org
Mon Jan 6 23:29:46 GMT 2025


Hello,

In htl/pt-alloc.c, we call __mempcpy(), but in pt-alloc.os we get an
external ref to mempcpy, which then violates symbol exposition rules.

Apparently what is happening is that include/string.h #defines __mempcpy
to __builtin_mempcpy, and the compiler doesn't actually inline code and
rather emits a reference to mempcpy. Do we have a proper way to avoid
this?

#if IS_IN (libc) && !defined SHARED \
  && !defined NO_MEMPCPY_STPCPY_REDIRECT
/* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
   __mempcpy and __stpcpy if not inlined.  */
extern __typeof (mempcpy) mempcpy __asm__ ("__mempcpy");

is done only for IS_IN (libc), should we perhaps drop that piece of the
condition?

Samuel


More information about the Libc-alpha mailing list