Skip to content

Build stage0/lib/libstd.so using the stage0 compiler. #720

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
wants to merge 2 commits into from
Closed

Build stage0/lib/libstd.so using the stage0 compiler. #720

wants to merge 2 commits into from

Conversation

msullivan
Copy link
Contributor

This essentially starts the bootstrapping one step earlier by building
the stdlib from source using the stage0 compiler and then using that
stdlib to build the stage1 compiler. (Instead of starting by building
the stage1 compiler and then building a stdlib with it).

This means we should now be able to add features to the stdlib and use
them in the compiler without having to do a snapshot. (On the flip
side, this means that we now need to do a snapshot if we want to use a
new language feature in the stdlib, but that doesn't really seem too
burdensome (we already need to snapshot if we want to use a new
language feature in the compiler)).

This essentially starts the bootstrapping one step earlier by building
the stdlib from source using the stage0 compiler and then using that
stdlib to build the stage1 compiler. (Instead of starting by building
the stage1 compiler and then building a stdlib with it).

This means we should now be able to add features to the stdlib and use
them in the compiler without having to do a snapshot. (On the flip
side, this means that we now need to do a snapshot if we want to use a
new language feature in the stdlib, but that doesn't really seem too
burdensome (we already need to snapshot if we want to use a new
language feature in the compiler)).
@espindola
Copy link

I like the idea. Not sure about doing part of the work in stage0.mk and part in stageN.mk, but we can fix that afterwards.
LGTM.

@msullivan
Copy link
Contributor Author

Putting it in stage0.mk doesn't work because the macro you need to invoke hasn't been defined yet. I guess if we included stageN.mk before stage0.mk...

@brson
Copy link
Contributor

brson commented Jul 21, 2011

I kind of dislike building into stage0, but don't necessarily see a better solution. If we did this we would probably want to snapshot stage3/libstd.so and not stage3/lib/libstd.so, right?

And if we're going down this path, does it also make sense to do the same thing with rustrt? Snapshot the stage3/ version and build the stage0/lib version.

@msullivan
Copy link
Contributor Author

I think we want to snapshot the stage3/lib/libstd.so version, and not the stage3/libstd.so version. It doesn't matter for stage3, since they should be the same. But if we were taking a stage1 or stage2 snapshot, we definitely want the version built with the stage1 or stage2 compiler, which means the lib version. (Of course, we want it to wind up as stage0/libstd.so and not stage0/lib/libstd.so.)

I think that it probably does not make sense to build a stage0/lib/rustrt. Since calls into the runtime are generally inserted by the compiler and not called directly, the stage1 compiler won't depend on new runtime features since the stage0 compiler won't be generating calls to them anyways. I might be mistaken about how rustrt is used, though, so...

@brson
Copy link
Contributor

brson commented Jul 21, 2011

Isn't it true that stageN/rustc always dynamically links to stageN/libstd.so? If that's true then no matter which stage you're at, the stageN/ version of std is the one you need to hold on to, I think. Anyway, that doesn't really affect this patch.

@msullivan
Copy link
Contributor Author

I updated the patch to instantiate the rules from stage0.mk.

@brson
Copy link
Contributor

brson commented Jul 21, 2011

Integrated.

@brson brson closed this Jul 21, 2011
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this pull request Dec 12, 2017
Add more fcntl and seal constants for Android/Linux
pdietl pushed a commit to pdietl/rust that referenced this pull request Apr 23, 2020
document `bind_by_move_pattern_guards`
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