TOOLCHAIN for target aarch64-unknown-linux-gnu

585 views
Skip to first unread message

shawn peng

unread,
Jul 30, 2018, 8:17:13 PM7/30/18
to Tock Embedded OS Development Discussion

What TOOLCHAIN value should be used for target aarch64-unknown-linux-gnu in Makefile.common file? To cross compile Tock on Linux/x86-64bit.
The llvm is the current TOOLCHAIN value in Makefile.common, which failed the link process.
As I changed linker=lld to linker=aarch64-linux-gnu-ld, or to linker=aarch64-linux-gnu-gcc.
should I need change the linker-flavor=ld.lld too?


Thanks,
Shawn

Pat Pannuto

unread,
Jul 30, 2018, 8:32:25 PM7/30/18
to shawn peng, Tock Embedded OS Development Discussion
Do you have a basic non-Tock example of cross-compiling Rust for your target platform? It should be the same toolchain.

--
You received this message because you are subscribed to the Google Groups "Tock Embedded OS Development Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tock-dev+u...@googlegroups.com.
To post to this group, send email to tock...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tock-dev/f6948e16-30d3-4b22-9b46-b3e626c2f8c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

shawn peng

unread,
Jul 30, 2018, 9:47:51 PM7/30/18
to Tock Embedded OS Development Discussion
The tool chain I used is "nightly-x86_64-unknown-linux-gnu", the link error may relate to ld.lld file or script, do you know where to find ld.lld?

~/tock/0724/tock/boards/hikey$ make
   Compiling tock-registers v0.1.0 (file:///home/shawnpeng/tock/0724/tock/libraries/tock-register-interface)
   Compiling tock-cells v0.1.0 (file:///home/shawnpeng/tock/0724/tock/libraries/tock-cells)
   Compiling kernel v0.1.0 (file:///home/shawnpeng/tock/0724/tock/kernel)
   Compiling cortexa53 v0.1.0 (file:///home/shawnpeng/tock/0724/tock/arch/cortex-a53)
   Compiling capsules v0.1.0 (file:///home/shawnpeng/tock/0724/tock/capsules)
   Compiling hi6220 v0.1.0 (file:///home/shawnpeng/tock/0724/tock/chips/hi6220)
   Compiling hikey v0.1.0 (file:///home/shawnpeng/tock/0724/tock/boards/hikey)
error: linking with `aarch64-linux-gnu-gcc` failed: exit code: 1
  |
  = note: "aarch64-linux-gnu-gcc" "-flavor" "gnu" "-L" "/home/shawnpeng/.rustup/toolchains/nightly-2018-06-26-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "/home/shawnpeng/tock/0724/tock/boards/hikey/target/aarch64-unknown-linux-gnu/release/deps/hikey-fb876f21c2527240.hikey0.rcgu.o" "-o" "/home/shawnpeng/tock/0724/tock/boards/hikey/target/aarch64-unknown-linux-gnu/release/deps/hikey-fb876f21c2527240" "--gc-sections" "-no-pie" "-z,relro,-z,now" "-L" "/home/shawnpeng/tock/0724/tock/boards/hikey/target/aarch64-unknown-linux-gnu/release/deps" "-L" "/home/shawnpeng/tock/0724/tock/boards/hikey/target/release/deps" "-L" "/home/shawnpeng/.rustup/toolchains/nightly-2018-06-26-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib" "--start-group" "-Bstatic" "/tmp/rustc5AS0kU/libstd-1d788a3e6eae5ccc.rlib" "--end-group" "/home/shawnpeng/.rustup/toolchains/nightly-2018-06-26-x86_64-unknown-linux-gnu/lib/rustlib/aarch64-unknown-linux-gnu/lib/libcompiler_builtins-990fa33e9fc6c062.rlib" "-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" "-Tlayout.ld" "-zmax-page-size=512"
  = note: aarch64-linux-gnu-gcc: error: gnu: No such file or directory
          aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-flavor’; did you mean ‘-flto’?
          aarch64-linux-gnu-gcc: error: unrecognized command line option ‘--gc-sections’; did you mean ‘--data-sections’?
          aarch64-linux-gnu-gcc: error: unrecognized command line option ‘--start-group’; did you mean ‘--stdarg-opt’?
          aarch64-linux-gnu-gcc: error: unrecognized command line option ‘--end-group’; did you mean ‘--no-out’?
          

error: aborting due to previous error

error: Could not compile `hikey`.

To learn more, run the command again with --verbose.
../Makefile.common:170: recipe for target 'target/aarch64-unknown-linux-gnu/release/hikey' failed
make: *** [target/aarch64-unknown-linux-gnu/release/hikey] Error 101

Shawn

Amit Levy

unread,
Jul 30, 2018, 10:01:43 PM7/30/18
to tock...@googlegroups.com

Hi Shawn,

It's great that you're excited about using Tock on different architectures, but this list doesn't have anyone who's very familiar with the internals of compiling Rust to architectures other than the ones we've already tried ourselves.

A much better venue for questions like this would be the Rust users forum, or the Rust embedded working group. I believe there are folks over there who have actually compiled Rust to Cortex-A.

We're of course excited for you to keep us posted as you progress getting Tock up and running on a Cortex-A.

-Amit

shawn peng

unread,
Jul 31, 2018, 1:55:06 PM7/31/18
to Tock Embedded OS Development Discussion
I see, I will update you when got it resolved.

Thanks,
Shawn
Reply all
Reply to author
Forward
0 new messages