Commits

Ronald Oussoren committed 50e8780

Merge with libffi-15 from 10.6.7, and fix an x86-64 issue

This check-in does two things:

1) Use the libffi-15 sources from MacOSX 10.6.7 (as provided on opensource.apple.com)

2) Patch that version to fix a test failure for x86-64 when using clang as the compiler

This adds explict sign extension to the code in x86-ffi64.c, which wasn't required
when using GCC but is required with clang. It is unclear whether this is a bug in clang,
the x86-64 API specification isn't very clear about this.

  • Participants
  • Parent commits adbfb83

Comments (0)

Files changed (9)

File pyobjc-core/libffi-src/include/ffi.h

 extern "C" {
 #endif
 
+#include "fficonfig.h"
+
 /*	Specify which architecture libffi is configured for. */
 #ifdef MACOSX
 #	if defined(__i386__) || defined(__x86_64__)
 /* ---- System configuration information --------------------------------- */
 
 #include "ffitarget.h"
-#include "fficonfig.h"
 
 #ifndef LIBFFI_ASM
 
 	void				(*fun)(ffi_cif*,void*,ffi_raw*,void*),
 	void*				user_data);
 
-#endif	// FFI_CLOSURES
+#elif
+#error FFI_CLOSURES not defined
+#endif
 
 /* ---- Public interface definition -------------------------------------- */
 

File pyobjc-core/libffi-src/include/ffi_common.h

 #	endif
 #endif
 
-/*#if defined(FFI_DEBUG) 
-#include <stdio.h>
-#endif*/
-
 #ifdef FFI_DEBUG
 #include <stdio.h>
 

File pyobjc-core/libffi-src/include/fficonfig.h

 	NOTE: This file was added by PyObjC.
 */
 
+#if defined(__APPLE__) && defined(__MACH__) && !defined(MACOSX)
+	#define MACOSX
+#endif
+
 #ifndef MACOSX
 #error "This file is only supported on Mac OS X"
 #endif
 #define EH_FRAME_FLAGS "aw"
 
 /*	Define this if you want extra debugging. */
-/*	#undef FFI_DEBUG */
+#undef FFI_DEBUG
 
 /*	Define this is you do not want support for the raw API. */
 #define FFI_NO_RAW_API 1

