]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-148557: Use em-config to locate trampoline clang (GH-148556) (#150482)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 26 May 2026 17:05:51 +0000 (19:05 +0200)
committerGitHub <noreply@github.com>
Tue, 26 May 2026 17:05:51 +0000 (10:05 -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.
(cherry picked from commit 1310d2c25242041f0a218012426fba14e756eef8)

Co-authored-by: Clément Péron <peron.clem@gmail.com>
Makefile.pre.in

index ce320042bbf043008b5ce7a0ba35b7365149f288..f86d7363e0900fa79416c3b25355e21e47d4427f 100644 (file)
@@ -3112,7 +3112,7 @@ Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.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