diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-12-11 15:31:23 +0100 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-12-13 00:40:35 +0100 |
| commit | 307d98dc35354c6562bb0c12cc79710f6b8a4c01 (patch) | |
| tree | eeb803f62161d1b94a547cca6df7c4ed9c19344e /src/Compilation.zig | |
| parent | d569e37cb538d17d009f5632c25acd643d3736cb (diff) | |
| download | zig-307d98dc35354c6562bb0c12cc79710f6b8a4c01.tar.gz zig-307d98dc35354c6562bb0c12cc79710f6b8a4c01.zip | |
stage2: support dynamically linking musl libc
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 96bf7b5797..1c8edcfde2 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1025,7 +1025,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { .{ .musl_crt_file = .crt1_o }, .{ .musl_crt_file = .scrt1_o }, .{ .musl_crt_file = .rcrt1_o }, - .{ .musl_crt_file = .libc_a }, + switch (comp.bin_file.options.link_mode) { + .Static => .{ .musl_crt_file = .libc_a }, + .Dynamic => .{ .musl_crt_file = .libc_so }, + }, }); } if (comp.wantBuildMinGWFromSource()) { |
