01BTC10
01BTC10

Reputation: 536

Flag for cross-compiling for ARMv6l with arm-linux-gnueabi-gcc

I have some difficulty to cross-compile a simple HelloWorld in C. The host is Ubuntu X86_64 and the target is ARMv6-compatible processor rev 7 (v6l) running Linux kernel 2.6.21.7

If i try:

arm-linux-gnueabi-gcc -static -march=armv6 hello.c -o hello

I get a segmentation fault on the target. File command output is:

hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.31, BuildID[sha1]=0x0c77ad13c58160eab9dcbf2feeeaf4d27a4319cb, not stripped

I don't see any "armv6l" flag in the GCC documentation. Is it possible to cross-compile for this architecture with GCC?

Upvotes: 0

Views: 3388

Answers (1)

01BTC10
01BTC10

Reputation: 536

It worked with sourcery: https://sourcery.mentor.com/sgpp/lite/arm/portal/release2029

After the installation, I had to reboot my computer then it compiled fine with this command:

arm-none-linux-gnueabi-gcc -o hello -static hello.c

Upvotes: 1

Related Questions