riscv-rust / riscv-rust-toolchain Goto Github PK
View Code? Open in Web Editor NEWRISCV Rust Toolchain
RISCV Rust Toolchain
I get the following error when I try to "make toolchain" on my Debian Stretch machine:
CMake Error: The source directory "/home/michael/Code/risc_v/riscv-rust-toolchain/llvm" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Makefile:25: recipe for target 'llvm-configure' failed
make: *** [llvm-configure] Error 1
Any ideas?
I am trying to build the toolchain using make toolchain
as described in the readme, but the build fails:
-DLOCALEDIR="\"$BASEDIR/riscv-rust-toolchain/toolchain/share/locale\"" -DHAVE_CONFIG_H -I$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/../include/opcode -I$BASEDIR/riscv-rust-toolchain/riscv-binuti
ls-gdb/gdb/../opcodes/.. -I$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/../readline/.. -I$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/../zlib -I../bfd -I$BASEDIR/riscv-rust-toolchain/riscv
-binutils-gdb/gdb/../bfd -I$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/../include -I../libdecnumber -I$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/../libdecnumber -I$BASEDIR/riscv-rust-t
oolchain/riscv-binutils-gdb/gdb/gnulib/import -Ibuild-gnulib/import -DTUI=1 -pthread -I/usr/include/guile/2.2 -I/usr/include/python3.6m -I/usr/include/python3.6m -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty
-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized -c -o scm-ports.o -MT scm-ports.o -MMD -MP -MF .deps/scm-ports.Tpo $BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/
scm-ports.c
$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c: In function ‘scm_unused_struct* ioscm_open_port(scm_t_bits, long int)’:
$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c:146:10: error: ‘scm_new_port_table_entry’ was not declared in this scope
port = scm_new_port_table_entry (port_type);
^~~~~~~~~~~~~~~~~~~~~~~~
$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c:146:10: note: suggested alternative: ‘scm_c_weak_table_put_x’
port = scm_new_port_table_entry (port_type);
^~~~~~~~~~~~~~~~~~~~~~~~
scm_c_weak_table_put_x
$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c: In function ‘int ioscm_fill_input(SCM)’:
$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c:231:20: error: ‘SCM_PTAB_ENTRY’ was not declared in this scope
scm_t_port *pt = SCM_PTAB_ENTRY (port);
^~~~~~~~~~~~~~
$BASEDIR/riscv-rust-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c:231:20: note: suggested alternative: ‘SCM_VTABLE_NAME’
scm_t_port *pt = SCM_PTAB_ENTRY (port);
^~~~~~~~~~~~~~
SCM_VTABLE_NAME
$BASEDIR
in the output above refers to the directory into which I checked out riscv-rust-toolchain and is not an actual directory nor does this string actually appear in the output.
The issue appears to be the same as sifive/freedom-e-sdk#83.
I am using Arch Linux on this machine. Guile 2.2.3 is installed.
Ubuntu version 16.04 LTS
Linux kernel version 4.13
I'm trying to build this project, but I keep getting errors related to CMake believing my C compiler is incorrect:
$ make toolchain
<snip snip>
-- Check for working C compiler using: Ninja
CMake Error:
The detected version of Ninja () is less than the version of Ninja required
by CMake (1.3).
CMake Error: Internal CMake error, TryCompile generation of cmake failed
-- Check for working C compiler using: Ninja -- broken
CMake Error at /usr/share/cmake-3.5/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "/usr/bin/cc" is not able to compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:45 (project)
-- Configuring incomplete, errors occurred!
See also "/home/jakobw/riscv/riscv-rust-toolchain/build/llvm/CMakeFiles/CMakeOutput.log".
See also "/home/jakobw/riscv/riscv-rust-toolchain/build/llvm/CMakeFiles/CMakeError.log".
Makefile:25: recipe for target 'llvm-configure' failed
make: *** [llvm-configure] Error 1
As far as I can tell, I do in fact have a sane C compiler - I used it to compile GCC for RISC V just today.
$ /usr/bin/cc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 6.3.0-18ubuntu2~16.04' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170519 (Ubuntu/Linaro 6.3.0-18ubuntu2~16.04)
I'm not familiar with ninja - I previously got the error that I had too old a version of ninja (0.1.3)
so I installed package build-ninja
instead of ninja
and ninja --version
returns 1.5.1
, but CMake doesn't seem to be able to detect this ninja for some reason.
Any ideas where I might be going wrong?
I'm interested in testing the 64-bit capabilities of RISC-V with Rust, and I noticed you have a JSON file for RV32. I wanted to know if it would be easy to add 64-bit support by creating a RV64 JSON as well?
debian@debian:~/wasmtime$ cargo test --package cranelift-tools --test filetests -- filetests --exact --nocapture --verbose
error: failed to download from https://crates.io/api/v1/crates/ahash/0.7.6/download
Caused by:
[60] SSL peer certificate or SSH remote key was not OK (server certificate verification failed. CAfile: none CRLfile: none)
debian@debian:~/wasmtime$
Hi,
I just cloned the repo, it failed to fetch the rust submodule:
~ git submodule update error: no such remote ref 842ce79133db9632aaf9f7b4720e9bcb88e3914a Fetched in submodule path 'rust', but it did not contain 842ce79133db9632aaf9f7b4720e9bcb88e3914a. Direct fetching of that commit failed.
Hi,
I tried to build riscv-rust-toolchain on ubuntu 17.10 and I report I had some compile error.
At first compiler error was generated like "no such file or directory "llvm/Target/TargetSubtargetInfo.h" at src/rustllvm/PassWrapper.cpp.
So I modified like that:
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp
index fafa119498..7d5026cc52 100644
--- a/src/rustllvm/PassWrapper.cpp
+++ b/src/rustllvm/PassWrapper.cpp
@@ -22,7 +22,8 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Host.h"
#include "llvm/Target/TargetMachine.h"
-#include "llvm/Target/TargetSubtargetInfo.h"
+// #include "llvm/Target/TargetSubtargetInfo.h"
+#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#if LLVM_VERSION_GE(4, 0)
Next, how can I use build-env.sh during build riscv-rust-toolchain?
During bulding, I got error like error while loading shared libraries: "libLLVM-6.0svn.so"
and I needed to add LD_LIBRARY_PATH
or LIBRARY_PATH
. But build-env.sh can set them?
Could you check my modification is reasonable?
When I cross-compile RISCV assembly instructions in file.asm with "rustc 1.60.0-nightly (5e57faa78 2022-01-19) riscv64imac-unknown-none-elf" toolchain.
I got the following error:
error: instruction requires the following: 'M' (Integer Multiplication and Division)
mul t0, t0, a0
^
Please help, How should I avoid this error ?
Use this commit for a working toolchain: a20482e
gdb variable printing shows scrambled values
This repository is marked as obsolete, and the following is mentioned as replacement:
This is no longer the recommended way to get a Rust toolchain for RISCV. Instead, you can clone the riscv-rust/rust fork of Rust and build it as normal:
However, there is no riscv-rust/rust
repository on github either. Did it move again?
Am I insane for trying to build this on a Mac? (I could make a Docker container, and perhaps try to upstream it?) That said, it actually got surprisingly far and perhaps my problems are unrelated to my OS.
It's blowing up trying to build the stage0 compiler:
cd /Users/bascule/src/riscv-rust-toolchain/rust && make
Updating submodules
Finished dev [unoptimized] target(s) in 0.0 secs
Building stage0 std artifacts (x86_64-apple-darwin -> x86_64-apple-darwin)
Finished dev [unoptimized] target(s) in 0.0 secs
Copying stage0 std from stage0 (x86_64-apple-darwin -> x86_64-apple-darwin / x86_64-apple-darwin)
Building stage0 test artifacts (x86_64-apple-darwin -> x86_64-apple-darwin)
Finished dev [unoptimized] target(s) in 0.0 secs
Copying stage0 test from stage0 (x86_64-apple-darwin -> x86_64-apple-darwin / x86_64-apple-darwin)
Building stage0 compiler artifacts (x86_64-apple-darwin -> x86_64-apple-darwin)
Compiling rustc_llvm v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/librustc_llvm)
Compiling rustc_const_math v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/librustc_const_math)
Compiling rustc_back v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/librustc_back)
Compiling proc_macro v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/libproc_macro)
Compiling syntax_ext v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/libsyntax_ext)
Compiling rustc v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/librustc)
error: failed to run custom build command for `rustc_llvm v0.0.0 (file:///Users/bascule/src/riscv-rust-toolchain/rust/src/librustc_llvm)`
process didn't exit successfully: `/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/debug/build/rustc_llvm-a09d35dcc802ede6/build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-changed=/Users/bascule/src/riscv-rust-toolchain/toolchain/bin/llvm-config
cargo:rerun-if-env-changed=LLVM_CONFIG
cargo:rustc-cfg=llvm_component="asmparser"
cargo:rustc-cfg=llvm_component="bitreader"
cargo:rustc-cfg=llvm_component="bitwriter"
cargo:rustc-cfg=llvm_component="instrumentation"
cargo:rustc-cfg=llvm_component="interpreter"
cargo:rustc-cfg=llvm_component="ipo"
cargo:rustc-cfg=llvm_component="linker"
cargo:rustc-cfg=llvm_component="mcjit"
cargo:rustc-cfg=llvm_component="riscv"
cargo:rustc-cfg=llvm_component="x86"
cargo:rerun-if-changed=../rustllvm/ArchiveWrapper.cpp
cargo:rerun-if-changed=../rustllvm/rustllvm.h
cargo:rerun-if-changed=../rustllvm/PassWrapper.cpp
cargo:rerun-if-changed=../rustllvm/.editorconfig
cargo:rerun-if-changed=../rustllvm/README
cargo:rerun-if-changed=../rustllvm/RustWrapper.cpp
cargo:rerun-if-changed=../rustllvm/llvm-rebuild-trigger
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXX_x86_64-apple-darwin = Some("c++")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXXFLAGS_x86_64-apple-darwin = None
CXXFLAGS_x86_64_apple_darwin = None
HOST_CXXFLAGS = None
CXXFLAGS = None
PROFILE = Some("debug")
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I/Users/bascule/src/riscv-rust-toolchain/toolchain/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-Werror=unguarded-availability-new" "-std=c++11" "-Wall" "-W" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-pedantic" "-Wno-long-long" "-Wcovered-switch-default" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-fcolor-diagnostics" "-g" "-fno-exceptions" "-fno-rtti" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_RISCV" "-DLLVM_COMPONENT_X86" "-o" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/../rustllvm/PassWrapper.o" "-c" "../rustllvm/PassWrapper.cpp"
exit code: 0
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXX_x86_64-apple-darwin = Some("c++")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXXFLAGS_x86_64-apple-darwin = None
CXXFLAGS_x86_64_apple_darwin = None
HOST_CXXFLAGS = None
CXXFLAGS = None
PROFILE = Some("debug")
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I/Users/bascule/src/riscv-rust-toolchain/toolchain/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-Werror=unguarded-availability-new" "-std=c++11" "-Wall" "-W" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-pedantic" "-Wno-long-long" "-Wcovered-switch-default" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-fcolor-diagnostics" "-g" "-fno-exceptions" "-fno-rtti" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_RISCV" "-DLLVM_COMPONENT_X86" "-o" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/../rustllvm/RustWrapper.o" "-c" "../rustllvm/RustWrapper.cpp"
exit code: 0
TARGET = Some("x86_64-apple-darwin")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXX_x86_64-apple-darwin = Some("c++")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
CXXFLAGS_x86_64-apple-darwin = None
CXXFLAGS_x86_64_apple_darwin = None
HOST_CXXFLAGS = None
CXXFLAGS = None
PROFILE = Some("debug")
running: "c++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-m64" "-I/Users/bascule/src/riscv-rust-toolchain/toolchain/include" "-fPIC" "-fvisibility-inlines-hidden" "-Werror=date-time" "-Werror=unguarded-availability-new" "-std=c++11" "-Wall" "-W" "-Wno-unused-parameter" "-Wwrite-strings" "-Wcast-qual" "-Wmissing-field-initializers" "-pedantic" "-Wno-long-long" "-Wcovered-switch-default" "-Wnon-virtual-dtor" "-Wdelete-non-virtual-dtor" "-Wstring-conversion" "-fcolor-diagnostics" "-g" "-fno-exceptions" "-fno-rtti" "-D_DEBUG" "-D__STDC_CONSTANT_MACROS" "-D__STDC_FORMAT_MACROS" "-D__STDC_LIMIT_MACROS" "-DLLVM_COMPONENT_ASMPARSER" "-DLLVM_COMPONENT_BITREADER" "-DLLVM_COMPONENT_BITWRITER" "-DLLVM_COMPONENT_INSTRUMENTATION" "-DLLVM_COMPONENT_INTERPRETER" "-DLLVM_COMPONENT_IPO" "-DLLVM_COMPONENT_LINKER" "-DLLVM_COMPONENT_MCJIT" "-DLLVM_COMPONENT_RISCV" "-DLLVM_COMPONENT_X86" "-o" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/../rustllvm/ArchiveWrapper.o" "-c" "../rustllvm/ArchiveWrapper.cpp"
exit code: 0
TARGET = Some("x86_64-apple-darwin")
TARGET = Some("x86_64-apple-darwin")
HOST = Some("x86_64-apple-darwin")
AR_x86_64-apple-darwin = Some("ar")
running: "ar" "crs" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/librustllvm.a" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/../rustllvm/PassWrapper.o" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/../rustllvm/RustWrapper.o" "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out/../rustllvm/ArchiveWrapper.o"
exit code: 0
TARGET = Some("x86_64-apple-darwin")
cargo:rustc-link-lib=static=rustllvm
cargo:rustc-link-search=native=/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0-rustc/x86_64-apple-darwin/debug/build/rustc_llvm-ca2b8a7e4678a173/out
--- stderr
llvm-config: error: libLLVM-6.0svn.dylib is missing
thread 'main' panicked at 'command did not execute successfully: "/Users/bascule/src/riscv-rust-toolchain/toolchain/bin/llvm-config" "--libs" "--link-shared" "--system-libs" "asmparser" "bitreader" "bitwriter" "instrumentation" "interpreter" "ipo" "linker" "mcjit" "riscv" "x86"
expected success, got: exit code: 1', src/build_helper/lib.rs:137:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: build failed
thread 'main' panicked at 'command did not execute successfully: "/Users/bascule/src/riscv-rust-toolchain/rust/build/x86_64-apple-darwin/stage0/bin/cargo" "build" "-j" "8" "--target" "x86_64-apple-darwin" "--features" " jemalloc" "--manifest-path" "/Users/bascule/src/riscv-rust-toolchain/rust/src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', src/bootstrap/compile.rs:852:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: /Users/bascule/src/riscv-rust-toolchain/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:01:47
make[1]: *** [all] Error 1
make: *** [rust-build] Error 2
Specifically:
llvm-config: error: libLLVM-6.0svn.dylib is missing
Perhaps something to do with the .dylib
not being .so
on Mac. Anywho, perhaps I should give it a go on Linux.
Upstream Rust is currently using LLVM 6 (rust-lang/rust#48782). This fork seems to have some additional commits (rust-lang/llvm@6ceaaa4...riscv-rust:rust-llvm-release-6-0-0-riscv). I guess upstreaming RISC-V support in Rust shouldn't be done until the non-Rust specific changes are in upstream LLVM?
It looks like rust-lang/lld doesn't have RISC-V support, so I suppose that is needed.
I see there's currently an issue with std on RISC-V (https://github.com/riscv-rust/rust/issues/2), but that probably shouldn't block upstreaming if libcore is working, since it is still useful for bare metal targets.
Anything else?
I get this, building on Debian buster (testing):
running: "cc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-fomit-frame-pointer" "-DVISIBILITY_HIDDEN" "-o" "/home/tshepang/rust/riscv-rust-toolchain/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-a0b91f57ce001a7d/out/../../libcompiler_builtins/compiler-rt/lib/builtins/x86_64/floatundidf.o" "-c" "../../libcompiler_builtins/compiler-rt/lib/builtins/x86_64/floatundidf.S"
cargo:warning=cc: error: ../../libcompiler_builtins/compiler-rt/lib/builtins/x86_64/floatundidf.S: No such file or directory
cargo:warning=cc: fatal error: no input files
cargo:warning=compilation terminated.
exit code: 1
--- stderr
thread 'main' panicked at '
Internal error occurred: Command "cc" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-m64" "-fno-builtin" "-fvisibility=hidden" "-ffreestanding" "-fomit-frame-pointer" "-DVISIBILITY_HIDDEN" "-o" "/home/tshepang/rust/riscv-rust-toolchain/build/x86_64-unknown-linux-gnu/stage0-std/x86_64-unknown-linux-gnu/release/build/compiler_builtins-a0b91f57ce001a7d/out/../../libcompiler_builtins/compiler-rt/lib/builtins/x86_64/floatundidf.o" "-c" "../../libcompiler_builtins/compiler-rt/lib/builtins/x86_64/floatundidf.S" with args "cc" did not execute successfully (status code exit code: 1).
', /home/tshepang/rust/riscv-rust-toolchain/build/cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.4/src/lib.rs:1984:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread 'main' panicked at 'command did not execute successfully: "/home/tshepang/rust/riscv-rust-toolchain/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/home/tshepang/rust/riscv-rust-toolchain/rust/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', bootstrap/compile.rs:1086:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: /home/tshepang/rust/riscv-rust-toolchain/build/bootstrap/debug/bootstrap install
Build completed unsuccessfully in 0:00:07
Makefile:73: recipe for target 'rust-build' failed
make: *** [rust-build] Error 1
I'm trying to build the accompanying quickstart project, having built the toolchain, and I'm having little success. In particular, the rust compiler I've built doesn't seem to want to build for RISC V.
jakobw@ubuntu:~/riscv/riscv-rust-quickstart$ make build
xargo build --target riscv32i-unknown-none
error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --sysroot /home/jakobw/.xargo -Z force-unstable-if-unmarked --target riscv32i-unknown-none --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 101)
--- stderr
error: Could not create LLVM TargetMachine for triple: riscv32: No available targets are compatible with this triple.
jakobw@ubuntu:~/riscv/riscv-rust-quickstart$ which rustc
/home/jakobw/riscv/riscv-rust-toolchain/toolchain/bin/rustc
jakobw@ubuntu:~/riscv/riscv-rust-quickstart$ rustc --print target-list | grep risc
riscv32i-unknown-none
riscv32ia-unknown-none
link https://github.com/riscv-rust/rust is broken
Problem is this is first search result which comes up when searching for "Risc-V rust" please, fix it, because it seems like rust on Risc-V is dead and this thing is obsolete.
# OBSOLETE
This is no longer the recommended way to get a Rust toolchain for RISCV.
Instead, you can clone the [riscv-rust/rust](https://github.com/riscv-rust/rust)
fork of Rust and build it as normal:
./x.py build
Blocked by rust-lang/rust#43982
I am trying to build the toolchain using make toolchain as described in the readme, fixed #6, but the build fails:
Finished release [optimized] target(s) in 1014.61 secs
Copying stage0 rustc from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-gnu)
Assembling stage1 compiler (x86_64-unknown-linux-gnu)
Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
error: process didn't exit successfully: `$BASEDIR/riscv-rust-toolchain/rust/build/bootstrap/debug/rustc -vV` (exit code: 127)
--- stderr
$BASEDIR/riscv-rust-toolchain/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc: error while loading shared libraries: libLLVM-6.0svn.so: cannot open shared object file: No such file or directory
thread 'main' panicked at 'command did not execute successfully: "$BASEDIR/riscv-rust-toolchain/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "-j" "4" "--target" "x86_64-unknown-linux-gnu" "--release" "--features" "panic-unwind jemall
oc backtrace" "--manifest-path" "$BASEDIR/riscv-rust-toolchain/rust/src/libstd/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', src/bootstrap/compile.rs:852:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: $BASEDIR/riscv-rust-toolchain/rust/build/bootstrap/debug/bootstrap build
Build completed unsuccessfully in 0:26:25
make[1]: *** [Makefile:24: all] Error 1
$BASEDIR
in the output above refers to the directory into which I checked out riscv-rust-toolchain and is not an actual directory nor does this string actually appear in the output.
I am using Arch Linux on this machine.
Currently trying to install on Ubuntu 16.04 with the default variables.
$ make rust
python2 rust/x.py install
Updating only changed submodules
<snip snip, build stuff, copy stuff, document stuff, generate stuff>
Install docs stage2 (Some("x86_64-unknown-linux-gnu"))
touch: cannot touch '/usr/local/lib/rust-install-probe': Permission denied
install: error: can't write to destination. consider `sudo`.
command did not execute successfully: "sh" "/home/jakobw/riscv/riscv-rust-toolchain/build/tmp/dist/rust-docs-1.26.0-dev-x86_64-unknown-linux-gnu/install.sh" "--prefix=/usr/local" "--sysconfdir=/etc" "--datadir=/usr/local/share" "--docdir=/usr/local/share/doc/rust" "--bindir=/usr/local/bin" "--libdir=/usr/local/lib" "--mandir=/usr/local/share/man" "--disable-ldconfig"
expected success, got: exit code: 1
failed to run: /home/jakobw/riscv/riscv-rust-toolchain/build/bootstrap/debug/bootstrap install
Build completed unsuccessfully in 0:00:40
Makefile:73: recipe for target 'rust-build' failed
make: *** [rust-build] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.