if("${LLVM_NATIVE_ARCH}" STREQUAL "X86")
if(NOT MSVC)
test_target_arch(x86_64 "" "-m64")
- test_target_arch(i386 __i386__ "-m32")
test_target_arch(i686 __i686__ "-m32")
+ if(NOT CAN_TARGET_i686)
+ test_target_arch(i386 __i386__ "-m32")
+ endif()
else()
test_target_arch(i386 "" "")
endif()
target_link_libraries(clang_rt.asan-dynamic-${arch} ${ASAN_DYNAMIC_LIBS})
add_dependencies(asan clang_rt.asan-dynamic-${arch})
- if (UNIX AND NOT ${arch} STREQUAL "i386" AND NOT ${arch} STREQUAL "i686")
+ if (UNIX AND NOT ${arch} MATCHES "i386|i686")
add_sanitizer_rt_symbols(clang_rt.asan_cxx-${arch})
add_dependencies(asan clang_rt.asan_cxx-${arch}-symbols)
add_sanitizer_rt_symbols(clang_rt.asan-${arch} asan.syms.extra)
clang_rt.san-${arch}
clang_rt.ubsan-${arch}
clang_rt.ubsan_cxx-${arch})
- if (UNIX AND NOT ${arch} STREQUAL "i386" AND NOT ${arch} STREQUAL "i686")
+ if (UNIX AND NOT ${arch} MATCHES "i386|i686")
add_sanitizer_rt_symbols(clang_rt.ubsan-${arch} ubsan.syms.extra)
add_sanitizer_rt_symbols(clang_rt.ubsan_cxx-${arch} ubsan.syms.extra)
add_dependencies(ubsan