From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id C2D553858412; Wed, 30 Aug 2023 12:41:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2D553858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693399287; bh=SymJwB1NBQBlVhAz/SiO0Gu4o37+sDbbwe+mXD1RLwE=; h=From:To:Subject:Date:From; b=nKChjxgCqeXC79Y7ZsQfrcP5LSfguAOCk7YdbIZ5CCHzjGHwOf+Sr0AhMMhGB5Rtu xuBZlFeplBeObiSs4pfpz6Kvt65yDKLN5HBBwBqYh8ycjRj47xaI9LNW37mTURZI/f BC4jqq/b6vWylWzFzindutNeJiY8J932RR50b4x4= 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: 230619c70398c7d0c886b5b48f1211c05eae5b57 X-Git-Newrev: 9f4e0b4922f980487374f1d0ed6e4322e70c4ea3 Message-Id: <20230830124127.C2D553858412@sourceware.org> Date: Wed, 30 Aug 2023 12:41:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=9f4e0b4922f980487374f1d0ed6e4322e70c4ea3 commit 9f4e0b4922f980487374f1d0ed6e4322e70c4ea3 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 27f4e6e563..df5742c116 100644 --- a/include/string.h +++ b/include/string.h @@ -175,13 +175,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,