]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-148557: Use em-config to locate trampoline clang (#148556)
authorClément Péron <peron.clem@gmail.com>
Tue, 26 May 2026 15:57:08 +0000 (17:57 +0200)
committerGitHub <noreply@github.com>
Tue, 26 May 2026 15:57:08 +0000 (08:57 -0700)
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.

Makefile.pre.in

index 242aca0dc05eec2076542841431a9cd6f84f660f..2b34b009fd745a04556483f2b54e3f39e41e7d4b 100644 (file)
@@ -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