Index: cmake/config-ix.cmake =================================================================== --- cmake/config-ix.cmake +++ cmake/config-ix.cmake @@ -196,11 +196,11 @@ # FIXME: Ideally, we would build the N32 library too. if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "mipsel|mips64el") # regex for mipsel, mips64el - test_target_arch(mipsel "" "-mips32r2") - test_target_arch(mips64el "" "-mips64r2 -mabi=n64") + test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu") + test_target_arch(mips64el "" "-mips64r2" "-mabi=n64") else() - test_target_arch(mips "" "-mips32r2") - test_target_arch(mips64 "" "-mips64r2 -mabi=n64") + test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu") + test_target_arch(mips64 "" "-mips64r2" "-mabi=n64") endif() elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm") test_target_arch(arm "" "-march=armv7-a") @@ -226,6 +226,7 @@ set(${out_var} ${archs} PARENT_SCOPE) endfunction() +# Returns a list of architecture specific target cflags in @out_var list. function(get_target_flags_for_arch arch out_var) list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) if(ARCH_INDEX EQUAL -1) Index: test/asan/CMakeLists.txt =================================================================== --- test/asan/CMakeLists.txt +++ test/asan/CMakeLists.txt @@ -28,6 +28,7 @@ set(ASAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} ASAN_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " ASAN_TEST_TARGET_CFLAGS "${ASAN_TEST_TARGET_CFLAGS}") endif() if(ANDROID) set(ASAN_TEST_DYNAMIC True) Index: test/sanitizer_common/CMakeLists.txt =================================================================== --- test/sanitizer_common/CMakeLists.txt +++ test/sanitizer_common/CMakeLists.txt @@ -28,6 +28,7 @@ ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS "${SANITIZER_COMMON_TEST_TARGET_CFLAGS}") endif() set(CONFIG_NAME ${tool}-${arch}-${OS_NAME}) configure_lit_site_cfg( Index: test/ubsan/CMakeLists.txt =================================================================== --- test/ubsan/CMakeLists.txt +++ test/ubsan/CMakeLists.txt @@ -22,6 +22,7 @@ set(UBSAN_TEST_TARGET_CFLAGS ${COMPILER_RT_TEST_COMPILER_CFLAGS}) else() get_target_flags_for_arch(${arch} UBSAN_TEST_TARGET_CFLAGS) + string(REPLACE ";" " " UBSAN_TEST_TARGET_CFLAGS "${UBSAN_TEST_TARGET_CFLAGS}") endif() add_ubsan_testsuite("Standalone" ubsan ${arch})