File pyobjc-core/libffi-src/libffi.xcodeproj/project.pbxproj

 	objects = {
 
 /* Begin PBXBuildFile section */
-		4D615B6E0B84B5160064908B /* darwin64.S in Sources */ = {isa = PBXBuildFile; fileRef = 4D615B6C0B84B5160064908B /* darwin64.S */; };
-		4D615B6F0B84B5160064908B /* x86-ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D615B6D0B84B5160064908B /* x86-ffi64.c */; };
-		774A68780AB08B5000FBC511 /* prep_cif.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A68760AB08B5000FBC511 /* prep_cif.c */; };
-		774A68790AB08B5000FBC511 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A68770AB08B5000FBC511 /* types.c */; };
-		774A68820AB08B6D00FBC511 /* ppc-asm.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A687A0AB08B6D00FBC511 /* ppc-asm.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		774A68830AB08B6D00FBC511 /* ppc-darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 774A687B0AB08B6D00FBC511 /* ppc-darwin.S */; };
-		774A68840AB08B6D00FBC511 /* ppc-darwin_closure.S in Sources */ = {isa = PBXBuildFile; fileRef = 774A687C0AB08B6D00FBC511 /* ppc-darwin_closure.S */; };
-		774A68860AB08B6D00FBC511 /* ppc-ffi_darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A687E0AB08B6D00FBC511 /* ppc-ffi_darwin.c */; };
-		774A68870AB08B6D00FBC511 /* ppc-ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A687F0AB08B6D00FBC511 /* ppc-ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		774A68910AB08B7A00FBC511 /* x86-darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 774A688A0AB08B7A00FBC511 /* x86-darwin.S */; };
-		774A68940AB08B7A00FBC511 /* x86-ffi_darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A688D0AB08B7A00FBC511 /* x86-ffi_darwin.c */; };
-		774A68950AB08B7A00FBC511 /* x86-ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A688E0AB08B7A00FBC511 /* x86-ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		774A689E0AB08BEB00FBC511 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689A0AB08BEB00FBC511 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		774A689F0AB08BEB00FBC511 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689B0AB08BEB00FBC511 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		774A68A00AB08BEB00FBC511 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689C0AB08BEB00FBC511 /* fficonfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		774A68A10AB08BEB00FBC511 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689D0AB08BEB00FBC511 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		2511C4030C371B4A005376A8 /* ffi.c in Sources */ = {isa = PBXBuildFile; fileRef = 2511C4020C371B4A005376A8 /* ffi.c */; };
+		25840CF80C7A295600864AAA /* ffi_call.3 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2575F8B90C6BDD0500B6D9A2 /* ffi_call.3 */; };
+		25840CF90C7A295600864AAA /* ffi_prep_cif.3 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2575F8BA0C6BDD0500B6D9A2 /* ffi_prep_cif.3 */; };
+		25840CFA0C7A295600864AAA /* ffi.3 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2575F8BB0C6BDD0500B6D9A2 /* ffi.3 */; };
+		25840CFB0C7A295600864AAA /* ffi_prep_closure.3 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2575F8BC0C6BDD0500B6D9A2 /* ffi_prep_closure.3 */; };
+		259F43340C28CD8900537400 /* ppc-ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A687F0AB08B6D00FBC511 /* ppc-ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F43350C28CD8900537400 /* x86-ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A688E0AB08B7A00FBC511 /* x86-ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F43360C28CD8900537400 /* ffi.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689A0AB08BEB00FBC511 /* ffi.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F43370C28CD8900537400 /* ffi_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689B0AB08BEB00FBC511 /* ffi_common.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F43380C28CD8900537400 /* fficonfig.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689C0AB08BEB00FBC511 /* fficonfig.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F43390C28CD8900537400 /* ffitarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 774A689D0AB08BEB00FBC511 /* ffitarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F433A0C28CD8900537400 /* ppc-darwin.h in Headers */ = {isa = PBXBuildFile; fileRef = 25A25CCE0C0F6B6100532060 /* ppc-darwin.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		259F433C0C28CD9400537400 /* types.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A68770AB08B5000FBC511 /* types.c */; };
+		259F433D0C28CD9400537400 /* ppc-darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 774A687B0AB08B6D00FBC511 /* ppc-darwin.S */; };
+		259F433E0C28CD9400537400 /* ppc-darwin_closure.S in Sources */ = {isa = PBXBuildFile; fileRef = 774A687C0AB08B6D00FBC511 /* ppc-darwin_closure.S */; };
+		259F433F0C28CD9400537400 /* ppc-ffi_darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A687E0AB08B6D00FBC511 /* ppc-ffi_darwin.c */; };
+		259F43400C28CD9400537400 /* x86-darwin.S in Sources */ = {isa = PBXBuildFile; fileRef = 774A688A0AB08B7A00FBC511 /* x86-darwin.S */; };
+		259F43410C28CD9400537400 /* x86-ffi_darwin.c in Sources */ = {isa = PBXBuildFile; fileRef = 774A688D0AB08B7A00FBC511 /* x86-ffi_darwin.c */; };
+		259F43420C28CD9400537400 /* darwin64.S in Sources */ = {isa = PBXBuildFile; fileRef = 4D615B6C0B84B5160064908B /* darwin64.S */; };
+		259F43430C28CD9400537400 /* x86-ffi64.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D615B6D0B84B5160064908B /* x86-ffi64.c */; };
+		259F43440C28CD9400537400 /* ppc64-darwin_closure.S in Sources */ = {isa = PBXBuildFile; fileRef = 25358B780C18D7AF00537400 /* ppc64-darwin_closure.S */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXCopyFilesBuildPhase section */
+		25840CFC0C7A29E800864AAA /* CopyFiles */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 8;
+			dstPath = /usr/share/man/man3/;
+			dstSubfolderSpec = 0;
+			files = (
+				25840CFA0C7A295600864AAA /* ffi.3 in CopyFiles */,
+				25840CF80C7A295600864AAA /* ffi_call.3 in CopyFiles */,
+				25840CF90C7A295600864AAA /* ffi_prep_cif.3 in CopyFiles */,
+				25840CFB0C7A295600864AAA /* ffi_prep_closure.3 in CopyFiles */,
+			);
+			runOnlyForDeploymentPostprocessing = 1;
+		};
+/* End PBXCopyFilesBuildPhase section */
+
 /* Begin PBXFileReference section */
