https://github.com/python/cpython/commit/1310d2c25242041f0a218012426fba14e756eef8
commit: 1310d2c25242041f0a218012426fba14e756eef8
branch: main
author: Clément Péron <[email protected]>
committer: emmatyping <[email protected]>
date: 2026-05-26T08:57:08-07:00
summary:

gh-148557: Use em-config to locate trampoline clang (#148556)

When CC is wrapped by ccache, the Emscripten trampoline rule cannot derive the
matching clang path by treating CC as a single executable path. Query the active
LLVM toolchain path with em-config instead.

files:
M Makefile.pre.in

diff --git a/Makefile.pre.in b/Makefile.pre.in
index 242aca0dc05eec..2b34b009fd745a 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -3139,7 +3139,7 @@ Python/asm_trampoline_universal2.o: 
$(srcdir)/Python/asm_trampoline_aarch64.S $(
 
 Python/emscripten_trampoline_inner.wasm: 
$(srcdir)/Python/emscripten_trampoline_inner.c
        # emcc has a path that ends with emsdk/upstream/emscripten/emcc, we're 
looking for emsdk/upstream/bin/clang.
-       $$(dirname $$(dirname $(CC)))/bin/clang -o $@ $< -mgc -O2 
-Wl,--no-entry -Wl,--import-table -Wl,--import-memory -target 
wasm32-unknown-unknown -nostdlib
+       $$(em-config LLVM_ROOT)/clang -o $@ $< -mgc -O2 -Wl,--no-entry 
-Wl,--import-table -Wl,--import-memory -target wasm32-unknown-unknown -nostdlib
 
 Python/emscripten_trampoline_wasm.c: Python/emscripten_trampoline_inner.wasm
        $(PYTHON_FOR_REGEN) 
$(srcdir)/Platforms/emscripten/prepare_external_wasm.py $< $@ 
getWasmTrampolineModule

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to