2011-12-22 16:19:25 +01:00
|
|
|
TARGET = kernel
|
|
|
|
REQUIRES += pistachio
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
KERNEL_BUILD_DIR = $(BUILD_BASE_DIR)/kernel/pistachio/build
|
2014-05-23 13:37:21 +02:00
|
|
|
KERNEL_SRC := $(call select_from_ports,pistachio)/src/kernel/pistachio/kernel
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
LIBGCC_DIR = $(dir $(shell $(CC) $(CC_MARCH) -print-libgcc-file-name))
|
|
|
|
GCCINC_DIR = $(dir $(shell $(CC) -print-libgcc-file-name))include
|
|
|
|
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
KERNEL_CCFLAGS := $(CC_MARCH)
|
|
|
|
KERNEL_CCFLAGS += -Wno-unused-function -Wno-array-bounds -Wno-narrowing \
|
|
|
|
-Wno-unused-but-set-variable -Wno-maybe-uninitialized \
|
|
|
|
-Wno-unused-variable
|
2011-12-22 16:19:25 +01:00
|
|
|
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
$(TARGET): $(KERNEL_BUILD_DIR)/x86-kernel
|
|
|
|
$(VERBOSE)ln -sf $< $@
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
$(KERNEL_BUILD_DIR)/Makefile:
|
|
|
|
$(VERBOSE_MK) MAKEFLAGS= $(MAKE) $(VERBOSE_DIR) -C $(KERNEL_SRC) BUILDDIR=$(dir $@)
|
|
|
|
$(VERBOSE)cp $(REP_DIR)/config/kernel $(KERNEL_BUILD_DIR)/config/config.out
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# How to pass custom compiler flags to the Pistachio build system
|
|
|
|
#
|
|
|
|
# CFLAGS do not work because the variable gets assigned within the build
|
|
|
|
# system:
|
|
|
|
#
|
|
|
|
# Mk/Makeconf: 'CFLAGS = -ffreestanding $(CCFLAGS)'
|
|
|
|
#
|
|
|
|
# However, all flags specified in 'CCFLAGS' will end up in 'CFLAGS' and
|
|
|
|
# 'CCFLAGS' is never assigned - only extended via '+='. Because of this
|
|
|
|
# extension mechanism, we have to pass custom flags as environment variables
|
|
|
|
# rather than make arguments. If we specified 'CCFLAGS' as make argument, the
|
|
|
|
# '+=' mechanism would not work, leaving out some important flags assigned by
|
|
|
|
# the Pistachio build system.
|
|
|
|
#
|
|
|
|
# Because the Pistachio build system invokes the assembler via the GCC
|
|
|
|
# front end, we can pass 'CC_MARCH' as 'ASMFLAGS'. The linker, however, is
|
|
|
|
# invoked directly (using 'ld' rather than 'gcc'). Hence, we need to pass
|
|
|
|
# real linker flags (e.g., '-melf_i386' rather than -m32) to 'LDFLAGS'.
|
|
|
|
#
|
|
|
|
# The Pistachio build system has some built-in heuristics about where to find
|
|
|
|
# libgcc. Unfortunately, this heuristics break when using a multilib tool chain
|
|
|
|
# that uses -m64 by default. Hence, we need to supply the build system with the
|
|
|
|
# correct location via the 'GCCINSTALLDIR' and 'LIBGCCINC' variables.
|
|
|
|
#
|
|
|
|
|
|
|
|
$(KERNEL_BUILD_DIR)/config/.config: $(KERNEL_BUILD_DIR)/Makefile
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
$(VERBOSE_MK)CCFLAGS="$(KERNEL_CCFLAGS)" MAKEFLAGS=-s \
|
|
|
|
$(MAKE) -s $(VERBOSE_DIR) -C $(KERNEL_BUILD_DIR) batchconfig \
|
2011-12-22 16:19:25 +01:00
|
|
|
GCCINSTALLDIR=$(LIBGCC_DIR)
|
|
|
|
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
$(KERNEL_BUILD_DIR)/x86-kernel: $(KERNEL_BUILD_DIR)/config/.config
|
|
|
|
$(VERBOSE_MK)CCFLAGS="$(KERNEL_CCFLAGS)" LDFLAGS="$(LD_MARCH)" \
|
|
|
|
ASMFLAGS="$(CC_MARCH)" MAKEFLAGS= \
|
|
|
|
$(MAKE) -s $(VERBOSE_DIR) -C $(KERNEL_BUILD_DIR) \
|
2011-12-22 16:19:25 +01:00
|
|
|
TOOLPREFIX=$(CROSS_DEV_PREFIX) \
|
|
|
|
GCCINSTALLDIR=$(LIBGCC_DIR) \
|
|
|
|
LIBGCCINC=$(GCCINC_DIR)
|
|
|
|
|
|
|
|
clean cleanall:
|
|
|
|
$(VERBOSE)rm -rf $(KERNEL_BUILD_DIR)
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# Install symlinks for sigma0 and kickstart at kernel/pistachio/
|
|
|
|
#
|
|
|
|
# The 'LIBS' dependency ensures that the Pistachio userland is built before.
|
|
|
|
#
|
|
|
|
LIBS += syscall-pistachio
|
|
|
|
|
2017-04-07 15:52:16 +02:00
|
|
|
$(TARGET): $(INSTALL_DIR)/sigma0-pistachio \
|
|
|
|
$(INSTALL_DIR)/kickstart-pistachio \
|
|
|
|
$(INSTALL_DIR)/pistachio
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
|
2017-04-07 15:52:16 +02:00
|
|
|
$(INSTALL_DIR)/sigma0-pistachio:
|
|
|
|
$(VERBOSE)ln -sf $(LIB_CACHE_DIR)/syscall-pistachio/serv/sigma0/sigma0 $@
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
|
2017-04-07 15:52:16 +02:00
|
|
|
$(INSTALL_DIR)/kickstart-pistachio:
|
|
|
|
$(VERBOSE)ln -sf $(LIB_CACHE_DIR)/syscall-pistachio/util/kickstart/kickstart $@
|
Disambiguate kernel-specific file names
This patch removes possible ambiguities with respect to the naming of
kernel-dependent binaries and libraries. It also removes the use of
kernel-specific global side effects from the build system. The reach of
kernel-specific peculiarities has thereby become limited to the actual
users of the respective 'syscall-<kernel>' libraries.
Kernel-specific build artifacts are no longer generated at magic places
within the build directory (like okl4's includes, or the L4 build
directories of L4/Fiasco and Fiasco.OC, or the build directories of
various kernels). Instead, such artifacts have been largely moved to the
libcache. E.g., the former '<build-dir>/l4/' build directory for the L4
build system resides at '<build-dir>/var/libcache/syscall-foc/build/'.
This way, the location is unique to the kernel. Note that various tools
are still generated somewhat arbitrarily under '<build-dir>/tool/' as
there is no proper formalism for building host tools yet.
As the result of this work, it has become possible to use a joint Genode
build directory that is usable with all kernels of a given hardware
platform. E.g., on x86_32, one can now seamlessly switch between linux,
nova, sel4, okl4, fiasco, foc, and pistachio without rebuilding any
components except for core, the kernel, the dynamic linker, and the timer
driver. At the current stage, such a build directory must still be
created manually. A change of the 'create_builddir' tool will follow to
make this feature easily available.
This patch also simplifies various 'run/boot_dir' plugins by removing
the option for an externally hosted kernel. This option remained unused
for many years now.
Issue #2190
2016-12-10 01:30:38 +01:00
|
|
|
|
2017-04-07 15:52:16 +02:00
|
|
|
$(INSTALL_DIR)/pistachio: $(KERNEL_BUILD_DIR)/x86-kernel
|
|
|
|
$(VERBOSE)ln -sf $< $@
|