+		2511C4020C371B4A005376A8 /* ffi.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = ffi.c; sourceTree = "<group>"; };
+		25358B780C18D7AF00537400 /* ppc64-darwin_closure.S */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.asm; path = "ppc64-darwin_closure.S"; sourceTree = "<group>"; };
+		2575F8B90C6BDD0500B6D9A2 /* ffi_call.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; name = ffi_call.3; path = man/ffi_call.3; sourceTree = "<group>"; };
+		2575F8BA0C6BDD0500B6D9A2 /* ffi_prep_cif.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; name = ffi_prep_cif.3; path = man/ffi_prep_cif.3; sourceTree = "<group>"; };
+		2575F8BB0C6BDD0500B6D9A2 /* ffi.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; name = ffi.3; path = man/ffi.3; sourceTree = "<group>"; };
+		2575F8BC0C6BDD0500B6D9A2 /* ffi_prep_closure.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; name = ffi_prep_closure.3; path = man/ffi_prep_closure.3; sourceTree = "<group>"; };
+		259F43230C28CBD700537400 /* libffi.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libffi.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+		25A25CCE0C0F6B6100532060 /* ppc-darwin.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "ppc-darwin.h"; sourceTree = "<group>"; };
 		4D615B6C0B84B5160064908B /* darwin64.S */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.asm; path = darwin64.S; sourceTree = "<group>"; };
 		4D615B6D0B84B5160064908B /* x86-ffi64.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "x86-ffi64.c"; sourceTree = "<group>"; };
 		774A68580AB08A7400FBC511 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = LICENSE; sourceTree = "<group>"; };
 		774A68590AB08A8300FBC511 /* README */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
-		774A68760AB08B5000FBC511 /* prep_cif.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = prep_cif.c; sourceTree = "<group>"; };
 		774A68770AB08B5000FBC511 /* types.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = types.c; sourceTree = "<group>"; };
-		774A687A0AB08B6D00FBC511 /* ppc-asm.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "ppc-asm.h"; sourceTree = "<group>"; };
 		774A687B0AB08B6D00FBC511 /* ppc-darwin.S */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.asm; path = "ppc-darwin.S"; sourceTree = "<group>"; };
 		774A687C0AB08B6D00FBC511 /* ppc-darwin_closure.S */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.asm; path = "ppc-darwin_closure.S"; sourceTree = "<group>"; };
 		774A687E0AB08B6D00FBC511 /* ppc-ffi_darwin.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; path = "ppc-ffi_darwin.c"; sourceTree = "<group>"; };
 		774A689C0AB08BEB00FBC511 /* fficonfig.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = fficonfig.h; path = include/fficonfig.h; sourceTree = "<group>"; };
 		774A689D0AB08BEB00FBC511 /* ffitarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ffitarget.h; path = include/ffitarget.h; sourceTree = "<group>"; };
 		774A68EB0AB0BC2400FBC511 /* README.MacOSX */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.MacOSX; sourceTree = "<group>"; };
