sel4: fix segmentation fault with CCACHE=yes

Building the elfloader in kernel-sel4.inc has a problem with Genodes CCACHE
make variable. When issuing ...

! ./tool/depot/create mstein/bin/*/base-sel4-* CCACHE=yes

..., building the elfloader used to consume all memory of the host system and
then run into a segmentation fault:

! make[6]: *** [elfloader/elfloader.o] Segmentation fault (core dumped)

This is because the other build system invokes the CCACHE variable as a command
in front of the compiler command. If CCACHE is set to 'yes', the 'yes' command
is called and produces an endless output into some output file. The problem
can be fixed by locally re-setting the CCACHE variable for the
'make ... elfloader' command to 'ccache' (Genode CCACHE==yes) or '' (Genode
CCACHE!=yes).

Fixes #4212
This commit is contained in:
Martin Stein 2021-06-29 11:49:58 +02:00 committed by Christian Helmuth
parent 0074a7c4ac
commit 688379d1ed

View File

@ -12,6 +12,12 @@ else
all:
endif
ifeq ($(CCACHE),yes)
SEL4_CCACHE=ccache
else
SEL4_CCACHE=
endif
elfloader/elfloader.o:
$(VERBOSE)cp -r $(TOOLS_DIR)/elfloader-tool $(LIB_CACHE_DIR)/$(LIB)/elfloader
$(VERBOSE)mkdir -p $(LIB_CACHE_DIR)/$(LIB)/elfloader/tools/kbuild
@ -25,7 +31,8 @@ elfloader/elfloader.o:
ARCH=arm PLAT=$(PLAT) ARMV=armv7-a __ARM_32__="y" \
CPU=$(CPU) ASFLAGS="-march=armv7-a" \
CFLAGS="-march=armv7-a -D__KERNEL_32__ -fno-builtin" \
SEL4_COMMON=. SOURCE_DIR=. STAGE_DIR=. srctree=.
SEL4_COMMON=. CCACHE=$(SEL4_CCACHE) SOURCE_DIR=. STAGE_DIR=. \
srctree=.
build_kernel: elfloader/elfloader.o
$(VERBOSE)$(MAKE) \