From f5f527497f499be9ef178f571660f92a999db6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 31 Oct 2025 12:52:06 +0100 Subject: [PATCH 1/4] gh-140454: Generate jit_stencils-*-pc-linux-gnu.h instead of ...unknown-linux-gnu.h (as expected by Makefile) This avoids needless JIT recompilation during make install. --- .../next/Build/2025-10-31-13-20-16.gh-issue-140454.gF6dCe.rst | 3 +++ Tools/jit/_targets.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2025-10-31-13-20-16.gh-issue-140454.gF6dCe.rst diff --git a/Misc/NEWS.d/next/Build/2025-10-31-13-20-16.gh-issue-140454.gF6dCe.rst b/Misc/NEWS.d/next/Build/2025-10-31-13-20-16.gh-issue-140454.gF6dCe.rst new file mode 100644 index 00000000000000..4bb132ce01e170 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2025-10-31-13-20-16.gh-issue-140454.gF6dCe.rst @@ -0,0 +1,3 @@ +When building the JIT, match the jit_stencils filename expectations in +Makefile with the generator script. This avoid needless JIT recompilation +during ``make install``. diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py index dcc0abaf23f16d..f2fb75f0e27692 100644 --- a/Tools/jit/_targets.py +++ b/Tools/jit/_targets.py @@ -575,7 +575,7 @@ def get_target(host: str) -> _COFF32 | _COFF64 | _ELF | _MachO: optimizer = _optimizers.OptimizerAArch64 target = _COFF64(host, condition, args=args, optimizer=optimizer) elif re.fullmatch(r"aarch64-.*-linux-gnu", host): - host = "aarch64-unknown-linux-gnu" + host = "aarch64-pc-linux-gnu" condition = "defined(__aarch64__) && defined(__linux__)" # -mno-outline-atomics: Keep intrinsics from being emitted. args = ["-fpic", "-mno-outline-atomics"] @@ -600,7 +600,7 @@ def get_target(host: str) -> _COFF32 | _COFF64 | _ELF | _MachO: optimizer = _optimizers.OptimizerX86 target = _COFF64(host, condition, args=args, optimizer=optimizer) elif re.fullmatch(r"x86_64-.*-linux-gnu", host): - host = "x86_64-unknown-linux-gnu" + host = "x86_64-pc-linux-gnu" condition = "defined(__x86_64__) && defined(__linux__)" args = ["-fno-pic", "-mcmodel=medium", "-mlarge-data-threshold=0"] optimizer = _optimizers.OptimizerX86 From 15b13d5d318bd256d169c518560da194493dd1bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 3 Nov 2025 11:54:54 +0100 Subject: [PATCH 2/4] Fixup according to review --- Tools/jit/_targets.py | 4 ++-- configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tools/jit/_targets.py b/Tools/jit/_targets.py index f2fb75f0e27692..dcc0abaf23f16d 100644 --- a/Tools/jit/_targets.py +++ b/Tools/jit/_targets.py @@ -575,7 +575,7 @@ def get_target(host: str) -> _COFF32 | _COFF64 | _ELF | _MachO: optimizer = _optimizers.OptimizerAArch64 target = _COFF64(host, condition, args=args, optimizer=optimizer) elif re.fullmatch(r"aarch64-.*-linux-gnu", host): - host = "aarch64-pc-linux-gnu" + host = "aarch64-unknown-linux-gnu" condition = "defined(__aarch64__) && defined(__linux__)" # -mno-outline-atomics: Keep intrinsics from being emitted. args = ["-fpic", "-mno-outline-atomics"] @@ -600,7 +600,7 @@ def get_target(host: str) -> _COFF32 | _COFF64 | _ELF | _MachO: optimizer = _optimizers.OptimizerX86 target = _COFF64(host, condition, args=args, optimizer=optimizer) elif re.fullmatch(r"x86_64-.*-linux-gnu", host): - host = "x86_64-pc-linux-gnu" + host = "x86_64-unknown-linux-gnu" condition = "defined(__x86_64__) && defined(__linux__)" args = ["-fno-pic", "-mcmodel=medium", "-mlarge-data-threshold=0"] optimizer = _optimizers.OptimizerX86 diff --git a/configure.ac b/configure.ac index 6f29362f46735b..acae708c5bb29c 100644 --- a/configure.ac +++ b/configure.ac @@ -8218,10 +8218,10 @@ AS_VAR_IF([enable_experimental_jit], [no], JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h" ;; aarch64-*-linux-gnu) - JIT_STENCILS_H="jit_stencils-$host.h" + JIT_STENCILS_H="jit_stencils-aarch64-pc-linux-gnu.h" ;; x86_64-*-linux-gnu) - JIT_STENCILS_H="jit_stencils-$host.h" + JIT_STENCILS_H="jit_stencils-x86_64-pc-linux-gnu.h" ;; esac]) From 35e272cf983dcf13273ce40eb59bbe137ce52e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 3 Nov 2025 12:06:24 +0100 Subject: [PATCH 3/4] fixup! Fixup according to review --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index acae708c5bb29c..fbfeae96fb5b4c 100644 --- a/configure.ac +++ b/configure.ac @@ -8218,10 +8218,10 @@ AS_VAR_IF([enable_experimental_jit], [no], JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h" ;; aarch64-*-linux-gnu) - JIT_STENCILS_H="jit_stencils-aarch64-pc-linux-gnu.h" + JIT_STENCILS_H="jit_stencils-aarch64-unknown-linux-gnu.h" ;; x86_64-*-linux-gnu) - JIT_STENCILS_H="jit_stencils-x86_64-pc-linux-gnu.h" + JIT_STENCILS_H="jit_stencils-x86_64-unknown-linux-gnu.h" ;; esac]) From f553ad5c286149fdab9edc6369537f370d706232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 3 Nov 2025 13:18:43 +0100 Subject: [PATCH 4/4] make regen-configure --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 31eb0baa924207..6b0d4d10cc040b 100755 --- a/configure +++ b/configure @@ -34303,10 +34303,10 @@ else case e in #( JIT_STENCILS_H="jit_stencils-x86_64-pc-windows-msvc.h" ;; aarch64-*-linux-gnu) - JIT_STENCILS_H="jit_stencils-$host.h" + JIT_STENCILS_H="jit_stencils-aarch64-unknown-linux-gnu.h" ;; x86_64-*-linux-gnu) - JIT_STENCILS_H="jit_stencils-$host.h" + JIT_STENCILS_H="jit_stencils-x86_64-unknown-linux-gnu.h" ;; esac ;; esac