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

llvm-svn: 219323
This commit is contained in:
Tim Northover 2014-10-08 17:28:37 +00:00
parent 4292443101
commit a5a06ad6fc
9 changed files with 67 additions and 7 deletions

View File

@ -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"

View File

@ -32,13 +32,13 @@ char *strncpy(char *, const char *, size_t);
#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"

View File

@ -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"

View File

@ -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)

View File

@ -0,0 +1,20 @@
#===- lib/builtins/arm64/Makefile.mk -----------------------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
ModuleName := builtins
SubDirs :=
OnlyArchs := arm64
AsmSources := $(foreach file,$(wildcard $(Dir)/*.S),$(notdir $(file)))
Sources := $(foreach file,$(wildcard $(Dir)/*.c),$(notdir $(file)))
ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
Implementation := Optimized
# FIXME: use automatic dependencies?
Dependencies := $(wildcard lib/*.h $(Dir)/*.h)

View File

@ -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) {}

View File

@ -180,7 +180,7 @@ static uintptr_t readEncodedPointer(const uint8_t** data, uint8_t encoding)
* 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,

View File

@ -117,6 +117,13 @@ UniversalArchs.cc_kext_ios5 := $(filter-out armv7, $(UniversalArchs.cc_kext_ios5
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_DEPLOYMENT_ARGS)
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) $(OSX_DEPLOYMENT_ARGS)
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) $(IOSSIM_DEPLOYMENT_ARGS)
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) \
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 := \

View File

@ -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