mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
Use -unknown when converting WASI/Emscripten target triples into LLVM triples
The "musl" part of the Zig target triples `wasm32-wasi-musl` and `wasm32-emscripten-musl` refers to the libc, not really the ABI. For WASM, most LLVM-based tooling uses `wasm32-wasi`, which is normalized into `wasm32-unknown-wasi`, with an implicit `-unknown` and without `-musl`. Similarly, Emscripten uses `wasm32-unknown-emscripten` without `-musl`. By using `-unknown` instead of `-musl` we get better compatibility with external tooling.
This commit is contained in:
parent
eedfce92b0
commit
e62a3ea74e
@ -265,7 +265,12 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
|
||||
.eabihf => "eabihf",
|
||||
.android => "android",
|
||||
.androideabi => "androideabi",
|
||||
.musl => "musl",
|
||||
.musl => switch (target.os.tag) {
|
||||
// For WASI/Emscripten, "musl" refers to the libc, not really the ABI.
|
||||
// "unknown" provides better compatibility with LLVM-based tooling for these targets.
|
||||
.wasi, .emscripten => "unknown",
|
||||
else => "musl",
|
||||
},
|
||||
.muslabin32 => "musl", // Should be muslabin32 in LLVM 20.
|
||||
.muslabi64 => "musl", // Should be muslabi64 in LLVM 20.
|
||||
.musleabi => "musleabi",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user