From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org, leif.lindholm@linaro.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH] ArmPkg/CompilerIntrinsicsLib: use Clang-compatible 'weak' attribute
Date: Tue, 6 Sep 2016 15:27:31 +0100 [thread overview]
Message-ID: <1473172051-25022-1-git-send-email-ard.biesheuvel@linaro.org> (raw)
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>
---
Note that the CI job is currently broken due to this clang issue.
ArmPkg/Library/CompilerIntrinsicsLib/memset.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
index 0d837fcecf09..7271b4be6f96 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/memset.c
@@ -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);
--
2.7.4
next reply other threads:[~2016-09-06 14:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 14:27 Ard Biesheuvel [this message]
2016-09-06 14:38 ` [PATCH] ArmPkg/CompilerIntrinsicsLib: use Clang-compatible 'weak' attribute Leif Lindholm
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=1473172051-25022-1-git-send-email-ard.biesheuvel@linaro.org \
--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