From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by ml01.01.org (Postfix) with ESMTP id AE24A1A1E18 for ; Mon, 8 Aug 2016 07:56:48 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 08 Aug 2016 07:56:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,490,1464678000"; d="scan'208";a="1010510074" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 08 Aug 2016 07:56:32 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 8 Aug 2016 07:56:32 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.39]) by fmsmsx158.amr.corp.intel.com ([169.254.15.173]) with mapi id 14.03.0248.002; Mon, 8 Aug 2016 07:56:32 -0700 From: "Carsey, Jaben" To: Ard Biesheuvel , "edk2-devel@lists.01.org" , "edk2-lists@mc2research.org" CC: "sigmaepsilon92@gmail.com" , "leif.lindholm@linaro.org" , "Carsey, Jaben" Thread-Topic: [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine compiler intrinsics Thread-Index: AQHR8WXK+P+jXEzz8kC354YCsriSSKA/J0oA Date: Mon, 8 Aug 2016 14:56:31 +0000 Message-ID: References: <1470654741-24203-1-git-send-email-ard.biesheuvel@linaro.org> <1470654741-24203-2-git-send-email-ard.biesheuvel@linaro.org> In-Reply-To: <1470654741-24203-2-git-send-email-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGY0M2M0ZTItODk3Zi00ODczLTg4MDMtNGZmZTZhNmM4YjhjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImVwcHhUaFFCSzJtbmQwQXA4TzNOd3IyV3hzT2FTNkp6ZGJNN2JaQjRnWm89In0= x-ctpclassification: CTP_IC x-originating-ip: [10.1.200.108] MIME-Version: 1.0 Subject: Re: [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine compiler intrinsics X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Aug 2016 14:56:48 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----Original Message----- > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] > Sent: Monday, August 08, 2016 4:12 AM > To: edk2-devel@lists.01.org; edk2-lists@mc2research.org; Carsey, Jaben > > Cc: sigmaepsilon92@gmail.com; leif.lindholm@linaro.org; Ard Biesheuvel > > Subject: [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine compiler > intrinsics > Importance: High >=20 > The memset() function is a compiler intrinsics on AARCH64 and ARM, and > so is memmove() on ARM. Usually, redefining them as LibC currently does > is not a problem since only one version will be selected at link time > from the various static libraries that provide implementations. However, > under LTO, this is slightly different, since explicit references (in the > C code) and implicit references (emitted by the compiler backend) may > resolve to different versions (LTO vs non-LTO), causing conflicts. >=20 > So simply omit them for ARM/AARCH64 resp. ARM. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Ard Biesheuvel > --- > StdLib/LibC/String/Copying.c | 2 ++ > StdLib/LibC/String/Misc.c | 2 ++ > 2 files changed, 4 insertions(+) >=20 > diff --git a/StdLib/LibC/String/Copying.c b/StdLib/LibC/String/Copying.c > index 96be24b9a9bd..3234eccf0808 100644 > --- a/StdLib/LibC/String/Copying.c > +++ b/StdLib/LibC/String/Copying.c > @@ -39,6 +39,7 @@ memcpy(void * __restrict s1, const void * __restrict s2= , > size_t n) > } > #endif /* !(defined(MDE_CPU_IPF) && defined(__GCC)) */ >=20 > +#if !(defined(MDE_CPU_ARM) && defined(__GNUC__)) > /** The memmove function copies n characters from the object pointed to > by s2 > into the object pointed to by s1. Copying takes place as if the n > characters from the object pointed to by s2 are first copied into a > @@ -57,6 +58,7 @@ memmove(void *s1, const void *s2, size_t n) > { > return CopyMem( s1, s2, n); > } > +#endif >=20 > /** The strcpy function copies the string pointed to by s2 (including th= e > terminating null character) into the array pointed to by s1. If copy= ing > diff --git a/StdLib/LibC/String/Misc.c b/StdLib/LibC/String/Misc.c > index 99328252ed50..f024136446e7 100644 > --- a/StdLib/LibC/String/Misc.c > +++ b/StdLib/LibC/String/Misc.c > @@ -26,6 +26,7 @@ >=20 > extern char *sys_errlist[]; >=20 > +#if !((defined(MDE_CPU_ARM) || defined(MDE_CPU_AARCH64)) && > defined(__GNUC__)) > /** The memset function copies the value of c (converted to an unsigned > char) > into each of the first n characters of the object pointed to by s. >=20 > @@ -36,6 +37,7 @@ memset(void *s, int c, size_t n) > { > return SetMem( s, (UINTN)n, (UINT8)c); > } > +#endif >=20 > int > strerror_r(int errnum, char *buf, size_t buflen) > -- > 2.7.4