diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake --- a/llvm/cmake/config-ix.cmake +++ b/llvm/cmake/config-ix.cmake @@ -408,12 +408,19 @@ set(ENABLE_PIC 1) else() set(ENABLE_PIC 0) - check_cxx_compiler_flag("-fno-pie" SUPPORTS_NO_PIE_FLAG) - if(SUPPORTS_NO_PIE_FLAG) + check_cxx_compiler_flag("-fno-pie" SUPPORTS_FNO_PIE_FLAG) + if(SUPPORTS_FNO_PIE_FLAG) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fno-pie") endif() endif() +# In case the linker enables PIE by default, disable it for much faster lit +# testing. +check_cxx_compiler_flag("-no-pie" SUPPORTS_NO_PIE_FLAG) +if(SUPPORTS_NO_PIE_FLAG) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -no-pie") +endif() + check_cxx_compiler_flag("-Wvariadic-macros" SUPPORTS_VARIADIC_MACROS_FLAG) check_cxx_compiler_flag("-Wgnu-zero-variadic-macro-arguments" SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG)