From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id ECC613858006; Fri, 28 Oct 2022 17:46:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECC613858006 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666979194; bh=sTWoKwqAEL1MAy4c6qGYQ+E8FQAJuU6rA/QN5hMfUsk=; h=From:To:Subject:Date:From; b=ekbtO1a5ficjaRyKY3E8GpYMDsjgPleX5m+JavKL0WUws7I0UDeOco5JGKXzAZOZh avcBDEpdQHXVnrLcS7b9u37pvs2p95SuAa0z//vCZlBtu6t/KWZcgu75wTTl/7+TCl 7mM1v0+DyzqJQ1kOWxTQDRCO0ZmKzXhP03S/fBJg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] string: mempcy and stpcpy builtins internally X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: a954fbfdcc371d02f9e5001cbc04f76022c1d263 X-Git-Newrev: 352a71208eca7e09703cc5151bfa37934eeadf3b Message-Id: <20221028174634.ECC613858006@sourceware.org> Date: Fri, 28 Oct 2022 17:46:34 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=352a71208eca7e09703cc5151bfa37934eeadf3b commit 352a71208eca7e09703cc5151bfa37934eeadf3b Author: Adhemerval Zanella Date: Thu Mar 31 15:18:02 2022 -0300 string: mempcy and stpcpy builtins internally Diff: --- include/string.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/string.h b/include/string.h index 44c4049053..987afbd304 100644 --- a/include/string.h +++ b/include/string.h @@ -172,13 +172,17 @@ extern __typeof (strnlen) strnlen attribute_hidden; extern __typeof (strsep) strsep attribute_hidden; #endif -#if (!IS_IN (libc) || !defined SHARED) \ - && !defined NO_MEMPCPY_STPCPY_REDIRECT +#if IS_IN (libc) && !defined NO_MEMPCPY_STPCPY_REDIRECT /* Redirect calls to __builtin_mempcpy and __builtin_stpcpy to call __mempcpy and __stpcpy if not inlined. */ +# ifdef SHARED +__asm__ ("mempcpy = __GI_mempcpy"); +__asm__ ("stpcpy = __GI_stpcpy"); +# else __asm__ ("mempcpy = __mempcpy"); __asm__ ("stpcpy = __stpcpy"); #endif +#endif extern void *__memcpy_chk (void *__restrict __dest, const void *__restrict __src, size_t __len,