[sanitizer] Add i686 arch to compiler-rt.

This is needed so we can produce -i686- named libraries for
x86 Android (which is i686-linux-android).

An alternative solution would be keeping the "i386" name internally and
tweaking the OUTPUT_NAME of compiler-rt libraries.

llvm-svn: 218761
This commit is contained in:
Evgeniy Stepanov 2014-10-01 12:55:06 +00:00
parent 5091372331
commit 0f7ab59adc
5 changed files with 14 additions and 7 deletions

View File

@ -96,6 +96,7 @@ macro(detect_target_arch)
check_symbol_exists(__arm__ "" __ARM)
check_symbol_exists(__aarch64__ "" __AARCH64)
check_symbol_exists(__x86_64__ "" __X86_64)
check_symbol_exists(__i686__ "" __I686)
check_symbol_exists(__i386__ "" __I386)
check_symbol_exists(__mips__ "" __MIPS)
check_symbol_exists(__mips64__ "" __MIPS64)
@ -105,6 +106,8 @@ macro(detect_target_arch)
add_default_target_arch(aarch64)
elseif(__X86_64)
add_default_target_arch(x86_64)
elseif(__I686)
add_default_target_arch(i686)
elseif(__I386)
add_default_target_arch(i386)
elseif(__MIPS64) # must be checked before __MIPS
@ -155,9 +158,9 @@ endfunction()
# Arhcitectures supported by compiler-rt libraries.
filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
x86_64 i386 powerpc64 arm aarch64 mips)
x86_64 i386 i686 powerpc64 arm aarch64 mips)
filter_available_targets(ASAN_SUPPORTED_ARCH
x86_64 i386 powerpc64 arm mips)
x86_64 i386 i686 powerpc64 arm mips)
filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64)
filter_available_targets(LSAN_SUPPORTED_ARCH x86_64)
# LSan common files should be available on all architectures supported
@ -165,9 +168,9 @@ filter_available_targets(LSAN_SUPPORTED_ARCH x86_64)
filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH
${SANITIZER_COMMON_SUPPORTED_ARCH})
filter_available_targets(MSAN_SUPPORTED_ARCH x86_64)
filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 arm aarch64)
filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64)
filter_available_targets(TSAN_SUPPORTED_ARCH x86_64)
filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 arm aarch64 mips)
filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips)
if(ANDROID)
set(OS_NAME "Android")

View File

@ -161,7 +161,7 @@ else()
add_dependencies(asan clang_rt.asan-dynamic-${arch})
endif()
if (UNIX AND NOT ${arch} STREQUAL "i386")
if (UNIX AND NOT ${arch} STREQUAL "i386" AND NOT ${arch} STREQUAL "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)

View File

@ -163,6 +163,9 @@ set(i386_SOURCES
i386/umoddi3.S
${GENERIC_SOURCES})
set(i686_SOURCES
${i386_SOURCES})
set(arm_SOURCES
arm/adddf3vfp.S
arm/addsf3vfp.S
@ -250,7 +253,7 @@ set(arm_SOURCES
add_custom_target(builtins)
if (NOT WIN32)
foreach (arch x86_64 i386 arm)
foreach (arch x86_64 i386 i686 arm)
if (CAN_TARGET_${arch})
# Filter out generic versions of routines that are re-implemented in
# architecture specific manner. This prevents multiple definitions of the

View File

@ -44,7 +44,7 @@ else()
clang_rt.san-${arch}
clang_rt.ubsan-${arch}
clang_rt.ubsan_cxx-${arch})
if (UNIX AND NOT ${arch} STREQUAL "i386")
if (UNIX AND NOT ${arch} STREQUAL "i386" AND NOT ${arch} STREQUAL "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

View File

@ -5,6 +5,7 @@ set(ASAN_TESTSUITES)
macro(get_bits_for_arch arch bits)
if (${arch} STREQUAL "arm" OR
${arch} STREQUAL "i386" OR
${arch} STREQUAL "i686" OR
${arch} STREQUAL "mips")
set(bits 32)
elseif (${arch} STREQUAL "aarch64" OR