[GLIBC][PATCH v2] Remove strdup inlines

Wilco Dijkstra Wilco.Dijkstra@arm.com
Mon Dec 12 17:28:00 GMT 2016


Mike Frysinger wrote:
> > +# define strdup(s) __builtin_strdup (s)

> why do we need these at all ?  these seem like the sort of thing that
> gcc should do automatically for us ?

strdup and strndup are used inside GLIBC and without these defines
I get lots of linknamespace and ocalplt failures. We do something similar
for __stpcpy in bits/string2.h. However here is this in include/string.h:

#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");
extern __typeof (stpcpy) stpcpy __asm__ ("__stpcpy");
#endif

Maybe strdup needs to be added here?

> 2nd #define is missing an indent

I'll fix that once we decide where the magic needs to go...

Wilco
    


More information about the Libc-alpha mailing list