Skip to content

Commit 2c9ebd4

Browse files
savannahostrowskidanigm
authored andcommitted
pythonGH-137218: Fix unnecessary recompile of Programs/_freeze_module (python#139241)
1 parent cf77ea2 commit 2c9ebd4

File tree

3 files changed

+55
-51
lines changed

3 files changed

+55
-51
lines changed

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3132,7 +3132,7 @@ JIT_DEPS = \
31323132
jit_stencils.h @JIT_STENCILS_H@: $(JIT_DEPS)
31333133
@REGEN_JIT_COMMAND@
31343134

3135-
Python/jit.o: $(srcdir)/Python/jit.c jit_stencils.h @JIT_STENCILS_H@
3135+
Python/jit.o: $(srcdir)/Python/jit.c @JIT_STENCILS_H@
31363136
$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
31373137

31383138
.PHONY: regen-jit

configure

Lines changed: 29 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,13 +2787,11 @@ AS_VAR_IF([jit_flags],
27872787
[AS_VAR_APPEND([CFLAGS_NODIST], [" $jit_flags"])
27882788
AS_VAR_SET([REGEN_JIT_COMMAND],
27892789
["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$host} --output-dir . --pyconfig-dir . --cflags=\"$CFLAGS_JIT\" --llvm-version=\"$LLVM_VERSION\""])
2790-
AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
27912790
AS_VAR_IF([Py_DEBUG],
27922791
[true],
27932792
[AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --debug"])],
27942793
[])])
27952794
AC_SUBST([REGEN_JIT_COMMAND])
2796-
AC_SUBST([JIT_STENCILS_H])
27972795
AC_MSG_RESULT([$tier2_flags $jit_flags])
27982796

27992797
if test "$disable_gil" = "yes" -a "$enable_experimental_jit" != "no"; then
@@ -8175,29 +8173,31 @@ PY_STDLIB_MOD([xxlimited_35], [test "$TEST_MODULES" = yes], [test "$ac_cv_func_d
81758173

81768174
# Determine JIT stencils header files based on target platform
81778175
JIT_STENCILS_H=""
8178-
case "$host" in
8179-
aarch64-apple-darwin*)
8180-
JIT_STENCILS_H="jit_stencils-aarch64-apple-darwin.h"
8181-
;;
8182-
x86_64-apple-darwin*)
8183-
JIT_STENCILS_H="jit_stencils-x86_64-apple-darwin.h"
8184-
;;
8185-
aarch64-pc-windows-msvc)
8186-
JIT_STENCILS_H="jit_stencils-aarch64-pc-windows-msvc.h"
8187-
;;
8188-
i686-pc-windows-msvc)
8189-
JIT_STENCILS_H="jit_stencils-i686-pc-windows-msvc.h"
8190-
;;
8191-
x86_64-pc-windows-msvc)
8192-
JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h"
8193-
;;
8194-
aarch64-*-linux-gnu)
8195-
JIT_STENCILS_H="jit_stencils-$host.h"
8196-
;;
8197-
x86_64-*-linux-gnu)
8198-
JIT_STENCILS_H="jit_stencils-$host.h"
8199-
;;
8200-
esac
8176+
AS_VAR_IF([enable_experimental_jit], [no],
8177+
[],
8178+
[case "$host" in
8179+
aarch64-apple-darwin*)
8180+
JIT_STENCILS_H="jit_stencils-aarch64-apple-darwin.h"
8181+
;;
8182+
x86_64-apple-darwin*)
8183+
JIT_STENCILS_H="jit_stencils-x86_64-apple-darwin.h"
8184+
;;
8185+
aarch64-pc-windows-msvc)
8186+
JIT_STENCILS_H="jit_stencils-aarch64-pc-windows-msvc.h"
8187+
;;
8188+
i686-pc-windows-msvc)
8189+
JIT_STENCILS_H="jit_stencils-i686-pc-windows-msvc.h"
8190+
;;
8191+
x86_64-pc-windows-msvc)
8192+
JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h"
8193+
;;
8194+
aarch64-*-linux-gnu)
8195+
JIT_STENCILS_H="jit_stencils-$host.h"
8196+
;;
8197+
x86_64-*-linux-gnu)
8198+
JIT_STENCILS_H="jit_stencils-$host.h"
8199+
;;
8200+
esac])
82018201

82028202
AC_SUBST([JIT_STENCILS_H])
82038203

0 commit comments

Comments
 (0)