Skip to content

Instantly share code, notes, and snippets.

@MabezDev
Last active January 12, 2020 20:27
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MabezDev/26e175790f84f2f2b0f9bca4e63275d1 to your computer and use it in GitHub Desktop.
Save MabezDev/26e175790f84f2f2b0f9bca4e63275d1 to your computer and use it in GitHub Desktop.

Bootstrapping Rust with xtensa support

Build xtensa llvm from here https://esp32.com/viewtopic.php?t=9226&p=38466

But add the X86 target like so

cmake ../llvm-xtensa -DLLVM_TARGETS_TO_BUILD="Xtensa;X86" -DCMAKE_BUILD_TYPE=Release -G "Ninja"

X86 is required so that Rust can build itself, if your host machine is not x86 use your own host triple.

clone rust from https://github.com/MabezDev/rust and checkout the xtensa-target branch. Note: the minimum llvm version must be supported rustc, as of 1.33 its llvm 6.0

set llvm root to where you build llvm, e.g ./configure --llvm-root=$PATH_TO_BUILT_LLVM

then build rustc like normal

Build an application

See the xtensa-rust-quickstart crate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment