changed the title [-]--disable-gil & --wirh-experimental-jit fails to build on M1 Mac[/-][+]--disable-gil & --enable-experimental-jit fails to build on M1 Mac[/+]on May 9, 2024
Thanks! I’m not sure if this is a build configuration that’s been given any thought yet... or if it even makes sense right now (I believe our tier 2 optimization pipeline is disabled on free-threaded builds, but I’d need to check). Regardless, we’re headed towards a future with both of these features and should probably make sure that they at least build together.
@savannahostrowski, interested in taking this too? I’m on my phone now, but I think we probably just need to #include the header where this is defined in jit.c.
FWIW, I'm not sure this is M1-specific. It compiled just fine on my Dell laptop running XUbuntu 22.04. OTOH, on an old MacBook Air I have laying around (dual core Intel i5, MacOS 12.7.4), it failed to compile Python/jit.c in the same fashion as on my M1 MBP. Maybe it's a MacOS issue?
I saw the close-out of the PR and apparent backport to 3.13. I can build fine on main, but compilation still fails for me on 3.13. On both main and 3.13 I used this configure command (grepped from config.status):
I thought the PR was backported to 3.13, but maybe not? Diffing the main and 3.13 versions of Python/jit.c I see this line is missing from the 3.13 version:
#include "pycore_critical_section.h"
Adding it allows the compilation to succeed. I don't see it in the jit.c source on Github either.
Activity
Eclips4 commented on May 9, 2024
Full compilation error:
Detailsgcc -c -fno-strict-overflow -Wsign-compare -g -Og -Wall -D_Py_TIER2=1 -D_Py_JIT -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden -I./Include/internal -I./Include/internal/mimalloc -I. -I./Include -DPy_BUILD_CORE -o Python/jit.o Python/jit.c In file included from Python/jit.c:392: ./jit_stencils.h:24576:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16a(code + 0x230, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:24577:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16b(code + 0x234, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:24578:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16c(code + 0x238, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:24579:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16d(code + 0x23c, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:24596:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16a(code + 0x2a8, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:24597:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16b(code + 0x2ac, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:24598:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16c(code + 0x2b0, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:24599:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16d(code + 0x2b4, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:45384:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16a(code + 0x1c0, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:45385:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16b(code + 0x1c4, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:45386:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16c(code + 0x1c8, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:45387:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16d(code + 0x1cc, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:45404:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16a(code + 0x238, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:45405:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16b(code + 0x23c, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:45406:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16c(code + 0x240, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:45407:49: error: use of undeclared identifier '_PyCriticalSection_BeginSlow' patch_aarch64_16d(code + 0x244, (uintptr_t)&_PyCriticalSection_BeginSlow); ^ ./jit_stencils.h:48060:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16a(code + 0x358, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:48061:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16b(code + 0x35c, (uintptr_t)&_PyCriticalSection_Resume); ^ ./jit_stencils.h:48062:49: error: use of undeclared identifier '_PyCriticalSection_Resume' patch_aarch64_16c(code + 0x360, (uintptr_t)&_PyCriticalSection_Resume); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make: *** [Python/jit.o] Error 1brandtbucher commented on May 9, 2024
Thanks! I’m not sure if this is a build configuration that’s been given any thought yet... or if it even makes sense right now (I believe our tier 2 optimization pipeline is disabled on free-threaded builds, but I’d need to check). Regardless, we’re headed towards a future with both of these features and should probably make sure that they at least build together.
@savannahostrowski, interested in taking this too? I’m on my phone now, but I think we probably just need to #include the header where this is defined in jit.c.
sobolevn commented on May 9, 2024
Here' the code sample that is generated:
savannahostrowski commented on May 9, 2024
Yep - feel free to assign to me @brandtbucher! I'll take a look tonight or tomorrow!
smontanaro commented on May 9, 2024
FWIW, I'm not sure this is M1-specific. It compiled just fine on my Dell laptop running XUbuntu 22.04. OTOH, on an old MacBook Air I have laying around (dual core Intel i5, MacOS 12.7.4), it failed to compile Python/jit.c in the same fashion as on my M1 MBP. Maybe it's a MacOS issue?
GH-118844: Fix build failures when combining --disable-gil with --ena…
pythonGH-118844: Fix build failures when combining --disable-gil with…
smontanaro commented on May 13, 2024
@brandtbucher @savannahostrowski
I saw the close-out of the PR and apparent backport to 3.13. I can build fine on main, but compilation still fails for me on 3.13. On both main and 3.13 I used this configure command (grepped from config.status):
I thought the PR was backported to 3.13, but maybe not? Diffing the main and 3.13 versions of Python/jit.c I see this line is missing from the 3.13 version:
Adding it allows the compilation to succeed. I don't see it in the jit.c source on Github either.
brandtbucher commented on May 13, 2024
Ah, sorry, looks like the backport failed! Re-running it now...
[3.13] GH-118844: Fix build failures when combining --disable-gil wit…
brandtbucher commented on May 13, 2024
...done!
pythonGH-118844: Fix build failures when combining --disable-gil with…