[PATCH] D43080: Adding Msan support to FreeBSD
David CARLIER via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 9 03:01:34 PST 2018
devnexen updated this revision to Diff 133577.
devnexen retitled this revision from "Addind Msan support to FreeBSD" to "Adding Msan support to FreeBSD".
devnexen added a comment.
State of check-msan target
Testing Time: 32.72s
Expected Passes : 97
Expected Failures : 1
Unsupported Tests : 37
[100%] Built target check-msan
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D43080
Files:
msan/CMakeLists.txt
msan/msan_interceptors.cc
sanitizer_common/sanitizer_tls_get_addr.cc
Index: sanitizer_common/sanitizer_tls_get_addr.cc
===================================================================
--- sanitizer_common/sanitizer_tls_get_addr.cc
+++ sanitizer_common/sanitizer_tls_get_addr.cc
@@ -142,7 +142,8 @@
#else
void DTLS_on_libc_memalign(void *ptr, uptr size) {}
-DTLS::DTV *DTLS_on_tls_get_addr(void *arg, void *res) { return 0; }
+DTLS::DTV *DTLS_on_tls_get_addr(void *arg, void *res,
+ unsigned long, unsigned long) { return 0; }
DTLS *DTLS_Get() { return 0; }
void DTLS_Destroy() {}
bool DTLSInDestruction(DTLS *dtls) {
Index: msan/msan_interceptors.cc
===================================================================
--- msan/msan_interceptors.cc
+++ msan/msan_interceptors.cc
@@ -680,7 +680,7 @@
return res;
}
-#if SANITIZER_NETBSD
+#if SANITIZER_NETBSD || SANITIZER_FREEBSD
INTERCEPTOR(int, fstat, int fd, void *buf) {
ENSURE_MSAN_INITED();
int res = REAL(fstat)(fd, buf);
@@ -1275,6 +1275,7 @@
} while (false) // FIXME
#define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name)
#define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit()
+#if !SANITIZER_FREEBSD
#define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \
do { \
link_map *map = GET_LINK_MAP_BY_DLOPEN_HANDLE((handle)); \
@@ -1281,6 +1282,9 @@
if (filename && map) \
ForEachMappedRegion(map, __msan_unpoison); \
} while (false)
+#else
+#define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle)
+#endif
#define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end) \
if (MsanThread *t = GetCurrentThread()) { \
Index: msan/CMakeLists.txt
===================================================================
--- msan/CMakeLists.txt
+++ msan/CMakeLists.txt
@@ -17,8 +17,12 @@
set(MSAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS})
+append_list_if(COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC
+ -ftls-model=initial-exec MSAN_RTL_CFLAGS)
append_rtti_flag(OFF MSAN_RTL_CFLAGS)
-append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS)
+if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ append_list_if(COMPILER_RT_HAS_FPIE_FLAG -fPIE MSAN_RTL_CFLAGS)
+endif()
# Prevent clang from generating libc calls.
append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding MSAN_RTL_CFLAGS)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43080.133577.patch
Type: text/x-patch
Size: 2476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180209/63fa8069/attachment.bin>
More information about the llvm-commits
mailing list