Cross compiling for ARM7

Hello.
I would like to compile a example - Hello project.

mhanusek@EtHanusek:~/work/VersionControl$ cargo new --bin hello
Created binary (application) hello package

file ./helo/.cargo/config:

[build]
target = "armv7-unknown-linux-gnueabihf"

[target.armv7-unknown-linux-gnueabihf]
linker = "/opt/etos/1.2.1/sysroots/x86_64-etossdk-linux/usr/bin/arm-etos-linux-gnueabi/arm-etos-linux-gnueabi-gcc"

Compiling:

mhanusek@EtHanusek:~/work/VersionControl/hello$ cargo build --target=armv7-unknown-linux-gnueabihf
Compiling hello v0.1.0 (/home/mhanusek/work/VersionControl/hello)
error: linking with /opt/etos/1.2.1/sysroots/x86_64-etossdk-linux/usr/bin/arm-etos-linux-gnueabi/arm-etos-linux-gnueabi-gcc failed: exit code: 1
|
= note: "/opt/etos/1.2.1/sysroots/x86_64-etossdk-linux/usr/bin/arm-etos-linux-gnueabi/arm-etos-linux-gnueabi-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.12at8wfdxra88skk.rcgu.o" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.1a237hfzpin689v7.rcgu.o" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.1pv8xg0o6i8r6r7f.rcgu.o" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.2ewqjci0ftt4q7i8.rcgu.o" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.34d8kuxijeb7kvru.rcgu.o" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.3ll5clbdyyuvqf0n.rcgu.o" "-o" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps/hello-bce82b4f3ca0f73e.1kr4thkh8ec3jm9u.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/mhanusek/work/VersionControl/hello/target/armv7-unknown-linux-gnueabihf/debug/deps" "-L" "/home/mhanusek/work/VersionControl/hello/target/debug/deps" "-L" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libstd-f664592637218e43.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libpanic_unwind-40abf9c980dd2b57.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libhashbrown-71e8af76cf08793e.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_std_workspace_alloc-5a3ec6c55a4196cd.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libbacktrace-b5acd6a9241d690d.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libbacktrace_sys-97dc9498defc0f9d.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_demangle-d08be47a89a64cdd.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libunwind-92aa28ef0d9eadea.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcfg_if-f24ed9c5a8e8ab4e.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/liblibc-3839e52f1a9486f2.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/liballoc-43f54dda9bcb64b2.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/librustc_std_workspace_core-aae2afdcc2f813e2.rlib" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcore-373b3a592b1cb308.rlib" "-Wl,--end-group" "/home/mhanusek/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/libcompiler_builtins-cf96bed75be66e38.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: /opt/etos/1.2.1/sysroots/x86_64-etossdk-linux/usr/libexec/arm-etos-linux-gnueabi/gcc/arm-etos-linux-gnueabi/7.3.0/real-ld: cannot find Scrt1.o: No such file or directory
/opt/etos/1.2.1/sysroots/x86_64-etossdk-linux/usr/libexec/arm-etos-linux-gnueabi/gcc/arm-etos-linux-gnueabi/7.3.0/real-ld: cannot find crti.o: No such file or directory
/opt/etos/1.2.1/sysroots/x86_64-etossdk-linux/usr/libexec/arm-etos-linux-gnueabi/gcc/arm-etos-linux-gnueabi/7.3.0/real-ld: cannot find crtbeginS.o: No such file or directory
collect2: error: ld returned 1 exit status

error: aborting due to previous error

error: could not compile hello.

To learn more, run the command again with --verbose.

What's wrong?

That's what seems to be missing.

From this forum, it seems like you need to install your Linux distro's devtools.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.