I'm just doing my first steps with Buildroot and Raspberry Pi (running Raspbian). But somehow I seem to do something wrong with the cross compilation. The application is a most simple Hello World program written in C. This is what I did:
- Downloaded and installed buildroot
make raspberrypi2_defconfig
make toolchain
Then I wrote the tiny application and the following Makefile:
CROSS_BIN := /home/me/raspi/buildroot-2016.05/output/host/usr/bin
SYSROOT := /home/me/raspi/buildroot-2016.05/output/host/usr/arm-buildroot-linux-uclibcgnueabihf/sysroot
PATH := $(CROSS_BIN):$(PATH)
CC := arm-linux-gcc
CFLAGS := --sysroot=$(SYSROOT)
app: app.c
$(CC) $(CFLAGS) -o $@ $<
Compiled the app and copied it to the Raspberry. When I tried to run it, RPI complains that it can't find the file (though it's there and executable for sure). The binary type seems ok to me and should fit to the CPU:
pi@raspberrypi:~ $ ./app
-bash: ./app: No such file or directory
pi@raspberrypi:~ $ ls -l app
-rwxr-xr-x 1 pi pi 4916 Jul 10 11:07 app
pi@raspberrypi:~ $ file app
app: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, not stripped
pi@raspberrypi:~ $ lscpu
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Model name: ARMv7 Processor rev 5 (v7l)
CPU max MHz: 900.0000
CPU min MHz: 600.0000
Can somebody tell me what I'm doing wrong? If I compile the app natively and run it on the development host, it runs without a problem.