Open Lapshin opened 2 weeks ago
The configure
script has a check for -latomic
. I'm not sure why it's not working on your system:
Oh, I guess we disabled it for cross compilation (https://github.com/python/cpython/pull/109211). cc @vstinner @erlend-aasland
Could we use AC_LINK_IFELSE
instead of AC_RUN_IFELSE
for this check?
Could we use AC_LINK_IFELSE instead of AC_RUN_IFELSE for this check?
I don't know, it's beyond my autotools skills :-) Maybe @erlend-aasland or @corona10 knows.
I don't know autotools. When Python is cross-compiled, does AC_RUN_IFELSE build the program? Or does it do nothing?
IIRC, the LINK variant only runs the linker, so it should work on a correctly setup cross-compiling environment. The RUN variant also runs the resulting executable, which will fail in a cross-compiling dev environment.
Ah, the check in our configure script defaults to not requiring libatomic if we are cross compiling. Perhaps we want to change that configure branch.
Ah, the check in our configure script defaults to not requiring libatomic if we are cross compiling. Perhaps we want to change that configure branch.
Looking at the past PRs:
-latomic
the default when cross-compiling-latomic
to fix wasm32
, which is cross-compiled but doesn't support -latomic
.IIRC, the LINK variant only runs the linker, so it should work on a correctly setup cross-compiling environment
I think the link time check should be sufficient for both cross-compiling and native compilation (famous last words). I'll give it a go.
I think the link time check should be sufficient for both cross-compiling and native compilation (famous last words). I'll give it a go.
Yes, that aligns with my assumptions as well. Let's try.
Bug report
Bug description:
Should not configure script check if
-latomic
is needed?getting build error when cross-compile:
configure cmd line:
workaround
CPython versions tested on:
3.13
Operating systems tested on:
Linux
Linked PRs