Skip to content

Commit e95bba1

Browse files
committed
docs: Move -Cllvm-args forwarding explanation to tips.md
1 parent 2da6c16 commit e95bba1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ $ LIBRARY_PATH="[gcc-path value]" LD_LIBRARY_PATH="[gcc-path value]" rustc +$(ca
159159

160160
* _**CG_GCCJIT_DUMP_ALL_MODULES**_: Enables dumping of all compilation modules. When set to "1", a dump is created for each module during compilation and stored in `/tmp/reproducers/`.
161161
* _**CG_GCCJIT_DUMP_MODULE**_: Enables dumping of a specific module. When set with the module name, e.g., `CG_GCCJIT_DUMP_MODULE=module_name`, a dump of that specific module is created in `/tmp/reproducers/`.
162-
* _**CG_RUSTFLAGS**_: Send additional flags to rustc. Can be used to build the sysroot without unwinding by setting `CG_RUSTFLAGS=-Cpanic=abort`. Note that `-Cllvm-args` flags are forwarded to GCC.
162+
* _**CG_RUSTFLAGS**_: Send additional flags to rustc. Can be used to build the sysroot without unwinding by setting `CG_RUSTFLAGS=-Cpanic=abort`.
163163
* _**CG_GCCJIT_DUMP_TO_FILE**_: Dump a C-like representation to /tmp/gccjit_dumps and enable debug info in order to debug this C-like representation.
164164
* _**CG_GCCJIT_DUMP_RTL**_: Dumps RTL (Register Transfer Language) for virtual registers.
165165
* _**CG_GCCJIT_DUMP_RTL_ALL**_: Dumps all RTL passes.

doc/tips.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ be useful.
99
CG_RUSTFLAGS="-Clink-args=-save-temps -v" ../y.sh cargo build
1010
```
1111

12+
### How to send arguments to GCC
13+
14+
The `-Cllvm-args` `rustc` flag is repurposed by `rustc_codegen_gcc` to pass arguments directly to the GCC backend. You can use it via the `CG_RUSTFLAGS` environment variable. For example, to pass a `-f` flag to GCC:
15+
16+
```
17+
CG_RUSTFLAGS="-Cllvm-args=-fflag-name" ../y.sh cargo build
18+
```
19+
1220
### How to see the personality functions in the asm dump
1321

1422
```

0 commit comments

Comments
 (0)