From 3a4e3b814af8211f139991b6ab47d3c08a587f80 Mon Sep 17 00:00:00 2001 From: andrew Date: Tue, 18 Dec 2012 07:26:55 +0000 Subject: Get libcompiler-rt and libgcc building on ARM with clang. * Don't provide clear_cache or the __sync_* functions on ARM with clang as they are provided by clang as builtin functions. * Tell clang it is aloud to compile some libgcc code using heinous GCC extensions. --- lib/libcompiler_rt/Makefile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/libcompiler_rt') diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index 84f9b36..af1fcb6 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -28,7 +28,6 @@ SRCF= absvdi2 \ ashlti3 \ ashrdi3 \ ashrti3 \ - clear_cache \ clzdi2 \ clzsi2 \ clzti2 \ @@ -126,6 +125,11 @@ SRCF= absvdi2 \ umoddi3 \ umodti3 +# Don't build clear_cache on ARM with clang as it is a builtin there. +.if ${MACHINE_CPUARCH} != "arm" || ${COMPILER_TYPE} != "clang" +SRCF+= clear_cache +.endif + # These are already shipped by libc.a on arm and mips .if ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" SRCF+= adddf3 \ @@ -148,8 +152,9 @@ SRCF+= adddf3 \ umodsi3 .endif -# FreeBSD-specific atomic intrinsics. -.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "mips" +# FreeBSD-specific atomic intrinsics. Clang provides them as a builtin. +.if (${MACHINE_CPUARCH} == "arm" && ${COMPILER_TYPE} != "clang") || \ + ${MACHINE_CPUARCH} == "mips" SRCF+= __sync_fetch_and_add_4 \ __sync_fetch_and_and_4 \ __sync_fetch_and_or_4 \ -- cgit v1.1