Windows: `coff does not support linking multiple objects into one`

Open
#695 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
build-system

Research direction

The failure comes from the build step that splits the markup object before linking, and the issue points to build/app.zig around line 1777 in the installed SDK. Read how the COFF target path differs from the others, and reproduce on a Windows target with native dev. Done means the app builds and runs on Windows without the 'coff does not support linking multiple objects' error, with the change made in the repository rather than the global npm install.

Written by the indexing model from the issue text.

Description

Environment

  • Windows 11, x86_64
  • native 0.10.1
  • Zig 0.16.0
  • clang/LLVM 23.1.3

After running quick start commands:

npm install -g @native-sdk/[email protected] (there's a different bug on 0.11.0)
native init my_app
cd my_app
native dev

I get:
└─ compile obj meta-mp3-app-code Debug native failure
error: error: coff does not support linking multiple objects into one

I am new to Zig and this project (BTW, thanx for making it!!) so I asked AI where's the problem. It suggested several fixes: run it on (macOS that I don't have) or patch it:

Patch the installed SDK (build/app.zig, ~line 1777) to skip the object split on COFF and link the markup object directly instead:
const exe_root = if (ts_stage) |stage| root: {
    if (target.result.object_format == .coff) {
        app_mod.addObjectFile(markupDataObject(b, target, app_optimize, stage.markup_c).getEmittedBin());
        break :root app_mod;
    }
    … existing split …
};
Unblocks immediately; lost on SDK update/reinstall, and edits a global npm package.

I'm happy to provide more info if needed or test a fix in a PR :)

Dominant language
Zig
Stars
7.9k
Forks
335
Avg merge
10h 33m
Merged PRs (30d)
147

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vercel-labs/native

All issues in vercel-labs/native

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.