[compiler-rt] r178340 - [TSan] Build TSan runtime with -fPIE.

Alexander Potapenko glider at google.com
Fri Mar 29 02:44:11 PDT 2013


Author: glider
Date: Fri Mar 29 04:44:11 2013
New Revision: 178340

URL: http://llvm.org/viewvc/llvm-project?rev=178340&view=rev
Log:
[TSan] Build TSan runtime with -fPIE.
This removes all register spills from the performance-critical __tsan_{read,write}{1,2,4,8} functions when the host compiler is GCC.

Modified:
    compiler-rt/trunk/lib/tsan/CMakeLists.txt

Modified: compiler-rt/trunk/lib/tsan/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/CMakeLists.txt?rev=178340&r1=178339&r2=178340&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/tsan/CMakeLists.txt Fri Mar 29 04:44:11 2013
@@ -2,8 +2,11 @@
 
 include_directories(..)
 
+# SANITIZER_COMMON_CFLAGS contains -fPIC, but it's performance-critical for
+# TSan runtime to be built with -fPIE to reduce the number of register spills.
 set(TSAN_CFLAGS
   ${SANITIZER_COMMON_CFLAGS}
+  -fPIE
   -fno-rtti)
 # FIXME: Add support for compile flags:
 #   -Wframe-larger-than=512,





More information about the llvm-commits mailing list