Go to file
therealansh b563491f40 CI: build using -j (nproc)
Signed-off-by: therealansh <tyagiansh23@hotmail.com>
2021-03-14 18:35:55 +00:00
.github/workflows CI: build using -j (nproc) 2021-03-14 18:35:55 +00:00
INSTALL
config Daily bump. 2020-11-26 00:16:41 +00:00
contrib changelog: allow flexible "cherry picked" format. 2020-11-27 13:43:25 +01:00
fixincludes Daily bump. 2020-11-19 00:16:30 +00:00
gcc Fix Woverloaded-virtual warnings. 2021-03-14 18:35:34 +00:00
gnattools
gotools Daily bump. 2020-10-30 00:16:29 +00:00
include Daily bump. 2020-09-25 00:16:27 +00:00
intl
libada
libatomic Daily bump. 2020-10-12 00:16:25 +00:00
libbacktrace Daily bump. 2020-10-21 00:16:36 +00:00
libcc1 Daily bump. 2020-11-12 00:16:39 +00:00
libcpp Daily bump. 2020-11-25 09:34:01 +00:00
libdecnumber
libffi Daily bump. 2020-09-25 00:16:27 +00:00
libgcc Daily bump. 2020-11-26 00:16:41 +00:00
libgfortran Daily bump. 2020-11-27 00:16:31 +00:00
libgo log/syslog: correct asm name for C function 2020-11-23 08:14:20 -08:00
libgomp Daily bump. 2020-11-26 00:16:41 +00:00
libgrust Original rust code from 2014/2015 2020-11-27 14:51:23 +00:00
libhsail-rt
libiberty Daily bump. 2020-11-26 00:16:41 +00:00
libitm Daily bump. 2020-10-02 00:16:27 +00:00
libobjc Daily bump. 2020-10-12 00:16:25 +00:00
liboffloadmic
libphobos Daily bump. 2020-11-19 00:16:30 +00:00
libquadmath
libsanitizer Daily bump. 2020-11-26 00:16:41 +00:00
libssp
libstdc++-v3 libstdc++: Partially revert r11-5314 2020-11-27 12:25:02 +00:00
libvtv
lto-plugin Daily bump. 2020-11-26 00:16:41 +00:00
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore Massive lexer cleanup and refactoring - moved lots of stuff out of main method 2020-11-28 21:13:20 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Daily bump. 2020-11-26 00:16:41 +00:00
ChangeLog.jit
ChangeLog.tree-ssa
Dockerfile Update Automations to only build rust to improve build times 2020-12-07 10:13:16 +00:00
MAINTAINERS MAINTAINERS: add myself for write after approval 2020-11-13 11:01:12 +08:00
Makefile.def Initial TestSuite setup for make check-rust 2020-11-28 21:13:22 +00:00
Makefile.in Initial TestSuite setup for make check-rust 2020-11-28 21:13:22 +00:00
Makefile.tpl
README
README.md Trivial typo fix 2021-03-01 10:34:28 +00:00
ar-lib
compile
config-ml.in config-ml.in: Suppress output from multi-do recipes 2020-11-09 14:28:37 +00:00
config.guess config.sub, config.guess : Import upstream 2020-11-07. 2020-11-23 19:30:01 +00:00
config.rpath
config.sub config.sub, config.guess : Import upstream 2020-11-07. 2020-11-23 19:30:01 +00:00
configure libsanitizer: Add option to bootstrap using HWASAN 2020-11-25 16:35:37 +00:00
configure.ac libsanitizer: Add option to bootstrap using HWASAN 2020-11-25 16:35:37 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4
logo.png Add logo to README 2020-12-23 15:02:02 +00:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
symlink-tree
test-driver
ylwrap

README.md

C/C++ CI Docker Build Docker Pulls project chat

GCC Rust

GCC Rust

Please note, the compiler is in a very early stage and not usable yet for compiling real rust programs.

gccrs is a full alternative implementation of the Rust language ontop of GCC with the goal to become fully upstream with the GNU toolchain.

The origin of this project was a community effort several years ago where Rust was still at version 0.9; the language was subject to so much change that it became difficult for a community effort to play catch up. Now that the language is stable, it is an excellent time to create alternative compilers. The developers of the project are keen “Rustaceans” with a desire to give back to the Rust community and to learn what GCC is capable of when it comes to a modern language.

FAQ

Please find the answers to frequently asked questions over on: https://github.com/Rust-GCC/gccrs/wiki/Frequently-Asked-Questions

Development Environment

Fetch dependencies for Ubuntu:

$ apt install build-essential libgmp3-dev libmpfr-dev libmpc-dev flex bison autogen gcc-multilib dejagnu

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 their source directory which 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=rust
$ make

Running the compiler itself without make install we can simply invoke the compiler proper:

$ gdb --args ./gcc/rust1 test.rs -frust-dump-parse -Warray-bounds -dumpbase test.rs -mtune=generic -march=x86-64 -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

To invoke the compiler driver (gccrs) 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

Invoke the test suite via:

$ make check-rust

Test cases are located within gcc/testsuite/rust.test please feel free to contribute 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

$ docker pull 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 contributions 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: