authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-16 03:33:37-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-12-16 03:34:20-07:00
log9257669cd4ecb10c51baea2bccee993e0c82bd20
tree4343603e48044a8c1123ef5ad495a88bb164788d
parent1b0be5c1cef5b4836f4315e294e4156fc9d0956c

glibc: do not pass -DSHARED to any of the libc_nonshared.a sources

This essentially reverts 6a12dce207114842e2e49a3aeb18af01ab207f0b but it leaves breadcrumbs in the source explaining why things are the way they are.

1 files changed, 4 insertions(+), 1 deletions(-)

src/glibc.zig+4-1
...@@ -335,8 +335,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {...@@ -335,8 +335,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void {
335 }335 }
336336
337 const shared_def = switch (dep.flavor) {337 const shared_def = switch (dep.flavor) {
338 .shared => "-DSHARED",
339 .nonshared => "-DLIBC_NONSHARED=1",338 .nonshared => "-DLIBC_NONSHARED=1",
339 // glibc passes `-DSHARED` for these. However, empirically if
340 // we do that here we will see undefined symbols such as `__GI_memcpy`.
341 // So we pass the same thing as for nonshared.
342 .shared => "-DLIBC_NONSHARED=1",
340 };343 };
341 try args.appendSlice(&[_][]const u8{344 try args.appendSlice(&[_][]const u8{
342 "-D_LIBC_REENTRANT",345 "-D_LIBC_REENTRANT",