From 1032326fe46afaef57c3e01160a4f889dadfee95 Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Sat, 3 Feb 2024 17:16:03 -0600 Subject: [PATCH] gh-114883: Fix Makefile dependency tree for non-jit builds (GH-114884) --- Makefile.pre.in | 13 ++++++++++++- configure | 3 +++ configure.ac | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Makefile.pre.in b/Makefile.pre.in index fff3d3c4914..aad637876ea 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -2643,7 +2643,18 @@ config.status: $(srcdir)/configure Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S $(CC) -c $(PY_CORE_CFLAGS) -o $@ $< -Python/jit.o: regen-jit + +JIT_DEPS = \ + $(srcdir)/Tools/jit/*.c \ + $(srcdir)/Tools/jit/*.py \ + $(srcdir)/Python/executor_cases.c.h \ + pyconfig.h + +jit_stencils.h: $(JIT_DEPS) + @REGEN_JIT_COMMAND@ + +Python/jit.o: $(srcdir)/Python/jit.c @JIT_STENCILS_H@ + $(CC) -c $(PY_CORE_CFLAGS) -o $@ $< .PHONY: regen-jit regen-jit: diff --git a/configure b/configure index 1d41d7ba664..0375565c294 100755 --- a/configure +++ b/configure @@ -920,6 +920,7 @@ LLVM_AR PROFILE_TASK DEF_MAKE_RULE DEF_MAKE_ALL_RULE +JIT_STENCILS_H REGEN_JIT_COMMAND ABIFLAGS LN @@ -8019,12 +8020,14 @@ then : else $as_nop as_fn_append CFLAGS_NODIST " -D_Py_JIT" REGEN_JIT_COMMAND="\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host" + JIT_STENCILS_H="jit_stencils.h" if test "x$Py_DEBUG" = xtrue then : as_fn_append REGEN_JIT_COMMAND " --debug" fi fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_experimental_jit" >&5 printf "%s\n" "$enable_experimental_jit" >&6; } diff --git a/configure.ac b/configure.ac index b29cd028f8f..e121e893a1d 100644 --- a/configure.ac +++ b/configure.ac @@ -1592,11 +1592,13 @@ AS_VAR_IF([enable_experimental_jit], [AS_VAR_APPEND([CFLAGS_NODIST], [" -D_Py_JIT"]) AS_VAR_SET([REGEN_JIT_COMMAND], ["\$(PYTHON_FOR_REGEN) \$(srcdir)/Tools/jit/build.py $host"]) + 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([$enable_experimental_jit]) # Enable optimization flags