ArmPkg/CompilerIntrinsicsLib: use Clang-compatible 'weak' attribute

Clang does not like separate definitions for the __alias__ and the
__weak__ attributes, so merge the definitions into one.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
This commit is contained in:
Ard Biesheuvel 2016-09-06 15:25:03 +01:00
parent 4c0b2d25c6
commit ec68dc2855
1 changed files with 3 additions and 6 deletions

View File

@ -26,20 +26,17 @@ void *__memset(void *s, int c, size_t n)
return s;
}
__attribute__((__alias__("__memset")))
void *memset(void *dest, int c, size_t n);
#ifdef __arm__
//
// Other modules (such as CryptoPkg/IntrinsicLib) may provide another
// implementation of memset(), which may conflict with this one if this
// object was pulled into the link due to the definitions below. So make
// our memset() 'weak' to let the other implementation take precedence.
//
__attribute__((__weak__))
__attribute__((__weak__, __alias__("__memset")))
void *memset(void *dest, int c, size_t n);
#ifdef __arm__
void __aeabi_memset(void *dest, size_t n, int c)
{
__memset(dest, c, n);