[LITMUS^RT] Litmus on single-board computer

Björn Brandenburg bbb at mpi-sws.org
Sat Jan 13 15:40:55 CET 2018


> On 13. Jan 2018, at 15:03, Martinez Garcia Jorge Luis (PS-EC/ESB2) <JorgeLuis.MartinezGarcia at de.bosch.com> wrote:
> 
> I tried to cross-compile liblitmus by setting  LITMUS_KERNEL = ../linux-stable, ARCH = arm64 and CROSS_COMPILE = aarch64-linux-gnu- in the .config file and got the following output.  
> 
> ~/playground/liblitmus$ make
> cp ../linux-stable/include/litmus/rt_param.h include/litmus/rt_param.h
> cp ../linux-stable/include/litmus/ctrlpage.h include/litmus/ctrlpage.h
> cp ../linux-stable/include/litmus/fpmath.h include/litmus/fpmath.h
> gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE -m64 -DARCH=x86_64 -I./include -I./arch/x86/include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi  -c -o kernel_iface.o src/kernel_iface.c
> 
> [...]
> 
> Can you help me to figure out what the problem is?

Difficult to tell. The Makefile sets CC to include the cross compiler


	# incorporate cross-compiler (if any)
	CC  := ${CROSS_COMPILE}${CC}
	LD  := ${CROSS_COMPILE}${LD}
	AR  := ${CROSS_COMPILE}${AR}

	https://github.com/LITMUS-RT/liblitmus/blob/a430c7b5cacae4219a185decb863f6fb9e5cbcb9/Makefile#L61

and uses the provided ARCH if specified

	# ARCH -- what architecture are we compiling for?
	ARCH ?= ${host-arch}

	https://github.com/LITMUS-RT/liblitmus/blob/a430c7b5cacae4219a185decb863f6fb9e5cbcb9/Makefile#L12

but your output indicates that neither CROSS_COMPILE nor ARCH  was picked up. So my best guess is that there’s some mistake in the .config, or the .config is in the wrong place. 

Here is what it should look like:

bbb at lab:/ssd/bbb/aarch64/rpi3/liblitmus [9814] source ../../env.sh
bbb at lab:/ssd/bbb/aarch64/rpi3/liblitmus [9784] make
cp ../litmus-rt/include/litmus/rt_param.h include/litmus/rt_param.h
cp ../litmus-rt/include/litmus/ctrlpage.h include/litmus/ctrlpage.h
cp ../litmus-rt/include/litmus/fpmath.h include/litmus/fpmath.h
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o kernel_iface.o src/kernel_iface.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o migration.o src/migration.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o syscalls.o src/syscalls.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o task.o src/task.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o litmus.o src/litmus.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o clocks.o src/clocks.c
aarch64-linux-gnu-ar rcs liblitmus.a kernel_iface.o migration.o syscalls.o task.o litmus.o clocks.o
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o cycles.o bin/cycles.c
aarch64-linux-gnu-gcc -o cycles   cycles.o   -L. -llitmus 
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o base_task.o bin/base_task.c
aarch64-linux-gnu-gcc -o base_task   base_task.o   -L. -llitmus 
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o rt_launch.o bin/rt_launch.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o common.o bin/common.c
aarch64-linux-gnu-gcc -o rt_launch   rt_launch.o common.o   -L. -llitmus 
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o rtspin.o bin/rtspin.c
aarch64-linux-gnu-gcc -o rtspin   rtspin.o common.o   -L. -llitmus -lrt
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o release_ts.o bin/release_ts.c
aarch64-linux-gnu-gcc -o release_ts   release_ts.o common.o   -L. -llitmus 
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o null_call.o bin/null_call.c
aarch64-linux-gnu-gcc -o measure_syscall   null_call.o   -L. -llitmus -lm
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o base_mt_task.o bin/base_mt_task.c
aarch64-linux-gnu-gcc -o base_mt_task  -pthread base_mt_task.o   -L. -llitmus 
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o uncache.o bin/uncache.c
aarch64-linux-gnu-gcc -o uncache   uncache.o   -L. -llitmus -lrt
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o core_api.o tests/core_api.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o nesting.o tests/nesting.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o runner.o tests/runner.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o fdso.o tests/fdso.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o sched.o tests/sched.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o pcp.o tests/pcp.c
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o locks.o tests/locks.c
aarch64-linux-gnu-gcc -o runtests   core_api.o nesting.o runner.o fdso.o sched.o pcp.o locks.o   -L. -llitmus -lrt
aarch64-linux-gnu-gcc -O2 -Wall -Werror -g -Wdeclaration-after-statement -D_XOPEN_SOURCE=600 -D_GNU_SOURCE  -DARCH=arm64 -I./include -I./arch/arm64/include -I./arch/arm64/include/uapi -I./arch/arm64/include/generated/uapi  -c -o resctl.o bin/resctl.c
aarch64-linux-gnu-gcc -o resctl   resctl.o common.o   -L. -llitmus 

Note I set the variables via the shell’s environment, but that shouldn’t make a difference. For reference, here’s my env.sh script.

	export PATH=/opt/gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu/bin:$PATH
	export ARCH=arm64
	export CROSS_COMPILE=aarch64-linux-gnu-

- Björn




More information about the litmus-dev mailing list