Skip to content

gh-149800: Fix macOS universal2 build of perf trampoline (GH-149894 follow-up)#150364

Open
pablogsal wants to merge 2 commits into
python:mainfrom
pablogsal:fix-perf-trampoline-mac-universal2
Open

gh-149800: Fix macOS universal2 build of perf trampoline (GH-149894 follow-up)#150364
pablogsal wants to merge 2 commits into
python:mainfrom
pablogsal:fix-perf-trampoline-mac-universal2

Conversation

@pablogsal
Copy link
Copy Markdown
Member

@pablogsal pablogsal commented May 24, 2026

After the perf trampoline assembly was split into per-architecture files, the macOS universal2 build failed at the lipo step:

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

PY_CORE_CFLAGS on universal2 contains "-arch arm64 -arch x86_64", so each .S file was assembled into a fat .o containing both slices (with one slice empty because of the #ifdef guards). lipo then refused to merge two fat objects that share architectures.

Compile each per-arch object with a single -arch flag before merging.

…nGH-149894 follow-up)

After the perf trampoline assembly was split into per-architecture files,
the macOS universal2 build failed at the lipo step:

    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

PY_CORE_CFLAGS on universal2 contains "-arch arm64 -arch x86_64", so each
.S file was assembled into a fat .o containing both slices (with one slice
empty because of the #ifdef guards). lipo then refused to merge two fat
objects that share architectures.

Compile each per-arch object with a single -arch flag before merging.
Comment thread Makefile.pre.in
Comment thread Makefile.pre.in
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