summaryrefslogtreecommitdiffstats
path: root/llvm/cmake
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-11-24 08:04:59 +0000
committerChris Bieneman <beanz@apple.com>2015-11-24 08:04:59 +0000
commit7494dc5e5562e2f14cc00a4b1c3f910e63c7f119 (patch)
tree641b4f98c47026b3200236eda5a6df7238fd2d63 /llvm/cmake
parent812465436bb1ac9fe7652d0df01c0b3d77dddb9e (diff)
downloadbcm5719-llvm-7494dc5e5562e2f14cc00a4b1c3f910e63c7f119.tar.gz
bcm5719-llvm-7494dc5e5562e2f14cc00a4b1c3f910e63c7f119.zip
[CMake] When disabling PIC, also pass -fno-pie when linking if it is supported.
Building clang with -fno-pie generates slightly faster code. In my not-very-rigorous testing I saw about a 4% speed up using the clang test-suite sources. llvm-svn: 253959
Diffstat (limited to 'llvm/cmake')
-rwxr-xr-xllvm/cmake/config-ix.cmake4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index c984a19e85f..4b342bc586b 100755
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -299,6 +299,10 @@ if( LLVM_ENABLE_PIC )
set(ENABLE_PIC 1)
else()
set(ENABLE_PIC 0)
+ check_cxx_compiler_flag("-fno-pie" SUPPORTS_NO_PIE_FLAG)
+ if(SUPPORTS_NO_PIE_FLAG)
+ list(APPEND CMAKE_EXE_LINKER_FLAGS "-fno-pie")
+ endif()
endif()
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
OpenPOWER on IntegriCloud