-		D2AAC046055464E500DB518D /* libffi.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libffi.a; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
-		D289987405E68DCB004EDB86 /* Frameworks */ = {
+		259F43210C28CBD700537400 /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
 		08FB7795FE84155DC02AAC07 /* Source */ = {
 			isa = PBXGroup;
 			children = (
-				774A68760AB08B5000FBC511 /* prep_cif.c */,
+				2511C4020C371B4A005376A8 /* ffi.c */,
 				774A68770AB08B5000FBC511 /* types.c */,
 				774A685A0AB08AC500FBC511 /* powerpc */,
 				774A68630AB08AC500FBC511 /* x86 */,
 		1AB674ADFE9D54B511CA2CBB /* Products */ = {
 			isa = PBXGroup;
 			children = (
-				D2AAC046055464E500DB518D /* libffi.a */,
+				259F43230C28CBD700537400 /* libffi.dylib */,
 			);
 			name = Products;
 			sourceTree = "<group>";
 		774A685A0AB08AC500FBC511 /* powerpc */ = {
 			isa = PBXGroup;
 			children = (
-				774A687A0AB08B6D00FBC511 /* ppc-asm.h */,
+				25A25CCE0C0F6B6100532060 /* ppc-darwin.h */,
 				774A687B0AB08B6D00FBC511 /* ppc-darwin.S */,
 				774A687C0AB08B6D00FBC511 /* ppc-darwin_closure.S */,
+				25358B780C18D7AF00537400 /* ppc64-darwin_closure.S */,
 				774A687E0AB08B6D00FBC511 /* ppc-ffi_darwin.c */,
 				774A687F0AB08B6D00FBC511 /* ppc-ffitarget.h */,
 			);
 		C6A0FF2B0290797F04C91782 /* Documentation */ = {
 			isa = PBXGroup;
 			children = (
+				2575F8B90C6BDD0500B6D9A2 /* ffi_call.3 */,
+				2575F8BA0C6BDD0500B6D9A2 /* ffi_prep_cif.3 */,
+				2575F8BB0C6BDD0500B6D9A2 /* ffi.3 */,
+				2575F8BC0C6BDD0500B6D9A2 /* ffi_prep_closure.3 */,
 				774A68EB0AB0BC2400FBC511 /* README.MacOSX */,
 				774A68590AB08A8300FBC511 /* README */,
 				774A68580AB08A7400FBC511 /* LICENSE */,
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
-		D2AAC043055464E500DB518D /* Headers */ = {
+		259F431F0C28CBD700537400 /* Headers */ = {
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				774A68820AB08B6D00FBC511 /* ppc-asm.h in Headers */,
-				774A68870AB08B6D00FBC511 /* ppc-ffitarget.h in Headers */,
-				774A68950AB08B7A00FBC511 /* x86-ffitarget.h in Headers */,
-				774A689E0AB08BEB00FBC511 /* ffi.h in Headers */,
-				774A689F0AB08BEB00FBC511 /* ffi_common.h in Headers */,
-				774A68A00AB08BEB00FBC511 /* fficonfig.h in Headers */,
-				774A68A10AB08BEB00FBC511 /* ffitarget.h in Headers */,
+				259F43340C28CD8900537400 /* ppc-ffitarget.h in Headers */,
+				259F43350C28CD8900537400 /* x86-ffitarget.h in Headers */,
+				259F43360C28CD8900537400 /* ffi.h in Headers */,
+				259F43370C28CD8900537400 /* ffi_common.h in Headers */,
+				259F43380C28CD8900537400 /* fficonfig.h in Headers */,
+				259F43390C28CD8900537400 /* ffitarget.h in Headers */,
+				259F433A0C28CD8900537400 /* ppc-darwin.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXHeadersBuildPhase section */
 
 /* Begin PBXNativeTarget section */
-		D2AAC045055464E500DB518D /* libffi */ = {
+		259F43220C28CBD700537400 /* libffi */ = {
 			isa = PBXNativeTarget;
-			buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "libffi" */;
+			buildConfigurationList = 259F43260C28CBF700537400 /* Build configuration list for PBXNativeTarget "libffi" */;
 			buildPhases = (
-				D2AAC043055464E500DB518D /* Headers */,
-				D2AAC044055464E500DB518D /* Sources */,
-				D289987405E68DCB004EDB86 /* Frameworks */,
+				259F431F0C28CBD700537400 /* Headers */,
+				25840CFC0C7A29E800864AAA /* CopyFiles */,
+				259F43200C28CBD700537400 /* Sources */,
+				259F43210C28CBD700537400 /* Frameworks */,
 			);
 			buildRules = (
 			);
 			dependencies = (
 			);
 			name = libffi;
-			productName = libffi;
-			productReference = D2AAC046055464E500DB518D /* libffi.a */;
-			productType = "com.apple.product-type.library.static";
+			productName = libffi_dyn;
+			productReference = 259F43230C28CBD700537400 /* libffi.dylib */;
+			productType = "com.apple.product-type.library.dynamic";
 		};
 /* End PBXNativeTarget section */
 
 		08FB7793FE84155DC02AAC07 /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "libffi" */;
+			compatibilityVersion = "Xcode 2.4";
 			hasScannedForEncodings = 1;
 			mainGroup = 08FB7794FE84155DC02AAC07 /* libffi */;
 			projectDirPath = "";
 			projectRoot = "";
 			targets = (
-				D2AAC045055464E500DB518D /* libffi */,
+				259F43220C28CBD700537400 /* libffi */,
 			);
 		};
 /* End PBXProject section */
 
 /* Begin PBXSourcesBuildPhase section */
-		D2AAC044055464E500DB518D /* Sources */ = {
+		259F43200C28CBD700537400 /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				774A68780AB08B5000FBC511 /* prep_cif.c in Sources */,
-				774A68790AB08B5000FBC511 /* types.c in Sources */,
-				774A68830AB08B6D00FBC511 /* ppc-darwin.S in Sources */,
-				774A68840AB08B6D00FBC511 /* ppc-darwin_closure.S in Sources */,
-				774A68860AB08B6D00FBC511 /* ppc-ffi_darwin.c in Sources */,
-				774A68910AB08B7A00FBC511 /* x86-darwin.S in Sources */,
-				774A68940AB08B7A00FBC511 /* x86-ffi_darwin.c in Sources */,
-				4D615B6E0B84B5160064908B /* darwin64.S in Sources */,
-				4D615B6F0B84B5160064908B /* x86-ffi64.c in Sources */,
+				259F433C0C28CD9400537400 /* types.c in Sources */,
+				259F433D0C28CD9400537400 /* ppc-darwin.S in Sources */,
+				259F433E0C28CD9400537400 /* ppc-darwin_closure.S in Sources */,
+				259F433F0C28CD9400537400 /* ppc-ffi_darwin.c in Sources */,
+				259F43400C28CD9400537400 /* x86-darwin.S in Sources */,
+				259F43410C28CD9400537400 /* x86-ffi_darwin.c in Sources */,
+				259F43420C28CD9400537400 /* darwin64.S in Sources */,
+				259F43430C28CD9400537400 /* x86-ffi64.c in Sources */,
+				259F43440C28CD9400537400 /* ppc64-darwin_closure.S in Sources */,
+				2511C4030C371B4A005376A8 /* ffi.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXSourcesBuildPhase section */
 
 /* Begin XCBuildConfiguration section */
-		1DEB91EC08733DB70010E9CD /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				DEBUG_INFORMATION_FORMAT = dwarf;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_FIX_AND_CONTINUE = YES;
-				GCC_MODEL_TUNING = G5;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				INSTALL_PATH = /usr/lib;
-				PRODUCT_NAME = ffi;
-				ZERO_LINK = YES;
-			};
-			name = Debug;
-		};
-		1DEB91ED08733DB70010E9CD /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				ARCHS = ppc64;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-				GCC_MODEL_TUNING = G5;
-				INSTALL_PATH = /usr/lib;
-				PRIVATE_HEADERS_FOLDER_PATH = /usr/include;
-				PRODUCT_NAME = ffi;
-			};
-			name = Release;
-		};
 		1DEB91F008733DB70010E9CD /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = ppc64;
+				ARCHS = "$(NATIVE_ARCH_ACTUAL)";
+				DEPLOYMENT_LOCATION = NO;
+				EXPORTED_SYMBOLS_FILE = "libffi-exports.sym";
 				GCC_OPTIMIZATION_LEVEL = 3;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
+				INSTALL_PATH = "";
 				OTHER_CFLAGS = (
 					"-DMACOSX",
 					"-arch",
 		1DEB91F108733DB70010E9CD /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = ppc64;
+				ALWAYS_SEARCH_USER_PATHS = YES;
+				ARCHS = (
+					ppc,
+					i386,
+					x86_64,
+				);
+				DEPLOYMENT_LOCATION = NO;
+				EXPORTED_SYMBOLS_FILE = "libffi-exports.sym";
 				GCC_OPTIMIZATION_LEVEL = 3;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				OTHER_CFLAGS = (
-					"-DMACOSX",
-					"-arch",
-					ppc64,
-				);
+				INSTALL_PATH = "";
 				PREBINDING = NO;
 				PUBLIC_HEADERS_FOLDER_PATH = ../include/ffi;
 			};
 			name = Release;
 		};
+		259F43240C28CBD900537400 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = NO;
+				EXECUTABLE_PREFIX = lib;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_ENABLE_FIX_AND_CONTINUE = YES;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				INSTALL_PATH = /usr/local/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = libffi_dyn;
+				ZERO_LINK = YES;
+			};
+			name = Debug;
+		};
+		259F43250C28CBD900537400 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				COPY_PHASE_STRIP = YES;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				EXECUTABLE_PREFIX = lib;
+				GCC_ENABLE_FIX_AND_CONTINUE = NO;
+				GCC_OPTIMIZATION_LEVEL = s;
+				INSTALL_PATH = /usr/lib;
+				PREBINDING = NO;
+				PRODUCT_NAME = ffi;
+				ZERO_LINK = NO;
+			};
+			name = Release;
+		};
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
-		1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "libffi" */ = {
-			isa = XCConfigurationList;
-			buildConfigurations = (
-				1DEB91EC08733DB70010E9CD /* Debug */,
-				1DEB91ED08733DB70010E9CD /* Release */,
-			);
-			defaultConfigurationIsVisible = 0;
-			defaultConfigurationName = Release;
-		};
 		1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "libffi" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
+		259F43260C28CBF700537400 /* Build configuration list for PBXNativeTarget "libffi" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				259F43240C28CBD900537400 /* Debug */,
+				259F43250C28CBD900537400 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
 /* End XCConfigurationList section */
 	};
 	rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;

