Bugs item #1530448, was opened at 2006-07-28 10:04 Message generated for change (Comment added) made by montanaro You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1530448&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Build Group: Python 2.5 Status: Open Resolution: None Priority: 5 Submitted By: Skip Montanaro (montanaro) Assigned to: Thomas Heller (theller) Summary: ctypes build fails on Solaris 10 Initial Comment: Thomas, I tried to build Python from cvs (svn rev 50905) on Solaris 10 today. Compiler was gcc 3.4. I got a text relocation error when linking ctypes.so: /opt/app/g++lib6/gcc-3.4/bin/gcc -shared build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/_ctypes.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callbacks.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/stgdict.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/cfield.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/malloc_closure.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/prep_cif.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/unix64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o -L/usr/local/lib -o build/lib.solaris-2.10-i86pc-2.5/_ctypes.so Text relocation remains referenced against symbol offset in file ffi_closure_SYSV_inner 0x8e build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status I tried configuring both with and without the --with-system-ffi flag. The error was the same in both cases. If you need more information, let me know. Skip ---------------------------------------------------------------------- >Comment By: Skip Montanaro (montanaro) Date: 2006-08-03 15:14 Message: Logged In: YES user_id=44345 When I manually link _ctypes.o with -mimpure-text the link succeeds, but applying it to the configure script had no discernable effect. Was I supposed to apply it to the top-level Python configure script or to one deeper in the tree? Skip ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2006-08-03 15:02 Message: Logged In: YES user_id=44345 Thomas, I did an svn up (rev 51078), deleted any local changes, created a new build directory, configured and built. I got the same error about ffi_closure_SYSV_inner. I then manually reran the link command without mention of ffi.o or sysv.o. It linked fine but when I ran make again it complained that _ctypes.so couldn't resolve ffi_prep_closure. This symbol is defined in ffi.o, so it appears either that ffi.c is needed in the source list or maybe ffi64.c needs to be modified to provide it. As far as I can tell it doesn't export any useful symbols: $ nm -p build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o: 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 f ffi64.c Skip ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-08-03 14:36 Message: Logged In: YES user_id=11105 Correction: The option is '-mimpure-text', not '-impure-text'. I've attached a new patch 'setup.py.patch' which allows to build on the sourceforge solaris-x86 machine. ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-08-03 14:28 Message: Logged In: YES user_id=11105 And, BTW, building the bz2 extension on the compile farm solaris-x86 machine also fails with relocation errors (but I have no idea if that is related to the _ctypes build failure or not). ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-08-03 14:24 Message: Logged In: YES user_id=11105 What I've found out, after some painful time on the sourceforge compilefarm, is this: Python svn trunk also fails to build _ctypes.so on the solaris-x86 machine, but not on the sparc machines (both have solaris 9, I believe). ctypes from svn trunk *does* build also on the x86 machine, with the system installed python2.3, also with python 2.5b2. One difference that I found is that ctypes svn setup.py passes '-impure-text' to the linker, while python svn (when building the bundled ctypes) does not. ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-08-02 08:20 Message: Logged In: YES user_id=11105 It seems that the files 'src/x86/ffi.c' and 'src/x86/sysv.S' are not needed for the X86_64 platform in fficonfig.py.in. They *should* compile to nothing, anyway, because their contents is protected by 'ifndef __x86_64__'. Does removing them from fficonfig.py.in change the situation, so that only this remains: 'X86_64': ['src/x86/ffi64.c', 'src/x86/unix64.S'], I can build _ctypes on an unbuntu amd64 system with this change. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2006-08-02 08:08 Message: Logged In: YES user_id=44345 I don't understand. I swapped the order of ffi.c and sysv.S in the platforms dict. I confirmed that the order of the .o files on the link line changed so that ffi.o followed sysv.o. I still get the same error. I've also confirmed that ffi.o exports the symbol and that sysv.o references it: % nm -p build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o: 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000000 U _GLOBAL_OFFSET_TABLE_ 0000000000 f ffi.c 0000000332 T ffi_call 0000000000 U ffi_call_SYSV 0000000000 U ffi_closure_SYSV 0000000456 T ffi_closure_SYSV_inner 0000000000 T ffi_prep_args 0000000252 T ffi_prep_cif_machdep 0000000612 T ffi_prep_closure 0000000000 U memcpy % nm -p build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o: 0000000000 s 0000000000 s 0000000000 s 0000000000 s 0000000109 n epilogue 0000000000 T ffi_call_SYSV 0000000116 T ffi_closure_SYSV 0000000000 U ffi_closure_SYSV_inner 0000000000 U ffi_prep_args 0000000109 n noretval 0000000071 n retdouble 0000000059 n retfloat 0000000046 n retint 0000000095 n retint64 0000000083 n retlongdouble 0000000109 n retstruct All the object files were compiled with -fPIC. Here's the relevant chunk of make's output: creating build/temp.solaris-2.10-i86pc-2.5/libffi checking build system type... i386-pc-solaris2.10 checking host system type... i386-pc-solaris2.10 checking target system type... i386-pc-solaris2.10 checking for gcc... /opt/app/g++lib6/gcc-3.4/bin/gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether /opt/app/g++lib6/gcc-3.4/bin/gcc accepts -g... yes checking for /opt/app/g++lib6/gcc-3.4/bin/gcc option to accept ANSI C... none needed checking how to run the C preprocessor... /opt/app/g++lib6/gcc-3.4/bin/gcc -E checking for egrep... egrep checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking sys/mman.h usability... yes checking sys/mman.h presence... yes checking for sys/mman.h... yes checking for mmap... yes checking for sys/mman.h... (cached) yes checking for mmap... (cached) yes checking whether read-only mmap of a plain file works... yes checking whether mmap from /dev/zero works... yes checking for MAP_ANON(YMOUS)... yes checking whether mmap with MAP_ANON(YMOUS) works... yes checking for ANSI C header files... (cached) yes checking for memcpy... yes checking for working alloca.h... yes checking for alloca... yes checking for double... yes checking size of double... 8 checking for long double... yes checking size of long double... 12 checking whether byte ordering is bigendian... no checking whether .eh_frame section should be read-only... no checking for __attribute__((visibility("hidden")))... no configure: creating ./config.status config.status: creating include/ffi.h config.status: creating fficonfig.py config.status: creating fficonfig.h config.status: linking /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffitarget.h to include/ffitarget.h config.status: linking /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/include/ffi_common.h to include/ffi_common.h config.status: executing include commands config.status: executing src commands >>> X86_64 ['src/prep_cif.c', 'src/x86/ffi64.c', 'src/x86/unix64.S', 'src/x86/sysv.S', 'src/x86/ffi.c'] building '_ctypes' extension /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/_ctypes.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/_ctypes.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callbacks.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callbacks.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.o /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.c: In function `_CallProc': /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.c:917: warning: implicit declaration of function `alloca' /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/stgdict.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/stgdict.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/cfield.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/cfield.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/malloc_closure.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/malloc_closure.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/prep_cif.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/prep_cif.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/unix64.S -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/unix64.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.S -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o /opt/app/g++lib6/gcc-3.4/bin/gcc -fPIC -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I/home/ink/skipm/src/python-svn/trunk/./Include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi/include -Ibuild/temp.solaris-2.10-i86pc-2.5/libffi -I/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src -I/opt/app/nonc++/BerkleyDB-4.3/include -I/opt/app/nonc++/tcl-8.4/include -I/opt/app/nonc++/readline-4.3/include -I/opt/app/nonc++/gdbm-1.8/include -I../Include -I. -I/usr/local/include -I/home/ink/skipm/src/python-svn/trunk/Include -I/home/ink/skipm/src/python-svn/trunk/build -c /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.c -o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.c:177: warning: function declaration isn't a prototype /home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.c:194: warning: function declaration isn't a prototype /opt/app/g++lib6/gcc-3.4/bin/gcc -shared build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/_ctypes.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callbacks.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/stgdict.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/cfield.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/malloc_closure.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/prep_cif.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/unix64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o -L/usr/local/lib -o build/lib.solaris-2.10-i86pc-2.5/_ctypes.so Text relocation remains referenced against symbol offset in file ffi_closure_SYSV_inner 0x8e build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status I added a couple prints to fficonfig.py.in to demonstrate the file order and platform name (and to make sure fficonfig.py was being rebuilt). Oddly enough, if I remove both ffi.o and sysv.o from the link line, it links successfully. Is that significant or am I just getting desparate? ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-08-01 15:02 Message: Logged In: YES user_id=11105 I didn't know there are any systems that depend on the order of object files on the linker command line any more ;-). IIUC, the objects list is derived by distutils from the sources list, so the attached patch (for Modules/_ctypes/libffi/fficonfig.py.in) *could* do the trick. Please make sure that fficonfig.py is recreated (by doing make clean before building or whatever). Thanks for looking into this. ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2006-08-01 11:16 Message: Logged In: YES user_id=44345 Thomas> Skip, do you have *any* idea what might be Thomas> wrong, or could you even come up with a patch? Skip> I've no idea so far. I'll try to find some time Skip> to take a look at it later today. Thomas, Sorry for the delay. I think I have it figured out and it was fairly straightforward. Looking at the files in order on the _ctypes.so link line we see that the definition of ffi_closure_SYSV_inner is defined before it's referenced: for obj in build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/_ctypes.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callbacks.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/stgdict.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/cfield.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/malloc_closure.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/prep_cif.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/unix64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o ; do echo $obj; nm -p $obj | egrep ffi_closure_SYSV_inner; done build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/_ctypes.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callbacks.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/callproc.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/stgdict.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/cfield.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/malloc_closure.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/prep_cif.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/unix64.o build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/ffi.o 0000000456 T ffi_closure_SYSV_inner build/temp.solaris-2.10-i86pc-2.5/home/ink/skipm/src/python-svn/trunk/Modules/_ctypes/libffi/src/x86/sysv.o 0000000000 U ffi_closure_SYSV_inner Since we're linking from object files, it's a one-pass link algorithm. At the time ffo.o is examined, sysv.o hasn't been seen. Consequently, ffi_closure_SYSV_inner is not yet known and its definition isn't picked up from ffi.o. I couldn't quickly figure out where the link command is generated, but I'm sure you'll know where it resides. Either swap ffi.o and sysv.o on the link line, or add ffi.o a second time to resolve the new reference. Skip ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-07-31 05:54 Message: Logged In: YES user_id=11105 Skip, do you have *any* idea what might be wrong, or could you even come up with a patch? ---------------------------------------------------------------------- Comment By: Skip Montanaro (montanaro) Date: 2006-07-28 17:03 Message: Logged In: YES user_id=44345 Yeah, you'd definitely need -fPIC on any brand of Solaris. That test might be changed to plat = get_platform() if plat in (... buncha platforms ...) or "solaris" in plat: os.environ["CFLAGS"] = "-fPIC" That doesn't seem to be what's happening in this case though. I rm'd the .o files in .../Modules/_ctypes and tried again. The compile commands *do* have -fPIC on them. I don't think it's required on the link line. S ---------------------------------------------------------------------- Comment By: Thomas Heller (theller) Date: 2006-07-28 11:19 Message: Logged In: YES user_id=11105 Skip, This looks *somewhat* like the problems reported in bugs 1529269 and 1528620 (although they have a sparc, and you seem to have x86 solaris). Hm, in the standalone ctypes setup script, I find this code snippet: if get_platform() in ["solaris-2.9-sun4u", "linux-x86_64"]: os.environ["CFLAGS"] = "-fPIC" Can it be that -fPIC must be used, but is not specified? It is also funny that the solaris buildbot does NOT seem to have a problem. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1530448&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com