authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-29 17:24:21-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-09-29 17:24:21-07:00
log27e008eb292038c5a6b9a13b64c7b69d1525f690
treed718d7c3069ce1a2528ebe4bee1d1a8322188d31
parentf69650a4788c57ec20348e9c002884ba39339d1c

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.

1 files changed, 6 insertions(+), 0 deletions(-)

src/Compilation.zig+6
......@@ -2842,6 +2842,12 @@ pub fn build_crt_file(
28422842 .verbose_llvm_cpu_features = comp.verbose_llvm_cpu_features,
28432843 .clang_passthrough_mode = comp.clang_passthrough_mode,
28442844 .is_compiler_rt_or_libc = true,
2845 // This is so that compiler_rt and libc.zig libraries know whether they
2846 // will eventually be linked with libc. They make different decisions
2847 // about what to export depending on whether another libc will be linked
2848 // in. For example, compiler_rt will not export the __chkstk symbol if it
2849 // knows libc will provide it, and likewise c.zig will not export memcpy.
2850 .link_libc = comp.bin_file.options.link_libc,
28452851 });
28462852 defer sub_compilation.destroy();
28472853