summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_linux.cc
diff options
context:
space:
mode:
authorViktor Kutuzov <vkutuzov@accesssoftek.com>2014-06-15 13:56:28 +0000
committerViktor Kutuzov <vkutuzov@accesssoftek.com>2014-06-15 13:56:28 +0000
commit1f386f0f364183d85d636ff7be160712fc4bb5b8 (patch)
tree38a91597c205b1b7b8192a6845e335300cf38dd4 /compiler-rt/lib/asan/asan_linux.cc
parent004c49b0176300b1b141368c884cb51d4b41fb22 (diff)
downloadbcm5719-llvm-1f386f0f364183d85d636ff7be160712fc4bb5b8.tar.gz
bcm5719-llvm-1f386f0f364183d85d636ff7be160712fc4bb5b8.zip
Fix getting IP, BP and SP for address sanitizer's needs on FreeBSD in 32-bit mode
llvm-svn: 210988
Diffstat (limited to 'compiler-rt/lib/asan/asan_linux.cc')
-rw-r--r--compiler-rt/lib/asan/asan_linux.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/compiler-rt/lib/asan/asan_linux.cc b/compiler-rt/lib/asan/asan_linux.cc
index b3c45ee8632..fdd009c960d 100644
--- a/compiler-rt/lib/asan/asan_linux.cc
+++ b/compiler-rt/lib/asan/asan_linux.cc
@@ -19,6 +19,7 @@
#include "asan_internal.h"
#include "asan_thread.h"
#include "sanitizer_common/sanitizer_flags.h"
+#include "sanitizer_common/sanitizer_freebsd.h"
#include "sanitizer_common/sanitizer_libc.h"
#include "sanitizer_common/sanitizer_procmaps.h"
@@ -46,15 +47,11 @@ extern "C" void* _DYNAMIC;
#include <link.h>
#endif
-// x86_64 FreeBSD 9.2 and older define 64-bit register names in both 64-bit
-// and 32-bit modes.
-#if SANITIZER_FREEBSD
-#include <sys/param.h>
-# if __FreeBSD_version <= 902001 // v9.2
-# define mc_eip mc_rip
-# define mc_ebp mc_rbp
-# define mc_esp mc_rsp
-# endif
+// x86-64 FreeBSD 9.2 and older define 'ucontext_t' incorrectly in
+// 32-bit mode.
+#if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32) && \
+ __FreeBSD_version <= 902001 // v9.2
+#define ucontext_t xucontext_t
#endif
typedef enum {
OpenPOWER on IntegriCloud