Permalink
Browse files

more libffi simplifications, fixes for iOS compiler warnings.

  • Loading branch information...
1 parent a96a227 commit af95d9233bcf9744142a0f745e90f7c37de92c5b @timburks timburks committed Jul 9, 2011
Showing with 11 additions and 78 deletions.
  1. +4 −32 Xcode/Nu.xcodeproj/project.pbxproj
  2. +1 −1 libffi/ffi.S
  3. +6 −45 libffi/ffi.c
@@ -34,7 +34,6 @@
22B3B3CA13B033D400B3AB31 /* test_math.nu in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B39C13B033D400B3AB31 /* test_math.nu */; };
22B3B3CB13B033D400B3AB31 /* test_memory.nu in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B39D13B033D400B3AB31 /* test_memory.nu */; };
22B3B3CC13B033D400B3AB31 /* test_nu.nu in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B39E13B033D400B3AB31 /* test_nu.nu */; };
- 22B3B3CD13B033D400B3AB31 /* test_nu.rb in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B39F13B033D400B3AB31 /* test_nu.rb */; };
22B3B3CE13B033D400B3AB31 /* test_numbers.nu in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B3A013B033D400B3AB31 /* test_numbers.nu */; };
22B3B3CF13B033D400B3AB31 /* test_onlisp.nu in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B3A113B033D400B3AB31 /* test_onlisp.nu */; };
22B3B3D013B033D400B3AB31 /* test_operators.nu in Resources */ = {isa = PBXBuildFile; fileRef = 22B3B3A213B033D400B3AB31 /* test_operators.nu */; };
@@ -143,7 +142,6 @@
22B3B39C13B033D400B3AB31 /* test_math.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_math.nu; sourceTree = "<group>"; };
22B3B39D13B033D400B3AB31 /* test_memory.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_memory.nu; sourceTree = "<group>"; };
22B3B39E13B033D400B3AB31 /* test_nu.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_nu.nu; sourceTree = "<group>"; };
- 22B3B39F13B033D400B3AB31 /* test_nu.rb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.ruby; path = test_nu.rb; sourceTree = "<group>"; };
22B3B3A013B033D400B3AB31 /* test_numbers.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_numbers.nu; sourceTree = "<group>"; };
22B3B3A113B033D400B3AB31 /* test_onlisp.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_onlisp.nu; sourceTree = "<group>"; };
22B3B3A213B033D400B3AB31 /* test_operators.nu */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = test_operators.nu; sourceTree = "<group>"; };
@@ -325,7 +323,6 @@
22B3B39C13B033D400B3AB31 /* test_math.nu */,
22B3B39D13B033D400B3AB31 /* test_memory.nu */,
22B3B39E13B033D400B3AB31 /* test_nu.nu */,
- 22B3B39F13B033D400B3AB31 /* test_nu.rb */,
22B3B3A013B033D400B3AB31 /* test_numbers.nu */,
22B3B3A113B033D400B3AB31 /* test_onlisp.nu */,
22B3B3A213B033D400B3AB31 /* test_operators.nu */,
@@ -554,7 +551,6 @@
22B3B3CA13B033D400B3AB31 /* test_math.nu in Resources */,
22B3B3CB13B033D400B3AB31 /* test_memory.nu in Resources */,
22B3B3CC13B033D400B3AB31 /* test_nu.nu in Resources */,
- 22B3B3CD13B033D400B3AB31 /* test_nu.rb in Resources */,
22B3B3CE13B033D400B3AB31 /* test_numbers.nu in Resources */,
22B3B3CF13B033D400B3AB31 /* test_onlisp.nu in Resources */,
22B3B3D013B033D400B3AB31 /* test_operators.nu in Resources */,
@@ -704,13 +700,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Frameworks";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../build/i386\"",
- "\"$(SRCROOT)/../build/x86_64\"",
- "\"$(SRCROOT)/../examples/NuAnywhere/NuInject/build/x86_64\"",
- "\"$(SRCROOT)/../iphone/platforms/iPhoneSimulator/lib\"",
- );
+ LIBRARY_SEARCH_PATHS = "";
PRODUCT_NAME = Nu;
WRAPPER_EXTENSION = framework;
};
@@ -735,13 +725,7 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Frameworks";
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../build/i386\"",
- "\"$(SRCROOT)/../build/x86_64\"",
- "\"$(SRCROOT)/../examples/NuAnywhere/NuInject/build/x86_64\"",
- "\"$(SRCROOT)/../iphone/platforms/iPhoneSimulator/lib\"",
- );
+ LIBRARY_SEARCH_PATHS = "";
PRODUCT_NAME = Nu;
WRAPPER_EXTENSION = framework;
};
@@ -870,13 +854,7 @@
);
INFOPLIST_FILE = "NuApp/NuApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../build/i386\"",
- "\"$(SRCROOT)/../build/x86_64\"",
- "\"$(SRCROOT)/../examples/NuAnywhere/NuInject/build/x86_64\"",
- "\"$(SRCROOT)/../iphone/platforms/iPhoneSimulator/lib\"",
- );
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
@@ -912,13 +890,7 @@
);
INFOPLIST_FILE = "NuApp/NuApp-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../build/i386\"",
- "\"$(SRCROOT)/../build/x86_64\"",
- "\"$(SRCROOT)/../examples/NuAnywhere/NuInject/build/x86_64\"",
- "\"$(SRCROOT)/../iphone/platforms/iPhoneSimulator/lib\"",
- );
+ LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
OTHER_LDFLAGS = "";
PRODUCT_NAME = "$(TARGET_NAME)";
View
@@ -147,7 +147,7 @@ _L__\name:
@ sp+4: fn
.text
- .align 0
+ .align 4
.globl _ffi_call_SYSV
_ffi_call_SYSV:
UNWIND .fnstart
View
@@ -43,25 +43,10 @@
#ifdef __cplusplus
extern "C" {
#endif
-
- /* Do not move this. Some versions of AIX are very picky about where
- this is positioned. */
-#ifdef __GNUC__
- //## # define alloca __builtin_alloca
-# define MAYBE_UNUSED __attribute__((__unused__))
-#else
-# define MAYBE_UNUSED
-
-# ifndef alloca /* predefined by HP cc +Olibcalls */
- char *alloca ();
-# endif
-
-#endif
-
+
void bcopy(const void *s1, void *s2, size_t n);
#define memcpy(d, s, n) bcopy ((s), (d), (n))
-
#if defined(FFI_DEBUG)
#include <stdio.h>
#endif
@@ -138,25 +123,10 @@ FFI_TYPEDEF(uint32, UINT32, FFI_TYPE_UINT32);
FFI_TYPEDEF(sint32, SINT32, FFI_TYPE_SINT32);
FFI_TYPEDEF(uint64, UINT64, FFI_TYPE_UINT64);
FFI_TYPEDEF(sint64, SINT64, FFI_TYPE_SINT64);
-
FFI_TYPEDEF(pointer, void*, FFI_TYPE_POINTER);
-
FFI_TYPEDEF(float, float, FFI_TYPE_FLOAT);
FFI_TYPEDEF(double, double, FFI_TYPE_DOUBLE);
-#ifdef __alpha__
-/* Even if we're not configured to default to 128-bit long double,
- maintain binary compatibility, as -mlong-double-128 can be used
- at any time. */
-/* Validate the hard-coded number below. */
-# if defined(__LONG_DOUBLE_128__) && FFI_TYPE_LONGDOUBLE != 4
-# error FFI_TYPE_LONGDOUBLE out of date
-# endif
-const ffi_type ffi_type_longdouble = { 16, 16, 4, NULL };
-#elif FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
-FFI_TYPEDEF(longdouble, long double, FFI_TYPE_LONGDOUBLE);
-#endif
-
/* -----------------------------------------------------------------------
raw_api.c - Copyright (c) 1999, 2008 Red Hat, Inc.
@@ -459,13 +429,10 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
/* Perform a sanity check on the return type */
FFI_ASSERT_VALID_TYPE(cif->rtype);
- /* x86-64 and s390 stack space allocation is handled in prep_machdep. */
-#if !defined M68K && !defined __x86_64__ && !defined S390 && !defined PA
+ /* x86-64 stack space allocation is handled in prep_machdep. */
+#if !defined __x86_64__
/* Make space for the return structure pointer */
if (cif->rtype->type == FFI_TYPE_STRUCT
-#ifdef SPARC
- && (cif->abi != FFI_V9 || cif->rtype->size > 32)
-#endif
#ifdef X86_DARWIN
&& (cif->rtype->size > 8)
#endif
@@ -484,15 +451,7 @@ ffi_status ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
check after the initialization. */
FFI_ASSERT_VALID_TYPE(*ptr);
-#if !defined __x86_64__ && !defined S390 && !defined PA
-#ifdef SPARC
- if (((*ptr)->type == FFI_TYPE_STRUCT
- && ((*ptr)->size > 16 || cif->abi != FFI_V9))
- || ((*ptr)->type == FFI_TYPE_LONGDOUBLE
- && cif->abi != FFI_V9))
- bytes += sizeof(void*);
- else
-#endif
+#if !defined __x86_64__
{
/* Add any padding if necessary */
if (((*ptr)->alignment - 1) & bytes)
@@ -729,6 +688,8 @@ static void ffi_prep_incoming_args_SYSV (char *stack, void **ret,
void ffi_closure_SYSV (ffi_closure *);
/* This function is jumped to by the trampoline */
+unsigned int FFI_HIDDEN ffi_closure_SYSV_inner (ffi_closure *, void **, void *)
+__attribute__ ((regparm(1)));
unsigned int
ffi_closure_SYSV_inner (closure, respp, args)

0 comments on commit af95d92

Please sign in to comment.