summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2015-11-28 12:44:23 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2015-11-28 12:44:23 +0000
commitf94bb99adce9eb58a5d28e9e9aa6a311b54efa27 (patch)
treedfdab0f5e4f2cec74dbc96e5d9742e71ec5368ba /compiler-rt/lib/sanitizer_common/sanitizer_asm.h
parentf12b925bb17eb491ddcd2e2047887375f56554e6 (diff)
downloadbcm5719-llvm-f94bb99adce9eb58a5d28e9e9aa6a311b54efa27.tar.gz
bcm5719-llvm-f94bb99adce9eb58a5d28e9e9aa6a311b54efa27.zip
[tsan] Port tsan_rtl_amd64.S to OS X to add support for setjmp/longjmp
This patch ports the assembly file tsan_rtl_amd64.S to OS X, where we need several changes: * Some assembler directives are not available on OS X (.hidden, .type, .size) * Symbol names need to start with an underscore (added a ASM_TSAN_SYMBOL macro for that). * To make the interceptors work, we ween to name the function "_wrap_setjmp" (added ASM_TSAN_SYMBOL_INTERCEPTOR for that). * Calling the original setjmp is done with a simple "jmp _setjmp". * __sigsetjmp doesn't exist on OS X. Differential Revision: http://reviews.llvm.org/D14947 llvm-svn: 254228
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_asm.h')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_asm.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
index 731f1a539d5..47c2b12a204 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_asm.h
@@ -43,4 +43,16 @@
# define CFI_RESTORE(reg)
#endif
-
+#if !defined(__APPLE__)
+# define ASM_HIDDEN(symbol) .hidden symbol
+# define ASM_TYPE_FUNCTION(symbol) .type symbol, @function
+# define ASM_SIZE(symbol) .size symbol, .-symbol
+# define ASM_TSAN_SYMBOL(symbol) symbol
+# define ASM_TSAN_SYMBOL_INTERCEPTOR(symbol) symbol
+#else
+# define ASM_HIDDEN(symbol)
+# define ASM_TYPE_FUNCTION(symbol)
+# define ASM_SIZE(symbol)
+# define ASM_TSAN_SYMBOL(symbol) _##symbol
+# define ASM_TSAN_SYMBOL_INTERCEPTOR(symbol) _wrap_##symbol
+#endif
OpenPOWER on IntegriCloud