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 From f2ad512ac756b1b261350e839de0d10ff085688f Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 19 Jan 2013 02:28:44 +0000 Subject: Add the __aeabi_*divmod functions to the compiler-rt build --- lib/libcompiler_rt/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libcompiler_rt') diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index af1fcb6..72b55d8 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -181,6 +181,13 @@ SRCS+= ${file}.c . endif .endfor +.if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" +SRCS+= aeabi_idivmod.S \ + aeabi_ldivmod.S \ + aeabi_uidivmod.S \ + aeabi_uldivmod.S +.endif + .if ${MACHINE_CPUARCH} != "mips" . if ${MK_INSTALLLIB} != "no" SYMLINKS+=libcompiler_rt.a ${LIBDIR}/libgcc.a -- cgit v1.1 From 388178c195ed8f369019ba43899e39da72e35e87 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 19 Jan 2013 03:47:18 +0000 Subject: There should have been a tab after SRCS+= --- lib/libcompiler_rt/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libcompiler_rt') diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index 72b55d8..44df5e0 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -182,7 +182,7 @@ SRCS+= ${file}.c .endfor .if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" -SRCS+= aeabi_idivmod.S \ +SRCS+= aeabi_idivmod.S \ aeabi_ldivmod.S \ aeabi_uidivmod.S \ aeabi_uldivmod.S -- cgit v1.1 From 3600c83b820e00959d61600e67e9dcb32ef6b518 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 19 Jan 2013 04:11:45 +0000 Subject: Use the compiler-rt version __{u,}divsi3 and __{u,}modsi3 on ARM EABI --- lib/libcompiler_rt/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/libcompiler_rt') diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index 44df5e0..26ce4f7a 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -136,18 +136,22 @@ SRCF+= adddf3 \ addsf3 \ divdf3 \ divsf3 \ - divsi3 \ extendsfdf2 \ fixdfsi \ fixsfsi \ floatsidf \ floatsisf \ - modsi3 \ muldf3 \ mulsf3 \ subdf3 \ subsf3 \ - truncdfsf2 \ + truncdfsf2 +.endif + +.if ${MACHINE_CPUARCH} != "mips" && \ + (${MACHINE_CPUARCH} != "arm" || ${MK_ARM_EABI} != "no") +SRCF+= divsi3 \ + modsi3 \ udivsi3 \ umodsi3 .endif -- cgit v1.1 From 34f6d259a30c45a17229a6742c75eaf1a57452f6 Mon Sep 17 00:00:00 2001 From: andrew Date: Wed, 6 Feb 2013 00:01:28 +0000 Subject: Add the __aeabi_mem* functions to compiler-rt as clang uses them. --- lib/libcompiler_rt/Makefile | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libcompiler_rt') diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile index 26ce4f7a..a9daada 100644 --- a/lib/libcompiler_rt/Makefile +++ b/lib/libcompiler_rt/Makefile @@ -188,6 +188,10 @@ SRCS+= ${file}.c .if ${MACHINE_CPUARCH} == "arm" && ${MK_ARM_EABI} != "no" SRCS+= aeabi_idivmod.S \ aeabi_ldivmod.S \ + aeabi_memcmp.S \ + aeabi_memcpy.S \ + aeabi_memmove.S \ + aeabi_memset.S \ aeabi_uidivmod.S \ aeabi_uldivmod.S .endif -- cgit v1.1