genode/repos/base-okl4/lib/mk/kernel-okl4.inc

63 lines
2.6 KiB
PHP
Raw Normal View History

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 00:30:38 +00:00
LIBS = kernel-okl4-include
SRC_O += $(addprefix asm/,$(addsuffix .o,$(basename $(SRC_SPP))))
2011-12-22 15:19:25 +00:00
SRC_CC += $(subst $(OKL4_SRC_DIR)/,,$(wildcard $(OKL4_SRC_DIR)/pistachio/kdb/src/*.cc)) \
$(subst $(OKL4_SRC_DIR)/,,$(wildcard $(OKL4_SRC_DIR)/pistachio/src/*.cc))
CONFIG += __API__=v4 \
CONFIG_ASSERT_LEVEL=3 \
CONFIG_DEBUG=1 \
CONFIG_ENABLE_FASTPATHS=1 \
CONFIG_HYBRID_MUTEXES=1 \
CONFIG_IS_32BIT=1 \
CONFIG_KDB=1 \
CONFIG_KDB_BREAKIN=1 \
CONFIG_KDB_CLI=1 \
CONFIG_KDB_COLOR_VT=1 \
CONFIG_KDB_CONS=1 \
CONFIG_KMEM_TRACE=1 \
CONFIG_LITTLEENDIAN=1 \
CONFIG_MAX_SPACES=256U \
CONFIG_MAX_THREAD_BITS=10 \
CONFIG_MUTEX_NAMES=1 \
CONFIG_REMOTE_MEMORY_COPY=1 \
CONFIG_SCHEDULE_INHERITANCE=1 \
CONFIG_SMP_MAX_CPUS=1 \
CONFIG_THREAD_NAMES=1 \
CONFIG_TRACEBUFFER=1 \
CONFIG_TRACEBUF_PAGES=64 \
CONFIG_TRACEPOINTS=1 \
KENGE_PISTACHIO \
KERNEL_GEN_DAY=$(shell date +%d) \
KERNEL_GEN_MONTH=$(shell date +%m) \
KERNEL_GEN_YEAR=$(shell date +%g) \
KERNEL_SUBSUBVERSION=0 \
KERNEL_SUBVERSION=1 \
KERNEL_VERSION=0 \
WORDSIZE_32
CC_OPT += -Wno-write-strings -Wredundant-decls -Wundef \
-Wpointer-arith -Wno-uninitialized \
-fno-builtin -fomit-frame-pointer \
-fno-exceptions -fno-unwind-tables \
-fno-asynchronous-unwind-tables \
-finline-limit=99999999 $(addprefix -D,$(CONFIG)) \
"-D__USER__=\"Genode Labs\""
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 00:30:38 +00:00
CC_OPT += -DCONFIG_MAX_THREAD_BITS=10
2011-12-22 15:19:25 +00: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 00:30:38 +00:00
CC_OPT_PIC =
Follow practices suggested by "Effective C++" The patch adjust the code of the base, base-<kernel>, and os repository. To adapt existing components to fix violations of the best practices suggested by "Effective C++" as reported by the -Weffc++ compiler argument. The changes follow the patterns outlined below: * A class with virtual functions can no longer publicly inherit base classed without a vtable. The inherited object may either be moved to a member variable, or inherited privately. The latter would be used for classes that inherit 'List::Element' or 'Avl_node'. In order to enable the 'List' and 'Avl_tree' to access the meta data, the 'List' must become a friend. * Instead of adding a virtual destructor to abstract base classes, we inherit the new 'Interface' class, which contains a virtual destructor. This way, single-line abstract base classes can stay as compact as they are now. The 'Interface' utility resides in base/include/util/interface.h. * With the new warnings enabled, all member variables must be explicitly initialized. Basic types may be initialized with '='. All other types are initialized with braces '{ ... }' or as class initializers. If basic types and non-basic types appear in a row, it is nice to only use the brace syntax (also for basic types) and align the braces. * If a class contains pointers as members, it must now also provide a copy constructor and assignment operator. In the most cases, one would make them private, effectively disallowing the objects to be copied. Unfortunately, this warning cannot be fixed be inheriting our existing 'Noncopyable' class (the compiler fails to detect that the inheriting class cannot be copied and still gives the error). For now, we have to manually add declarations for both the copy constructor and assignment operator as private class members. Those declarations should be prepended with a comment like this: /* * Noncopyable */ Thread(Thread const &); Thread &operator = (Thread const &); In the future, we should revisit these places and try to replace the pointers with references. In the presence of at least one reference member, the compiler would no longer implicitly generate a copy constructor. So we could remove the manual declaration. Issue #465
2017-12-21 14:42:15 +00:00
CC_CXX_WARN := -Wall -Wno-unused-but-set-variable -Wno-uninitialized
2011-12-22 15:19:25 +00:00
#
# Enforce building the kernel with -O3. Otherwise, the kernel build would fail
# if the global 'CC_OLEVEL' is set is -O0. (OKL4 depends on some builtin
# functions that are not provided by the compiler when building with -O0)
#
override CC_OLEVEL = -O3
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 00:30:38 +00:00
asm/%.o: $(OKL4_SRC_DIR)/%.spp
2011-12-22 15:19:25 +00:00
$(MSG_COMP)$*.spp
$(VERBOSE)$(CC) $(CC_MARCH) -x assembler-with-cpp -DASSEMBLY \
$(addprefix -D,$(CONFIG)) \
$(addprefix -I,$(INC_DIR)) -c $< -o $@
vpath %.cc $(OKL4_SRC_DIR)