Issue 33063: failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL' (original) (raw)

Issue33063

Created on 2018-03-13 02:31 by siming85, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
ffi.patch siming85,2018-03-13 02:33
Messages (9)
msg313716 - (view) Author: Siming Yuan (siming85) * Date: 2018-03-13 02:31
compiling Python 3.5.5 under RHEL 6.4, 32-bit: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/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 related to https://bugs.python.org/issue23042 - but it seems like the patch for x86/ffi.c never made it to release.
msg313717 - (view) Author: Siming Yuan (siming85) * Date: 2018-03-13 02:33
attached patch that fixes the build issue. credit to davin @ https://bugs.python.org/issue23042
msg313720 - (view) Author: Siming Yuan (siming85) * Date: 2018-03-13 02:53
tested again with Python 3.4.8 and the bug is observed. patch & builds fine. strangely, tested building python 3.6.4 on the same environment without patch, no issues, even though the ffi.c code is exactly the same.
msg313755 - (view) Author: Siming Yuan (siming85) * Date: 2018-03-13 14:48
edit - I do see this in python 3.6.4 on a different server when building 32-bit Red Hat Enterprise Linux Workstation release 6.7 (Santiago) gcc --version gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
msg313759 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2018-03-13 14:56
3.4 and 3.5 are in security release-only mode.
msg313760 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2018-03-13 15:25
Your better option is to install libffi-devel (or whatever the correct name is ) on your system and use `./configure --with-system-ffi`. This is the default in 3.6 and the only option in 3.7 (on any platform but Windows and macOS).
msg313769 - (view) Author: Siming Yuan (siming85) * Date: 2018-03-13 19:14
interesting, didn't know that option existed.
msg398038 - (view) Author: santhosh (santhu_reddy12) Date: 2021-07-23 09:14
build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/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 build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/c//c/types/li bf fi/ s rc/x86/ffi.o: relocation R_386_GOTOFF against undefined hidden symbol `ffi_ closure_ FAST CALL' can not be used when making a shared object /usr/bin/ld: final link failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/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 failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffio: In function `ffiprep_closure_loc': /opt/python/Python-3.5.5/Modules/_ c types/ b f fi/sr c/x86/ffi.c:678: undefined reference to ` ff_ closure_ FAST CALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/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 failedbuild/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.o: In function `ffi_prep_closure_loc': /opt/python/Python-3.5.5/Modules/_ctypes/libffi/src/x86/ffi.c:678: undefined reference to `ffi_closure_FASTCALL' /usr/bin/ld: build/temp.linux-x86_64-3.5/opt/python/Python-3.5.5/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
msg398073 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2021-07-23 15:56
The bundled version of libffi is no longer included in any version in bugfix support; closing this as out of date. As suggested in an earlier message, the libffi from your system should be used instead if you're building a version of Python that still includes a copy of libffi.
History
Date User Action Args
2022-04-11 14:58:58 admin set github: 77244
2021-07-23 15:56:25 zach.ware set status: open -> closedresolution: out of datemessages: + stage: patch review -> resolved
2021-07-23 15:53:41 zach.ware set pull_requests: - <pull%5Frequest25844>
2021-07-23 09:14:26 santhu_reddy12 set nosy: + santhu_reddy12messages: +
2021-07-23 03:06:15 fantix set nosy: + fantixpull_requests: + <pull%5Frequest25844>stage: patch review
2018-03-13 19:14:24 siming85 set messages: +
2018-03-13 15:25:33 zach.ware set nosy: + zach.waremessages: +
2018-03-13 14:56:40 christian.heimes set nosy: + christian.heimesmessages: + versions: - Python 3.4, Python 3.5
2018-03-13 14:48:36 siming85 set messages: + versions: + Python 3.6
2018-03-13 02:53:21 siming85 set messages: + components: + ctypesversions: + Python 3.4
2018-03-13 02:33:32 siming85 set files: + ffi.patchkeywords: + patchmessages: +
2018-03-13 02:31:35 siming85 create