diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-12-16 03:33:37 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-16 03:34:20 -0700 |
| commit | 9257669cd4ecb10c51baea2bccee993e0c82bd20 (patch) | |
| tree | 4343603e48044a8c1123ef5ad495a88bb164788d | |
| parent | 1b0be5c1cef5b4836f4315e294e4156fc9d0956c (diff) | |
| download | zig-9257669cd4ecb10c51baea2bccee993e0c82bd20.tar.gz zig-9257669cd4ecb10c51baea2bccee993e0c82bd20.zip | |
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.
| -rw-r--r-- | src/glibc.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/glibc.zig b/src/glibc.zig index d0f358a03f..e9c0651fdc 100644 --- a/src/glibc.zig +++ b/src/glibc.zig @@ -335,8 +335,11 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile) !void { } const shared_def = switch (dep.flavor) { - .shared => "-DSHARED", .nonshared => "-DLIBC_NONSHARED=1", + // glibc passes `-DSHARED` for these. However, empirically if + // we do that here we will see undefined symbols such as `__GI_memcpy`. + // So we pass the same thing as for nonshared. + .shared => "-DLIBC_NONSHARED=1", }; try args.appendSlice(&[_][]const u8{ "-D_LIBC_REENTRANT", |
