From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 8343D3858428; Thu, 9 Feb 2023 19:53:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8343D3858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675972403; bh=FBDT+cKuRZyRrIj943GSK20Fy+4N/kUXVZQQcGE7LwY=; h=From:To:Subject:Date:From; b=vlh8DJk0AfBN8p8QFtLIAvhCoMgeOyXkIJHfDK4bniRV3hz+AXppJwvTkHsCRr/sR 7qO/Yovt8+ow+yug9rkS0khInVPL/jDh7I/Q+RC+E2JKWnHleuyxZ+AEfX334yFt/V XiB/HItUCC/0i761R4sQUA9kgu80Ua7fNSGIGhYo= 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: b4e3ef166b0db77ca9818f579156ebee93434c35 X-Git-Newrev: f182c5acdd6eb6e989fa251c1cf5055309065061 Message-Id: <20230209195323.8343D3858428@sourceware.org> Date: Thu, 9 Feb 2023 19:53:23 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=f182c5acdd6eb6e989fa251c1cf5055309065061 commit f182c5acdd6eb6e989fa251c1cf5055309065061 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 d6e352e214..d7a133f4e7 100644 --- a/include/string.h +++ b/include/string.h @@ -174,13 +174,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,