0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00

link.File.Wasm: parse inputs in compilation pipeline

Primarily, this moves linker input parsing from flush() into the linker
task queue, which is executed simultaneously with the frontend.

I also made it avoid redundantly opening the same archive file N times
for each object file inside. Furthermore, hard code fixed buffer stream
rather than using a generic stream type.

Finally, I fixed the error handling of the Wasm.Archive.parse function.
Please pay attention to this pattern of returning a struct rather than
accepting a mutable struct as an argument. This ensures function-level
atomicity and makes resource management straightforward.

Deletes the file and path fields from Archive and Object.

Removed a well-meaning but ultimately misguided suggestion about how to
think about ZigObject since thinking about it that way has led to
problematic anti-DOD patterns.
This commit is contained in:
Andrew Kelley 2024-10-30 18:33:06 -07:00
commit f2dcfe0e40
6 changed files with 735 additions and 840 deletions