[PATCH] [RFC] Compiler-RT on ARM via CMake

Renato Golin renato.golin at linaro.org
Fri Jan 31 03:00:40 PST 2014


  My last attempt to build all RT and make the sanitizer tests pass. It's still running, I'll update here once they pass.

Hi samsonov, asl,

http://llvm-reviews.chandlerc.com/D2604

CHANGE SINCE LAST DIFF
  http://llvm-reviews.chandlerc.com/D2604?vs=6603&id=6790#toc

Files:
  CMakeLists.txt
  lib/CMakeLists.txt
  lib/asan/lit_tests/Unit/lit.site.cfg.in
  lib/lit.common.unit.configured.in
  lib/lsan/CMakeLists.txt
  lib/profile/CMakeLists.txt
  lib/ubsan/CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -98,6 +98,8 @@
   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
@@ -210,7 +212,7 @@
 # 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)
 
Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -195,8 +195,72 @@
   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}
Index: lib/asan/lit_tests/Unit/lit.site.cfg.in
===================================================================
--- lib/asan/lit_tests/Unit/lit.site.cfg.in
+++ lib/asan/lit_tests/Unit/lit.site.cfg.in
@@ -12,5 +12,6 @@
 config.test_exec_root = "@ASAN_BINARY_DIR@/tests"
 config.test_source_root = config.test_exec_root
 
-if config.host_os == 'Linux':
+# Make sure we're dealing with a supported architecture
+if config.host_os in ['Linux'] and config.host_arch in ['x86_64']:
   config.environment['ASAN_OPTIONS'] = 'detect_leaks=1'
Index: lib/lit.common.unit.configured.in
===================================================================
--- lib/lit.common.unit.configured.in
+++ lib/lit.common.unit.configured.in
@@ -9,6 +9,7 @@
 config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
 config.llvm_build_mode = "@LLVM_BUILD_MODE@"
 config.host_os = "@HOST_OS@"
+config.host_arch = "@HOST_ARCH@"
 
 # LLVM tools dir and build mode can be passed in lit parameters,
 # so try to apply substitution.
Index: lib/lsan/CMakeLists.txt
===================================================================
--- lib/lsan/CMakeLists.txt
+++ lib/lsan/CMakeLists.txt
@@ -20,7 +20,7 @@
 # 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
Index: lib/profile/CMakeLists.txt
===================================================================
--- lib/profile/CMakeLists.txt
+++ lib/profile/CMakeLists.txt
@@ -2,7 +2,7 @@
   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
Index: lib/ubsan/CMakeLists.txt
===================================================================
--- lib/ubsan/CMakeLists.txt
+++ lib/ubsan/CMakeLists.txt
@@ -16,7 +16,7 @@
 set(UBSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 
 filter_available_targets(UBSAN_SUPPORTED_ARCH
-  x86_64 i386)
+  x86_64 i386 arm)
 
 set(UBSAN_RUNTIME_LIBRARIES)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2604.2.patch
Type: text/x-patch
Size: 4721 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140131/7ec7f6a9/attachment.bin>


More information about the llvm-commits mailing list