1
1
![ C/C++ CI] ( https://github.com/philberty/gccrs/workflows/C/C++%20CI/badge.svg )
2
2
# GCC Rust
3
3
4
- This is an implementation of rust following the gccgo style front-end.
4
+ This is a full alternative implementaion of the Rust language ontop of GCC.
5
+ Please see the accompanying reporting repository: https://github.com/Rust-GCC/Reporting for
6
+ status reports from Philip Herron and tast tracking overviews.
5
7
6
- ## Compilation for Development
8
+ ## Development Enviroment
7
9
8
10
Fetch dependancies for ubuntu:
9
11
10
12
``` bash
11
13
$ apt install build-essential libgmp3-dev libmpfr-dev libmpc-dev flex bison autogen gcc-multilib
12
14
```
13
15
14
- Clone
16
+ Clone the repository
15
17
16
18
``` bash
17
- $ git clone https:// github.com/philberty/ gccrs
19
+ $ git clone git@ github.com:Rust-GCC/ gccrs.git
18
20
```
19
21
20
- Dev Build
22
+ Compilation script. It is important to remember that GNU toolchain projects are designed to be built outside of its source directory
23
+ this is why a build directory is created.
21
24
22
25
``` bash
23
26
$ mkdir gccrs-build
@@ -26,8 +29,60 @@ $ ../gccrs/configure --prefix=$HOME/gccrs-install --disable-bootstrap --enable-m
26
29
$ make
27
30
```
28
31
29
- Running the compiler itself - no need to make install
32
+ Running the compiler itself without make install we can simply imvoke the compiler proper:
30
33
31
34
```
32
35
$ gdb --args ./gcc/rust1 test1.rs -frust-dump-parse -dumpbase test.rs -mtune=generic -march=x86-64 -auxbase-strip test.s -O0 -version -fdump-tree-gimple -o test.s -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64
33
36
```
37
+
38
+ Invoking the compiler driver we need to:
39
+
40
+ ```
41
+ $ make install
42
+ ```
43
+
44
+ Then invoke the compiler as expected:
45
+
46
+ ```
47
+ $ gccrs -g -O2 -c test.rs -o test.o
48
+ $ gccrs -o test test.o
49
+ ```
50
+
51
+ ## Testsuite
52
+
53
+ The test suite can be invoked via:
54
+
55
+ ```
56
+ $ make check-rust
57
+ ```
58
+
59
+ Test cases can be found within gcc/testsuite/rust.test please feel free to contriobute your specific
60
+ test cases referencing any issues on github.
61
+
62
+ ## Docker image
63
+
64
+ There is a docker image hosted over on:
65
+
66
+ https://hub.docker.com/repository/docker/philberty/gccrs
67
+
68
+ Or you can build your own image:
69
+
70
+ ```
71
+ $ docker build . -t gccrs-dev
72
+ $ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
73
+ gccrs-dev:latest gccrs -g -O2 -c \
74
+ gcc/testsuite/rust.test/compilable/type_infer1.rs -o type_infer1.o
75
+ ```
76
+
77
+ ## Contributing
78
+
79
+ Please be aware this project is designed to be pushed upstream to GCC when we reach some milestones and this means we require
80
+ contribtions to have copyright assignment in place. Please see: https://gcc.gnu.org/contribute.html
81
+
82
+ Not all contributions must be code we would love to see new test cases or bugs and issues to be reported. Feel free to add any comments on open PRs
83
+
84
+ We can be found on:
85
+
86
+ * Rust-lang Zulip: https://rust-lang.zulipchat.com/
87
+ * GNU toolchain discord:
88
+ * Mailing list: TODO
0 commit comments