-
Notifications
You must be signed in to change notification settings - Fork 83
document combination of flags #756
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,6 +25,45 @@ We encourage new contributors to join our communication channels and introduce t | |||||
|
||||||
## Understanding Core Concepts | ||||||
|
||||||
|
||||||
|
||||||
### Sysroot & compilation flags | ||||||
|
||||||
#### What *is* the sysroot? | ||||||
The **sysroot** is the directory that stores the compiled standard | ||||||
library (`core`, `alloc`, `std`, `test`, …) and compiler built-ins. | ||||||
Rustup ships these libraries **pre-compiled with LLVM**. | ||||||
|
||||||
Because **rustc_codegen_gcc** replaces LLVM with the GCC backend, the shipped | ||||||
LLVM artefacts are **incompatible**. | ||||||
Therefore the standard library must be **rebuilt with GCC** before ordinary Rust crates can be compiled. | ||||||
|
||||||
The freshly compiled sysroot ends up in | ||||||
`build/build_sysroot/...`. | ||||||
|
||||||
A rebuild of sysroot is needed when | ||||||
|
||||||
* the backend changes in a way that affects code generation, or | ||||||
* the user switches toolchains / updates submodules. | ||||||
|
||||||
Both backend and sysroot can be built using different [profiles](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles). | ||||||
That is exactly what the `--sysroot`, `--release-sysroot` and `--release` flag supported by the frontend script `y.sh` take care of. | ||||||
|
That is exactly what the `--sysroot`, `--release-sysroot` and `--release` flag supported by the frontend script `y.sh` take care of. | |
That is exactly what the `--sysroot`, `--release-sysroot` and `--release` flag supported by the build system script `y.sh` take care of. |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the Cargo.toml
, only the dependencies are built with optimizations.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--release-sysroot
should not be used without --sysroot
, so I would remove this line and the other doing this from this table and perhaps specify that this outside the table.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should build the sysroot since the --sysroot
flag is provided.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should build the sysroot since the --sysroot
flag is provided.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should only build a release sysroot, not a debug sysroot.
And this builds a "debug" (well, dependencies compiled with optimizations + backend not optimized) backend.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,13 +472,22 @@ impl ConfigInfo { | |
|
||
pub fn show_usage() { | ||
println!( | ||
"\ | ||
" | ||
--features [arg] : Add a new feature [arg] | ||
--target-triple [arg] : Set the target triple to [arg] | ||
--target [arg] : Set the target to [arg] | ||
--out-dir : Location where the files will be generated | ||
--release : Build in release mode | ||
--release-sysroot : Build sysroot in release mode | ||
--release : Build and optimize the backend in release mode | ||
--sysroot : When used on its own, build both | ||
sysroot and backend in dev. mode. Only the backend is optimized. | ||
When used together with --release, build and optimize the backend | ||
in release mode instead of in dev. mode. | ||
When used together with --release-sysroot, | ||
build and optimize the sysroot in release mode instead of in dev. mode | ||
--release-sysroot : When used on its own, build and optimize only the backend in dev. mode. | ||
When combined with --release, it has no effect. | ||
When combined with --sysroot, additionally | ||
build and optimize the sysroot in release mode | ||
|
||
--sysroot-panic-abort : Build the sysroot without unwinding support | ||
--config-file : Location of the config file to be used | ||
--gcc-path : Location of the GCC root folder | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be compatible. If they are not, this would be an ABI bug.