diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-09-29 17:24:21 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-09-29 17:24:21 -0700 |
| commit | 27e008eb292038c5a6b9a13b64c7b69d1525f690 (patch) | |
| tree | d718d7c3069ce1a2528ebe4bee1d1a8322188d31 /src/Compilation.zig | |
| parent | f69650a4788c57ec20348e9c002884ba39339d1c (diff) | |
| download | zig-27e008eb292038c5a6b9a13b64c7b69d1525f690.tar.gz zig-27e008eb292038c5a6b9a13b64c7b69d1525f690.zip | |
fix not passing std.builtin.link_libc to compiler_rt.zig and c.zig
comment reproduced here:
This is so that compiler_rt and libc.zig libraries know whether they
will eventually be linked with libc. They make different decisions
about what to export depending on whether another libc will be linked
in. For example, compiler_rt will not export the __chkstk symbol if it
knows libc will provide it, and likewise c.zig will not export memcpy.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index d60b323216..1cb02d6f1c 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -2842,6 +2842,12 @@ pub fn build_crt_file( .verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features, .clang_passthrough_mode = comp.clang_passthrough_mode, .is_compiler_rt_or_libc = true, + // This is so that compiler_rt and libc.zig libraries know whether they + // will eventually be linked with libc. They make different decisions + // about what to export depending on whether another libc will be linked + // in. For example, compiler_rt will not export the __chkstk symbol if it + // knows libc will provide it, and likewise c.zig will not export memcpy. + .link_libc = comp.bin_file.options.link_libc, }); defer sub_compilation.destroy(); |
