Commits

Ronald Oussoren  committed 25d68f8

More fixes for the x86 port. We're not their yet, some of the libffi tests
are still failing.

I'm also forcing 'DYLD_BIND_AT_LAUNCH' into the environment during the libffi
tests, because there are binding errors if I don't. I guess this is yet another
bug waiting for a fix (although it doesn't seem to affect normal usage)

  • Participants
  • Parent commits 93ae343
  • Branches pyobjc-ancient

Comments (0)

Files changed (4)

File libffi-src/src/prep_cif.c

 #ifdef SPARC
       && (cif->abi != FFI_V9 || cif->rtype->size > 32)
 #endif
-#ifdef __i386__ /* FIXME: only on darwin */
+#ifdef X86_DARWIN
       && (cif->rtype->size > 8) 
 #endif
       )

File libffi-src/src/types.c

 #endif
 
 
-#if defined X86 || defined X86_WIN32 || defined M68K
+#if defined X86 || defined X86_WIN32 || defined M68K || defined(X86_DARWIN)
 
 #ifdef X86_WIN32 
 FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE);

File libffi-src/src/x86/ffi.c

   switch (cif->rtype->type)
     {
     case FFI_TYPE_VOID:
-#ifndef X86_WIN32
+#if !defined(X86_WIN32) && !defined(X86_DARWIN)
     case FFI_TYPE_STRUCT:
 #endif
     case FFI_TYPE_SINT64:
       cif->flags = FFI_TYPE_SINT64;
       break;
 
-#ifdef X86_WIN32
+#if defined(X86_WIN32) || defined(X86_DARWIN)
     case FFI_TYPE_STRUCT:
       if (cif->rtype->size == 1)
         {
 
   argp = stack;
 
-  if ( cif->flags == FFI_TYPE_STRUCT ) {
+  if ( cif->flags == FFI_TYPE_STRUCT && cif->rtype->size > 8) {
     *rvalue = *(void **) argp;
     argp += 4;
   }
       }
 
       z = (*p_arg)->size;
+      if (z == 0) {
+	      abort();
+      }
 
       /* because we're little endian, this is what it turns into.   */
 

File setup-lib/dejagnu.py

 
 
     def runTestCase(self):
+        os.environ['DYLD_BIND_AT_LAUNCH'] = '1'
         fp = os.popen('/tmp/test.bin', 'r')
+        del os.environ['DYLD_BIND_AT_LAUNCH']
         data = fp.read()
         xit = fp.close()
         if xit != None: