]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-137218: Fix unnecessary recompile of `Programs/_freeze_module` (#139241)
authorSavannah Ostrowski <savannahostrowski@gmail.com>
Sun, 5 Oct 2025 03:05:37 +0000 (20:05 -0700)
committerGitHub <noreply@github.com>
Sun, 5 Oct 2025 03:05:37 +0000 (20:05 -0700)
Makefile.pre.in
configure
configure.ac

index 37bde125166f817897d906ad826005532c53070f..244e25c348f5a4bde0b630aa4ec1fd4226513b5d 100644 (file)
@@ -3132,7 +3132,7 @@ JIT_DEPS = \
 jit_stencils.h @JIT_STENCILS_H@: $(JIT_DEPS)
        @REGEN_JIT_COMMAND@
 
-Python/jit.o: $(srcdir)/Python/jit.c jit_stencils.h @JIT_STENCILS_H@
+Python/jit.o: $(srcdir)/Python/jit.c @JIT_STENCILS_H@
        $(CC) -c $(PY_CORE_CFLAGS) -o $@ $<
 
 .PHONY: regen-jit
index 7624cbf0d2ae3d55af6185c2476f4f9fa98b093b..0d1f6a29e9b4327ea4bf57aa951eb68ade2017a0 100755 (executable)
--- a/configure
+++ b/configure
@@ -644,6 +644,7 @@ ac_includes_default="\
 ac_header_c_list=
 ac_subst_vars='LTLIBOBJS
 MODULE_BLOCK
+JIT_STENCILS_H
 MODULE_XXLIMITED_35_FALSE
 MODULE_XXLIMITED_35_TRUE
 MODULE_XXLIMITED_FALSE
@@ -904,7 +905,6 @@ LDSHARED
 SHLIB_SUFFIX
 DSYMUTIL_PATH
 DSYMUTIL
-JIT_STENCILS_H
 REGEN_JIT_COMMAND
 UNIVERSAL_ARCH_FLAGS
 WASM_STDLIB
@@ -10876,7 +10876,6 @@ then :
 else case e in #(
   e) as_fn_append CFLAGS_NODIST " $jit_flags"
            REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$host} --output-dir . --pyconfig-dir . --cflags=\"$CFLAGS_JIT\""
-           JIT_STENCILS_H="jit_stencils.h"
            if test "x$Py_DEBUG" = xtrue
 then :
   as_fn_append REGEN_JIT_COMMAND " --debug"
@@ -10884,7 +10883,6 @@ fi ;;
 esac
 fi
 
-
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tier2_flags $jit_flags" >&5
 printf "%s\n" "$tier2_flags $jit_flags" >&6; }
 
@@ -34196,29 +34194,35 @@ printf "%s\n" "$py_cv_module_xxlimited_35" >&6; }
 
 # Determine JIT stencils header files based on target platform
 JIT_STENCILS_H=""
-case "$host" in
-  aarch64-apple-darwin*)
-    JIT_STENCILS_H="jit_stencils-aarch64-apple-darwin.h"
-    ;;
-  x86_64-apple-darwin*)
-    JIT_STENCILS_H="jit_stencils-x86_64-apple-darwin.h"
-    ;;
-  aarch64-pc-windows-msvc)
-    JIT_STENCILS_H="jit_stencils-aarch64-pc-windows-msvc.h"
-    ;;
-  i686-pc-windows-msvc)
-    JIT_STENCILS_H="jit_stencils-i686-pc-windows-msvc.h"
-    ;;
-  x86_64-pc-windows-msvc)
-    JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h"
-    ;;
-  aarch64-*-linux-gnu)
-    JIT_STENCILS_H="jit_stencils-$host.h"
-    ;;
-  x86_64-*-linux-gnu)
-    JIT_STENCILS_H="jit_stencils-$host.h"
-    ;;
+if test "x$enable_experimental_jit" = xno
+then :
+
+else case e in #(
+  e) case "$host" in
+    aarch64-apple-darwin*)
+      JIT_STENCILS_H="jit_stencils-aarch64-apple-darwin.h"
+      ;;
+    x86_64-apple-darwin*)
+      JIT_STENCILS_H="jit_stencils-x86_64-apple-darwin.h"
+      ;;
+    aarch64-pc-windows-msvc)
+      JIT_STENCILS_H="jit_stencils-aarch64-pc-windows-msvc.h"
+      ;;
+    i686-pc-windows-msvc)
+      JIT_STENCILS_H="jit_stencils-i686-pc-windows-msvc.h"
+      ;;
+    x86_64-pc-windows-msvc)
+      JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h"
+      ;;
+    aarch64-*-linux-gnu)
+      JIT_STENCILS_H="jit_stencils-$host.h"
+      ;;
+    x86_64-*-linux-gnu)
+      JIT_STENCILS_H="jit_stencils-$host.h"
+      ;;
+  esac ;;
 esac
