1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[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
This commit is contained in:
Chris Bieneman 2015-11-24 08:04:59 +00:00
parent 2c11bd56d2
commit fc7b01b423

View File

@ -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)