[PATCH] [RFC] Compiler-RT on ARM via CMake
Renato Golin
renato.golin at linaro.org
Thu Jan 23 07:07:22 PST 2014
Hi samsonov, asl,
First attempt to compile the RT library on ARM via CMake.
The current changes builds:
lib/clang/3.5/lib/linux/libclang_rt.arm.a
lib/clang/3.5/lib/linux/libclang_rt.san-arm.a
The UBSan tests are looking for:
lib/clang/3.5/lib/linux/libclang_rt.san-armv7l.a
lib/clang/3.5/lib/linux/libclang_rt.ubsan-armv7l.a
lib/clang/3.5/lib/linux/libclang_rt.ubsan_cxx-armv7l.a
So, not only it's looking for the wrong arch name (the libs should work on all ARM, so I don't think we should name it armv7), but it's also looking for the UBSan libraries, which weren't compiled. I'm not sure why not...
http://llvm-reviews.chandlerc.com/D2604
Files:
CMakeLists.txt
lib/CMakeLists.txt
lib/dfsan/lit_tests/lit.cfg
lib/ubsan/lit_tests/lit.common.cfg
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/dfsan/lit_tests/lit.cfg
===================================================================
--- lib/dfsan/lit_tests/lit.cfg
+++ lib/dfsan/lit_tests/lit.cfg
@@ -67,3 +67,11 @@
# DataFlowSanitizer tests are currently supported on Linux only.
if config.host_os not in ['Linux']:
config.unsupported = True
+
+# We're building the sanitizers on ARM, but the tests are looking for the
+# wrong name of static objects, disable for now
+if 'armv4' in config.root.target_triple or \
+ 'armv5' in config.root.target_triple or \
+ 'armv6' in config.root.target_triple or \
+ 'armv7' in config.root.target_triple:
+ config.unsupported = True
Index: lib/ubsan/lit_tests/lit.common.cfg
===================================================================
--- lib/ubsan/lit_tests/lit.common.cfg
+++ lib/ubsan/lit_tests/lit.common.cfg
@@ -28,4 +28,12 @@
if config.host_os not in ['Linux', 'Darwin']:
config.unsupported = True
+# We're building the sanitizers on ARM, but the tests are looking for the
+# wrong name of static objects, disable for now
+if 'armv4' in config.root.target_triple or \
+ 'armv5' in config.root.target_triple or \
+ 'armv6' in config.root.target_triple or \
+ 'armv7' in config.root.target_triple:
+ config.unsupported = True
+
config.pipefail = False
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2604.1.patch
Type: text/x-patch
Size: 3759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140123/8ead32c6/attachment.bin>
More information about the llvm-commits
mailing list