Refresh config.guess and config.sub
[libffi.git] / patches / xcode-improvements
1 Index: libffi/.gitignore
2 ===================================================================
3 --- libffi.orig/.gitignore
4 +++ libffi/.gitignore
5 @@ -19,4 +19,5 @@ autom4te.cache
6  libffi.xcodeproj/xcuserdata
7  libffi.xcodeproj/project.xcworkspace
8  ios/
9 -
10 +osx/
11 +build_*/
12 \ No newline at end of file
13 Index: libffi/ChangeLog
14 ===================================================================
15 --- libffi.orig/ChangeLog
16 +++ libffi/ChangeLog
17 @@ -29,6 +29,14 @@
18  
19         * configure: Regenerated.
20  
21 +2012-04-11  Zachary Waldowski  <zwaldowski@gmail.com>
22 +
23 +       * generate-ios-source-and-headers.py,
24 +       libffi.xcodeproj/project.pbxproj: Support a Mac static library via
25 +       Xcode. Set iOS compatibility to 4.0.  Move iOS trampoline
26 +       generation into an Xcode "run script" phase.  Include both as
27 +       Xcode build scripts. Don't always regenerate config files.
28 +
29  2012-04-10  Anthony Green  <green@moxielogic.com>
30  
31         * src/powerpc/ffi_darwin.c (ffi_prep_args): Add missing semicolon.
32 Index: libffi/generate-ios-source-and-headers.py
33 ===================================================================
34 --- libffi.orig/generate-ios-source-and-headers.py
35 +++ libffi/generate-ios-source-and-headers.py
36 @@ -1,19 +1,17 @@
37  #!/usr/bin/env python
38 +
39  import subprocess
40  import re
41  import os
42  import errno
43  import collections
44  import sys
45 -#developer_path =
46 -
47  
48  class Platform(object):
49      pass
50  
51  sdk_re = re.compile(r'.*-sdk ([a-zA-Z0-9.]*)')
52  
53 -
54  def sdkinfo(sdkname):
55      ret = {}
56      for line in subprocess.Popen(['xcodebuild', '-sdk', sdkname, '-version'], stdout=subprocess.PIPE).stdout:
57 @@ -23,16 +21,6 @@ def sdkinfo(sdkname):
58              ret[k] = v
59      return ret
60  
61 -def mkdir_p(path):
62 -    try:
63 -        os.makedirs(path)
64 -    except OSError as exc: # Python >2.5
65 -        if exc.errno == errno.EEXIST:
66 -            pass
67 -        else:
68 -            raise
69 -
70 -
71  sim_sdk_info = sdkinfo('iphonesimulator')
72  device_sdk_info = sdkinfo('iphoneos')
73  
74 @@ -54,7 +42,7 @@ sim_sdk, device_sdk = latest_sdks()
75  class simulator_platform(Platform):
76      sdk='iphonesimulator'
77      arch = 'i386'
78 -    short_arch = arch
79 +    name = 'simulator'
80      triple = 'i386-apple-darwin10'
81      sdkroot = sim_sdk_info['Path']
82  
83 @@ -63,8 +51,8 @@ class simulator_platform(Platform):
84  
85  class device_platform(Platform):
86      sdk='iphoneos'
87 +    name = 'ios'
88      arch = 'armv7'
89 -    short_arch = 'arm'
90      triple = 'arm-apple-darwin10'
91      sdkroot = device_sdk_info['Path']
92  
93 @@ -73,7 +61,9 @@ class device_platform(Platform):
94  
95  
96  def move_file(src_dir, dst_dir, filename, file_suffix=None, prefix='', suffix=''):
97 -    mkdir_p(dst_dir)
98 +    if not os.path.exists(dst_dir):
99 +        os.makedirs(dst_dir)
100 +
101      out_filename = filename
102  
103      if file_suffix:
104 @@ -130,38 +120,31 @@ def build_target(platform):
105      def xcrun_cmd(cmd):
106          return subprocess.check_output(['xcrun', '-sdk', platform.sdkroot, '-find', cmd]).strip()
107  
108 -    build_dir = 'build_' + platform.short_arch
109 -    mkdir_p(build_dir)
110 -    env = dict(CC=xcrun_cmd('clang'),
111 -               LD=xcrun_cmd('ld'),
112 -               CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=4.3' % (platform.arch, platform.sdkroot))
113 -    working_dir=os.getcwd()
114 -    try:
115 -        os.chdir(build_dir)
116 -        subprocess.check_call(['../configure', '-host', platform.triple], env=env)
117 -        move_source_tree('.', None, '../ios/include',
118 -                         arch=platform.short_arch,
119 -                         prefix=platform.prefix,
120 -                         suffix=platform.suffix)
121 -        move_source_tree('./include', None, '../ios/include',
122 -                         arch=platform.short_arch,
123 -                         prefix=platform.prefix,
124 -                         suffix=platform.suffix)
125 -    finally:
126 -        os.chdir(working_dir)
127 -
128 -    for header_name, archs in headers_seen.iteritems():
129 -        basename, suffix = os.path.splitext(header_name)
130 -
131 -def make_tramp():
132 -    with open('src/arm/trampoline.S', 'w') as tramp_out:
133 -        p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)
134 -        p.wait()
135 +    build_dir = 'build_' + platform.name
136 +    if not os.path.exists(build_dir):
137 +        os.makedirs(build_dir)
138 +        env = dict(CC=xcrun_cmd('clang'),
139 +                   LD=xcrun_cmd('ld'),
140 +                   CFLAGS='-arch %s -isysroot %s -miphoneos-version-min=4.0' % (platform.arch, platform.sdkroot))
141 +        working_dir=os.getcwd()
142 +        try:
143 +            os.chdir(build_dir)
144 +            subprocess.check_call(['../configure', '-host', platform.triple], env=env)
145 +            move_source_tree('.', None, '../ios/include',
146 +                             arch=platform.arch,
147 +                             prefix=platform.prefix,
148 +                             suffix=platform.suffix)
149 +            move_source_tree('./include', None, '../ios/include',
150 +                            arch=platform.arch,
151 +                            prefix=platform.prefix,
152 +                            suffix=platform.suffix)
153 +        finally:
154 +            os.chdir(working_dir)
155  
156 +        for header_name, archs in headers_seen.iteritems():
157 +            basename, suffix = os.path.splitext(header_name)
158  
159  def main():
160 -    make_tramp()
161 -
162      move_source_tree('src', 'ios/src', 'ios/include')
163      move_source_tree('include', None, 'ios/include')
164      build_target(simulator_platform)
165 Index: libffi/libffi.xcodeproj/project.pbxproj
166 ===================================================================
167 --- libffi.orig/libffi.xcodeproj/project.pbxproj
168 +++ libffi/libffi.xcodeproj/project.pbxproj
169 @@ -7,47 +7,104 @@
170         objects = {
171  
172  /* Begin PBXBuildFile section */
173 -               F66B6AF9152FA32400B29B2A /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AE4152FA32400B29B2A /* ffi.c */; };
174 -               F66B6AFA152FA32400B29B2A /* sysv.S in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AE6152FA32400B29B2A /* sysv.S */; };
175 -               F66B6AFB152FA32400B29B2A /* trampoline.S in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AE7152FA32400B29B2A /* trampoline.S */; };
176 -               F66B6AFC152FA32400B29B2A /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AE8152FA32400B29B2A /* closures.c */; };
177 -               F66B6AFD152FA32400B29B2A /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AE9152FA32400B29B2A /* debug.c */; };
178 -               F66B6AFE152FA32400B29B2A /* dlmalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AEA152FA32400B29B2A /* dlmalloc.c */; };
179 -               F66B6AFF152FA32400B29B2A /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AEB152FA32400B29B2A /* java_raw_api.c */; };
180 -               F66B6B00152FA32400B29B2A /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AEC152FA32400B29B2A /* prep_cif.c */; };
181 -               F66B6B01152FA32400B29B2A /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AED152FA32400B29B2A /* raw_api.c */; };
182 -               F66B6B02152FA32400B29B2A /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AEE152FA32400B29B2A /* types.c */; };
183 -               F66B6B03152FA32400B29B2A /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AF0152FA32400B29B2A /* darwin.S */; };
184 -               F66B6B05152FA32400B29B2A /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = F66B6AF2152FA32400B29B2A /* ffi.c */; };
185 +               6C43CBDC1534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBD1534F76F00162364 /* ffi.c */; };
186 +               6C43CBDD1534F76F00162364 /* sysv.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBBF1534F76F00162364 /* sysv.S */; };
187 +               6C43CBDE1534F76F00162364 /* trampoline.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC01534F76F00162364 /* trampoline.S */; };
188 +               6C43CBE61534F76F00162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBC91534F76F00162364 /* darwin.S */; };
189 +               6C43CBE81534F76F00162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBCB1534F76F00162364 /* ffi.c */; };
190 +               6C43CBE91534F76F00162364 /* ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CBCC1534F76F00162364 /* ffi64.c */; };
191 +               6C43CC1F1534F77800162364 /* darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC051534F77800162364 /* darwin.S */; };
192 +               6C43CC201534F77800162364 /* darwin64.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC061534F77800162364 /* darwin64.S */; };
193 +               6C43CC211534F77800162364 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC071534F77800162364 /* ffi.c */; };
194 +               6C43CC221534F77800162364 /* ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC081534F77800162364 /* ffi64.c */; };
195 +               6C43CC2F1534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; };
196 +               6C43CC301534F7BE00162364 /* closures.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC281534F7BE00162364 /* closures.c */; };
197 +               6C43CC311534F7BE00162364 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC291534F7BE00162364 /* debug.c */; };
198 +               6C43CC321534F7BE00162364 /* debug.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC291534F7BE00162364 /* debug.c */; };
199 +               6C43CC331534F7BE00162364 /* dlmalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2A1534F7BE00162364 /* dlmalloc.c */; };
200 +               6C43CC341534F7BE00162364 /* dlmalloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2A1534F7BE00162364 /* dlmalloc.c */; };
201 +               6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; };
202 +               6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2B1534F7BE00162364 /* java_raw_api.c */; };
203 +               6C43CC371534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; };
204 +               6C43CC381534F7BE00162364 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2C1534F7BE00162364 /* prep_cif.c */; };
205 +               6C43CC391534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; };
206 +               6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2D1534F7BE00162364 /* raw_api.c */; };
207 +               6C43CC3B1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; };
208 +               6C43CC3C1534F7BE00162364 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 6C43CC2E1534F7BE00162364 /* types.c */; };
209 +               6C43CC971535032600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8D1535032600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
210 +               6C43CC981535032600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8E1535032600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
211 +               6C43CC991535032600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC8F1535032600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
212 +               6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC901535032600162364 /* ffi_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; };
213 +               6C43CC9B1535032600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC911535032600162364 /* fficonfig.h */; };
214 +               6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC921535032600162364 /* fficonfig_i386.h */; };
215 +               6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC931535032600162364 /* fficonfig_x86_64.h */; };
216 +               6C43CC9E1535032600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC941535032600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
217 +               6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC951535032600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
218 +               6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CC961535032600162364 /* ffitarget_x86_64.h */; settings = {ATTRIBUTES = (Public, ); }; };
219 +               6C43CCAD1535039600162364 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA21535039600162364 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
220 +               6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA31535039600162364 /* ffi_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; };
221 +               6C43CCAF1535039600162364 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA41535039600162364 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
222 +               6C43CCB01535039600162364 /* ffi_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA51535039600162364 /* ffi_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
223 +               6C43CCB11535039600162364 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA61535039600162364 /* fficonfig.h */; };
224 +               6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA71535039600162364 /* fficonfig_armv7.h */; };
225 +               6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA81535039600162364 /* fficonfig_i386.h */; };
226 +               6C43CCB41535039600162364 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCA91535039600162364 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
227 +               6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAA1535039600162364 /* ffitarget_arm.h */; settings = {ATTRIBUTES = (Public, ); }; };
228 +               6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAB1535039600162364 /* ffitarget_armv7.h */; settings = {ATTRIBUTES = (Public, ); }; };
229 +               6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C43CCAC1535039600162364 /* ffitarget_i386.h */; settings = {ATTRIBUTES = (Public, ); }; };
230  /* End PBXBuildFile section */
231  
232  /* Begin PBXFileReference section */
233 -               F66B6AE4152FA32400B29B2A /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
234 -               F66B6AE5152FA32400B29B2A /* gentramp.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = gentramp.sh; sourceTree = "<group>"; };
235 -               F66B6AE6152FA32400B29B2A /* sysv.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv.S; sourceTree = "<group>"; };
236 -               F66B6AE7152FA32400B29B2A /* trampoline.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline.S; sourceTree = "<group>"; };
237 -               F66B6AE8152FA32400B29B2A /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = closures.c; sourceTree = "<group>"; };
238 -               F66B6AE9152FA32400B29B2A /* debug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = debug.c; sourceTree = "<group>"; };
239 -               F66B6AEA152FA32400B29B2A /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlmalloc.c; sourceTree = "<group>"; };
240 -               F66B6AEB152FA32400B29B2A /* java_raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = java_raw_api.c; sourceTree = "<group>"; };
241 -               F66B6AEC152FA32400B29B2A /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = "<group>"; };
242 -               F66B6AED152FA32400B29B2A /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = raw_api.c; sourceTree = "<group>"; };
243 -               F66B6AEE152FA32400B29B2A /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = "<group>"; };
244 -               F66B6AF0152FA32400B29B2A /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
245 -               F66B6AF2152FA32400B29B2A /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
246 -               F6B08473147252410031D8A1 /* ffi_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_arm.h; sourceTree = "<group>"; };
247 -               F6B08474147252410031D8A1 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
248 -               F6B08475147252410031D8A1 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
249 -               F6B08476147252410031D8A1 /* fficonfig_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_arm.h; sourceTree = "<group>"; };
250 -               F6B08477147252410031D8A1 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
251 -               F6B08478147252410031D8A1 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
252 -               F6B08479147252410031D8A1 /* ffitarget_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm.h; sourceTree = "<group>"; };
253 -               F6B0847A147252410031D8A1 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
254 -               F6B0847B147252410031D8A1 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
255 +               6C43CB3D1534E9D100162364 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
256 +               6C43CBBD1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
257 +               6C43CBBF1534F76F00162364 /* sysv.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = sysv.S; sourceTree = "<group>"; };
258 +               6C43CBC01534F76F00162364 /* trampoline.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = trampoline.S; sourceTree = "<group>"; };
259 +               6C43CBC91534F76F00162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
260 +               6C43CBCB1534F76F00162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
261 +               6C43CBCC1534F76F00162364 /* ffi64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64.c; sourceTree = "<group>"; };
262 +               6C43CC051534F77800162364 /* darwin.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin.S; sourceTree = "<group>"; };
263 +               6C43CC061534F77800162364 /* darwin64.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = darwin64.S; sourceTree = "<group>"; };
264 +               6C43CC071534F77800162364 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
265 +               6C43CC081534F77800162364 /* ffi64.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ffi64.c; sourceTree = "<group>"; };
266 +               6C43CC281534F7BE00162364 /* closures.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = closures.c; path = src/closures.c; sourceTree = SOURCE_ROOT; };
267 +               6C43CC291534F7BE00162364 /* debug.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = debug.c; path = src/debug.c; sourceTree = SOURCE_ROOT; };
268 +               6C43CC2A1534F7BE00162364 /* dlmalloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dlmalloc.c; path = src/dlmalloc.c; sourceTree = SOURCE_ROOT; };
269 +               6C43CC2B1534F7BE00162364 /* java_raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = java_raw_api.c; path = src/java_raw_api.c; sourceTree = SOURCE_ROOT; };
270 +               6C43CC2C1534F7BE00162364 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prep_cif.c; path = src/prep_cif.c; sourceTree = SOURCE_ROOT; };
271 +               6C43CC2D1534F7BE00162364 /* raw_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = raw_api.c; path = src/raw_api.c; sourceTree = SOURCE_ROOT; };
272 +               6C43CC2E1534F7BE00162364 /* types.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = types.c; path = src/types.c; sourceTree = SOURCE_ROOT; };
273 +               6C43CC8D1535032600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
274 +               6C43CC8E1535032600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
275 +               6C43CC8F1535032600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
276 +               6C43CC901535032600162364 /* ffi_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_x86_64.h; sourceTree = "<group>"; };
277 +               6C43CC911535032600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
278 +               6C43CC921535032600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
279 +               6C43CC931535032600162364 /* fficonfig_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_x86_64.h; sourceTree = "<group>"; };
280 +               6C43CC941535032600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
281 +               6C43CC951535032600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
282 +               6C43CC961535032600162364 /* ffitarget_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_x86_64.h; sourceTree = "<group>"; };
283 +               6C43CCA21535039600162364 /* ffi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi.h; sourceTree = "<group>"; };
284 +               6C43CCA31535039600162364 /* ffi_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_armv7.h; sourceTree = "<group>"; };
285 +               6C43CCA41535039600162364 /* ffi_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_common.h; sourceTree = "<group>"; };
286 +               6C43CCA51535039600162364 /* ffi_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffi_i386.h; sourceTree = "<group>"; };
287 +               6C43CCA61535039600162364 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig.h; sourceTree = "<group>"; };
288 +               6C43CCA71535039600162364 /* fficonfig_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_armv7.h; sourceTree = "<group>"; };
289 +               6C43CCA81535039600162364 /* fficonfig_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fficonfig_i386.h; sourceTree = "<group>"; };
290 +               6C43CCA91535039600162364 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget.h; sourceTree = "<group>"; };
291 +               6C43CCAA1535039600162364 /* ffitarget_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_arm.h; sourceTree = "<group>"; };
292 +               6C43CCAB1535039600162364 /* ffitarget_armv7.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_armv7.h; sourceTree = "<group>"; };
293 +               6C43CCAC1535039600162364 /* ffitarget_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ffitarget_i386.h; sourceTree = "<group>"; };
294                 F6F980BA147386130008F121 /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
295  /* End PBXFileReference section */
296  
297  /* Begin PBXFrameworksBuildPhase section */
298 +               6C43CB3A1534E9D100162364 /* Frameworks */ = {
299 +                       isa = PBXFrameworksBuildPhase;
300 +                       buildActionMask = 2147483647;
301 +                       files = (
302 +                       );
303 +                       runOnlyForDeploymentPostprocessing = 0;
304 +               };
305                 F6F980B7147386130008F121 /* Frameworks */ = {
306                         isa = PBXFrameworksBuildPhase;
307                         buildActionMask = 2147483647;
308 @@ -58,81 +115,139 @@
309  /* End PBXFrameworksBuildPhase section */
310  
311  /* Begin PBXGroup section */
312 -               F66B6AE2152FA32400B29B2A /* src */ = {
313 +               6C43CBAF1534F76F00162364 /* iOS */ = {
314                         isa = PBXGroup;
315                         children = (
316 -                               F66B6AE3152FA32400B29B2A /* arm */,
317 -                               F66B6AE8152FA32400B29B2A /* closures.c */,
318 -                               F66B6AE9152FA32400B29B2A /* debug.c */,
319 -                               F66B6AEA152FA32400B29B2A /* dlmalloc.c */,
320 -                               F66B6AEB152FA32400B29B2A /* java_raw_api.c */,
321 -                               F66B6AEC152FA32400B29B2A /* prep_cif.c */,
322 -                               F66B6AED152FA32400B29B2A /* raw_api.c */,
323 -                               F66B6AEE152FA32400B29B2A /* types.c */,
324 -                               F66B6AEF152FA32400B29B2A /* x86 */,
325 +                               6C43CCA11535039600162364 /* include */,
326 +                               6C43CBBB1534F76F00162364 /* src */,
327                         );
328 -                       name = src;
329 -                       path = ios/src;
330 +                       name = iOS;
331 +                       path = ios;
332                         sourceTree = "<group>";
333                 };
334 -               F66B6AE3152FA32400B29B2A /* arm */ = {
335 +               6C43CBBB1534F76F00162364 /* src */ = {
336                         isa = PBXGroup;
337                         children = (
338 -                               F66B6AE4152FA32400B29B2A /* ffi.c */,
339 -                               F66B6AE5152FA32400B29B2A /* gentramp.sh */,
340 -                               F66B6AE6152FA32400B29B2A /* sysv.S */,
341 -                               F66B6AE7152FA32400B29B2A /* trampoline.S */,
342 +                               6C43CBC81534F76F00162364 /* x86 */,
343 +                               6C43CBBC1534F76F00162364 /* arm */,
344 +                       );
345 +                       path = src;
346 +                       sourceTree = "<group>";
347 +               };
348 +               6C43CBBC1534F76F00162364 /* arm */ = {
349 +                       isa = PBXGroup;
350 +                       children = (
351 +                               6C43CBBD1534F76F00162364 /* ffi.c */,
352 +                               6C43CBBF1534F76F00162364 /* sysv.S */,
353 +                               6C43CBC01534F76F00162364 /* trampoline.S */,
354                         );
355                         path = arm;
356                         sourceTree = "<group>";
357                 };
358 -               F66B6AEF152FA32400B29B2A /* x86 */ = {
359 +               6C43CBC81534F76F00162364 /* x86 */ = {
360                         isa = PBXGroup;
361                         children = (
362 -                               F66B6AF0152FA32400B29B2A /* darwin.S */,
363 -                               F66B6AF2152FA32400B29B2A /* ffi.c */,
364 +                               6C43CBC91534F76F00162364 /* darwin.S */,
365 +                               6C43CBCB1534F76F00162364 /* ffi.c */,
366 +                               6C43CBCC1534F76F00162364 /* ffi64.c */,
367                         );
368                         path = x86;
369                         sourceTree = "<group>";
370                 };
371 -               F6B0839514721EE50031D8A1 = {
372 +               6C43CBF01534F77800162364 /* OS X */ = {
373                         isa = PBXGroup;
374                         children = (
375 -                               F66B6AE2152FA32400B29B2A /* src */,
376 -                               F6B0846C147241640031D8A1 /* include */,
377 -                               F6B083A214721EE50031D8A1 /* Frameworks */,
378 -                               F6F980C6147386260008F121 /* Products */,
379 +                               6C43CC8C1535032600162364 /* include */,
380 +                               6C43CBFC1534F77800162364 /* src */,
381                         );
382 +                       name = "OS X";
383 +                       path = osx;
384                         sourceTree = "<group>";
385                 };
386 -               F6B083A214721EE50031D8A1 /* Frameworks */ = {
387 +               6C43CBFC1534F77800162364 /* src */ = {
388                         isa = PBXGroup;
389                         children = (
390 +                               6C43CC041534F77800162364 /* x86 */,
391                         );
392 -                       name = Frameworks;
393 +                       path = src;
394                         sourceTree = "<group>";
395                 };
396 -               F6B0846C147241640031D8A1 /* include */ = {
397 +               6C43CC041534F77800162364 /* x86 */ = {
398                         isa = PBXGroup;
399                         children = (
400 -                               F6B08473147252410031D8A1 /* ffi_arm.h */,
401 -                               F6B08474147252410031D8A1 /* ffi_i386.h */,
402 -                               F6B08475147252410031D8A1 /* ffi.h */,
403 -                               F6B08476147252410031D8A1 /* fficonfig_arm.h */,
404 -                               F6B08477147252410031D8A1 /* fficonfig_i386.h */,
405 -                               F6B08478147252410031D8A1 /* fficonfig.h */,
406 -                               F6B08479147252410031D8A1 /* ffitarget_arm.h */,
407 -                               F6B0847A147252410031D8A1 /* ffitarget_i386.h */,
408 -                               F6B0847B147252410031D8A1 /* ffitarget.h */,
409 +                               6C43CC051534F77800162364 /* darwin.S */,
410 +                               6C43CC061534F77800162364 /* darwin64.S */,
411 +                               6C43CC071534F77800162364 /* ffi.c */,
412 +                               6C43CC081534F77800162364 /* ffi64.c */,
413 +                       );
414 +                       path = x86;
415 +                       sourceTree = "<group>";
416 +               };
417 +               6C43CC3D1534F7C400162364 /* src */ = {
418 +                       isa = PBXGroup;
419 +                       children = (
420 +                               6C43CC281534F7BE00162364 /* closures.c */,
421 +                               6C43CC291534F7BE00162364 /* debug.c */,
422 +                               6C43CC2A1534F7BE00162364 /* dlmalloc.c */,
423 +                               6C43CC2B1534F7BE00162364 /* java_raw_api.c */,
424 +                               6C43CC2C1534F7BE00162364 /* prep_cif.c */,
425 +                               6C43CC2D1534F7BE00162364 /* raw_api.c */,
426 +                               6C43CC2E1534F7BE00162364 /* types.c */,
427 +                       );
428 +                       name = src;
429 +                       path = ios;
430 +                       sourceTree = "<group>";
431 +               };
432 +               6C43CC8C1535032600162364 /* include */ = {
433 +                       isa = PBXGroup;
434 +                       children = (
435 +                               6C43CC8D1535032600162364 /* ffi.h */,
436 +                               6C43CC8E1535032600162364 /* ffi_common.h */,
437 +                               6C43CC8F1535032600162364 /* ffi_i386.h */,
438 +                               6C43CC901535032600162364 /* ffi_x86_64.h */,
439 +                               6C43CC911535032600162364 /* fficonfig.h */,
440 +                               6C43CC921535032600162364 /* fficonfig_i386.h */,
441 +                               6C43CC931535032600162364 /* fficonfig_x86_64.h */,
442 +                               6C43CC941535032600162364 /* ffitarget.h */,
443 +                               6C43CC951535032600162364 /* ffitarget_i386.h */,
444 +                               6C43CC961535032600162364 /* ffitarget_x86_64.h */,
445 +                       );
446 +                       path = include;
447 +                       sourceTree = "<group>";
448 +               };
449 +               6C43CCA11535039600162364 /* include */ = {
450 +                       isa = PBXGroup;
451 +                       children = (
452 +                               6C43CCA21535039600162364 /* ffi.h */,
453 +                               6C43CCA31535039600162364 /* ffi_armv7.h */,
454 +                               6C43CCA41535039600162364 /* ffi_common.h */,
455 +                               6C43CCA51535039600162364 /* ffi_i386.h */,
456 +                               6C43CCA61535039600162364 /* fficonfig.h */,
457 +                               6C43CCA71535039600162364 /* fficonfig_armv7.h */,
458 +                               6C43CCA81535039600162364 /* fficonfig_i386.h */,
459 +                               6C43CCA91535039600162364 /* ffitarget.h */,
460 +                               6C43CCAA1535039600162364 /* ffitarget_arm.h */,
461 +                               6C43CCAB1535039600162364 /* ffitarget_armv7.h */,
462 +                               6C43CCAC1535039600162364 /* ffitarget_i386.h */,
463 +                       );
464 +                       path = include;
465 +                       sourceTree = "<group>";
466 +               };
467 +               F6B0839514721EE50031D8A1 = {
468 +                       isa = PBXGroup;
469 +                       children = (
470 +                               6C43CC3D1534F7C400162364 /* src */,
471 +                               6C43CBAF1534F76F00162364 /* iOS */,
472 +                               6C43CBF01534F77800162364 /* OS X */,
473 +                               F6F980C6147386260008F121 /* Products */,
474                         );
475 -                       name = include;
476 -                       path = ios/include;
477                         sourceTree = "<group>";
478                 };
479                 F6F980C6147386260008F121 /* Products */ = {
480                         isa = PBXGroup;
481                         children = (
482                                 F6F980BA147386130008F121 /* libffi.a */,
483 +                               6C43CB3D1534E9D100162364 /* libffi.a */,
484                         );
485                         name = Products;
486                         path = ../..;
487 @@ -141,20 +256,68 @@
488  /* End PBXGroup section */
489  
490  /* Begin PBXHeadersBuildPhase section */
491 +               6C43CB3B1534E9D100162364 /* Headers */ = {
492 +                       isa = PBXHeadersBuildPhase;
493 +                       buildActionMask = 2147483647;
494 +                       files = (
495 +                               6C43CC971535032600162364 /* ffi.h in Headers */,
496 +                               6C43CC981535032600162364 /* ffi_common.h in Headers */,
497 +                               6C43CC991535032600162364 /* ffi_i386.h in Headers */,
498 +                               6C43CC9A1535032600162364 /* ffi_x86_64.h in Headers */,
499 +                               6C43CC9E1535032600162364 /* ffitarget.h in Headers */,
500 +                               6C43CC9F1535032600162364 /* ffitarget_i386.h in Headers */,
501 +                               6C43CCA01535032600162364 /* ffitarget_x86_64.h in Headers */,
502 +                               6C43CC9B1535032600162364 /* fficonfig.h in Headers */,
503 +                               6C43CC9C1535032600162364 /* fficonfig_i386.h in Headers */,
504 +                               6C43CC9D1535032600162364 /* fficonfig_x86_64.h in Headers */,
505 +                       );
506 +                       runOnlyForDeploymentPostprocessing = 0;
507 +               };
508                 F6F980B8147386130008F121 /* Headers */ = {
509                         isa = PBXHeadersBuildPhase;
510                         buildActionMask = 2147483647;
511                         files = (
512 +                               6C43CCAD1535039600162364 /* ffi.h in Headers */,
513 +                               6C43CCAE1535039600162364 /* ffi_armv7.h in Headers */,
514 +                               6C43CCAF1535039600162364 /* ffi_common.h in Headers */,
515 +                               6C43CCB01535039600162364 /* ffi_i386.h in Headers */,
516 +                               6C43CCB41535039600162364 /* ffitarget.h in Headers */,
517 +                               6C43CCB51535039600162364 /* ffitarget_arm.h in Headers */,
518 +                               6C43CCB61535039600162364 /* ffitarget_armv7.h in Headers */,
519 +                               6C43CCB71535039600162364 /* ffitarget_i386.h in Headers */,
520 +                               6C43CCB11535039600162364 /* fficonfig.h in Headers */,
521 +                               6C43CCB21535039600162364 /* fficonfig_armv7.h in Headers */,
522 +                               6C43CCB31535039600162364 /* fficonfig_i386.h in Headers */,
523                         );
524                         runOnlyForDeploymentPostprocessing = 0;
525                 };
526  /* End PBXHeadersBuildPhase section */
527  
528  /* Begin PBXNativeTarget section */
529 -               F6F980B9147386130008F121 /* ffi */ = {
530 +               6C43CB3C1534E9D100162364 /* libffi OS X */ = {
531 +                       isa = PBXNativeTarget;
532 +                       buildConfigurationList = 6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */;
533 +                       buildPhases = (
534 +                               6C43CC401534FF3B00162364 /* Generate Source and Headers */,
535 +                               6C43CB391534E9D100162364 /* Sources */,
536 +                               6C43CB3A1534E9D100162364 /* Frameworks */,
537 +                               6C43CB3B1534E9D100162364 /* Headers */,
538 +                       );
539 +                       buildRules = (
540 +                       );
541 +                       dependencies = (
542 +                       );
543 +                       name = "libffi OS X";
544 +                       productName = "ffi OS X";
545 +                       productReference = 6C43CB3D1534E9D100162364 /* libffi.a */;
546 +                       productType = "com.apple.product-type.library.static";
547 +               };
548 +               F6F980B9147386130008F121 /* libffi iOS */ = {
549                         isa = PBXNativeTarget;
550 -                       buildConfigurationList = F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "ffi" */;
551 +                       buildConfigurationList = F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */;
552                         buildPhases = (
553 +                               6C43CC3E1534F8E200162364 /* Generate Trampoline */,
554 +                               6C43CC3F1534FF1B00162364 /* Generate Source and Headers */,
555                                 F6F980B6147386130008F121 /* Sources */,
556                                 F6F980B7147386130008F121 /* Frameworks */,
557                                 F6F980B8147386130008F121 /* Headers */,
558 @@ -163,7 +326,7 @@
559                         );
560                         dependencies = (
561                         );
562 -                       name = ffi;
563 +                       name = "libffi iOS";
564                         productName = ffi;
565                         productReference = F6F980BA147386130008F121 /* libffi.a */;
566                         productType = "com.apple.product-type.library.static";
567 @@ -174,7 +337,7 @@
568                 F6B0839714721EE50031D8A1 /* Project object */ = {
569                         isa = PBXProject;
570                         attributes = {
571 -                               LastUpgradeCheck = 0420;
572 +                               LastUpgradeCheck = 0430;
573                         };
574                         buildConfigurationList = F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */;
575                         compatibilityVersion = "Xcode 3.2";
576 @@ -188,34 +351,139 @@
577                         projectDirPath = "";
578                         projectRoot = "";
579                         targets = (
580 -                               F6F980B9147386130008F121 /* ffi */,
581 +                               F6F980B9147386130008F121 /* libffi iOS */,
582 +                               6C43CB3C1534E9D100162364 /* libffi OS X */,
583                         );
584                 };
585  /* End PBXProject section */
586  
587 +/* Begin PBXShellScriptBuildPhase section */
588 +               6C43CC3E1534F8E200162364 /* Generate Trampoline */ = {
589 +                       isa = PBXShellScriptBuildPhase;
590 +                       buildActionMask = 2147483647;
591 +                       files = (
592 +                       );
593 +                       inputPaths = (
594 +                       );
595 +                       name = "Generate Trampoline";
596 +                       outputPaths = (
597 +                       );
598 +                       runOnlyForDeploymentPostprocessing = 0;
599 +                       shellPath = /usr/bin/python;
600 +                       shellScript = "import subprocess\nimport re\nimport os\nimport errno\nimport sys\n\ndef main():\n    with open('src/arm/trampoline.S', 'w') as tramp_out:\n        p = subprocess.Popen(['bash', 'src/arm/gentramp.sh'], stdout=tramp_out)\n        p.wait()\n\nif __name__ == '__main__':\n    main()";
601 +               };
602 +               6C43CC3F1534FF1B00162364 /* Generate Source and Headers */ = {
603 +                       isa = PBXShellScriptBuildPhase;
604 +                       buildActionMask = 2147483647;
605 +                       files = (
606 +                       );
607 +                       inputPaths = (
608 +                       );
609 +                       name = "Generate Source and Headers";
610 +                       outputPaths = (
611 +                       );
612 +                       runOnlyForDeploymentPostprocessing = 0;
613 +                       shellPath = /bin/sh;
614 +                       shellScript = "/usr/bin/python generate-ios-source-and-headers.py";
615 +               };
616 +               6C43CC401534FF3B00162364 /* Generate Source and Headers */ = {
617 +                       isa = PBXShellScriptBuildPhase;
618 +                       buildActionMask = 2147483647;
619 +                       files = (
620 +                       );
621 +                       inputPaths = (
622 +                       );
623 +                       name = "Generate Source and Headers";
624 +                       outputPaths = (
625 +                       );
626 +                       runOnlyForDeploymentPostprocessing = 0;
627 +                       shellPath = /bin/sh;
628 +                       shellScript = "/usr/bin/python generate-osx-source-and-headers.py";
629 +               };
630 +/* End PBXShellScriptBuildPhase section */
631 +
632  /* Begin PBXSourcesBuildPhase section */
633 +               6C43CB391534E9D100162364 /* Sources */ = {
634 +                       isa = PBXSourcesBuildPhase;
635 +                       buildActionMask = 2147483647;
636 +                       files = (
637 +                               6C43CC1F1534F77800162364 /* darwin.S in Sources */,
638 +                               6C43CC201534F77800162364 /* darwin64.S in Sources */,
639 +                               6C43CC211534F77800162364 /* ffi.c in Sources */,
640 +                               6C43CC221534F77800162364 /* ffi64.c in Sources */,
641 +                               6C43CC301534F7BE00162364 /* closures.c in Sources */,
642 +                               6C43CC321534F7BE00162364 /* debug.c in Sources */,
643 +                               6C43CC341534F7BE00162364 /* dlmalloc.c in Sources */,
644 +                               6C43CC361534F7BE00162364 /* java_raw_api.c in Sources */,
645 +                               6C43CC381534F7BE00162364 /* prep_cif.c in Sources */,
646 +                               6C43CC3A1534F7BE00162364 /* raw_api.c in Sources */,
647 +                               6C43CC3C1534F7BE00162364 /* types.c in Sources */,
648 +                       );
649 +                       runOnlyForDeploymentPostprocessing = 0;
650 +               };
651                 F6F980B6147386130008F121 /* Sources */ = {
652                         isa = PBXSourcesBuildPhase;
653                         buildActionMask = 2147483647;
654                         files = (
655 -                               F66B6AF9152FA32400B29B2A /* ffi.c in Sources */,
656 -                               F66B6AFA152FA32400B29B2A /* sysv.S in Sources */,
657 -                               F66B6AFB152FA32400B29B2A /* trampoline.S in Sources */,
658 -                               F66B6AFC152FA32400B29B2A /* closures.c in Sources */,
659 -                               F66B6AFD152FA32400B29B2A /* debug.c in Sources */,
660 -                               F66B6AFE152FA32400B29B2A /* dlmalloc.c in Sources */,
661 -                               F66B6AFF152FA32400B29B2A /* java_raw_api.c in Sources */,
662 -                               F66B6B00152FA32400B29B2A /* prep_cif.c in Sources */,
663 -                               F66B6B01152FA32400B29B2A /* raw_api.c in Sources */,
664 -                               F66B6B02152FA32400B29B2A /* types.c in Sources */,
665 -                               F66B6B03152FA32400B29B2A /* darwin.S in Sources */,
666 -                               F66B6B05152FA32400B29B2A /* ffi.c in Sources */,
667 +                               6C43CBDC1534F76F00162364 /* ffi.c in Sources */,
668 +                               6C43CBDD1534F76F00162364 /* sysv.S in Sources */,
669 +                               6C43CBDE1534F76F00162364 /* trampoline.S in Sources */,
670 +                               6C43CBE61534F76F00162364 /* darwin.S in Sources */,
671 +                               6C43CBE81534F76F00162364 /* ffi.c in Sources */,
672 +                               6C43CBE91534F76F00162364 /* ffi64.c in Sources */,
673 +                               6C43CC2F1534F7BE00162364 /* closures.c in Sources */,
674 +                               6C43CC311534F7BE00162364 /* debug.c in Sources */,
675 +                               6C43CC331534F7BE00162364 /* dlmalloc.c in Sources */,
676 +                               6C43CC351534F7BE00162364 /* java_raw_api.c in Sources */,
677 +                               6C43CC371534F7BE00162364 /* prep_cif.c in Sources */,
678 +                               6C43CC391534F7BE00162364 /* raw_api.c in Sources */,
679 +                               6C43CC3B1534F7BE00162364 /* types.c in Sources */,
680                         );
681                         runOnlyForDeploymentPostprocessing = 0;
682                 };
683  /* End PBXSourcesBuildPhase section */
684  
685  /* Begin XCBuildConfiguration section */
686 +               6C43CB4B1534E9D100162364 /* Debug */ = {
687 +                       isa = XCBuildConfiguration;
688 +                       buildSettings = {
689 +                               ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
690 +                               DSTROOT = /tmp/ffi.dst;
691 +                               FRAMEWORK_SEARCH_PATHS = (
692 +                                       "$(inherited)",
693 +                                       "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"",
694 +                               );
695 +                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
696 +                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
697 +                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
698 +                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
699 +                               MACOSX_DEPLOYMENT_TARGET = 10.6;
700 +                               ONLY_ACTIVE_ARCH = YES;
701 +                               PRODUCT_NAME = ffi;
702 +                               SDKROOT = macosx;
703 +                       };
704 +                       name = Debug;
705 +               };
706 +               6C43CB4C1534E9D100162364 /* Release */ = {
707 +                       isa = XCBuildConfiguration;
708 +                       buildSettings = {
709 +                               ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
710 +                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
711 +                               DSTROOT = /tmp/ffi.dst;
712 +                               FRAMEWORK_SEARCH_PATHS = (
713 +                                       "$(inherited)",
714 +                                       "\"$(SYSTEM_APPS_DIR)/Xcode.app/Contents/Developer/Library/Frameworks\"",
715 +                               );
716 +                               GCC_ENABLE_OBJC_EXCEPTIONS = YES;
717 +                               GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
718 +                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
719 +                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
720 +                               MACOSX_DEPLOYMENT_TARGET = 10.6;
721 +                               PRODUCT_NAME = ffi;
722 +                               SDKROOT = macosx;
723 +                       };
724 +                       name = Release;
725 +               };
726                 F6B083AB14721EE50031D8A1 /* Debug */ = {
727                         isa = XCBuildConfiguration;
728                         buildSettings = {
729 @@ -230,8 +498,9 @@
730                                         "$(inherited)",
731                                 );
732                                 GCC_SYMBOLS_PRIVATE_EXTERN = NO;
733 -                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
734 +                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
735                                 GCC_WARN_ABOUT_RETURN_TYPE = YES;
736 +                               GCC_WARN_UNUSED_VALUE = NO;
737                                 GCC_WARN_UNUSED_VARIABLE = YES;
738                                 HEADER_SEARCH_PATHS = ios/include;
739                                 SDKROOT = iphoneos;
740 @@ -246,8 +515,9 @@
741                                 COPY_PHASE_STRIP = YES;
742                                 GCC_C_LANGUAGE_STANDARD = gnu99;
743                                 GCC_PREPROCESSOR_DEFINITIONS = "";
744 -                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
745 +                               GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
746                                 GCC_WARN_ABOUT_RETURN_TYPE = YES;
747 +                               GCC_WARN_UNUSED_VALUE = NO;
748                                 GCC_WARN_UNUSED_VARIABLE = YES;
749                                 HEADER_SEARCH_PATHS = ios/include;
750                                 SDKROOT = iphoneos;
751 @@ -258,10 +528,16 @@
752                 F6F980C2147386130008F121 /* Debug */ = {
753                         isa = XCBuildConfiguration;
754                         buildSettings = {
755 +                               ARCHS = (
756 +                                       armv6,
757 +                                       armv7,
758 +                               );
759                                 DSTROOT = /tmp/ffi.dst;
760                                 GCC_PRECOMPILE_PREFIX_HEADER = YES;
761 +                               GCC_THUMB_SUPPORT = NO;
762 +                               IPHONEOS_DEPLOYMENT_TARGET = 4.0;
763                                 OTHER_LDFLAGS = "-ObjC";
764 -                               PRODUCT_NAME = "$(TARGET_NAME)";
765 +                               PRODUCT_NAME = ffi;
766                                 SKIP_INSTALL = YES;
767                         };
768                         name = Debug;
769 @@ -269,10 +545,16 @@
770                 F6F980C3147386130008F121 /* Release */ = {
771                         isa = XCBuildConfiguration;
772                         buildSettings = {
773 +                               ARCHS = (
774 +                                       armv6,
775 +                                       armv7,
776 +                               );
777                                 DSTROOT = /tmp/ffi.dst;
778                                 GCC_PRECOMPILE_PREFIX_HEADER = YES;
779 +                               GCC_THUMB_SUPPORT = NO;
780 +                               IPHONEOS_DEPLOYMENT_TARGET = 4.0;
781                                 OTHER_LDFLAGS = "-ObjC";
782 -                               PRODUCT_NAME = "$(TARGET_NAME)";
783 +                               PRODUCT_NAME = ffi;
784                                 SKIP_INSTALL = YES;
785                         };
786                         name = Release;
787 @@ -280,6 +562,15 @@
788  /* End XCBuildConfiguration section */
789  
790  /* Begin XCConfigurationList section */
791 +               6C43CB4A1534E9D100162364 /* Build configuration list for PBXNativeTarget "libffi OS X" */ = {
792 +                       isa = XCConfigurationList;
793 +                       buildConfigurations = (
794 +                               6C43CB4B1534E9D100162364 /* Debug */,
795 +                               6C43CB4C1534E9D100162364 /* Release */,
796 +                       );
797 +                       defaultConfigurationIsVisible = 0;
798 +                       defaultConfigurationName = Release;
799 +               };
800                 F6B0839A14721EE50031D8A1 /* Build configuration list for PBXProject "libffi" */ = {
801                         isa = XCConfigurationList;
802                         buildConfigurations = (
803 @@ -289,7 +580,7 @@
804                         defaultConfigurationIsVisible = 0;
805                         defaultConfigurationName = Release;
806                 };
807 -               F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "ffi" */ = {
808 +               F6F980C4147386130008F121 /* Build configuration list for PBXNativeTarget "libffi iOS" */ = {
809                         isa = XCConfigurationList;
810                         buildConfigurations = (
811                                 F6F980C2147386130008F121 /* Debug */,
812 Index: libffi/src/arm/trampoline.S
813 ===================================================================
814 --- libffi.orig/src/arm/trampoline.S
815 +++ libffi/src/arm/trampoline.S
816 @@ -1,5 +1,5 @@
817  # GENERATED CODE - DO NOT EDIT
818 -# This file was generated by ./gentramp.sh
819 +# This file was generated by src/arm/gentramp.sh
820  
821  #  Copyright (c) 2010, Plausible Labs Cooperative, Inc.
822  #