File pyobjc-core/libffi-src/powerpc/ppc-ffi_darwin.c

 #include <ppc-darwin.h>
 #include <architecture/ppc/mode_independent_asm.h>
 
-#if 0
 #if defined(POWERPC_DARWIN)
 #include <libkern/OSCacheControl.h>	// for sys_icache_invalidate()
 #endif
 
-#else
-
-#pragma weak sys_icache_invalidate
-extern void sys_icache_invalidate(void *start, size_t len);
-
-#endif
-
-
 extern void ffi_closure_ASM(void);
 
 // The layout of a function descriptor.  A C function pointer really
 }
 
 #endif	/*	defined(__ppc64__)	*/
-#endif	/* __ppc__ || __ppc64__ */
+#endif	/* __ppc__ || __ppc64__ */

File pyobjc-core/libffi-src/tests/testsuite/libffi.call/cls_longdouble.c

 		a1, a2, a3, a4, a5, a6, a7, a8);
 }
 
-int main (void)
+int main(void)
 {
 	ffi_cif	cif;
 #ifndef USING_MMAP
 	ffi_closure*	pcl;
 	void*			args[9];
 	ffi_type*		arg_types[9];
-//	ffi_type		cls_ldouble_type;
 	long double		res	= 0;
 
 #ifdef USING_MMAP
 	long double	arg7	= 7;
 	long double	arg8	= 8;
 
-/*	cls_ldouble_type.size = sizeof(long double);
-	cls_ldouble_type.alignment = 0;
-	cls_ldouble_type.type = FFI_TYPE_LONGDOUBLE;
-	cls_ldouble_type.elements = NULL;*/
-
 	arg_types[0] = &ffi_type_longdouble;
 	arg_types[1] = &ffi_type_longdouble;
 	arg_types[2] = &ffi_type_longdouble;
 	printf("res: %Lg\n", res);
 	/* { dg-output "\nres: 36" } */
 
-  exit(0);
+	return 0;
 }

