Skip to content

Commit

Permalink
Use CMAKE_C_COMPILER_ARG1 in compiler invocation
Browse files Browse the repository at this point in the history
This is needed when using compiler wrappers such as ccache or distcc
and should address the failure on clang-x86_64-debian-fast bot.

Differential Revision: https://reviews.llvm.org/D62104

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@361111 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
petrhosek committed May 19, 2019
1 parent 167c4e9 commit fd09e55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmake/Modules/AddCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,11 @@ function(add_compiler_rt_runtime name type)
string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions
${CMAKE_C_COMPILE_OBJECT})
set(compile_command_${libname} "${CMAKE_C_COMPILE_OBJECT}")

set(output_file_${libname} ${output_name_${libname}}${CMAKE_C_OUTPUT_EXTENSION})
foreach(substitution ${substitutions})
if(substitution STREQUAL "<CMAKE_C_COMPILER>")
string(REPLACE "<CMAKE_C_COMPILER>" "${CMAKE_C_COMPILER}"
string(REPLACE "<CMAKE_C_COMPILER>" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}"
compile_command_${libname} ${compile_command_${libname}})
elseif(substitution STREQUAL "<OBJECT>")
string(REPLACE "<OBJECT>" "${output_dir_${libname}}/${output_file_${libname}}"
Expand Down
4 changes: 2 additions & 2 deletions lib/crt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ function(check_cxx_section_exists section output)
set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}")
foreach(substitution ${substitutions})
if(substitution STREQUAL "<CMAKE_C_COMPILER>")
string(REPLACE "<CMAKE_C_COMPILER>"
"${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command})
string(REPLACE "<CMAKE_C_COMPILER>" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}"
test_compile_command ${test_compile_command})
elseif(substitution STREQUAL "<OBJECT>")
string(REPLACE "<OBJECT>" "${TARGET_NAME}/CheckSectionExists.o"
test_compile_command ${test_compile_command})
Expand Down

0 comments on commit fd09e55

Please sign in to comment.