Skip to content
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

build: add -Donly-c option #13278

Merged
merged 1 commit into from
Oct 24, 2022
Merged

build: add -Donly-c option #13278

merged 1 commit into from
Oct 24, 2022

Conversation

andrewrk
Copy link
Member

This option can be used to produce a C backend build of the self-hosted compiler, which only has the C backend enabled. Once the C backend is capable of self-hosting, this will be a way for us to replace our stage1 codebase with a C backend build of self-hosted, which we can then use for bootstrapping. See #5246 for more details.

Using this option right now results in a crash because the C backend is not yet passing all the behavior tests.

@andrewrk andrewrk mentioned this pull request Oct 23, 2022
@kubkon
Copy link
Member

kubkon commented Oct 23, 2022

Very exciting!

This option can be used to produce a C backend build of the self-hosted
compiler, which only has the C backend enabled. Once the C backend is
capable of self-hosting, this will be a way for us to replace our stage1
codebase with a C backend build of self-hosted, which we can then use
for bootstrapping. See #5246 for more details.

Using this option right now results in a crash because the C backend is
not yet passing all the behavior tests.
@andrewrk andrewrk merged commit 4f04759 into master Oct 24, 2022
@andrewrk andrewrk deleted the build-c-bootstrap branch October 24, 2022 03:05
@jacobly0
Copy link
Member

Just FYI this can also trigger some compile errors when enabled:

src/Compilation.zig:2454:9: note: 'error.FlushFailure' not a member of destination error set
src/Compilation.zig:2455:9: note: 'error.LLDReportedFailure' not a member of destination error set

@andrewrk
Copy link
Member Author

Thanks for pointing this out - fixed in #13294.

After this, the unique errors that remain to build Zig with -Donly-c in your branch are these:

/home/andy/dev/zig/lib/std/multi_array_list.zig:438:9: error: TODO: C backend: implement value of type Vector
        fn capacityInBytes(capacity: usize) usize {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/andy/dev/zig/src/link.zig:624:9: error: TODO: C backend: implement airFieldParentPtr
    pub fn destroy(base: *File) void {
    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/andy/dev/zig/lib/std/child_process.zig:496:5: error: TODO: C backend: implement cmp_lt_errors_len
    fn cleanupAfterWait(self: *ChildProcess, status: u32) !Term {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/andy/dev/zig/src/value.zig:1615:5: error: TODO: C backend: implement lowering large float values
    fn bigIntToFloat(limbs: []const std.math.big.Limb, positive: bool) f128 {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/andy/dev/zig/lib/std/fmt/parse_float/parse_float.zig:14:5: error: TODO float types > 64 bits are not support in renderValue() as of now
pub fn parseFloat(comptime T: type, s: []const u8) ParseFloatError!T {
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

😮

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants