Skip to content

gh-153285: Preserve LTO target names on macOS#153532

Open
vismaytiwari wants to merge 1 commit into
python:mainfrom
vismaytiwari:gh-153285-preserve-lto-target
Open

gh-153285: Preserve LTO target names on macOS#153532
vismaytiwari wants to merge 1 commit into
python:mainfrom
vismaytiwari:gh-153285-preserve-lto-target

Conversation

@vismaytiwari

@vismaytiwari vismaytiwari commented Jul 10, 2026

Copy link
Copy Markdown

Fixes #153285.

On macOS with --with-lto, the LTO linker flags include Make automatic target variable $@. PY_CORE_EXE_LDFLAGS used an immediate assignment, so that variable expanded while Make parsed the file rather than while an executable target was linked. This produced an empty object path for Programs/_testembed and caused test_embed failures.

Use a recursive assignment so $@ is evaluated in the link recipe.

Validation:

  • Reproduced on macOS 26.5 with Apple Clang 17 using ./configure --with-lto and make -j8: test_embed had 84 failures before the change.
  • Fresh patched ThinLTO build: test_embed passed 90 tests with 8 expected skips.
  • Full ThinLTO suite: 50,091 tests run; 464 test files passed, with 32 platform skips and 9 resource skips.
  • make patchcheck passed.

@python-cla-bot

python-cla-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiling --with-lto results in test_embed failures on Darwin

1 participant