This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients
Date 2006-08-02.13:08:55
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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?

History
Date User Action Args
2007-08-23 14:41:41adminlinkissue1530448 messages
2007-08-23 14:41:41admincreate