-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
self-host linking #4314
Copy link
Copy link
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
Milestone
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.Solving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.Tokenization, parsing, AstGen, Sema, and Liveness.stage1The process of building from source via WebAssembly and the C backend.The process of building from source via WebAssembly and the C backend.
The C++ code in
src/link.cppis not really necessary for bootstrapping the self-hosted compiler.stage1 only needs to be able to create
libstage1.a(stage1.libon Windows) static library which then gets linked into stage2. That means linking can be self-hosted!This depends on #4313 being implemented first.
With this issue implemented, self-hosting the drop-in C compiler feature (see #3089) will be possible.
What it means to close this issue is that stage1 will call
stage2_link()with some set of parameters that does not include a list of linker arguments (the self-hosted code will figure out the set of linker arguments).This issue is not to be confused with #1535, which is to implement a linker in Zig. For this issue, LLD is used, same as in master branch. #1535 takes this a step further and does the actual linking itself in zig code, rather than in a third party dependency.