Skip to content

Commit 6d92a19

Browse files
updated code according to review's feedback
1 parent fcf5820 commit 6d92a19

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

CONTRIBUTING.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ The **sysroot** is the directory that stores the compiled standard
3434
library (`core`, `alloc`, `std`, `test`, …) and compiler built-ins.
3535
Rustup ships these libraries **pre-compiled with LLVM**.
3636

37-
Because **rustc_codegen_gcc** replaces LLVM with the GCC backend, the shipped
38-
LLVM artefacts are **incompatible**.
39-
Therefore the standard library must be **rebuilt with GCC** before ordinary Rust crates can be compiled.
37+
**rustc_codegen_gcc** replaces LLVM with the GCC backend.
4038

4139
The freshly compiled sysroot ends up in
4240
`build/build_sysroot/...`.
@@ -47,22 +45,22 @@ A rebuild of sysroot is needed when
4745
* the user switches toolchains / updates submodules.
4846

4947
Both backend and sysroot can be built using different [profiles](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles).
50-
That is exactly what the `--sysroot`, `--release-sysroot` and `--release` flag supported by the frontend script `y.sh` take care of.
48+
That is exactly what the `--sysroot`, `--release-sysroot` and `--release` flag supported by the build system script `y.sh` take care of.
5149

5250

5351
#### Typical flag combinations
5452

5553
| Command | Backend Profile | Sysroot Profile | Usage Scenario |
5654
|--------------------------------------------|-------------------------------|----------------------------------|------------------------------------------------------------|
57-
| `./y.sh build` |  dev (optimized + debuginfo) |  X |  Optimize backend with debug capabilities |
58-
| `./y.sh build --release` |  release (optimized) |  X |  Optimize backend without rebuilding sysroot |
59-
| `./y.sh build --release --release-sysroot`|  release (optimized) |  X |  Same as --release |
60-
| `./y.sh build --release --sysroot` |  release (optimized) |  dev (unoptimized + debuginfo) |  Optimize backend for release without full sysroot rebuild |
61-
| `./y.sh build --sysroot` |  dev (optimized + debuginfo) |  dev (unoptimized + debuginfo) |  Full debug capabilities with optimized backend |
62-
| `./y.sh build --release-sysroot` |  dev (optimized + debuginfo) |  X |  Build only optimized backend with debug capabilities |
63-
| `./y.sh build --release-sysroot --sysroot`|  dev (optimized + debuginfo) |  release (optimized) |  Build optimized backend and sysroot for debugging and release, respectively |
55+
| `./y.sh build` |  dev (optimized + debuginfo) |  X |  Build backend in dev. mode with optimized dependencies without rebuilding sysroot |
56+
| `./y.sh build --release` |  release (optimized) |  X |  Build backend in release mode with optimized dependencies without rebuilding sysroot |
57+
| `./y.sh build --release --sysroot` |  release (optimized) |  dev (unoptimized + debuginfo) |  Build backend in release mode with optimized dependencies and sysroot in dev. mode (unoptimized) |
58+
| `./y.sh build --sysroot` |  dev (optimized + debuginfo) |  dev (unoptimized + debuginfo) |  Build backend in dev. mode with optimized dependencies and sysroot in dev. mode (unoptimized) |
59+
| `./y.sh build --release-sysroot --sysroot`|  dev (optimized + debuginfo) |  release (optimized) |  Build backend in dev. mode and sysroot in release mode, both with optimized dependencies |
6460

6561

62+
Note: `--release-sysroot` should not be used without `--sysroot`.
63+
6664

6765
### Common Development Tasks
6866

build_system/src/build.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,17 @@ impl BuildArg {
4444
fn usage() {
4545
println!(
4646
r#"
47-
`build` command help:"#
47+
`build` command help:
48+
--release : Build backend in release mode with optimized dependencies without rebuilding sysroot
49+
--sysroot : When used on its own, build backend in dev. mode with optimized dependencies
50+
and sysroot in dev. mode (unoptimized)
51+
When used together with --release, build backend in release mode with optimized dependencies
52+
When used together with --release-sysroot,
53+
build the sysroot in release mode with optimized dependencies instead of in dev. mode
54+
--release-sysroot : When combined with --sysroot, additionally
55+
build the sysroot in release mode with optimized dependencies.
56+
When combined with --release, it has no effect.
57+
It should not be used on itw own."#
4858
);
4959
ConfigInfo::show_usage();
5060
println!(" --help : Show this help");

build_system/src/config.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -477,17 +477,6 @@ impl ConfigInfo {
477477
--target-triple [arg] : Set the target triple to [arg]
478478
--target [arg] : Set the target to [arg]
479479
--out-dir : Location where the files will be generated
480-
--release : Build and optimize the backend in release mode
481-
--sysroot : When used on its own, build both
482-
sysroot and backend in dev. mode. Only the backend is optimized.
483-
When used together with --release, build and optimize the backend
484-
in release mode instead of in dev. mode.
485-
When used together with --release-sysroot,
486-
build and optimize the sysroot in release mode instead of in dev. mode
487-
--release-sysroot : When used on its own, build and optimize only the backend in dev. mode.
488-
When combined with --release, it has no effect.
489-
When combined with --sysroot, additionally
490-
build and optimize the sysroot in release mode
491480
--sysroot-panic-abort : Build the sysroot without unwinding support
492481
--config-file : Location of the config file to be used
493482
--gcc-path : Location of the GCC root folder

0 commit comments

Comments
 (0)