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.

classification
Title: failed to build _ctypes: undefined reference to `ffi_closure_FASTCALL'
Type: Stage: resolved
Components: Build, ctypes Versions: Python 3.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: christian.heimes, fantix, santhu_reddy12, siming85, zach.ware
Priority: normal Keywords: patch

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:58adminsetgithub: 77244
2021-07-23 15:56:25zach.waresetstatus: open -> closed
resolution: out of date
messages: + msg398073

stage: patch review -> resolved
2021-07-23 15:53:41zach.waresetpull_requests: - pull_request25844
2021-07-23 09:14:26santhu_reddy12setnosy: + santhu_reddy12
messages: + msg398038
2021-07-23 03:06:15fantixsetnosy: + fantix

pull_requests: + pull_request25844
stage: patch review
2018-03-13 19:14:24siming85setmessages: + msg313769
2018-03-13 15:25:33zach.waresetnosy: + zach.ware
messages: + msg313760
2018-03-13 14:56:40christian.heimessetnosy: + christian.heimes

messages: + msg313759
versions: - Python 3.4, Python 3.5
2018-03-13 14:48:36siming85setmessages: + msg313755
versions: + Python 3.6
2018-03-13 02:53:21siming85setmessages: + msg313720
components: + ctypes
versions: + Python 3.4
2018-03-13 02:33:32siming85setfiles: + ffi.patch
keywords: + patch
messages: + msg313717
2018-03-13 02:31:35siming85create