List Info

Thread: ctypes patches




ctypes patches
country flaguser name
Germany
2008-02-26 10:49:04
Here are patches from the Python/ctypes libffi fork, for the
src directory.
It would be great if they were applied, in full or
partially, to the libffi CVS repository.

Comments on the patch:

- replace 'void (*)()' with 'void (*)(void)' everywhere.

- replace C++ comments with C comments in src/x86/ffi.c

- (src/x86/sysv.S) Patch #1560695: Add .note.GNU-stack to
ctypes' sysv.S so that
  ctypes isn't considered as requiring executable stacks.

- src/powerpc/darwin_closure.S: Try to fix the build on Mac
OS X 10.3.
  The 'live_support' segment attribute is not supported in
this version.

- powerpc/ffi_darwin.S, powerpc/darwin.S,
powerpc/darwin_closure.S, x86/darwin.S:
  The complete body of these files is surrounded by a #ifdef
<arch>/#endif block,
  where <arch> is the architecture to build for.  This
allows (with additional
  changes to configure.ac and configure) to build universal
(fat) binaries on OS X.

Thomas

  
Re: ctypes patches
country flaguser name
Germany
2008-02-26 11:22:19
Thomas Heller schrieb:
> Here are patches from the Python/ctypes libffi fork,
for the src directory.
> It would be great if they were applied, in full or
partially, to the libffi CVS repository.

I forgot the changes for ffi.h.in; here they are:

pcl-cvs: descending directory include/
Index: ffi.h.in
============================================================
=======
RCS file: /cvs/libffi/libffi/include/ffi.h.in,v
retrieving revision 1.10
diff -u -r1.10 ffi.h.in
--- ffi.h.in	15 Feb 2008 01:24:05 -0000	1.10
+++ ffi.h.in	26 Feb 2008 16:56:37 -0000
 -222,7
+222,7 
 
 
 void ffi_raw_call (ffi_cif *cif,
-		   void (*fn)(),
+		   void (*fn)(void),
 		   void *rvalue,
 		   ffi_raw *avalue);
 
 -235,7
+235,7 
 /* longs and doubles are followed by an empty 64-bit
word.		*/
 
 void ffi_java_raw_call (ffi_cif *cif,
-			void (*fn)(),
+			void (*fn)(void),
 			void *rvalue,
 			ffi_java_raw *avalue);
 
 -349,12
+349,12 
 			ffi_type **atypes);
 
 void ffi_call(ffi_cif *cif,
-	      void (*fn)(),
+	      void (*fn)(void),
 	      void *rvalue,
 	      void **avalue);
 
 /* Useful for eliminating compiler warnings */
-#define FFI_FN(f) ((void (*)())f)
+#define FFI_FN(f) ((void (*)(void))f)
 
 /* ---- Definitions shared with assembly code
---------------------------- */
 


Re: ctypes patches
user name
2008-02-26 12:12:22
Thomas Heller wrote:
> Here are patches from the Python/ctypes libffi fork,
for the src directory.
> It would be great if they were applied, in full or
partially, to the libffi CVS repository.
>   
Thanks Thomas!  Comments below...

> Comments on the patch:
>
> - replace 'void (*)()' with 'void (*)(void)'
everywhere.
>
> - replace C++ comments with C comments in
src/x86/ffi.c
>
>   
I've committed both of these.
> - (src/x86/sysv.S) Patch #1560695: Add .note.GNU-stack
to ctypes' sysv.S so that
>   ctypes isn't considered as requiring executable
stacks.
>   
See my follow-up email.

> - src/powerpc/darwin_closure.S: Try to fix the build on
Mac OS X 10.3.
>   The 'live_support' segment attribute is not supported
in this version.
>   
Hmm.. you had previously submitted test results for OS X. 
Was that a 
different version?
Should we use a configure test to determine whether or not
to use 
live_support.   (What is live_support anyways?)

> - powerpc/ffi_darwin.S, powerpc/darwin.S,
powerpc/darwin_closure.S, x86/darwin.S:
>   The complete body of these files is surrounded by a
#ifdef <arch>/#endif block,
>   where <arch> is the architecture to build for. 
This allows (with additional
>   changes to configure.ac and configure) to build
universal (fat) binaries on OS X.
>   
I haven't committed these yet, but they are probably fine.

Thanks again...

AG



> Thomas
>   


libffi and .note.GNU-stack (Was: ctypes patches)
user name
2008-02-26 12:26:13
Thomas Heller wrote:
> Here are patches from the Python/ctypes libffi fork,
for the src directory.
> It would be great if they were applied, in full or
partially, to the libffi CVS repository.
>
> - (src/x86/sysv.S) Patch #1560695: Add .note.GNU-stack
to ctypes' sysv.S so that
>   ctypes isn't considered as requiring executable
stacks.
>
>   
If I recall correctly, Jakub applied similar patches to the
Fedora/RHEL 
gcc/libffi.  Jakub -  was this patch submitted to the FSF? 

Thomas - your patch says:

+#ifdef __ELF__
+.section .note.GNU-stack,"",%progbits
+#endif

...but other patches floating out there say:

+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif

... I assume because .note.GNU-stack is Linux specific.  Do
you agree?

Thanks,

AG


Re: ctypes patches
user name
2008-02-26 12:32:11
Anthony Green wrote:
>
>> - src/powerpc/darwin_closure.S: Try to fix the
build on Mac OS X 10.3.
>>   The 'live_support' segment attribute is not
supported in this version.
>>   
> Hmm.. you had previously submitted test results for OS
X.  Was that a 
> different version?
> Should we use a configure test to determine whether or
not to use 
> live_support.   (What is live_support anyways?)
I had forgotten that Eli Barzilay has already answered
this:

http://sourceware.org/ml/libffi-discuss/2008/msg00003.
html


AG


Re: ctypes patches
country flaguser name
Germany
2008-02-27 10:45:39
Anthony Green schrieb:
> Anthony Green wrote:
>>
>>> - src/powerpc/darwin_closure.S: Try to fix the
build on Mac OS X 10.3.
>>>   The 'live_support' segment attribute is not
supported in this version.
>>>   
>> Hmm.. you had previously submitted test results for
OS X.  Was that a 
>> different version?

Yes, I did run the tests on OS X 10.4.

>> Should we use a configure test to determine whether
or not to use 
>> live_support.   (What is live_support anyways?)
> I had forgotten that Eli Barzilay has already answered
this:
> 
> http://sourceware.org/ml/libffi-discuss/2008/msg00003.
html
> 

Thomas

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )