diff options
| author | bors <bors@rust-lang.org> | 2013-11-06 14:01:14 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-11-06 14:01:14 -0800 |
| commit | 22eb11c09ba8939ab06351eb5d14b355f632e197 (patch) | |
| tree | e823b8b63030586cf3cc254aba383a61aa4c154f | |
| parent | fdc830df31df205c8edc5e11268a011d44c8bc09 (diff) | |
| parent | 2a333ed0884c65d06591607e6e9b2857bd327d6e (diff) | |
| download | rust-22eb11c09ba8939ab06351eb5d14b355f632e197.tar.gz rust-22eb11c09ba8939ab06351eb5d14b355f632e197.zip | |
auto merge of #10227 : kud1ing/rust/ios, r=alexcrichton
| -rw-r--r-- | mk/platform.mk | 4 | ||||
| -rw-r--r-- | mk/rt.mk | 7 | ||||
| -rw-r--r-- | src/rt/arch/arm/_context.S | 5 | ||||
| -rw-r--r-- | src/rt/arch/arm/record_sp.S | 5 | ||||
| -rw-r--r-- | src/rt/rust_builtin.cpp | 12 |
5 files changed, 26 insertions, 7 deletions
diff --git a/mk/platform.mk b/mk/platform.mk index e7c9a10bc63..d9df4d42f57 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -195,8 +195,8 @@ CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2)) # arm-apple-darwin configuration ifeq ($(CFG_OSTYPE),apple-darwin) -CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos) -CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I $(CFG_IOS_SDK)/usr/include -I $(CFG_IOS_SDK)/usr/include/c++/4.2.1 -I /usr/include +CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null) +CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I$(CFG_IOS_SDK)/usr/include -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1 CC_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang) CXX_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++) CPP_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++) diff --git a/mk/rt.mk b/mk/rt.mk index 15b13d99465..3d5e9cbcb82 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -28,6 +28,13 @@ LIBUV_FLAGS_i386 = -m32 -fPIC -I$(S)src/etc/mingw-fix-include LIBUV_FLAGS_x86_64 = -m64 -fPIC ifeq ($(OSTYPE_$(1)), linux-androideabi) LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99 +else ifeq ($(OSTYPE_$(1)), apple-darwin) + ifeq ($(HOST_$(1)), arm) + IOS_SDK := $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null) + LIBUV_FLAGS_arm := -fPIC -std=gnu99 -I$(IOS_SDK)/usr/include -I$(IOS_SDK)/usr/include/c++/4.2.1 + else + LIBUV_FLAGS_arm := -fPIC -std=gnu99 + endif else LIBUV_FLAGS_arm = -fPIC -std=gnu99 endif diff --git a/src/rt/arch/arm/_context.S b/src/rt/arch/arm/_context.S index 6441f59a4d3..7227c15cc47 100644 --- a/src/rt/arch/arm/_context.S +++ b/src/rt/arch/arm/_context.S @@ -6,8 +6,11 @@ .text .code 32 .arm +#if defined(__APPLE__) +.align 2 +#else .align - +#endif .globl swap_registers swap_registers: diff --git a/src/rt/arch/arm/record_sp.S b/src/rt/arch/arm/record_sp.S index 6900444c0fe..cce14ed5a3e 100644 --- a/src/rt/arch/arm/record_sp.S +++ b/src/rt/arch/arm/record_sp.S @@ -6,8 +6,11 @@ .text .code 32 .arm +#if defined(__APPLE__) +.align 2 +#else .align - +#endif .globl record_sp_limit .globl get_sp_limit diff --git a/src/rt/rust_builtin.cpp b/src/rt/rust_builtin.cpp index 486c95a548d..e8141d37ff1 100644 --- a/src/rt/rust_builtin.cpp +++ b/src/rt/rust_builtin.cpp @@ -17,8 +17,14 @@ #include <time.h> #ifdef __APPLE__ -#include <crt_externs.h> -#include <mach/mach_time.h> + #include <TargetConditionals.h> + #include <mach/mach_time.h> + + #if (TARGET_OS_IPHONE) + extern char **environ; + #else + #include <crt_externs.h> + #endif #endif #if !defined(__WIN32__) @@ -57,7 +63,7 @@ rust_env_pairs() { #else extern "C" CDECL char** rust_env_pairs() { -#ifdef __APPLE__ +#if defined(__APPLE__) && !(TARGET_OS_IPHONE) char **environ = *_NSGetEnviron(); #endif return environ; |
