Skip to content

Elf2 linker creates the wrong amount of nodes #25534

@myclevorname

Description

@myclevorname

Zig Version

0.16.0-dev.711+9aeabad51

Steps to Reproduce and Observed Behavior

  1. Clone https://github.com/myclevorname/narser/ at commit 04234e3b60e8b0969fceb267360e811129a44237
  2. Run zig build --watch -fincremental or apply the following patch:
diff --git a/build.zig b/build.zig
index 73ae236..223aa21 100644
--- a/build.zig
+++ b/build.zig
@@ -33,6 +33,7 @@ pub fn build(b: *std.Build) void {
             .imports = &.{.{ .name = "lib", .module = narser }},
         }),
     });
+    exe.use_new_linker = true;
 
     b.installFile("src/_narser.bash", "share/bash-completion/completions/narser");
     if (no_bin)
  1. https://gist.github.com/myclevorname/285907da5fcf7871e9b7faa3bd81080f

This does not happen on the Zig compiler source code.

Expected Behavior

The assert doesn't fail

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorlinking

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions