-
-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
importing _ctypes failed: undefined symbol: ffi_call_win32 #66824
Comments
Compiling Python 3.4.2 32-bit using GCC under RHEL6.4 and RHEL5.5 yields to crash: *** WARNING: renaming "_ctypes" since importing it failed: build/lib.linux-x86_64-3.4/_ctypes.cpython-34m.so: undefined symbol: ffi_call_win32 Why is it referring to a win32 api when i'm compiling under Linux? This failure causes pip installation to also fail due to missing ctypes module. FYI - 3.4.1 under exact same env. builds fine. |
Similar issue on old FreeBSD versions: issuee bpo-22521. |
This appears to be caused by the update to libffi version 3.1 in 3.4.2. |
could somebody attach a build log from such a system? and the libffi config.log? |
attached python 3.4.2 configure log on RHEL6.4 |
make log from RHEL 6.4 for python 3.4.2. Also got this on the STDERR: $ make > ../make.log
build/temp.linux-x86_64-3.4/opt/python-3.4.2/Python-3.4.2/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc':
/opt/python-3.4.2/Python-3.4.2/Modules/_ctypes/libffi/src/x86/ffi.c:679: undefined reference to `ffi_closure_FASTCALL'
/usr/bin/ld: build/temp.linux-x86_64-3.4/opt/python-3.4.2/Python-3.4.2/Modules/_ctypes/libffi/src/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_closure_FASTCALL' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status |
configure arguments: BASECFLAGS=-m32 LDFLAGS=-m32 CFLAGS=-m32 ./configure --prefix=/opt/python-3.4.2/ > ../configure.log attached system rpm information. no additional binaries/PATHs/LD_LIB_PATHs |
and using -m32 explicitly. so you'll get what you deserve ;-) |
[siyuan@siyuan-lnx:siyuan-ott]$ lsb_release -a :( there's nothing special.. |
What does "-m32" mean? |
"-m32" means "compile a 32-bit build though I'm on a 64-bit platform". I'm not sure why Matthias says this is "getting what you deserve", since everytime I've tried, "-m32" worked properly for building Python. |
Comparing this to bpo-23042, this same behavior appears on i386 releases of FreeBSD 8.3 and 10.1 (the i386-RELEASE means it's 32-bit as opposed to 64-bit build). Given that this issue is being triggered here with -m32 (triggers building of 32-bit binaries) and yet we don't appear to be having this issue on 64-bit builds, that could be a useful clue. |
This is likely also related to bpo-23042. The precompiler #ifdefs were mixed up, causing Win32 code to be compiled in on other platforms as well. |
There is now a proposed patch on bpo-23042 which, having gone through those changes, may well address this issue too. Testing that patch on multiple platforms (including the RHEL variants relevant here) would be much appreciated. Thanks goes to @lemburg for doing the investigative work and providing the diffs that occurred to the Modules/_ctypes/libffi/src/x86/ffi.c file in the past -- that work made the patch possible to sort out. |
@davin @lemburg dupe the bug? |
@siyuan: Duping it -- thanks for trying that patch out so quickly! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: