Index: compiler-rt/cmake/Modules/AddCompilerRT.cmake =================================================================== --- compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -262,10 +262,11 @@ 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 "") - string(REPLACE "" "${CMAKE_C_COMPILER}" + string(REPLACE "" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" compile_command_${libname} ${compile_command_${libname}}) elseif(substitution STREQUAL "") string(REPLACE "" "${output_dir_${libname}}/${output_file_${libname}}" Index: compiler-rt/lib/crt/CMakeLists.txt =================================================================== --- compiler-rt/lib/crt/CMakeLists.txt +++ compiler-rt/lib/crt/CMakeLists.txt @@ -25,8 +25,8 @@ set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}") foreach(substitution ${substitutions}) if(substitution STREQUAL "") - string(REPLACE "" - "${CMAKE_C_COMPILER}" test_compile_command ${test_compile_command}) + string(REPLACE "" "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}" + test_compile_command ${test_compile_command}) elseif(substitution STREQUAL "") string(REPLACE "" "${TARGET_NAME}/CheckSectionExists.o" test_compile_command ${test_compile_command})