diff --git a/cli/src/api/build.ts b/cli/src/api/build.ts index 348c5cfc..4446bb5c 100644 --- a/cli/src/api/build.ts +++ b/cli/src/api/build.ts @@ -544,6 +544,21 @@ class Builder { 'bin', 'wasm-ld', ) + this.envs.CARGO_TARGET_WASM32_WASIP1_LINKER = join( + WASI_SDK_PATH, + 'bin', + 'wasm-ld', + ) + this.envs.CARGO_TARGET_WASM32_WASIP1_THREADS_LINKER = join( + WASI_SDK_PATH, + 'bin', + 'wasm-ld', + ) + this.envs.CARGO_TARGET_WASM32_WASIP2_LINKER = join( + WASI_SDK_PATH, + 'bin', + 'wasm-ld', + ) this.setEnvIfNotExists('CC', join(WASI_SDK_PATH, 'bin', 'clang')) this.setEnvIfNotExists('CXX', join(WASI_SDK_PATH, 'bin', 'clang++')) this.setEnvIfNotExists('AR', join(WASI_SDK_PATH, 'bin', 'ar')) diff --git a/cli/src/utils/target.ts b/cli/src/utils/target.ts index e900b721..3534fefe 100644 --- a/cli/src/utils/target.ts +++ b/cli/src/utils/target.ts @@ -110,6 +110,7 @@ export interface Target { */ export function parseTriple(rawTriple: string): Target { if ( + rawTriple === 'wasm32-wasi' || rawTriple === 'wasm32-wasi-preview1-threads' || rawTriple.startsWith('wasm32-wasip') ) {