File pyobjc-core/libffi-src/tests/testsuite/libffi.call/ffitest.h

 
 #define CHECK(x) !(x) ? abort() : 0
 
+
 /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
    file open.  */
 #ifdef HAVE_MMAP_ANON

File pyobjc-core/libffi-src/tests/testsuite/libffi.call/return_ll.c

   void *values[MAX_ARGS];
   long long rlonglong;
   long long ll;
-  unsigned long ul;
-  
- 
+
   args[0] = &ffi_type_sint64;
   values[0] = &ll;
-  
+
   /* Initialize the cif */
   CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, 
 		     &ffi_type_sint64, args) == FFI_OK);
-  
-  for (ll = 0LL; ll < 100LL; ll++)
+
+	/*	BC:	Incrementing from signed 0 doesn't result in 1.
+		Starting from 1 now.	*/
+  for (ll = 1LL; ll < 100LL; ll++)
     {
-      ul++;
       ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
       CHECK(rlonglong == ll);
     }
   
   for (ll = 55555555555000LL; ll < 55555555555100LL; ll++)
     {
-      ul++;
       ffi_call(&cif, FFI_FN(return_ll), &rlonglong, values);
       CHECK(rlonglong == ll);
     }

File pyobjc-core/libffi-src/x86/x86-ffi64.c

 					case X86_64_INTEGER_CLASS:
 					case X86_64_INTEGERSI_CLASS:
 						reg_args->gpr[gprcount] = 0;
-						memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
+						switch (arg_types[i]->type) {
+						case FFI_TYPE_SINT8:
+						   {
+							int8_t shortval = *(int8_t*)a;
+							int64_t  actval = (int64_t)shortval;
+							memcpy (&reg_args->gpr[gprcount], &actval, 8);
+							break;
+						   }
+
+						case FFI_TYPE_SINT16:
+						   {
+							int16_t shortval = *(int16_t*)a;
+							int64_t  actval = (int64_t)shortval;
+							memcpy (&reg_args->gpr[gprcount], &actval, 8);
+							break;
+						   }
+
+						case FFI_TYPE_SINT32:
+						   {
+							int32_t shortval = *(int32_t*)a;
+							int64_t  actval = (int64_t)shortval;
+							memcpy (&reg_args->gpr[gprcount], &actval, 8);
+							break;
+						   }
+
+						default:
+							memcpy (&reg_args->gpr[gprcount], a, size < 8 ? size : 8);
+						}
 						gprcount++;
 						break;
 
 	return ret;
 }
 
-#endif /* __x86_64__ */
+#endif /* __x86_64__ */