Skip to content

Commit e61f0d8

Browse files
committed
Link libc
1 parent f7d0673 commit e61f0d8

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

build.zig

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub fn build(b: *Build) !void {
2323
const caresmod = b.createModule(.{
2424
.target = target,
2525
.optimize = optimize,
26+
.link_libc = true,
2627
});
2728
const libcares = b.addLibrary(.{ .name = "cares", .root_module = caresmod });
2829
const cares_config = switch (target.result.os.tag) {
@@ -70,7 +71,11 @@ pub fn build(b: *Build) !void {
7071
libs_step.dependOn(&b.addInstallArtifact(libabseil, .{}).step);
7172

7273
// UTF8-range
73-
const utf8mod = b.createModule(.{ .target = target, .optimize = optimize });
74+
const utf8mod = b.createModule(.{
75+
.target = target,
76+
.optimize = optimize,
77+
.link_libc = true,
78+
});
7479
const libutf8 = b.addLibrary(.{ .name = "utf8-range", .root_module = utf8mod });
7580
utf8mod.addCSourceFiles(.{
7681
.root = upstream.path("third_party/utf8_range"),
@@ -84,7 +89,11 @@ pub fn build(b: *Build) !void {
8489
libs_step.dependOn(&b.addInstallArtifact(libutf8, .{}).step);
8590

8691
// upb
87-
const upbmod = b.createModule(.{ .target = target, .optimize = optimize });
92+
const upbmod = b.createModule(.{
93+
.target = target,
94+
.optimize = optimize,
95+
.link_libc = true,
96+
});
8897
const libupb = b.addLibrary(.{ .name = "upb", .root_module = upbmod });
8998
upbmod.addCSourceFiles(.{
9099
.root = upstream.path("third_party/upb"),
@@ -124,7 +133,11 @@ pub fn build(b: *Build) !void {
124133
libs_step.dependOn(&b.addInstallArtifact(libssl, .{}).step);
125134

126135
// zlib
127-
const zmod = b.createModule(.{ .target = target, .optimize = optimize });
136+
const zmod = b.createModule(.{
137+
.target = target,
138+
.optimize = optimize,
139+
.link_libc = true,
140+
});
128141
const libz = b.addLibrary(.{ .name = "z", .root_module = zmod });
129142
zmod.addCSourceFiles(.{
130143
.root = zlib.path(""),
@@ -135,7 +148,11 @@ pub fn build(b: *Build) !void {
135148
libs_step.dependOn(&b.addInstallArtifact(libz, .{}).step);
136149

137150
// Address Sorting
138-
const addrsort = b.createModule(.{ .target = target, .optimize = optimize });
151+
const addrsort = b.createModule(.{
152+
.target = target,
153+
.optimize = optimize,
154+
.link_libc = true,
155+
});
139156
const libaddrsort = b.addLibrary(.{ .name = "addresssorting", .root_module = addrsort });
140157
addrsort.addCSourceFiles(.{
141158
.root = upstream.path("third_party/address_sorting"),

0 commit comments

Comments
 (0)