[compiler-rt] r219323 - AArch64: add support for ARM64 iOS versions of compiler-rt.
Tim Northover
tnorthover at apple.com
Wed Oct 8 10:28:37 PDT 2014
Author: tnorthover
Date: Wed Oct 8 12:28:37 2014
New Revision: 219323
URL: http://llvm.org/viewvc/llvm-project?rev=219323&view=rev
Log:
AArch64: add support for ARM64 iOS versions of compiler-rt.
Just a dummy directory and a few sane choices in the Darwin SDK.
rdar://problem/18575597
Added:
compiler-rt/trunk/lib/builtins/arm64/
compiler-rt/trunk/lib/builtins/arm64/Makefile.mk
- copied, changed from r219304, compiler-rt/trunk/lib/builtins/Makefile.mk
compiler-rt/trunk/lib/builtins/arm64/dummy.c
Modified:
compiler-rt/trunk/SDKs/darwin/usr/include/stdio.h
compiler-rt/trunk/SDKs/darwin/usr/include/string.h
compiler-rt/trunk/SDKs/darwin/usr/include/sys/fcntl.h
compiler-rt/trunk/lib/builtins/Makefile.mk
compiler-rt/trunk/lib/builtins/gcc_personality_v0.c
compiler-rt/trunk/make/platform/clang_darwin.mk
compiler-rt/trunk/make/platform/darwin_bni.mk
Modified: compiler-rt/trunk/SDKs/darwin/usr/include/stdio.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/darwin/usr/include/stdio.h?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/SDKs/darwin/usr/include/stdio.h (original)
+++ compiler-rt/trunk/SDKs/darwin/usr/include/stdio.h Wed Oct 8 12:28:37 2014
@@ -34,7 +34,7 @@ typedef __SIZE_TYPE__ size_t;
# define __FDOPEN_NAME "_fdopen"
# define __FOPEN_NAME "_fopen"
# define __FWRITE_NAME "_fwrite"
-# elif defined(__arm)
+# elif defined(__arm) || defined(__arm64)
# define __FDOPEN_NAME "_fdopen"
# define __FOPEN_NAME "_fopen"
# define __FWRITE_NAME "_fwrite"
@@ -46,7 +46,7 @@ typedef __SIZE_TYPE__ size_t;
# define __FDOPEN_NAME "_fdopen"
# define __FOPEN_NAME "_fopen"
# define __FWRITE_NAME "_fwrite"
-# elif defined(__arm)
+# elif defined(__arm) || defined(__arm64)
# define __FDOPEN_NAME "_fdopen"
# define __FOPEN_NAME "_fopen"
# define __FWRITE_NAME "_fwrite"
Modified: compiler-rt/trunk/SDKs/darwin/usr/include/string.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/darwin/usr/include/string.h?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/SDKs/darwin/usr/include/string.h (original)
+++ compiler-rt/trunk/SDKs/darwin/usr/include/string.h Wed Oct 8 12:28:37 2014
@@ -32,13 +32,13 @@ char *strncpy(char *, const char *, size
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
# if defined(__i386)
# define __STRERROR_NAME "_strerror$UNIX2003"
-# elif defined(__x86_64__) || defined(__arm)
+# elif defined(__x86_64__) || defined(__arm) || defined(__arm64)
# define __STRERROR_NAME "_strerror"
# else
# error "unrecognized architecture for targeting OS X"
# endif
#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
-# if defined(__i386) || defined (__x86_64) || defined(__arm)
+# if defined(__i386) || defined (__x86_64) || defined(__arm) || defined(__arm64)
# define __STRERROR_NAME "_strerror"
# else
# error "unrecognized architecture for targeting iOS"
Modified: compiler-rt/trunk/SDKs/darwin/usr/include/sys/fcntl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/SDKs/darwin/usr/include/sys/fcntl.h?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/SDKs/darwin/usr/include/sys/fcntl.h (original)
+++ compiler-rt/trunk/SDKs/darwin/usr/include/sys/fcntl.h Wed Oct 8 12:28:37 2014
@@ -23,7 +23,7 @@
# define __OPEN_NAME "_open$UNIX2003"
# elif defined(__x86_64__)
# define __OPEN_NAME "_open"
-# elif defined(__arm)
+# elif defined(__arm) || defined(__arm64)
# define __OPEN_NAME "_open"
# else
# error "unrecognized architecture for targeting OS X"
@@ -31,7 +31,7 @@
#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
# if defined(__i386) || defined (__x86_64)
# define __OPEN_NAME "_open"
-# elif defined(__arm)
+# elif defined(__arm) || defined(__arm64)
# define __OPEN_NAME "_open"
# else
# error "unrecognized architecture for targeting iOS"
Modified: compiler-rt/trunk/lib/builtins/Makefile.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/Makefile.mk?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/Makefile.mk (original)
+++ compiler-rt/trunk/lib/builtins/Makefile.mk Wed Oct 8 12:28:37 2014
@@ -13,6 +13,9 @@ SubDirs :=
# Add arch specific optimized implementations.
SubDirs += i386 ppc x86_64 arm armv6m
+# Add ARM64 dir.
+SubDirs += arm64
+
# Define the variables for this specific directory.
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
ObjNames := $(Sources:%.c=%.o)
Copied: compiler-rt/trunk/lib/builtins/arm64/Makefile.mk (from r219304, compiler-rt/trunk/lib/builtins/Makefile.mk)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm64/Makefile.mk?p2=compiler-rt/trunk/lib/builtins/arm64/Makefile.mk&p1=compiler-rt/trunk/lib/builtins/Makefile.mk&r1=219304&r2=219323&rev=219323&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/Makefile.mk (original)
+++ compiler-rt/trunk/lib/builtins/arm64/Makefile.mk Wed Oct 8 12:28:37 2014
@@ -1,4 +1,4 @@
-#===- lib/builtins/Makefile.mk -----------------------------*- Makefile -*--===#
+#===- lib/builtins/arm64/Makefile.mk -----------------------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
@@ -8,15 +8,13 @@
#===------------------------------------------------------------------------===#
ModuleName := builtins
-SubDirs :=
+SubDirs :=
+OnlyArchs := arm64
-# Add arch specific optimized implementations.
-SubDirs += i386 ppc x86_64 arm armv6m
-
-# Define the variables for this specific directory.
+AsmSources := $(foreach file,$(wildcard $(Dir)/*.S),$(notdir $(file)))
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
-ObjNames := $(Sources:%.c=%.o)
-Implementation := Generic
+ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
+Implementation := Optimized
# FIXME: use automatic dependencies?
-Dependencies := $(wildcard $(Dir)/*.h)
+Dependencies := $(wildcard lib/*.h $(Dir)/*.h)
Added: compiler-rt/trunk/lib/builtins/arm64/dummy.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/arm64/dummy.c?rev=219323&view=auto
==============================================================================
--- compiler-rt/trunk/lib/builtins/arm64/dummy.c (added)
+++ compiler-rt/trunk/lib/builtins/arm64/dummy.c Wed Oct 8 12:28:37 2014
@@ -0,0 +1,13 @@
+/* ===---------- dummy.c - Implements dummy function, for bringup -----------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+static void dummy(void) __attribute__((used));
+
+static void dummy(void) {}
Modified: compiler-rt/trunk/lib/builtins/gcc_personality_v0.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/gcc_personality_v0.c?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/gcc_personality_v0.c (original)
+++ compiler-rt/trunk/lib/builtins/gcc_personality_v0.c Wed Oct 8 12:28:37 2014
@@ -180,7 +180,7 @@ static uintptr_t readEncodedPointer(cons
* on each frame as the stack is unwound during a C++ exception
* throw through a C function compiled with -fexceptions.
*/
-#if __arm__
+#if __USING_SJLJ_EXCEPTIONS__
// the setjump-longjump based exceptions personality routine has a different name
COMPILER_RT_ABI _Unwind_Reason_Code
__gcc_personality_sj0(int version, _Unwind_Action actions,
Modified: compiler-rt/trunk/make/platform/clang_darwin.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_darwin.mk (original)
+++ compiler-rt/trunk/make/platform/clang_darwin.mk Wed Oct 8 12:28:37 2014
@@ -117,6 +117,13 @@ UniversalArchs.cc_kext_ios5 := $(filter-
UniversalArchs.profile_ios := $(filter-out armv7, $(UniversalArchs.profile_ios))
endif
+### ARM64 Support ###
+# Explicitly add these, to workaround CheckArches function not including the
+# CFLAGS, and not wanting to require an ARM64 assembler be installed.
+UniversalArchs.ios += arm64
+UniversalArchs.cc_kext += arm64
+UniversalArchs.profile_ios += arm64
+
# If RC_SUPPORTED_ARCHS is defined, treat it as a list of the architectures we
# are intended to support and limit what we try to build to that.
#
@@ -176,6 +183,7 @@ CFLAGS.ios.x86_64h := $(CFLAGS) $(IOSSIM
CFLAGS.ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.ios.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.ios.arm64 := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
CFLAGS.osx.i386 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.osx.x86_64 := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
CFLAGS.osx.x86_64h := $(CFLAGS) $(OSX_DEPLOYMENT_ARGS)
@@ -185,6 +193,7 @@ CFLAGS.cc_kext.x86_64h := $(CFLAGS) $(OS
CFLAGS.cc_kext.armv7 := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.armv7k := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
CFLAGS.cc_kext.armv7s := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
+CFLAGS.cc_kext.arm64 := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
CFLAGS.cc_kext_ios5.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.cc_kext_ios5.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.cc_kext_ios5.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
@@ -197,6 +206,7 @@ CFLAGS.profile_ios.x86_64h := $(CFLAGS)
CFLAGS.profile_ios.armv7 := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.profile_ios.armv7k := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
CFLAGS.profile_ios.armv7s := $(CFLAGS) $(IOS_DEPLOYMENT_ARGS)
+CFLAGS.profile_ios.arm64 := $(CFLAGS) $(IOS6_DEPLOYMENT_ARGS)
# Configure the asan_osx_dynamic library to be built shared.
SHARED_LIBRARY.asan_osx_dynamic := 1
@@ -219,6 +229,7 @@ FUNCTIONS.ios.i386 := $(FUNCTIONS.ios
divsi3 udivsi3
FUNCTIONS.ios.x86_64 := $(FUNCTIONS.ios.i386)
FUNCTIONS.ios.x86_64h := $(FUNCTIONS.ios.x86_64)
+FUNCTIONS.ios.arm64 := dummy
FUNCTIONS.osx := mulosi4 mulodi4 muloti4
@@ -388,6 +399,7 @@ CCKEXT_ARMVFP_FUNCTIONS := $(CCKEXT_ARM_
FUNCTIONS.cc_kext.armv7 := $(CCKEXT_ARMVFP_FUNCTIONS)
FUNCTIONS.cc_kext.armv7k := $(CCKEXT_ARMVFP_FUNCTIONS)
FUNCTIONS.cc_kext.armv7s := $(CCKEXT_ARMVFP_FUNCTIONS)
+FUNCTIONS.cc_kext.arm64 := dummy
FUNCTIONS.cc_kext_ios5.armv7 := $(CCKEXT_ARMVFP_FUNCTIONS)
FUNCTIONS.cc_kext_ios5.armv7k := $(CCKEXT_ARMVFP_FUNCTIONS)
FUNCTIONS.cc_kext_ios5.armv7s := $(CCKEXT_ARMVFP_FUNCTIONS)
@@ -473,6 +485,8 @@ FUNCTIONS.cc_kext.armv7k := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7k))
FUNCTIONS.cc_kext.armv7s := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.armv7s))
+FUNCTIONS.cc_kext.arm64 := \
+ $(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext.arm64))
FUNCTIONS.cc_kext_ios5.armv7 := \
$(filter-out $(CCKEXT_MISSING_FUNCTIONS),$(FUNCTIONS.cc_kext_ios5.armv7))
FUNCTIONS.cc_kext_ios5.armv7k := \
Modified: compiler-rt/trunk/make/platform/darwin_bni.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/darwin_bni.mk?rev=219323&r1=219322&r2=219323&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/darwin_bni.mk (original)
+++ compiler-rt/trunk/make/platform/darwin_bni.mk Wed Oct 8 12:28:37 2014
@@ -115,3 +115,13 @@ FUNCTIONS.armv7 := $(FUNCTIONS) \
FUNCTIONS.armv7s := $(FUNCTIONS.armv7)
+FUNCTIONS.arm64 := divti3 modti3 \
+ udivmodti4 \
+ udivti3 umodti3 \
+ powisf2 powidf2 \
+ clzti2 \
+ fixdfti fixsfti \
+ fixunsdfti fixunssfti fixunssfti \
+ floattidf floattisf floatuntidf floatuntisf \
+ gcc_personality_v0 atomic
+
More information about the llvm-commits
mailing list