From 78a9a8f99d973931742bd37cd78c911ac277af23 Mon Sep 17 00:00:00 2001 From: vismaytiwari Date: Sat, 11 Jul 2026 02:09:31 +0530 Subject: [PATCH] gh-153285: Preserve LTO target names on macOS --- Makefile.pre.in | 2 +- .../next/Build/2026-07-11-01-53-58.gh-issue-153285.YmSox4.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2026-07-11-01-53-58.gh-issue-153285.YmSox4.rst diff --git a/Makefile.pre.in b/Makefile.pre.in index 4f2465798db820..bc82e9a58a795d 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -127,7 +127,7 @@ PY_CORE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE # LDFLAGS used to build executables and shared targets. PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) CONFIGURE_EXE_LDFLAGS=@EXE_LDFLAGS@ -PY_CORE_EXE_LDFLAGS:= $(if $(CONFIGURE_EXE_LDFLAGS), $(CONFIGURE_EXE_LDFLAGS) $(PY_LDFLAGS_NODIST), $(PY_CORE_LDFLAGS)) +PY_CORE_EXE_LDFLAGS= $(if $(CONFIGURE_EXE_LDFLAGS), $(CONFIGURE_EXE_LDFLAGS) $(PY_LDFLAGS_NODIST), $(PY_CORE_LDFLAGS)) # Strict or non-strict aliasing flags used to compile dtoa.c, see above CFLAGS_ALIASING=@CFLAGS_ALIASING@ # Compilation flags only for ceval.c. diff --git a/Misc/NEWS.d/next/Build/2026-07-11-01-53-58.gh-issue-153285.YmSox4.rst b/Misc/NEWS.d/next/Build/2026-07-11-01-53-58.gh-issue-153285.YmSox4.rst new file mode 100644 index 00000000000000..e4b528fc2b2e1f --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-07-11-01-53-58.gh-issue-153285.YmSox4.rst @@ -0,0 +1,2 @@ +Fix a build failure with ``--with-lto`` on macOS where executable linker +flags expanded Make's ``$@`` before the target was known.