Giter Club home page Giter Club logo

eloydegen / rust Goto Github PK

View Code? Open in Web Editor NEW

This project forked from avr-rust/rust-legacy-fork

0.0 2.0 0.0 376.17 MB

A fork of the Rust programming language with AVR support

License: Other

Rust 95.42% Python 0.69% Makefile 0.34% Dockerfile 0.15% Shell 1.19% C 1.18% HTML 0.01% PHP 0.01% Roff 0.04% CSS 0.10% Inno Setup 0.04% XSLT 0.01% Batchfile 0.01% Lex 0.03% Yacc 0.27% C++ 0.30% M4 0.04% Awk 0.01% RenderScript 0.02% JavaScript 0.18%

rust's Introduction

Rust with AVR support

Gitter

This project adds support for the AVR microcontroller to Rust.

It uses the AVR-LLVM backend.

Caveats

  • Some parts of libcore are disabled via substituting the functions in the original API with empty functions
    • This is done because several bugs cause certain functions to trigger bugs in the AVR LLVM backend
    • Missing functionality includes

Building and installation

This will compile Rust with AVR support. This will not create a fully-fledged cross-compiler, however, as it does not compile any libraries such as libcore or liblibc. To do this, the --target=avr-unknown-unknown flag must be passed to configure, which is not fully supported yet due to bugs.

# Grab the avr-rust sources
git clone https://github.com/avr-rust/rust.git

# Create a directory to place built files in
mkdir build && cd build

# Generate Makefile using settings suitable for an experimental compiler
../rust/configure \
  --enable-debug \
  --disable-docs \
  --enable-llvm-assertions \
  --enable-debug-assertions \
  --enable-optimize \
  --prefix=/opt/avr-rust

# Build the compiler, optionally install it to /opt/avr-rust
make
make install

# Register the toolchain with rustup
rustup toolchain link avr-toolchain $(realpath $(find . -name 'stage1'))

# Optionally enable the avr toolchain globally
rustup default avr-toolchain

Usage

With Xargo (recommended)

Take a look at the example blink program.

Vanilla rustc

AVR support is enabled by passing the --target avr-unknown-unknown flag to rustc.

Note that the Rust libcore library (essentially required for every Rust program), must be manually compiled for it to be used, as it will not be built for AVR during compiler compilation (yet). Work is currently being done in order to allow libcore to be automatically compiled for AVR.

rust's People

Contributors

bors avatar brson avatar alexcrichton avatar pcwalton avatar nikomatsakis avatar graydon avatar manishearth avatar steveklabnik avatar catamorphism avatar guillaumegomez avatar eddyb avatar marijnh avatar frewsxcv avatar huonw avatar jseyfried avatar thestinger avatar pnkfelix avatar erickt avatar michaelwoerister avatar nrc avatar mark-simulacrum avatar bluss avatar msullivan avatar eholk avatar petrochenkov avatar emberian avatar bblum avatar sfackler avatar luqmana avatar jbclements avatar

Watchers

James Cloos avatar Eloy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.