blob: 90feba57ce8e5a04cb54088ad82417773bde3d6b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
* Rust Front-End to GCC
This is an implementation of Rust ontop of GCC.
** Building
Building gccrs is fairly confsing to most people who haven't built
GCC before:
YOU CANNOT build GCC within the same directory of the sources!
#+BEGIN_SRC bash
$ apt-get install bison flex build-essential libgmp-dev libmpfr-dev libmpc-dev
#+END_SRC
Then to compile:
#+BEGIN_SRC bash
$ git clone https://github.com/redbrain/gccrs.git # or the gcc offical branch
$ cd gccrs
$ ./contrib/download_prerequisites # optional if you havent gmp/mpfr/mpc
$ mkdir gccpy-build
$ cd gccpy-build
$ ../configure --prefix=/opt/gccrs \
--enable-languages=rust \
--disable-multilib \
--disable-bootstrap
$ make
$ sudo make install
$ export PATH=/opt/gccrs/bin
$ export LD_LIBRARY_PATH=/opt/gccrs/lib:$LD_LIBRARY_PATH
$ cd -
#+END_SRC
*** Usage
For my development sessions i generally pass:
#+BEGIN_SRC bash
$ gccrs -g -O2 -frust-dump-dot helloworld.rs -o helloworld
$ ./helloworld
#+END_SRC
Options:
-frust-dump-dot Dumps out the textural output of the DOT IL
-fdump-tree-gimple Dumps the textural output of the code generated
for the GCC middle-end.
Remember you can use all the normal GCC compiler options it works as
if you were compiling C with GCC all target specific options will
work etc.
** Status
Very early and out of date
|