Skip to content

Commit 8732053

Browse files
[3.14] gh-148557: Use em-config to locate trampoline clang (GH-148556) (#150482)
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 1310d2c) Co-authored-by: Clément Péron <peron.clem@gmail.com>
1 parent e01a038 commit 8732053

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
@@ -3112,7 +3112,7 @@ Python/asm_trampoline.o: $(srcdir)/Python/asm_trampoline.S
31123112

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

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

0 commit comments

Comments
 (0)