Skip to content

error in building 3.13.2 for arm free-threaded with jit #130834

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

Closed
eyalk11 opened this issue Mar 4, 2025 · 6 comments
Closed

error in building 3.13.2 for arm free-threaded with jit #130834

eyalk11 opened this issue Mar 4, 2025 · 6 comments
Labels
build The build process and cross-build topic-free-threading topic-JIT type-bug An unexpected behavior, bug, or error

Comments

@eyalk11
Copy link

eyalk11 commented Mar 4, 2025

Bug report

Bug description:

CONFIGURE_OPTS="--disable-gil --enable-experimental-jit" pyenv install 3.13.2

Results logged to /tmp/python-build.20250304140853.1135365.log

Last 10 log lines:
./jit_stencils.h: In function ‘emit__UNPACK_SEQUENCE_TUPLE’:
./jit_stencils.h:36885:49: error: ‘__aarch64_ldadd8_acq_rel’ undeclared (first use in this function)
36885 |     patch_aarch64_16a(code + 0x148, (uintptr_t)&__aarch64_ldadd8_acq_rel);
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
./jit_stencils.h: In function ‘emit__UNPACK_SEQUENCE_TWO_TUPLE’:
./jit_stencils.h:37151:49: error: ‘__aarch64_ldadd8_acq_rel’ undeclared (first use in this function)
37151 |     patch_aarch64_16a(code + 0x1d8, (uintptr_t)&__aarch64_ldadd8_acq_rel);
      |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:3009: Python/jit.o] Error 1

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

@eyalk11 eyalk11 added the type-bug An unexpected behavior, bug, or error label Mar 4, 2025
@mdboom mdboom added the performance Performance or resource usage label Mar 4, 2025
@picnixz picnixz added build The build process and cross-build topic-free-threading topic-JIT and removed performance Performance or resource usage labels Mar 4, 2025
@corona10
Copy link
Member

corona10 commented Apr 2, 2025

@eyalk11 I want to check that passing -mno-outline-atomics to CFLAGS resolve your issue.
IIRC, you can pass the custom CFLAGS to pyenv.
cc @diegorusso

@diegorusso
Copy link
Contributor

@corona10 is right. I've just checked and in 3.13.2 the flag is not set. https://github.com/python/cpython/blob/v3.13.2/Tools/jit/_targets.py#L514

You can try installing the libatomic library.

sudo apt-get install libatomic1

CFLAGS are not passed down to the compilation of the JIT stencils. This because we don't use Makefile to compile the JIT stencils. Also because the compiler needed for compiling CPython might be different from clang (which is mandatory for the JIT stencils).
So if you want to pass that flag you need to modify the _target.py file and pass the flag.

Anyway we do this in 3.14: https://github.com/python/cpython/blob/main/Tools/jit/_targets.py#L524 and I'm wondering if it is worth to back port this change. @brandtbucher opinions?

@corona10
Copy link
Member

Hmm, I think that there is no reason not to backport it since we triage it as a bug.
Any ideas? @savannahostrowski @brandtbucher ?

@brandtbucher
Copy link
Member

Yeah, I'm fine with backporting it. On my phone now, is anyone else able to do it?

@corona10
Copy link
Member

Patch sent: #132368

corona10 added a commit that referenced this issue Apr 11, 2025
…132368)

* [3.13] gh-130834: Fix free-threaded build with JIT for arm

* lint
@corona10
Copy link
Member

@eyalk11 I think that we can close the issue, please let us know if this is still an issue at the latest 3.13 branch or the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build topic-free-threading topic-JIT type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

7 participants