unigen
fails to build on a cross target due to libc linkage
#3218
-
When testing We managed to identify the culprit as This patch succeeds to work around the issue: diff --git a/build.zig b/build.zig
index c3f7302..9fa73e9 100644
--- a/build.zig
+++ b/build.zig
@@ -1494,7 +1494,7 @@ fn addUnicodeTables(
.root_source_file = b.path("src/unicode/props.zig"),
.target = b.host,
});
- exe.linkLibC();
+ // exe.linkLibC();
if (step_ == null) b.installArtifact(exe);
const ziglyph_dep = b.dependency("ziglyph", .{
diff --git a/src/unicode/props.zig b/src/unicode/props.zig
index d77bf4c..994cf36 100644
--- a/src/unicode/props.zig
+++ b/src/unicode/props.zig
@@ -131,7 +131,7 @@ pub fn get(cp: u21) Properties {
/// Runnable binary to generate the lookup tables and output to stdout.
pub fn main() !void {
- const alloc = std.heap.c_allocator;
+ const alloc = std.heap.page_allocator;
const gen: lut.Generator(
Properties, I'm interested if it's acceptable, or if there's a reason for opting for system allocator here? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I believe libc is a required library for the macos build as it interfaces with ghostty through exported c bindings |
Beta Was this translation helpful? Give feedback.
-
Same happens to me when building natively on Ubuntu 24.04. The patch indeed does work. |
Beta Was this translation helpful? Give feedback.
-
No reason to use |
Beta Was this translation helpful? Give feedback.
No reason to use
c_allocator
here; just submitted a PR to replace it with ArenaAllocator: #5268