-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
ARM Raspbian 3.x fails to build _testcapi extension: undefined symbol: __atomic_fetch_or_8 #109054
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
Comments
Maybe Python should be linked to
|
I confirm that this regression comes from the commit 2bd960b. |
I'm on vacation this week, but I'll have some time to look at this this evening. |
I never heard about Raspbian before. I was curious about it, so I added
|
Check if <cpython/pyatomic.h> needs to be linked to libatomic.
Fix building the _testcapi extension on ARM Raspbian which requires linking to libatomic when <cpython/pyatomic.h> is used. * configure checks if programs using <cpython/pyatomic.h> need to be linked to libatomic. * Add LIBATOMIC variable to Makefile. * _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
Fix building the _testcapi extension on ARM Raspbian which requires linking to libatomic when <cpython/pyatomic.h> is used. * configure checks if programs using <cpython/pyatomic.h> need to be linked to libatomic. * Add LIBATOMIC variable to Makefile. * _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
Fix building the _testcapi extension on ARM Raspbian which requires linking to libatomic when <cpython/pyatomic.h> is used. * configure checks if programs using <cpython/pyatomic.h> need to be linked to libatomic. * Add LIBATOMIC variable to Makefile. * _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint8() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint8() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint8() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
From @vstinner's comments and playing with https://gcc.godbolt.org/, it looks like the 8 byte (64-bit) use library support with the default compiler options on this platform. GCC doesn't need the library support if you target Some random other things that I learned, but are probably not important:
|
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint64() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint64() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>.
It's nice if libatomic can be omitted depending on the compiler and compiler flags, but I would like to cover all cases :-) We should detect and add |
AIX also fails to build because of this problem. Need -latomic to be passed. I see MODULE__TESTCAPI_LDFLAGS variable in the generated Makefile but not populated with anything |
Can you try my PR? Does it fix your issue? |
https://github.com/vstinner/cpython/tree/configure_libatomic The config.log has this configure:27770: checking whether libatomic is needed by <pyatomic.h> |
In AIX, only the 32bit build fails. 64bit build doesn't require -latomic looks like. |
What does the configure say? Does it say Also, check if |
https://github.com/vstinner/cpython/blob/configure_libatomic/configure#L27834 |
LIBATOMIC=${LIBATOMIC-"-latomic"} |
MODULE__TESTCAPI_LDFLAGS is never populated with $LIBATOMIC, even though "MODULE__TESTCAPI_STATE=yes" |
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint64() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>. Co-authored-by: Erlend E. Aasland <[email protected]>
Sorry but I don't understand you test. Please:
It's not clear to me if you ran your test on 32-bit or 64-bit AIX. |
I did a fresh checking whether libatomic is needed by <pyatomic.h>, the result is yes It's a 32bit build. In AIX ,the default build environment is 32bit. 64bit build in AIX works as it doesn't require -latomic . |
LIBATOMIC="" This scenario never works |
LIBATOMIC=${LIBATOMIC:-"-latomic"} will work instead. |
I fixed (again ;-)) my PR. Please test it. The problem is that |
It works now. |
Thanks for testing it! |
Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint64() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>. Co-authored-by: Erlend E. Aasland <[email protected]>
Fixed by 1f7e421 |
configure no longer uses libatomic by default when Python is cross-compiled. The LIBATOMIC variable can be set manually in this case: ./configure LIBATOMIC="-latomic" (...)
configure no longer uses libatomic by default when Python is cross-compiled. The LIBATOMIC variable can be set manually in this case: ./configure LIBATOMIC="-latomic" (...)
configure no longer uses libatomic by default when Python is cross-compiled. The LIBATOMIC variable can be set manually in this case: ./configure LIBATOMIC="-latomic" (...)
I supposed that the build error is related to
Modules/_testcapi/pyatomic.c
andInclude/cpython/pyatomic.h
."Raspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware."
Buildbot worker says: "Raspberry Pi 4 B running Raspbian (Bullseye 11.x)."
test.pythoninfo:
-fno-strict-overflow -DNDEBUG -g -O3 -Wall -UNDEBUG
-std=c11 -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal
-fno-strict-overflow -DNDEBUG -g -O3 -Wall -UNDEBUG -std=c11 -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I. -I./Include
Logs:
logs: https://buildbot.python.org/all/#/builders/424/builds/4849
cc @colesbury @gpshead
Linked PRs
The text was updated successfully, but these errors were encountered: