[PATCH] D46822: [RISCV] Add driver for riscv32-unknown-elf baremetal target

Alex Bradbury via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 15 14:02:41 PDT 2018


asb added a comment.

In https://reviews.llvm.org/D46822#1098764, @efriedma wrote:

> Could you include some documentation for how to construct a baremetal environment like the one this code expects?  It's not clear what exactly you expect to be installed where.


Thanks for taking a look Eli.

Building gcc+binutils+newlib will spit out a directory tree with the expected setup. e.g. a while ago I wrote a blog post <http://www.lowrisc.org/blog/2017/09/building-upstream-risc-v-gccbinutilsnewlib-the-quick-and-dirty-way/> trying to show how to build upstream RISC-V gcc+binutils+newlib in the simplest way possible. You need a multistage build for C++ support and other features, but those instructions are enough to get a baremetal cross compiler. The directory layout is the same as if you use the build script in the riscv-gnu-toolchain repo <https://github.com/riscv/riscv-gnu-toolchain>, doing `./configure --prefix=/my/target/path --with-arch=rv32i --with-abi=ilp32; make -j$(nproc)`. This is a more advanced multi-stage build.

Would you like to see more information on this added to the commit message, as comments in the code, or elsewhere?

e.g. this is the directory listing of the build output if you follow the linked blog instructions: https://pastebin.com/8HeCMpxF


Repository:
  rC Clang

https://reviews.llvm.org/D46822





More information about the cfe-commits mailing list