forked from OSchip/llvm-project
[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:
parent
812465436b
commit
7494dc5e55
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue