Darwin/iOS prep script: try and compile for arm64
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
diff --git a/generate-ios-source-and-headers.py b/generate-ios-source-and-headers.py
index 68d31d0..57c9736 100644
--- a/generate-ios-source-and-headers.py
+++ b/generate-ios-source-and-headers.py
@@ -59,8 +59,21 @@ class simulator_platform(Platform):
short_arch = arch
triple = 'i386-apple-darwin10'
sdkroot = sim_sdk_info['Path']
+ version_min = '5.0'
- prefix = "#if !defined(__arm__) && defined(__i386__)\n\n"
+ prefix = "#if !defined(__arm__) && !defined(__arm64__) && !defined(__x86_64__) && defined(__i386__)\n\n"
+ suffix = "\n\n#endif"
+
+
+class simulator64_platform(Platform):
+ sdk = 'iphonesimulator'
+ arch = 'x86_64'
+ short_arch = arch
+ triple = 'x86_64-apple-darwin13'
+ sdkroot = sim_sdk_info['Path']
+ version_min = '5.0'
+
+ prefix = "#if !defined(__arm__) && !defined(__arm64__) && !defined(__i386__) && defined(__x86_64__)\n\n"
suffix = "\n\n#endif"
@@ -70,8 +83,21 @@ class device_platform(Platform):
short_arch = 'arm'
triple = 'arm-apple-darwin10'
sdkroot = device_sdk_info['Path']
+ version_min = '5.0'
- prefix = "#ifdef __arm__\n\n"
+ prefix = "#if !defined(__arm64__) && defined(__arm__)\n\n"
+ suffix = "\n\n#endif"
+
+
+class device64_platform(Platform):
+ sdk = 'iphoneos'
+ arch = 'arm64'
+ short_arch = 'arm64'
+ triple = 'aarch64-apple-darwin13'
+ sdkroot = device_sdk_info['Path']
+ version_min = '7.0'
+
+ prefix = "#if !defined(__arm__) && defined(__arm64__)\n\n"
suffix = "\n\n#endif"
@@ -119,14 +145,23 @@ def move_source_tree(src_dir, dest_dir, dest_include_dir, arch=None, prefix=None
suffix=suffix)
elif relroot == 'arm':
move_dir(arch='arm',
- prefix="#ifdef __arm__\n\n",
+ prefix="#if !defined(__arm64__) && defined(__arm__)\n\n",
suffix="\n\n#endif",
files=['sysv.S', 'trampoline.S', 'ffi.c'])
+ elif relroot == 'aarch64':
+ move_dir(arch='arm64',
+ prefix="#if !defined(__arm__) && defined(__arm64__)\n\n",
+ suffix="\n\n#endif",
+ files=['sysv.S', 'ffi.c'])
elif relroot == 'x86':
move_dir(arch='i386',
- prefix="#if !defined(__arm__) && defined(__i386__)\n\n",
+ prefix="#if !defined(__arm__) && !defined(__arm64__) && !defined(__x86_64__) && defined(__i386__)\n\n",
suffix="\n\n#endif",
files=['darwin.S', 'ffi.c'])
+ move_dir(arch='x86_64',
+ prefix="#if !defined(__arm__) && !defined(__arm64__) && !defined(__i386__) && defined(__x86_64__)\n\n",
+ suffix="\n\n#endif",
+ files=['darwin64.S', 'ffi64.c'])
def build_target(platform):
@@ -137,7 +172,7 @@ def build_target(platform):
mkdir_p(build_dir)
env = dict(CC=xcrun_cmd('clang'),
LD=xcrun_cmd('ld'),
- CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=4.3' % (platform.arch, platform.sdkroot))
+ CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=%s' % (platform.arch, platform.sdkroot, platform.version_min))
working_dir = os.getcwd()
try:
os.chdir(build_dir)
@@ -169,7 +204,9 @@ def main():
move_source_tree('src', 'ios/src', 'ios/include')
move_source_tree('include', None, 'ios/include')
build_target(simulator_platform)
+ build_target(simulator64_platform)
build_target(device_platform)
+ build_target(device64_platform)
for header_name, archs in headers_seen.iteritems():
basename, suffix = os.path.splitext(header_name)