[PATCH] D43613: Msan, cmake configuration changes

David CARLIER via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 01:13:08 PST 2018


devnexen created this revision.
Herald added subscribers: Sanitizers, llvm-commits, krytarowski, mgorny, emaste.
devnexen added a comment.
devnexen added reviewers: vitalybuka, krytarowski.

As discussed here https://reviews.llvm.org/D43080 this is the specific change into Msan cmake configuration part.


- Applies tls-exec generally, on FreeBSD despite enabling it in Msan, the TLS part does not execute.
- Suppress PIE which does not go together with PIC in FreeBSD (linkage issue when trying to compile code with msan flag).


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43613

Files:
  lib/msan/CMakeLists.txt


Index: lib/msan/CMakeLists.txt
===================================================================
--- lib/msan/CMakeLists.txt
+++ lib/msan/CMakeLists.txt
@@ -17,8 +17,11 @@
 
 
 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: D43613.135371.patch
Type: text/x-patch
Size: 680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180222/5e91aea5/attachment.bin>


More information about the llvm-commits mailing list