[PATCH] include/string.h: Also redirect calls if not inlined in libpthread
Samuel Thibault
samuel.thibault@gnu.org
Tue Jan 7 19:53:47 GMT 2025
H.J. Lu, le mar. 07 janv. 2025 09:49:12 +0800, a ecrit:
> On Tue, Jan 7, 2025, 9:40 AM Samuel Thibault <[1]samuel.thibault@ens-lyon.org>
> wrote:
>
> htl's pt-alloc.c calls __mempcpy, which is #defined to
> __builtin_mempcpy, but which does not happen to get inlined (the size is
> dynamic), and then gcc emits a reference to mempcpy, thus violating
> symbol exposition standard. We thus also have to redirect such
> references to __mempcpy too.
> ---
> include/string.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/string.h b/include/string.h
> index 1f6aef9f93..b9c41b0eea 100644
> --- a/include/string.h
> +++ b/include/string.h
> @@ -175,7 +175,7 @@ extern __typeof (strnlen) strnlen attribute_hidden;
> extern __typeof (strsep) strsep attribute_hidden;
> #endif
>
> -#if IS_IN (libc) && !defined SHARED \
> +#if (IS_IN (libc) || IS_IN (libpthread)) && !defined SHARED \
> && !defined NO_MEMPCPY_STPCPY_REDIRECT
> /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call
> __mempcpy and __stpcpy if not inlined. */
> --
> 2.45.2
>
>
> OK.
Pushed, thanks!
Samuel
More information about the Libc-alpha
mailing list