mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-22 03:55:26 +00:00
sel4: update tools to currently used version 9.0.x
Until now, Genode referenced a fork of the outdated elfloader-tool to enable bootstrapping of sel4 on ARM platforms. Because the elfloader is inherently dependent on the used platforms newer ARM versions supported by the kernel could not be loaded by the outdated elfloader. This commit uses a fresh fork of the nowadays used sel4_tools repository. Ref #3251
This commit is contained in:
parent
c19c5ed0a4
commit
3d727a403f
34
repos/base-sel4/lib/mk/spec/arm/kernel-sel4.inc
Normal file
34
repos/base-sel4/lib/mk/spec/arm/kernel-sel4.inc
Normal file
@ -0,0 +1,34 @@
|
||||
SEL4_DIR := $(call select_from_ports,sel4)/src/kernel/sel4
|
||||
TOOLS_DIR := $(call select_from_ports,sel4_tools)/src/tool/sel4_tools
|
||||
|
||||
#
|
||||
# Execute the kernel build only at the second build stage when we know
|
||||
# about the complete build settings (e.g., the 'CROSS_DEV_PREFIX') and the
|
||||
# current working directory is the library location.
|
||||
#
|
||||
ifeq ($(called_from_lib_mk),yes)
|
||||
all: build_kernel
|
||||
else
|
||||
all:
|
||||
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
|
||||
$(VERBOSE)mkdir -p $(LIB_CACHE_DIR)/$(LIB)/elfloader/include/generated
|
||||
$(VERBOSE)ln -s $(TOOLS_DIR)/common-tool/common.mk $(LIB_CACHE_DIR)/$(LIB)/elfloader/
|
||||
$(VERBOSE)ln -s $(TOOLS_DIR)/common-tool/files_to_obj.sh $(LIB_CACHE_DIR)/$(LIB)/elfloader/
|
||||
$(VERBOSE)ln -s $(TOOLS_DIR)/kbuild-tool/Kbuild.include $(LIB_CACHE_DIR)/$(LIB)/elfloader/tools/kbuild/
|
||||
$(VERBOSE)ln -s $(SEL4_DIR)/configs/$(PLAT)/$(BOARD)/autoconf.h $(LIB_CACHE_DIR)/$(LIB)/elfloader/include/generated/
|
||||
$(VERBOSE)$(MAKE) -C $(LIB_CACHE_DIR)/$(LIB)/elfloader \
|
||||
TOOLPREFIX=$(CROSS_DEV_PREFIX) \
|
||||
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=.
|
||||
|
||||
build_kernel: elfloader/elfloader.o
|
||||
$(VERBOSE)$(MAKE) \
|
||||
TOOLPREFIX=$(CROSS_DEV_PREFIX) \
|
||||
BOARD=$(BOARD) ARCH=arm PLAT=$(PLAT) CPU=$(CPU) ARMV=armv7-a DEBUG=1 \
|
||||
SOURCE_ROOT=$(SEL4_DIR) -f$(SEL4_DIR)/Makefile
|
@ -1,32 +1,5 @@
|
||||
SEL4_DIR := $(call select_from_ports,sel4)/src/kernel/sel4
|
||||
ELFLOADER_DIR := $(call select_from_ports,sel4_elfloader)/src/tool/elfloader
|
||||
|
||||
#
|
||||
# Execute the kernel build only at the second build stage when we know
|
||||
# about the complete build settings (e.g., the 'CROSS_DEV_PREFIX') and the
|
||||
# current working directory is the library location.
|
||||
#
|
||||
ifeq ($(called_from_lib_mk),yes)
|
||||
all: build_kernel
|
||||
else
|
||||
all:
|
||||
endif
|
||||
|
||||
elfloader/elfloader.o:
|
||||
$(VERBOSE)cp -rf $(ELFLOADER_DIR) elfloader && \
|
||||
cd elfloader && \
|
||||
$(MAKE) \
|
||||
TOOLPREFIX=$(CROSS_DEV_PREFIX) \
|
||||
NK_ASFLAGS=-DARMV7_A \
|
||||
ARCH=arm PLAT=imx6 ARMV=armv7-a \
|
||||
SEL4_COMMON=$(LIB_CACHE_DIR)/$(LIB)/elfloader \
|
||||
SOURCE_DIR=$(LIB_CACHE_DIR)/$(LIB)/elfloader \
|
||||
STAGE_DIR=$(LIB_CACHE_DIR)/$(LIB)/elfloader \
|
||||
srctree=$(LIB_CACHE_DIR)/$(LIB)/elfloader
|
||||
|
||||
build_kernel: elfloader/elfloader.o
|
||||
$(VERBOSE)$(MAKE) \
|
||||
TOOLPREFIX=$(CROSS_DEV_PREFIX) \
|
||||
BOARD=imx6q_sabrelite ARCH=arm PLAT=imx6 CPU=cortex-a9 ARMV=armv7-a DEBUG=1 \
|
||||
SOURCE_ROOT=$(SEL4_DIR) -f$(SEL4_DIR)/Makefile
|
||||
PLAT := imx6
|
||||
CPU := cortex-a9
|
||||
BOARD := imx6q_sabrelite
|
||||
|
||||
-include $(REP_DIR)/lib/mk/spec/arm/kernel-sel4.inc
|
||||
|
@ -1 +0,0 @@
|
||||
cf90c5aba6d10a0582d53ada6aed06c96ec585b5
|
@ -1,12 +0,0 @@
|
||||
LICENSE := GPLv2
|
||||
VERSION := git
|
||||
DOWNLOADS := sel4_elfloader.git
|
||||
|
||||
URL(sel4_elfloader) := https://github.com/alex-ab/elfloader-tool.git
|
||||
# genode branch
|
||||
REV(sel4_elfloader) := 5a12b40ef6be2e71a005e822d17a0b3af8c309bd
|
||||
DIR(sel4_elfloader) := src/tool/elfloader
|
||||
|
||||
$(call check_tool,python)
|
||||
|
||||
PATCHES := $(wildcard $(REP_DIR)/patches/elfloader/*.patch)
|
1
repos/base-sel4/ports/sel4_tools.hash
Normal file
1
repos/base-sel4/ports/sel4_tools.hash
Normal file
@ -0,0 +1 @@
|
||||
3b20dfecead271767ede321161ef471396c800f2
|
10
repos/base-sel4/ports/sel4_tools.port
Normal file
10
repos/base-sel4/ports/sel4_tools.port
Normal file
@ -0,0 +1,10 @@
|
||||
LICENSE := GPLv2
|
||||
VERSION := git
|
||||
DOWNLOADS := sel4_tools.git
|
||||
|
||||
URL(sel4_tools) := https://github.com/skalk/seL4_tools.git
|
||||
# Rev 9.0.x genode branch
|
||||
REV(sel4_tools) := dd8068bfd4acfa2c3142398521c40bea093bbe04
|
||||
DIR(sel4_tools) := src/tool/sel4_tools
|
||||
|
||||
$(call check_tool,python)
|
@ -18,7 +18,7 @@ content: lib/import etc include/sel4
|
||||
lib/import etc include/sel4:
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
content: src/tool/elfloader
|
||||
content: src/tool/sel4_tools
|
||||
src/kernel:
|
||||
$(mirror_from_rep_dir)
|
||||
|
||||
@ -27,10 +27,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sel4)
|
||||
src/kernel/sel4: src/kernel
|
||||
cp -r $(KERNEL_PORT_DIR)/src/kernel/sel4/* $@
|
||||
|
||||
ELFLOADER_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sel4_elfloader)
|
||||
src/tool/elfloader: src/kernel/sel4
|
||||
ELFLOADER_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sel4_tools)
|
||||
src/tool/sel4_tools: src/kernel/sel4
|
||||
mkdir -p $@
|
||||
cp -r $(ELFLOADER_PORT_DIR)/src/tool/elfloader/* $@
|
||||
cp -r $(ELFLOADER_PORT_DIR)/src/tool/sel4_tools/* $@
|
||||
|
||||
content:
|
||||
mv lib/mk/spec/arm/ld-sel4.mk lib/mk/spec/arm/ld.mk;
|
||||
|
@ -98,11 +98,14 @@ proc run_boot_dir {binaries} {
|
||||
}
|
||||
# keep Genode image.elf as genode.elf
|
||||
exec mv [run_dir]/boot/image.elf [run_dir]/boot/genode.elf
|
||||
exec mv [run_dir]/boot/sel4 [run_dir]/boot/kernel.elf
|
||||
|
||||
# call seL4 elfloader tool to generate image.elf bootable by uboot with 'bootelf' command
|
||||
set ::env(COMMON_PATH) [sel4_elfloader_dir]
|
||||
set ::env(CPPFLAGS) -I[sel4_elfloader_dir]/include
|
||||
set ::env(PLAT) imx6
|
||||
set ::env(TOOLPREFIX) [cross_dev_prefix]
|
||||
exec [sel4_elfloader_dir]/gen_boot_image.sh [run_dir]/boot/sel4 [run_dir]/boot/genode.elf [run_dir]/boot/image.elf
|
||||
exec [sel4_elfloader_dir]/gen_boot_image.sh [pwd]/[run_dir]/boot/kernel.elf [pwd]/[run_dir]/boot/genode.elf [pwd]/[run_dir]/boot/image.elf
|
||||
}
|
||||
|
||||
run_image [run_dir]/boot/image.elf
|
||||
|
Loading…
x
Reference in New Issue
Block a user