Adds new TypeVisitor to resolve Types from the AST via Visitor Pattern, so the element type can be extracted. Addresses: #27 #55
GCC Rust
This is a full alternative implementaion of the Rust language ontop of GCC. Please see the accompanying reporting repository: https://github.com/Rust-GCC/Reporting for status reports from Philip Herron and tast tracking overviews.
Development Enviroment
Fetch dependancies for ubuntu:
$ apt install build-essential libgmp3-dev libmpfr-dev libmpc-dev flex bison autogen gcc-multilib
Clone the repository
$ git clone git@github.com:Rust-GCC/gccrs.git
Compilation script. It is important to remember that GNU toolchain projects are designed to be built outside of its source directory this is why a build directory is created.
$ mkdir gccrs-build
$ cd gccrs-build
$ ../gccrs/configure --prefix=$HOME/gccrs-install --disable-bootstrap --enable-multilib --enable-languages=c,c++,rust
$ make
Running the compiler itself without make install we can simply imvoke the compiler proper:
$ 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
Invoking the compiler driver we need to:
$ make install
Then invoke the compiler as expected:
$ gccrs -g -O2 -c test.rs -o test.o
$ gccrs -o test test.o
Testsuite
The test suite can be invoked via:
$ make check-rust
Test cases can be found within gcc/testsuite/rust.test please feel free to contriobute your specific test cases referencing any issues on github.
Docker image
There is a docker image hosted over on:
https://hub.docker.com/repository/docker/philberty/gccrs
Or you can build your own image:
$ docker build . -t gccrs-dev
$ docker run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp \
gccrs-dev:latest gccrs -g -O2 -c \
gcc/testsuite/rust.test/compilable/type_infer1.rs -o type_infer1.o
Contributing
Please be aware this project is designed to be pushed upstream to GCC when we reach some milestones and this means we require contribtions to have copyright assignment in place. Please see: https://gcc.gnu.org/contribute.html
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
Community
We can be found on all usual Rust channels such as Zulip but we also have our own channels:
- GCC Rust Zulip: https://gcc-rust.zulipchat.com/
- Twitter: comming-soon