diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-09-23 20:48:47 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-09-23 20:48:47 -0700 |
| commit | b08fd0e8fca5ff9ac5531437f5749e74dc009a14 (patch) | |
| tree | e2fcc2a3a28e1ce90631542745d779c92b9356c0 /lib | |
| parent | 64deb46859a11588fb97e8464ec9dae53124b96b (diff) | |
| download | zig-b08fd0e8fca5ff9ac5531437f5749e74dc009a14.tar.gz zig-b08fd0e8fca5ff9ac5531437f5749e74dc009a14.zip | |
stage2: building musl libc from source
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/std/zig/system.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 57d0449379..d13d0b22ef 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -393,6 +393,12 @@ pub const NativeTargetInfo = struct { if (!native_target_has_ld or have_all_info or os_is_non_native) { return defaultAbiAndDynamicLinker(cpu, os, cross_target); } + if (cross_target.abi) |abi| { + if (abi.isMusl()) { + // musl implies static linking. + return defaultAbiAndDynamicLinker(cpu, os, cross_target); + } + } // The current target's ABI cannot be relied on for this. For example, we may build the zig // compiler for target riscv64-linux-musl and provide a tarball for users to download. // A user could then run that zig compiler on riscv64-linux-gnu. This use case is well-defined |
