Skip to content

Commit

Permalink
Enable compilation of RT on ARM
Browse files Browse the repository at this point in the history
Adding the ARM RT sources to the CMake files, and enabling some
sanitizers to also build on ARM. This is far from supported or
production quality, but enabling it to build will get us errors
that we can actually fix.

Having said that, the Compiler-RT and the Asan libraries are
know to work on some variations of ARM.

llvm-svn: 200546
  • Loading branch information
rengolin committed Jan 31, 2014
1 parent e7a971b commit 66e2b70
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 4 deletions.
4 changes: 3 additions & 1 deletion compiler-rt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ if("${LLVM_NATIVE_ARCH}" STREQUAL "X86")
test_target_arch(i386 ${TARGET_32_BIT_CFLAGS})
elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC")
test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS})
elseif("${LLVM_NATIVE_ARCH}" STREQUAL "ARM")
test_target_arch(arm "")
endif()

# We only support running instrumented tests when we're not cross compiling
Expand Down Expand Up @@ -212,7 +214,7 @@ endif()
# Architectures supported by Sanitizer runtimes. Specific sanitizers may
# support only subset of these (e.g. TSan works on x86_64 only).
filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
x86_64 i386 powerpc64)
x86_64 i386 powerpc64 arm)

add_subdirectory(include)

Expand Down
66 changes: 65 additions & 1 deletion compiler-rt/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,72 @@ set(i386_SOURCES
i386/umoddi3.S
${GENERIC_SOURCES})

set(arm_SOURCES
arm/adddf3vfp.S
arm/extendsfdf2vfp.S
arm/nedf2vfp.S
arm/addsf3vfp.S
arm/fixdfsivfp.S
arm/negdf2vfp.S
arm/aeabi_dcmp.S
arm/fixsfsivfp.S
arm/negsf2vfp.S
arm/aeabi_fcmp.S
arm/fixunsdfsivfp.S
arm/nesf2vfp.S
arm/aeabi_idivmod.S
arm/fixunssfsivfp.S
arm/restore_vfp_d8_d15_regs.S
arm/aeabi_ldivmod.S
arm/floatsidfvfp.S
arm/save_vfp_d8_d15_regs.S
arm/aeabi_memcmp.S
arm/floatsisfvfp.S
arm/aeabi_memcpy.S
arm/floatunssidfvfp.S
arm/subdf3vfp.S
arm/aeabi_memmove.S
arm/floatunssisfvfp.S
arm/subsf3vfp.S
arm/aeabi_memset.S
arm/gedf2vfp.S
arm/switch16.S
arm/aeabi_uidivmod.S
arm/gesf2vfp.S
arm/switch32.S
arm/aeabi_uldivmod.S
arm/gtdf2vfp.S
arm/switch8.S
arm/bswapdi2.S
arm/gtsf2vfp.S
arm/switchu8.S
arm/bswapsi2.S
arm/ledf2vfp.S
arm/sync_synchronize.S
arm/comparesf2.S
arm/lesf2vfp.S
arm/truncdfsf2vfp.S
arm/divdf3vfp.S
arm/ltdf2vfp.S
arm/udivmodsi4.S
arm/divmodsi4.S
arm/ltsf2vfp.S
arm/udivsi3.S
arm/divsf3vfp.S
arm/Makefile.mk
arm/umodsi3.S
arm/divsi3.S
arm/modsi3.S
arm/unorddf2vfp.S
arm/eqdf2vfp.S
arm/muldf3vfp.S
arm/unordsf2vfp.S
arm/eqsf2vfp.S
arm/mulsf3vfp.S
${GENERIC_SOURCES})

if (NOT WIN32)
foreach(arch x86_64 i386)
foreach(arch x86_64 i386 arm)
if(CAN_TARGET_${arch})
add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
SOURCES ${${arch}_SOURCES}
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/lsan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# The common files need to build on every arch supported by ASan.
# (Even if they build into dummy object files.)
filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH
x86_64 i386 powerpc64)
x86_64 i386 powerpc64 arm)

# Architectures supported by the standalone LSan.
filter_available_targets(LSAN_SUPPORTED_ARCH
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/profile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(PROFILE_SOURCES
GCDAProfiling.c
PGOProfiling.c)

filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386)
filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 arm)

if(APPLE)
add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
Expand Down

0 comments on commit 66e2b70

Please sign in to comment.