You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: compiler/rustc_codegen_gcc/Readme.md
+38-18
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,14 @@ This is a GCC codegen for rustc, which means it can be loaded by the existing ru
12
12
The primary goal of this project is to be able to compile Rust code on platforms unsupported by LLVM.
13
13
A secondary goal is to check if using the gcc backend will provide any run-time speed improvement for the programs compiled using rustc.
14
14
15
+
### Dependencies
16
+
17
+
**rustup:** Follow the instructions on the official [website](https://www.rust-lang.org/tools/install)
18
+
19
+
**DejaGnu:** Consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading)
20
+
21
+
22
+
15
23
## Building
16
24
17
25
**This requires a patched libgccjit in order to work.
@@ -80,7 +88,7 @@ Then you can run commands like this:
80
88
81
89
```bash
82
90
$ ./y.sh prepare # download and patch sysroot src and install hyperfine for benchmarking
83
-
$ ./y.sh build --release
91
+
$ ./y.sh build --sysroot --release
84
92
```
85
93
86
94
To run the tests:
@@ -91,10 +99,16 @@ $ ./y.sh test --release
91
99
92
100
## Usage
93
101
94
-
`$CG_GCCJIT_DIR` is the directory you cloned this repo into in the following instructions:
102
+
You have to run these commands, in the corresponding order:
95
103
96
104
```bash
97
-
export CG_GCCJIT_DIR=[the full path to rustc_codegen_gcc]
<dd>Don't cache object files in the incremental cache. Useful during development of cg_gccjit
132
-
to make it possible to use incremental mode for all analyses performed by rustc without caching
133
-
object files when their content should have been changed by a change to cg_gccjit.</dd>
134
-
<dt>CG_GCCJIT_DISPLAY_CG_TIME</dt>
135
-
<dd>Display the time it took to perform codegen for a crate</dd>
136
-
<dt>CG_RUSTFLAGS</dt>
137
-
<dd>Send additional flags to rustc. Can be used to build the sysroot without unwinding by setting `CG_RUSTFLAGS=-Cpanic=abort`.</dd>
138
-
<dt>CG_GCCJIT_DUMP_TO_FILE</dt>
139
-
<dd>Dump a C-like representation to /tmp/gccjit_dumps and enable debug info in order to debug this C-like representation.</dd>
140
-
</dl>
148
+
*_**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/`.
149
+
*_**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/`.
150
+
*_**CG_RUSTFLAGS**_: Send additional flags to rustc. Can be used to build the sysroot without unwinding by setting `CG_RUSTFLAGS=-Cpanic=abort`.
151
+
*_**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.
152
+
*_**CG_GCCJIT_DUMP_RTL**_: Dumps RTL (Register Transfer Language) for virtual registers.
153
+
*_**CG_GCCJIT_DUMP_RTL_ALL**_: Dumps all RTL passes.
154
+
*_**CG_GCCJIT_DUMP_TREE_ALL**_: Dumps all tree (GIMPLE) passes.
155
+
*_**CG_GCCJIT_DUMP_IPA_ALL**_: Dumps all Interprocedural Analysis (IPA) passes.
156
+
*_**CG_GCCJIT_DUMP_CODE**_: Dumps the final generated code.
157
+
*_**CG_GCCJIT_DUMP_GIMPLE**_: Dumps the initial GIMPLE representation.
158
+
*_**CG_GCCJIT_DUMP_EVERYTHING**_: Enables dumping of all intermediate representations and passes.
159
+
*_**CG_GCCJIT_KEEP_INTERMEDIATES**_: Keeps intermediate files generated during the compilation process.
160
+
*_**CG_GCCJIT_VERBOSE**_: Enables verbose output from the GCC driver.
0 commit comments