+fi
 
 
 
index 7a7e32d42945b9fc27963c7806c266572155bb1d..7b5da6e0d15682323d4b96cc0540ef86f794e92d 100644 (file)
@@ -2787,13 +2787,11 @@ AS_VAR_IF([jit_flags],
           [AS_VAR_APPEND([CFLAGS_NODIST], [" $jit_flags"])
            AS_VAR_SET([REGEN_JIT_COMMAND],
                       ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py ${ARCH_TRIPLES:-$host} --output-dir . --pyconfig-dir . --cflags=\"$CFLAGS_JIT\""])
-           AS_VAR_SET([JIT_STENCILS_H], ["jit_stencils.h"])
            AS_VAR_IF([Py_DEBUG],
                      [true],
                      [AS_VAR_APPEND([REGEN_JIT_COMMAND], [" --debug"])],
                      [])])
 AC_SUBST([REGEN_JIT_COMMAND])
-AC_SUBST([JIT_STENCILS_H])
 AC_MSG_RESULT([$tier2_flags $jit_flags])
 
 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
 
 # Determine JIT stencils header files based on target platform
 JIT_STENCILS_H=""
-case "$host" in
-  aarch64-apple-darwin*)
-    JIT_STENCILS_H="jit_stencils-aarch64-apple-darwin.h"
-    ;;
-  x86_64-apple-darwin*)
-    JIT_STENCILS_H="jit_stencils-x86_64-apple-darwin.h"
-    ;;
-  aarch64-pc-windows-msvc)
-    JIT_STENCILS_H="jit_stencils-aarch64-pc-windows-msvc.h"
-    ;;
-  i686-pc-windows-msvc)
-    JIT_STENCILS_H="jit_stencils-i686-pc-windows-msvc.h"
-    ;;
-  x86_64-pc-windows-msvc)
-    JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h"
-    ;;
-  aarch64-*-linux-gnu)
-    JIT_STENCILS_H="jit_stencils-$host.h"
-    ;;
-  x86_64-*-linux-gnu)
-    JIT_STENCILS_H="jit_stencils-$host.h"
-    ;;
-esac
+AS_VAR_IF([enable_experimental_jit], [no], 
+  [],
+  [case "$host" in
+    aarch64-apple-darwin*)
+      JIT_STENCILS_H="jit_stencils-aarch64-apple-darwin.h"
+      ;;
+    x86_64-apple-darwin*)
+      JIT_STENCILS_H="jit_stencils-x86_64-apple-darwin.h"
+      ;;
+    aarch64-pc-windows-msvc)
+      JIT_STENCILS_H="jit_stencils-aarch64-pc-windows-msvc.h"
+      ;;
+    i686-pc-windows-msvc)
+      JIT_STENCILS_H="jit_stencils-i686-pc-windows-msvc.h"
+      ;;
+    x86_64-pc-windows-msvc)
+      JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h"
+      ;;
+    aarch64-*-linux-gnu)
+      JIT_STENCILS_H="jit_stencils-$host.h"
+      ;;
+    x86_64-*-linux-gnu)
+      JIT_STENCILS_H="jit_stencils-$host.h"
+      ;;
+  esac])
 
 AC_SUBST([JIT_STENCILS_H])