FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-149800: Fix macOS universal2 build of perf trampoline by eendebakpt · Pull Request #150365 · python/cpython · GitHub

Repository navigation

gh-149800: Fix macOS universal2 build of perf trampoline - #150365

Closed
eendebakpt wants to merge 2 commits into
python:mainfrom
eendebakpt:fix-universal2-trampoline
Closed

eendebakpt wants to merge 2 commits into
python:mainfrom
eendebakpt:fix-universal2-trampoline

Conversation

eendebakpt commented May 24, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Address failing JIT CI, see https://github.com/python/cpython/actions/runs/26343871355/job/77550446716?pr=150324

Claude analysis:

After splitting the perf trampoline into per-architecture .S files in #149894, PY_CORE_CFLAGS still carries -arch arm64 -arch x86_64 on universal2 builds, so each per-arch object becomes a fat Mach-O whose wrong-arch slice is empty (thanks to the #ifdef guards in the sources). lipo -create then refused to merge two fat inputs sharing both architectures:

fatal error: lipo: Python/asm_trampoline_aarch64.o and
Python/asm_trampoline_x86_64.o have the same architectures (x86_64)
and can't be in the same fat output file

Extract the matching slice from each per-arch object with lipo -thin before recombining into asm_trampoline_universal2.o.

The PR #149894 passed because it did not trigger jit builds.

Marking as DO-NOT-MERGE until someone can verify the above is correct.

After splitting the perf trampoline into per-architecture .S files,
PY_CORE_CFLAGS still carries `-arch arm64 -arch x86_64` on universal2
builds, so each per-arch object becomes a fat Mach-O whose wrong-arch
slice is empty (thanks to the `#ifdef` guards in the sources). `lipo
-create` then refused to merge two fat inputs sharing both
architectures:

    fatal error: lipo: Python/asm_trampoline_aarch64.o and
    Python/asm_trampoline_x86_64.o have the same architectures (x86_64)
    and can't be in the same fat output file

Extract the matching slice from each per-arch object with `lipo -thin`
before recombining into `asm_trampoline_universal2.o`.

Copy link
Copy Markdown
Member

Looks like @pablogsal was a couple of minutes ahead of you: duplicate of #150364

Copy link
Copy Markdown
Contributor Author

Looks like @pablogsal was a couple of minutes ahead of you: duplicate of #150364

Yeah, he beat me by a minute. I'll close this one, his approach is similar to this one.

eendebakpt closed this May 24, 2026

Copy link
Copy Markdown
Member

Thanks for jumping on it!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

2 participants


Back | FazBrowse Home | New Git URL