From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 9BFF93857822; Tue, 10 May 2022 18:29:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9BFF93857822 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: 8ccf7c9bcae3625a2bd73b8a7a7c61188612d7c5 X-Git-Newrev: af4350966aa43a9f4b4035fc41b0c957700adf92 Message-Id: <20220510182923.9BFF93857822@sourceware.org> Date: Tue, 10 May 2022 18:29:23 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 18:29:23 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=af4350966aa43a9f4b4035fc41b0c957700adf92 commit af4350966aa43a9f4b4035fc41b0c957700adf92 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,