Index: compiler-rt/cmake/Modules/CompilerRTUtils.cmake =================================================================== --- compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -337,7 +337,10 @@ function(get_compiler_rt_target arch variable) string(FIND ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} "-" dash_index) string(SUBSTRING ${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${dash_index} -1 triple_suffix) - if(ANDROID AND ${arch} STREQUAL "i386") + if(COMPILER_RT_DEFAULT_TARGET_ONLY) + # Use exact spelling when building only for the target specified to CMake. + set(target "${COMPILER_RT_DEFAULT_TARGET_TRIPLE}") + elseif(ANDROID AND ${arch} STREQUAL "i386") set(target "i686${COMPILER_RT_OS_SUFFIX}${triple_suffix}") else() set(target "${arch}${triple_suffix}")