Compare commits

...

2 Commits

Author SHA1 Message Date
Peterino2 88f48c83d9 updated output 2026-01-03 04:04:45 -08:00
Peterino2 df0248ec7b zig std lib doesnt work with dynamic linking on linux? 2026-01-03 04:01:52 -08:00
2 changed files with 23 additions and 29 deletions

View File

@ -9,6 +9,7 @@ pub fn build(b: *std.Build) void {
.root_module = b.createModule(.{
.root_source_file = b.path("lib.zig"),
.target = target,
.link_libc = true,
.optimize = optimize,
}),
.linkage = .dynamic,
@ -20,6 +21,7 @@ pub fn build(b: *std.Build) void {
.name = "repro",
.root_module = b.createModule(.{
.root_source_file = b.path("main.zig"),
.link_libc = true,
.target = target,
.optimize = optimize,
}),

View File

@ -1,37 +1,29 @@
[sear@nixos:~/Backlog/engine/core/shared-repro]$ zig build run
Loaded that shizz
test_debug_print found... calling...
Segmentation fault at address 0x1
???:?:?: 0x1 in ??? (???)
Unwind information for `???:0x1` was not available, trace may be incomplete
???:?:?: 0x7f96340dcccc in ??? (???)
???:?:?: 0x7f96340b68fc in ??? (???)
???:?:?: 0x7f963410a16a in ??? (???)
???:?:?: 0x7f96340dcb81 in ??? (???)
???:?:?: 0x7f96340b68d9 in ??? (???)
???:?:?: 0x7f96341a5d31 in ??? (???)
???:?:?: 0x7f96341a5ca1 in ??? (???)
/home/sear/Backlog/engine/core/shared-repro/main.zig:17:21: 0x113d482 in main (main.zig)
Segmentation fault at address 0x0
/nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig/std/Progress.zig:660:34: 0x7f06bc904e78 in unlockStderrWriter (std.zig)
pub fn unlockStderrWriter() void {
^
/nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig/std/debug.zig:219:36: 0x7f06bc8d968c in unlockStderrWriter (std.zig)
std.Progress.unlockStderrWriter();
^
/nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig/std/debug.zig:230:29: 0x7f06bc9a5da0 in print__anon_22298 (std.zig)
defer unlockStderrWriter();
^
/home/sear/git/zig-015-shared-bug/lib.zig:4:20: 0x7f06bc9a5ca1 in test_debug_print (lib.zig)
std.debug.print("hi, this crashes\n", .{});
^
/home/sear/git/zig-015-shared-bug/main.zig:17:21: 0x1139d96 in main (main.zig)
test_debug_print();
^
/nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig/std/start.zig:627:37: 0x113dc79 in posixCallMainAndExit (std.zig)
/nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig/std/start.zig:627:37: 0x113a261 in main (std.zig)
const result = root.main() catch |err| {
^
/nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig/std/start.zig:232:5: 0x113d351 in _start (std.zig)
asm volatile (switch (native_arch) {
^
???:?:?: 0x7f06bca2a4d7 in ??? (libc.so.6)
Unwind information for `libc.so.6:0x7f06bca2a4d7` was not available, trace may be incomplete
???:?:?: 0x7f06bca2a59a in ??? (libc.so.6)
???:?:?: 0x11603f4 in ??? (???)
run
└─ run exe repro failure
error: the following command terminated unexpectedly:
/home/sear/Backlog/engine/core/shared-repro/zig-out/bin/repro
Build Summary: 5/7 steps succeeded; 1 failed
run transitive failure
└─ run exe repro failure
error: the following build command failed with exit code 1:
.zig-cache/o/02ebcde8c5fdab533d40fa2b3ab58553/build /nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/bin/zig /nix/store/zbdyznm7b8yjvbcb18nladvffs79s66z-zig-0.15.2/lib/zig /home/sear/Backlog/engine/core/shared-repro .zig-cache /home/sear/.cache/zig --seed 0x64fe2e98 -Z80bb1b3472eb4d3f run
error: the following command terminated unexpect