Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 205208 Details for
Bug 285986
dev-lang/python-2.6.2-r2 fails to build on IRIX with external libffi
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch resolve all IRIX build issues, including ctypes assembly (with corrected attribution)
python-2.6.2-irix.patch (text/plain), 13.50 KB, created by
Stuart Shelton
on 2009-09-25 13:14:59 UTC
(
hide
)
Description:
Patch resolve all IRIX build issues, including ctypes assembly (with corrected attribution)
Filename:
MIME Type:
Creator:
Stuart Shelton
Created:
2009-09-25 13:14:59 UTC
Size:
13.50 KB
patch
obsolete
>IRIX patch by Frank Everdij and Stuart Shelton > >http://bugs.gentoo.org/show_bug.cgi?id=266494 > >--- setup.py.orig 2009-06-19 19:36:59.000000000 +0200 >+++ setup.py 2009-06-19 19:52:42.000000000 +0200 >@@ -1311,6 +1311,14 @@ class PyBuildExt(build_ext): > ) > libraries = [] > >+ elif platform.startswith('irix'): >+ macros = dict( # IRIX >+ HAVE_SEM_OPEN=1, >+ HAVE_SEM_TIMEDWAIT=0, >+ HAVE_FD_TRANSFER=1, >+ ) >+ libraries = [] >+ > else: # Linux and other unices > macros = dict( > HAVE_SEM_OPEN=1, >--- Lib/test/test_fileio.py.orig 2009-09-25 10:23:21.948485520 +0100 >+++ Lib/test/test_fileio.py 2009-09-25 10:24:19.035311480 +0100 >@@ -152,7 +152,8 @@ class OtherFileTests(unittest.TestCase): > self.assertEquals(f.writable(), True) > if sys.platform != "darwin" and \ > not sys.platform.startswith('freebsd') and \ >- not sys.platform.startswith('sunos'): >+ not sys.platform.startswith('sunos') and \ >+ not sys.platform.startswith('irix'): > # Somehow /dev/tty appears seekable on some BSDs > self.assertEquals(f.seekable(), False) > self.assertEquals(f.isatty(), True) >--- Modules/_cursesmodule.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_cursesmodule.c 2009-06-19 19:52:42.000000000 +0200 >@@ -120,9 +120,6 @@ char *PyCursesVersion = "2.2"; > curses module in other ways. So the code will just specify > explicit prototypes here. */ > extern int setupterm(char *,int,int *); >-#ifdef __sgi >-#include <term.h> >-#endif > > #if !defined(HAVE_NCURSES_H) && (defined(sgi) || defined(__sun) || defined(SCO5)) > #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ >--- Modules/_fileio.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_fileio.c 2009-06-19 19:52:42.000000000 +0200 >@@ -33,7 +33,7 @@ typedef struct { > unsigned readable : 1; > unsigned writable : 1; > int seekable : 2; /* -1 means unknown */ >- int closefd : 1; >+ unsigned int closefd : 1; > PyObject *weakreflist; > } PyFileIOObject; > >--- Modules/mmapmodule.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/mmapmodule.c 2009-06-19 19:52:42.000000000 +0200 >@@ -50,6 +50,10 @@ my_getallocationgranularity (void) > #include <sys/mman.h> > #include <sys/stat.h> > >+#ifdef HAVE_FCNTL_H >+#include <fcntl.h> >+#endif >+ > #if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) > static int > my_getpagesize(void) >--- Modules/posixmodule.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/posixmodule.c 2009-06-19 19:52:42.000000000 +0200 >@@ -169,7 +169,9 @@ corresponding Unix manual entries for mo > extern char *ctermid_r(char *); > #endif > >-#ifndef HAVE_UNISTD_H >+#ifdef HAVE_UNISTD_H >+#include <unistd.h> >+#else > #if defined(PYCC_VACPP) > extern int mkdir(char *); > #else >--- Modules/python.c.orig 2009-09-25 11:33:05.391785600 +0100 >+++ Modules/python.c 2009-09-25 11:33:43.150227520 +0100 >@@ -3,7 +3,10 @@ > #include "Python.h" > > #ifdef __FreeBSD__ >-#include <floatingpoint.h> >+# include <floatingpoint.h> >+#endif >+#ifdef __sgi >+# include <sys/fpu.h> > #endif > > int >@@ -20,5 +23,11 @@ main(int argc, char **argv) > m = fpgetmask(); > fpsetmask(m & ~FP_X_OFL); > #endif >+#ifdef __sgi >+ unsigned int m; >+ >+ m = get_fpc_csr(); >+ set_fpc_csr(m & ~FPCSR_FLUSH_ZERO); >+#endif > return Py_Main(argc, argv); > } >--- Modules/_ctypes/_ctypes.c.orig 2009-04-05 23:48:06.000000000 +0200 >+++ Modules/_ctypes/_ctypes.c 2009-06-19 19:52:42.000000000 +0200 >@@ -111,11 +111,11 @@ bytes(cdata) > > #include <ffi.h> > #ifdef MS_WIN32 >-#include <windows.h> >-#include <malloc.h> >-#ifndef IS_INTRESOURCE >-#define IS_INTRESOURCE(x) (((size_t)(x) >> 16) == 0) >-#endif >+# include <windows.h> >+# include <malloc.h> >+# ifndef IS_INTRESOURCE >+# define IS_INTRESOURCE(x) (((size_t)(x) >> 16) == 0) >+# endif > # ifdef _WIN32_WCE > /* Unlike desktop Windows, WinCE has both W and A variants of > GetProcAddress, but the default W version is not what we want */ >@@ -123,8 +123,11 @@ bytes(cdata) > # define GetProcAddress GetProcAddressA > # endif > #else >-#include "ctypes_dlfcn.h" >+# include "ctypes_dlfcn.h" > #endif >+/* #ifdef HAVE_ALLOCA_H */ >+#include <alloca.h> >+/* #endif */ > #include "ctypes.h" > > PyObject *PyExc_ArgError; >@@ -3854,7 +3857,7 @@ CFuncPtr_call(CFuncPtrObject *self, PyOb > } > } > >- result = _CallProc(pProc, >+ result = _CallProc((PPROC)pProc, > callargs, > #ifdef MS_WIN32 > piunk, >--- Modules/_ctypes/_ctypes_test.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/_ctypes_test.c 2009-06-19 19:52:43.000000000 +0200 >@@ -369,8 +369,8 @@ EXPORT(PY_LONG_LONG) last_tf_arg_s; > EXPORT(unsigned PY_LONG_LONG) last_tf_arg_u; > > struct BITS { >- int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H: 8, I: 9; >- short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7; >+ unsigned int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H: 8, I: 9; >+ unsigned short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7; > }; > > DL_EXPORT(void) set_bitfields(struct BITS *bits, char name, int value) >--- Modules/_ctypes/callproc.c.orig 2009-02-10 19:46:11.000000000 +0100 >+++ Modules/_ctypes/callproc.c 2009-06-19 19:52:43.000000000 +0200 >@@ -73,6 +73,10 @@ > #include <malloc.h> > #endif > >+/* #ifdef HAVE_ALLOCA_H */ >+#include <alloca.h> >+/* #endif */ >+ > #include <ffi.h> > #include "ctypes.h" > >@@ -463,7 +467,7 @@ PyCArg_repr(PyCArgObject *self) > #ifdef MS_WIN32 > "<cparam '%c' (%I64d)>", > #else >- "<cparam '%c' (%qd)>", >+ "<cparam '%c' (%lld)>", > #endif > self->tag, self->value.q); > break; >@@ -812,7 +816,7 @@ static int _call_function_pointer(int fl > #endif > delta = > #endif >- ffi_call(&cif, (void *)pProc, resmem, avalues); >+ ffi_call(&cif, FFI_FN(pProc), resmem, avalues); > #ifdef MS_WIN32 > #ifndef DONT_USE_SEH > } >--- Modules/_ctypes/malloc_closure.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/malloc_closure.c 2009-06-19 19:52:43.000000000 +0200 >@@ -5,12 +5,18 @@ > #include <Python.h> > #include <ffi.h> > #ifdef MS_WIN32 >-#include <windows.h> >+# include <windows.h> > #else >-#include <sys/mman.h> >-#include <unistd.h> >-# if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) >-# define MAP_ANONYMOUS MAP_ANON >+# include <sys/mman.h> >+# include <unistd.h> >+# if !defined(MAP_ANONYMOUS) >+# if defined(MAP_ANON) >+# define MAP_ANONYMOUS MAP_ANON >+# else /* For open(), O_RDWR, etc. */ >+# include <sys/types.h> >+# include <sys/stat.h> >+# include <fcntl.h> >+# endif > # endif > #endif > #include "ctypes.h" >@@ -37,6 +43,8 @@ int _pagesize; > static void more_core(void) > { > ITEM *item; >+ int flags = MAP_PRIVATE; >+ int devzero = -1; > int count, i; > > /* determine the pagesize */ >@@ -68,12 +76,24 @@ static void more_core(void) > if (item == NULL) > return; > #else >+#ifdef MAP_ANONYMOUS >+ /* BSD way to map anonymous memory */ >+ flags |= MAP_ANONYMOUS; >+#else >+ /* SVR4 method to map anonymous memory is to open /dev/zero */ >+ devzero = open("/dev/zero", O_RDWR); >+ if (devzero == -1) >+ return; >+#endif > item = (ITEM *)mmap(NULL, > count * sizeof(ITEM), > PROT_READ | PROT_WRITE | PROT_EXEC, >- MAP_PRIVATE | MAP_ANONYMOUS, >- -1, >+ flags, >+ devzero, > 0); >+ if (devzero != -1) >+ close(devzero); >+ > if (item == (void *)MAP_FAILED) > return; > #endif >--- Modules/_ctypes/libffi/configure.ac.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/libffi/configure.ac 2009-06-19 19:52:43.000000000 +0200 >@@ -106,10 +106,10 @@ case "$host" in > ;; > > mips-sgi-irix5.* | mips-sgi-irix6.*) >- TARGET=MIPS; TARGETDIR=mips >+ TARGET=MIPS_IRIX; TARGETDIR=mips > ;; > mips*-*-linux*) >- TARGET=MIPS; TARGETDIR=mips >+ TARGET=MIPS_LINUX; TARGETDIR=mips > ;; > > powerpc*-*-linux* | powerpc-*-sysv*) >@@ -162,7 +162,8 @@ if test $TARGETDIR = unknown; then > AC_MSG_ERROR(["libffi has not been ported to $host."]) > fi > >-AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS) >+AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS_IRIX) >+AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS_LINUX) > AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) > AM_CONDITIONAL(X86, test x$TARGET = xX86) > AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD) >--- Modules/_ctypes/libffi/configure.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/libffi/configure 2009-06-19 19:52:43.000000000 +0200 >@@ -20426,10 +20426,10 @@ case "$host" in > ;; > > mips-sgi-irix5.* | mips-sgi-irix6.*) >- TARGET=MIPS; TARGETDIR=mips >+ TARGET=MIPS_IRIX; TARGETDIR=mips > ;; > mips*-*-linux*) >- TARGET=MIPS; TARGETDIR=mips >+ TARGET=MIPS_LINUX; TARGETDIR=mips > ;; > > powerpc*-*-linux* | powerpc-*-sysv*) >@@ -20484,7 +20484,15 @@ echo "$as_me: error: \"libffi has not be > { (exit 1); exit 1; }; } > fi > >- if test x$TARGET = xMIPS; then >+ if test x$TARGET = xMIPS_IRIX; then >+ MIPS_TRUE= >+ MIPS_FALSE='#' >+else >+ MIPS_TRUE='#' >+ MIPS_FALSE= >+fi >+ >+ if test x$TARGET = xMIPS_LINUX; then > MIPS_TRUE= > MIPS_FALSE='#' > else >--- Modules/_ctypes/libffi/src/mips/n32.S.orig 2009-09-25 10:25:10.835555720 +0100 >+++ Modules/_ctypes/libffi/src/mips/n32.S 2009-09-25 10:26:46.016867360 +0100 >@@ -40,7 +40,7 @@ > > #define SIZEOF_FRAME ( 8 * FFI_SIZEOF_ARG ) > >- .abicalls >+/* .abicalls */ > .text > .align 2 > .globl ffi_call_N32 >@@ -474,7 +474,7 @@ cls_epilogue: > .LFE2: > .end ffi_closure_N32 > >- .section .eh_frame,"aw",@progbits >+/* .section .eh_frame,"aw",@progbits > .Lframe1: > .4byte .LECIE1-.LSCIE1 # length > .LSCIE1: >@@ -530,5 +530,6 @@ cls_epilogue: > .uleb128 (SIZEOF_FRAME2 - RA_OFF2)/4 > .align EH_FRAME_ALIGN > .LEFDE3: >+*/ > > #endif >--- Modules/_ctypes/libffi/src/mips/ffitarget.h.orig 2009-06-19 19:52:37.000000000 +0200 >+++ Modules/_ctypes/libffi/src/mips/ffitarget.h 2009-06-19 19:52:43.000000000 +0200 >@@ -27,8 +27,13 @@ > #ifndef LIBFFI_TARGET_H > #define LIBFFI_TARGET_H > >-#ifdef linux >-#include <asm/sgidefs.h> >+#if defined(linux) || defined (__sgi) >+# ifdef linux >+# include <asm/sgidefs.h> >+# endif >+# ifdef __sgi >+# include <sgidefs.h> >+# endif > # ifndef _ABIN32 > # define _ABIN32 _MIPS_SIM_NABI32 > # endif >@@ -41,7 +46,7 @@ > #endif > > #if !defined(_MIPS_SIM) >--- something is very wrong -- >+# error -- something is very wrong -- > #else > # if (_MIPS_SIM==_ABIN32 && defined(_ABIN32)) || (_MIPS_SIM==_ABI64 && defined(_ABI64)) > # define FFI_MIPS_N32 >@@ -49,7 +54,7 @@ > # if (_MIPS_SIM==_ABIO32 && defined(_ABIO32)) > # define FFI_MIPS_O32 > # else >--- this is an unsupported platform -- >+# error -- this is an unsupported platform -- > # endif > # endif > #endif >@@ -145,14 +150,26 @@ > # endif /* _MIPS_SIM==_ABI64 */ > #endif /* !FFI_MIPS_O32 */ > #else /* !LIBFFI_ASM */ >-#ifdef FFI_MIPS_O32 >+#ifdef __GNUC__ >+# ifdef FFI_MIPS_O32 > /* O32 stack frames have 32bit integer args */ > typedef unsigned int ffi_arg __attribute__((__mode__(__SI__))); > typedef signed int ffi_sarg __attribute__((__mode__(__SI__))); >-#else >+# else > /* N32 and N64 frames have 64bit integer args */ > typedef unsigned int ffi_arg __attribute__((__mode__(__DI__))); > typedef signed int ffi_sarg __attribute__((__mode__(__DI__))); >+# endif >+#else >+# ifdef FFI_MIPS_O32 >+/* O32 stack frames have 32bit integer args */ >+typedef __uint32_t ffi_arg; >+typedef __int32_t ffi_sarg; >+# else >+/* N32 and N64 frames have 64bit integer args */ >+typedef __uint64_t ffi_arg; >+typedef __int64_t ffi_sarg; >+# endif > #endif > > typedef enum ffi_abi { >--- Modules/_ctypes/libffi/include/ffi.h.in.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/libffi/include/ffi.h.in 2009-06-19 19:52:43.000000000 +0200 >@@ -249,12 +249,22 @@ size_t ffi_java_raw_size (ffi_cif *cif); > > #if FFI_CLOSURES > >+#ifdef __sgi >+# pragma pack 8 >+#endif > typedef struct { > char tramp[FFI_TRAMPOLINE_SIZE]; > ffi_cif *cif; > void (*fun)(ffi_cif*,void*,void**,void*); > void *user_data; >+#ifdef __GNUC__ > } ffi_closure __attribute__((aligned (8))); >+#else >+} ffi_closure; >+# ifdef __sgi >+# pragma pack 0 >+# endif >+#endif > > void *ffi_closure_alloc (size_t size, void **code); > void ffi_closure_free (void *); >--- Modules/_ctypes/libffi/include/ffi_common.h.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/libffi/include/ffi_common.h 2009-06-19 19:53:26.000000000 +0200 >@@ -44,6 +44,14 @@ char *alloca (); > # endif > #endif > >+#if HAVE_INTTYPES_H >+# include <inttypes.h> >+#else >+# if HAVE_SYS_TYPES_H >+# include <sys/types.h> >+# endif >+#endif >+ > #if defined(FFI_DEBUG) > #include <stdio.h> > #endif >@@ -77,6 +85,7 @@ typedef struct > } extended_cif; > > /* Terse sized type definitions. */ >+#if defined(__GNUC__) > typedef unsigned int UINT8 __attribute__((__mode__(__QI__))); > typedef signed int SINT8 __attribute__((__mode__(__QI__))); > typedef unsigned int UINT16 __attribute__((__mode__(__HI__))); >@@ -85,6 +94,16 @@ typedef unsigned int UINT32 __attribute_ > typedef signed int SINT32 __attribute__((__mode__(__SI__))); > typedef unsigned int UINT64 __attribute__((__mode__(__DI__))); > typedef signed int SINT64 __attribute__((__mode__(__DI__))); >+#else >+typedef uint8_t UINT8; >+typedef int8_t SINT8; >+typedef uint16_t UINT16; >+typedef int16_t SINT16; >+typedef uint32_t UINT32; >+typedef int32_t SINT32; >+typedef uint64_t UINT64; >+typedef int64_t SINT64; >+#endif > > typedef float FLOAT32; > >--- Modules/_ctypes/stgdict.c.orig 2009-06-19 19:52:36.000000000 +0200 >+++ Modules/_ctypes/stgdict.c 2009-06-19 19:52:43.000000000 +0200 >@@ -8,6 +8,9 @@ > #include <windows.h> > #include <malloc.h> > #endif >+/* #ifdef HAVE_ALLOCA_H */ >+#include <alloca.h> >+/* #endif */ > #include "ctypes.h" > > /******************************************************************/
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 285986
:
205207
|
205208
|
212014