Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -275,6 +275,7 @@ if (${condition}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${var}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${var}") + list(APPEND LIBCXXABI_COMPILE_FLAGS ${var}) list(APPEND LIBCXXABI_LINK_FLAGS ${var}) endif() endmacro() @@ -287,9 +288,9 @@ # Configure target flags add_target_flags_if(LIBCXXABI_BUILD_32_BITS "-m32") add_target_flags_if(LIBCXXABI_TARGET_TRIPLE - "-target ${LIBCXXABI_TARGET_TRIPLE}") + "--target=${LIBCXXABI_TARGET_TRIPLE}") add_target_flags_if(LIBCXXABI_GCC_TOOLCHAIN - "-gcc-toolchain ${LIBCXXABI_GCC_TOOLCHAIN}") + "--gcc-toolchain=${LIBCXXABI_GCC_TOOLCHAIN}") add_target_flags_if(LIBCXXABI_SYSROOT "--sysroot=${LIBCXXABI_SYSROOT}") Index: cmake/Modules/HandleCompilerRT.cmake =================================================================== --- cmake/Modules/HandleCompilerRT.cmake +++ cmake/Modules/HandleCompilerRT.cmake @@ -3,7 +3,7 @@ message(FATAL_ERROR "LIBCXXABI_COMPILE_FLAGS must be defined when using this function") endif() set(dest "" PARENT_SCOPE) - set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${TARGET_TRIPLE} ${LIBCXXABI_COMPILE_FLAGS} + set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXXABI_COMPILE_FLAGS} "--rtlib=compiler-rt" "--print-libgcc-file-name") if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET) list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}")