public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Carsey, Jaben" <jaben.carsey@intel.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"edk2-lists@mc2research.org" <edk2-lists@mc2research.org>
Cc: "sigmaepsilon92@gmail.com" <sigmaepsilon92@gmail.com>,
	"leif.lindholm@linaro.org" <leif.lindholm@linaro.org>,
	"Carsey, Jaben" <jaben.carsey@intel.com>
Subject: Re: [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine compiler intrinsics
Date: Mon, 8 Aug 2016 14:56:31 +0000	[thread overview]
Message-ID: <CB6E33457884FA40993F35157061515C54A187EC@FMSMSX103.amr.corp.intel.com> (raw)
In-Reply-To: <1470654741-24203-2-git-send-email-ard.biesheuvel@linaro.org>

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>

> -----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
> <jaben.carsey@intel.com>
> Cc: sigmaepsilon92@gmail.com; leif.lindholm@linaro.org; Ard Biesheuvel
> <ard.biesheuvel@linaro.org>
> Subject: [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine compiler
> intrinsics
> Importance: High
> 
> 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.
> 
> So simply omit them for ARM/AARCH64 resp. ARM.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  StdLib/LibC/String/Copying.c | 2 ++
>  StdLib/LibC/String/Misc.c    | 2 ++
>  2 files changed, 4 insertions(+)
> 
> 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)) */
> 
> +#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
> 
>  /** The strcpy function copies the string pointed to by s2 (including the
>      terminating null character) into the array pointed to by s1. If copying
> 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 @@
> 
>  extern char *sys_errlist[];
> 
> +#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.
> 
> @@ -36,6 +37,7 @@ memset(void *s, int c, size_t n)
>  {
>    return SetMem( s, (UINTN)n, (UINT8)c);
>  }
> +#endif
> 
>  int
>  strerror_r(int errnum, char *buf, size_t buflen)
> --
> 2.7.4



  reply	other threads:[~2016-08-08 14:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 11:12 [PATCH 1/2] StdLib/LibC: avoid LTO code for compiler intrinsics Ard Biesheuvel
2016-08-08 11:12 ` [PATCH 2/2] StdLib/LibC ARM AARCH64: do not redefine " Ard Biesheuvel
2016-08-08 14:56   ` Carsey, Jaben [this message]
2016-08-08 11:24 ` [PATCH 1/2] StdLib/LibC: avoid LTO code for " Michael Zimmermann
2016-08-08 14:56   ` Carsey, Jaben
2016-08-09  8:13     ` Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CB6E33457884FA40993F35157061515C54A187EC@FMSMSX103.amr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox