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:
parent
2c11bd56d2
commit
fc7b01b423
@ -299,6 +299,10 @@ if( LLVM_ENABLE_PIC )
|
|||||||
set(ENABLE_PIC 1)
|
set(ENABLE_PIC 1)
|
||||||
else()
|
else()
|
||||||
set(ENABLE_PIC 0)
|
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()
|
endif()
|
||||||
|
|
||||||
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
|
check_cxx_compiler_flag("-Wno-variadic-macros" SUPPORTS_NO_VARIADIC_MACROS_FLAG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user