This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

can't cross compile on arch linux

Hi, I'm trying to learn arm development with my laptop, which is hosted a x86_64 OS. I downloaded arm gcc toolchain x86_64 version.

But when I compile, it throws me an error: 

./gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc -Wall -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -c boot.S -o boot.o
aarch64-none-elf-gcc: fatal error: cannot execute '/home/joey/Projects/pi/gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin/../lib/gcc/aarch64-none-elf/11.2.1/../../../../aarch64-none-elf/bin/as': execv: Exec format error
compilation terminated.

`file` gcc gives me:

./gcc-arm-11.2-2022.02-x86_64-aarch64-none-elf/bin/aarch64-none-elf-gcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=6062e5a5acafaae05ce5896fe9c3632adc069589, not stripped
and `uname -m` gives me:
uname -m
x86_64

can someone help me? I don't think it relate code, because I tried `hello world` and it just simply not working.

Parents Reply Children
No data