From 92c13f52c93669a6dffa0a1426172ff598784fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Mon, 6 Mar 2023 16:08:27 +0100 Subject: [PATCH 1/3] Add documentation for RUSTC_EMIT --- src/building/bootstrapping.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index fe34cb500..727837afe 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -365,6 +365,16 @@ recompiling all dependencies. `CARGOFLAGS` will pass arguments to cargo itself (e.g. `--timings`). `CARGOFLAGS_BOOTSTRAP` and `CARGOFLAGS_NOT_BOOTSTRAP` work analogously to `RUSTFLAGS_BOOTSTRAP`. +`RUSTC_EMIT` will cause `bootstrap` to pass `--emit` arguments on to `rustc`. +You can specify which `--emit` formats which are used with a comma separated list prefixed with +a crate name and `=`, for example: `rustc_arena=llvm-ir,asm`. +You can also substitute `*` for the crate name to apply it to all crates. +You can combine multiple such specifiers by seperating them with semi-colons like +`rustc_arena=llvm-ir,asm;rustc_span=asm;*=llvm-bc`. +The emitted files will be stored inside the `emit` directory in the target specific build directory. +`RUSTC_EMIT` will not cause `bootstrap` to rebuild any crates so you may need to modify the crates +you're interested in. + `--test-args` will pass arguments through to the test runner. For `tests/ui`, this is compiletest; for unit tests and doctests this is the `libtest` runner. Most test runner accept `--help`, which you can use to find out the options accepted by the runner. From 6c827aaa39b95a4b5a21be567abfb678f51d3656 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Mon, 6 Mar 2023 16:41:51 +0100 Subject: [PATCH 2/3] List emit formats and mention to modify crate files --- src/building/bootstrapping.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index 727837afe..3928bfc40 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -371,9 +371,12 @@ a crate name and `=`, for example: `rustc_arena=llvm-ir,asm`. You can also substitute `*` for the crate name to apply it to all crates. You can combine multiple such specifiers by seperating them with semi-colons like `rustc_arena=llvm-ir,asm;rustc_span=asm;*=llvm-bc`. -The emitted files will be stored inside the `emit` directory in the target specific build directory. -`RUSTC_EMIT` will not cause `bootstrap` to rebuild any crates so you may need to modify the crates -you're interested in. +Currently `rustc` supports `asm`, `llvm-bc`, `llvm-ir`, +`obj`, `metadata`, `link`, `dep-info`, and `mir` as `--emit` formats. +The emitted files will be stored inside the `emit` +directory in the target specific build directory. +`RUSTC_EMIT` will not cause `bootstrap` to rebuild any crates so you may need to modify +one of the source files of the crates you're interested in. `--test-args` will pass arguments through to the test runner. For `tests/ui`, this is compiletest; for unit tests and doctests this is the `libtest` runner. Most test runner accept From 549492fdd777fcd093f28ccf17d58e05fa21bc87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Fri, 17 Mar 2023 21:33:04 +0100 Subject: [PATCH 3/3] Fix some nits --- src/building/bootstrapping.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/building/bootstrapping.md b/src/building/bootstrapping.md index 3928bfc40..6dcb2b614 100644 --- a/src/building/bootstrapping.md +++ b/src/building/bootstrapping.md @@ -366,16 +366,16 @@ recompiling all dependencies. `CARGOFLAGS_NOT_BOOTSTRAP` work analogously to `RUSTFLAGS_BOOTSTRAP`. `RUSTC_EMIT` will cause `bootstrap` to pass `--emit` arguments on to `rustc`. -You can specify which `--emit` formats which are used with a comma separated list prefixed with +You can specify which `--emit` formats are used with a comma separated list prefixed with a crate name and `=`, for example: `rustc_arena=llvm-ir,asm`. You can also substitute `*` for the crate name to apply it to all crates. You can combine multiple such specifiers by seperating them with semi-colons like `rustc_arena=llvm-ir,asm;rustc_span=asm;*=llvm-bc`. -Currently `rustc` supports `asm`, `llvm-bc`, `llvm-ir`, +Currently, `rustc` supports `asm`, `llvm-bc`, `llvm-ir`, `obj`, `metadata`, `link`, `dep-info`, and `mir` as `--emit` formats. The emitted files will be stored inside the `emit` -directory in the target specific build directory. -`RUSTC_EMIT` will not cause `bootstrap` to rebuild any crates so you may need to modify +directory in the target-specific build directory. +`RUSTC_EMIT` will not cause `bootstrap` to rebuild any crates, so you may need to modify one of the source files of the crates you're interested in. `--test-args` will pass arguments through to the test runner. For `tests/ui`, this is