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

Enable building freestanding sysroot with cargo #31792

Merged
merged 1 commit into from
Feb 21, 2016
Merged

Conversation

Zoxc
Copy link
Contributor

@Zoxc Zoxc commented Feb 20, 2016

With these changes you can build a freestanding sysroot without using floating points using a Cargo.toml and copying the deps folder cargo outputs.

[package]
name = "sysroot"
version = "0.1.0"

[lib]
path = "lib.rs"
crate-type = ["rlib"]

[dependencies.core]
path = "../vendor/rust/src/src/libcore"
features = ["disable_float"]

[dependencies]
collections = { path = "../vendor/rust/src/src/libcollections" }

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@hanna-kruppe
Copy link
Contributor

Are you aware of rust-lang/rfcs#1364? Over there, a different approach has been discussed. I'm not sure how much this PR and that issue overlap, because I am not sure what a "freestanding sysroot" is, can you elaborate on what one would use this for and why that's important?

@alexcrichton
Copy link
Member

Thanks for the PR! I think that the disable_float feature and its relevant changes may want to be held off for now (as @rkruppe) mentioned, so perhaps those can be separated out for another PR?

@Zoxc Zoxc force-pushed the sysroot branch 2 times, most recently from c9de9e7 to c13c51a Compare February 20, 2016 19:35
@alexcrichton
Copy link
Member

Ah also I don't think this PR will work because alloc does indeed link to alloc_system. I think that can move to the standard library, however?

@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 21, 2016

alloc links to some unknown crate implementing allocators. std already links to alloc_system. (and also optionally to alloc_jemalloc, not sure how that works)

@alexcrichton
Copy link
Member

Sorry, but to clarify, this will not compile. Crates built with Cargo can only depend on other crates listed in Cargo.toml. If alloc_system is listed in src/liballoc/lib.rs, it will not compile.

The business of selecting alloc_system unconditionally in stage0 can be moved to src/libstd/lib.rs, however, where it's probably more appropriately placed anyway.

@Zoxc
Copy link
Contributor Author

Zoxc commented Feb 21, 2016

I moved that to libstd

@alexcrichton
Copy link
Member

@bors: r+ 8ade080

Thanks!

bors added a commit that referenced this pull request Feb 21, 2016
With these changes you can build a freestanding sysroot without using floating points using a Cargo.toml and copying the `deps` folder cargo outputs.
```
[package]
name = "sysroot"
version = "0.1.0"

[lib]
path = "lib.rs"
crate-type = ["rlib"]

[dependencies.core]
path = "../vendor/rust/src/src/libcore"
features = ["disable_float"]

[dependencies]
collections = { path = "../vendor/rust/src/src/libcollections" }
```
@bors
Copy link
Contributor

bors commented Feb 21, 2016

⌛ Testing commit 8ade080 with merge f93a62b...

@bors bors merged commit 8ade080 into rust-lang:master Feb 21, 2016
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.

6 participants