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.