1 2 3 4 5 6 7 8 9 10 11 12
| $ rustc -C opt-level=3 -C link-arg="-s" \ --target=riscv64gc-unknown-linux-gnu -C linker=riscv64-linux-gnu-gcc -o hello-world-linux-riscv64 \ hello-world.rs
$ du -ks hello-world-linux-riscv64 248 hello-world-linux-riscv64
$ file hello-world-linux-riscv64 hello-world-linux-riscv64: ELF 64-bit LSB pie executable, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=09f924445a178acccd328d89104760203b98dd43, for GNU/Linux 4.15.0, stripped
$ QEMU_LD_PREFIX=/usr/riscv64-linux-gnu/ qemu-riscv64-static ./hello-world-linux-riscv64 Hello, world!
|