Skip to content

Commit 1310d2c

Browse files
authored
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.
1 parent a679366 commit 1310d2c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3139,7 +3139,7 @@ Python/asm_trampoline_universal2.o: $(srcdir)/Python/asm_trampoline_aarch64.S $(
31393139

31403140
Python/emscripten_trampoline_inner.wasm: $(srcdir)/Python/emscripten_trampoline_inner.c
31413141
# emcc has a path that ends with emsdk/upstream/emscripten/emcc, we're looking for emsdk/upstream/bin/clang.
3142-
$$(dirname $$(dirname $(CC)))/bin/clang -o $@ $< -mgc -O2 -Wl,--no-entry -Wl,--import-table -Wl,--import-memory -target wasm32-unknown-unknown -nostdlib
3142+
$$(em-config LLVM_ROOT)/clang -o $@ $< -mgc -O2 -Wl,--no-entry -Wl,--import-table -Wl,--import-memory -target wasm32-unknown-unknown -nostdlib
31433143

31443144
Python/emscripten_trampoline_wasm.c: Python/emscripten_trampoline_inner.wasm
31453145
$(PYTHON_FOR_REGEN) $(srcdir)/Platforms/emscripten/prepare_external_wasm.py $< $@ getWasmTrampolineModule

0 commit comments

Comments
 (0)