Skip to content

self-host linking #4314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrewrk opened this issue Jan 29, 2020 · 1 comment
Closed

self-host linking #4314

andrewrk opened this issue Jan 29, 2020 · 1 comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness. stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@andrewrk
Copy link
Member

The C++ code in src/link.cpp is not really necessary for bootstrapping the self-hosted compiler.

stage1 only needs to be able to create libstage1.a (stage1.lib on 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.

@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. frontend Tokenization, parsing, AstGen, Sema, and Liveness. stage1 The process of building from source via WebAssembly and the C backend. labels Jan 29, 2020
@andrewrk andrewrk added this to the 0.7.0 milestone Jan 29, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.6.0 Feb 17, 2020
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Mar 29, 2020
@andrewrk
Copy link
Member Author

Landed in fe117d9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness. stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

No branches or pull requests

1 participant