https://github.com/Rust-GCC/gccrs Skip to content Sign up * Why GitHub? Features - + Code review + Project management + Integrations + Actions + Packages + Security + Team management + Hosting + Mobile + Customer stories - + Security - * Team * Enterprise * Explore + Explore GitHub - Learn & contribute + Topics + Collections + Trending + Learning Lab + Open source guides Connect with others + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing Plans - + Compare plans + Contact Sales + Nonprofit - + Education - [ ] [search-key] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} Rust-GCC / gccrs * Watch 15 * Star 242 * Fork 17 GCC Front-End for Rust View license 242 stars 17 forks Star Watch * Code * Issues 38 * Pull requests 4 * Discussions * Actions * Projects 3 * Wiki * Security * Insights More * Code * Issues * Pull requests * Discussions * Actions * Projects * Wiki * Security * Insights master 6 branches 0 tags Go to file Code Clone HTTPS GitHub CLI [https://github.com/R] Use Git or checkout with SVN using the web URL. [gh repo clone Rust-G] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Go back Launching Xcode If nothing happens, download Xcode and try again. Go back Launching Visual Studio If nothing happens, download the GitHub extension for Visual Studio and try again. Go back Latest commit @philberty philberty Add in a check for unused decls within ribs. ... 9a3ad29 Jan 10, 2021 Add in a check for unused decls within ribs. This lead to cleanup of the name resolver as the usage of mappings means that in a given rib if there are no references to a decl NodeId that means it was not used. To get on par with the offical rust compiler it should be allowed to have a reference where the name was assigned but not used but this might be a seperate pass. 9a3ad29 Git stats * 181,885 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github/workflows Change CI to look for any unexpected failures to fail the build. Jan 6, 2021 INSTALL README: Do not mention CVS. Oct 12, 2014 config Daily bump. Nov 26, 2020 contrib changelog: allow flexible "cherry picked" format. Nov 27, 2020 fixincludes Daily bump. Nov 19, 2020 gcc Add in a check for unused decls within ribs. Jan 10, 2021 gnattools PR81878: fix --disable-bootstrap --enable-languages=ada Nov 20, 2018 gotools Daily bump. Oct 30, 2020 include Daily bump. Sep 25, 2020 intl intl: Unbreak intl build with bison 3 when no regeneration is needed ... Apr 16, 2020 libada Add `--with-toolexeclibdir=' configuration option Jan 24, 2020 libatomic Daily bump. Oct 12, 2020 libbacktrace Daily bump. Oct 21, 2020 libcc1 Daily bump. Nov 12, 2020 libcpp Daily bump. Nov 25, 2020 libdecnumber Daily bump. Jul 31, 2020 libffi Daily bump. Sep 25, 2020 libgcc Daily bump. Nov 26, 2020 libgfortran Daily bump. Nov 27, 2020 libgo log/syslog: correct asm name for C function Nov 23, 2020 libgomp Daily bump. Nov 26, 2020 libgrust Original rust code from 2014/2015 Nov 27, 2020 libhsail-rt Add `--with-toolexeclibdir=' configuration option Jan 24, 2020 libiberty Daily bump. Nov 26, 2020 libitm Daily bump. Oct 2, 2020 libobjc Daily bump. Oct 12, 2020 liboffloadmic Add missing ChangeLog entries. May 5, 2020 libphobos Daily bump. Nov 19, 2020 libquadmath Daily bump. May 30, 2020 libsanitizer Daily bump. Nov 26, 2020 libssp Daily bump. May 30, 2020 libstdc++-v3 libstdc++: Partially revert r11-5314 Nov 27, 2020 libvtv Daily bump. May 30, 2020 lto-plugin Daily bump. Nov 26, 2020 maintainer-scripts Daily bump. May 30, 2020 zlib Daily bump. May 30, 2020 .dir-locals.el * .dir-locals.el: Add. Oct 16, 2013 .gitattributes Add *.md diff=md. Jan 15, 2020 .gitignore Massive lexer cleanup and refactoring - moved lots of stuff out of ma... Nov 28, 2020 ABOUT-NLS intl: New directory; see intl/ChangeLog for details. Jul 4, 2003 COPYING COPYING, [...]: Sync from upstream sources. Jul 14, 2005 COPYING.LIB Update COPYING.LIB from upstream. Correct last Changelog. Jul 14, 2005 COPYING.RUNTIME Licensing changes to GPLv3 resp. GPLv3 with GCC Runtime Exception. Apr 9, 2009 COPYING3 COPYING_v3: New file. Jul 17, 2007 COPYING3.LIB COPYING_v3: New file. Jul 17, 2007 ChangeLog Daily bump. Nov 26, 2020 ChangeLog.jit Merger of dmalcolm/jit branch from git Nov 11, 2014 ChangeLog.tree-ssa Merge tree-ssa-20020619-branch into mainline. May 13, 2004 Dockerfile Update Automations to only build rust to improve build times Dec 7, 2020 MAINTAINERS MAINTAINERS: add myself for write after approval Nov 13, 2020 Makefile.def Initial TestSuite setup for make check-rust Nov 28, 2020 Makefile.in Initial TestSuite setup for make check-rust Nov 28, 2020 Makefile.tpl Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. Aug 23, 2019 README * README: Document use of ranges of years in copyright notices. Jul 16, 2012 README.md Add logo to README Dec 23, 2020 ar-lib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). Oct 31, 2018 compile Update from upstream Automake files. Nov 16, 2014 config-ml.in config-ml.in: Suppress output from multi-do recipes Nov 9, 2020 config.guess config.sub, config.guess : Import upstream 2020-11-07. Nov 23, 2020 config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. Feb 13, 2011 config.sub config.sub, config.guess : Import upstream 2020-11-07. Nov 23, 2020 configure libsanitizer: Add option to bootstrap using HWASAN Nov 25, 2020 configure.ac libsanitizer: Add option to bootstrap using HWASAN Nov 25, 2020 depcomp Update from upstream Automake files. Nov 16, 2014 install-sh Update from upstream Automake files. Nov 16, 2014 libtool-ldflags re PR sanitizer/56781 (boostrap-asan failure: fixincl fails to link (... Apr 17, 2014 libtool.m4 [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in c... Sep 10, 2019 logo.png Add logo to README Dec 23, 2020 ltgcc.m4 libtool.m4: Update to libtool 2.2.6. Sep 26, 2008 ltmain.sh Do not use HAVE_DOS_BASED_FILE_SYSTEM for Cygwin. Apr 17, 2020 ltoptions.m4 Sync from git Libtool and regenerate. Dec 5, 2009 ltsugar.m4 libtool.m4: Update to libtool 2.2.6. Sep 26, 2008 ltversion.m4 Sync from git Libtool and regenerate. Dec 5, 2009 lt~obsolete.m4 Sync from git Libtool and regenerate. Dec 5, 2009 missing Update from upstream Automake files. Nov 16, 2014 mkdep merge with /cvs/src Jul 22, 2000 mkinstalldirs Update from upstream Automake files. Nov 16, 2014 move-if-change Update move-if-change from gnulib Nov 16, 2014 multilib.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). Oct 31, 2018 symlink-tree COPYING, [...]: Sync from upstream sources. Jul 14, 2005 test-driver Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). Oct 31, 2018 ylwrap Update from upstream Automake files. Nov 16, 2014 View code README.md C/C++ CI Docker Build Docker Pulls project chat GCC Rust GCC Rust This is a full alternative implementaion of the Rust language ontop of GCC which 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 in a stable state, it is a good 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. Development Enviroment Fetch dependancies 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 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=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 invoking 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 The test suite can be invoked via: $ make check-rust Test cases can be found 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 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: https://twitter.com/gcc_rust About GCC Front-End for Rust Topics gcc gcc-rust Resources Readme License View license Releases No releases published Packages 0 No packages published Contributors 909 * @jakubjelinek * @rguenth * @jicama * @jwakely * @jsm28 * @marxin * @hjl-tools * @ubizjak * @davidmalcolm * @mpolacek * @rsandifo-arm + 898 contributors * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Help * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. 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.