Ask Your Question

How to install the ARM tool chain in Fedora 28

asked 2018-09-02 14:58:06 -0500

Tronta gravatar image

Which packages do I have to install in order to install the cross compiler (for Rust) in Fedora.

For Ubuntu I found the following instruction:

Install Rust. heavily recommended. See for details Alternatively, you can also use multirust. See for details $ curl -sSf | sh

Step 0: Our target is an ARMv7 device, the triple for this target is armv7-unknown-linux-gnueabihf

Step 1: Install the C cross toolchain $ sudo apt-get install -qq gcc-arm-linux-gnueabihf

Step 2: Install the cross compiled standard crates $ rustup target add armv7-unknown-linux-gnueabihf

Step 3: Configure cargo for cross compilation $ mkdir -p ~/.cargo $ cat

~/.cargo/config <<eof [target.armv7-unknown-linux-gnueabihf]="" linker="arm-linux-gnueabihf-gcc" eof<="" p="">

Test cross compiling a Cargo project $ cargo new --bin hello

$ cd hello $ cargo build --target=armv7-unknown-linux-gnueabihf Compiling hello v0.1.0 (file:///home/ubuntu/hello) $ file target/armv7-unknown-linux-gnueabihf/debug/hello hello: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=67b58f42db4842dafb8a15f8d47de87ca12cc7de, not stripped

Test the binary $ scp target/armv7-unknown-linux-gnueabihf/debug/hello me@arm:~ $ ssh me@arm:~ ./hello Hello, world!

Thanks a lot, Peter

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2019-02-21 02:17:43 -0500

hedayat gravatar image

Fedora doesn't provide a complete cross-compiler to compile applications for Fedora ARM. But you might use Fedora ARM distro files with qemu-user to compile for ARM under x86/... . But I've no idea about Rust.

You might also check ldbox ( or scratchbox .

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-09-02 14:58:06 -0500

Seen: 496 times

Last updated: Feb 21