public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-5693] sanitizer: Fix build on SPARC/Solaris with Solaris as [PR112562]
@ 2023-11-21 20:03 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2023-11-21 20:03 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:c7c1ee1cfdea228f79ba9d495b407f3689efc608
commit r14-5693-gc7c1ee1cfdea228f79ba9d495b407f3689efc608
Author: Jakub Jelinek <jakub@redhat.com>
Date: Tue Nov 21 21:01:48 2023 +0100
sanitizer: Fix build on SPARC/Solaris with Solaris as [PR112562]
Solaris as apparently doesn't accept %function and requires @function
instead.
This cherry-picks upstream commit.
2023-11-21 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/112562
* sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision
a855a16a02e76a0f4192c038bb64f3773947a2f7.
* interception/interception.h: Likewise.
Diff:
---
libsanitizer/interception/interception.h | 8 +++++++-
libsanitizer/sanitizer_common/sanitizer_asm.h | 6 +++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/libsanitizer/interception/interception.h b/libsanitizer/interception/interception.h
index 069f73d276f..9d8b60b2eef 100644
--- a/libsanitizer/interception/interception.h
+++ b/libsanitizer/interception/interception.h
@@ -185,6 +185,11 @@ const interpose_substitution substitution_##func_name[] \
# else
# define __ASM_WEAK_WRAPPER(func) ".weak " #func "\n"
# endif // SANITIZER_FREEBSD || SANITIZER_NETBSD
+# if defined(__arm__) || defined(__aarch64__)
+# define ASM_TYPE_FUNCTION_STR "%function"
+# else
+# define ASM_TYPE_FUNCTION_STR "@function"
+# endif
// Keep trampoline implementation in sync with sanitizer_common/sanitizer_asm.h
# define DECLARE_WRAPPER(ret_type, func, ...) \
extern "C" ret_type func(__VA_ARGS__); \
@@ -196,7 +201,8 @@ const interpose_substitution substitution_##func_name[] \
__ASM_WEAK_WRAPPER(func) \
".set " #func ", " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n" \
".globl " SANITIZER_STRINGIFY(TRAMPOLINE(func)) "\n" \
- ".type " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", %function\n" \
+ ".type " SANITIZER_STRINGIFY(TRAMPOLINE(func)) ", " \
+ ASM_TYPE_FUNCTION_STR "\n" \
SANITIZER_STRINGIFY(TRAMPOLINE(func)) ":\n" \
SANITIZER_STRINGIFY(CFI_STARTPROC) "\n" \
SANITIZER_STRINGIFY(ASM_TAIL_CALL) " __interceptor_" \
diff --git a/libsanitizer/sanitizer_common/sanitizer_asm.h b/libsanitizer/sanitizer_common/sanitizer_asm.h
index 3c9bbdc9678..bbb18cfbdf1 100644
--- a/libsanitizer/sanitizer_common/sanitizer_asm.h
+++ b/libsanitizer/sanitizer_common/sanitizer_asm.h
@@ -62,7 +62,11 @@
#if !defined(__APPLE__)
# define ASM_HIDDEN(symbol) .hidden symbol
-# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
+# if defined(__arm__) || defined(__aarch64__)
+# define ASM_TYPE_FUNCTION(symbol) .type symbol, %function
+# else
+# define ASM_TYPE_FUNCTION(symbol) .type symbol, @function
+# endif
# define ASM_SIZE(symbol) .size symbol, .-symbol
# define ASM_SYMBOL(symbol) symbol
# define ASM_SYMBOL_INTERCEPTOR(symbol) symbol
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-21 20:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 20:03 [gcc r14-5693] sanitizer: Fix build on SPARC/Solaris with Solaris as [PR112562] Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).