The toolchain of my linux computer is x86_64-redhat-linux.
On Juno board, I run the prebuilt image https://releases.linaro.org/openembedded/juno-lsk/15.09/lt-vexpress64-openembedded_minimal-armv8-gcc-4.9_20150912-729.img.gz
1. I searched online, many developers said the toolchain of arm juno r1 board is gcc-arm-none-eabi. I downloaded the package of this toolchain, and set path to this toolchain directory in my linux computer. I can compile a simple hellowold application with linux machine, and copy it to juno board, it can not run on Juno board. When run it, it shows
root@genericarmv8:/mnt# ./hello
hello[999]: unhandled level 3 translation fault (11) at 0x0007fff8, esr 0x92000047
pgd = ffffffc07a00a000
[0007fff8] *pgd=00000000fabda003, *pud=00000000fabda003, *pmd=00000000fa0b4003, *pte=0000000000000000
CPU: 1 PID: 999 Comm: hello Not tainted 3.19.0+ #13
Hardware name: ARM Juno development board (r1) (DT)
task: ffffffc07aa66300 ti: ffffffc07a0cc000 task.ti: ffffffc07a0cc000
PC is at 0x82c8
LR is at 0x819c
pc : [<00000000000082c8>] lr : [<000000000000819c>] pstate: 60000010
sp : 0000000000080000
x12: 0000000000000000
x11: 0000000000000000 x10: 0000000000070000
x9 : 0000000000000000 x8 : 0000000000000000
x7 : 0000000000000000 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000000
x3 : 0000000000080000 x2 : 0000000000000058
x1 : 0000000000000000 x0 : 00000000000139a4
Segmentation fault
2. I downloaded Juno pre built full image https://releases.linaro.org/openembedded/juno-lsk/15.09/linaro-image-lamp-genericarmv8-20150921-770.rootfs.tar.gz
In user local, I can see this toolchain is aarch64-oe-linux-gcc, I copied this one to linux computer, and set the path, I cannot even compile helloworld application with this toolchain, it says Exec format error, wrong architecture
Hello,
You said:
I searched online, many developers said the toolchain of arm juno r1 board is gcc-arm-none-eabi.
That's an ARMv7-A baremetal cross compiler, but what you actually need is an AArch64 Linux cross compiler - Linaro host one here (direct download).
That's because you've copied an ARM AArch64 binary onto your Intel/AMD x86_64 machine If you download the cross compiler that I linked above, use that to compile your application, and copy the resulting binary across to the Juno, it should work.
You can alternatively compile your Hello World application natively on the Juno itself by using the aarch64-oe-linux-gcc that you mentioned (i.e. put your source code on the Juno and compile it through the serial terminal).
Hope that helps,
Ash