capdl-loader-app: Refactor two-phase build design #56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The capdl-loader-app has previously used a non-conventional CMake
pattern for building. As the app is built with the capDL spec and ELF
files for any program data the loader is required to load, the actual
CMake target definitions are deferred until the targets for generating
the capDL spec are known as well as the ELF targets. These are then
used to declare a capdl-loader-app target.
Instead this change uses a different approach:
capDL spec and CPIO archive containing the ELF files unresolved, while
still producing a base object file "capdl-loader.o".
and an object file containing a CPIO archive of ELF files and
compiling these with the "capdl-loader.o" file. This compilation can
be done outside of a CMake build as only access to libsel4 and
capdl-loader-app header files are required to compile the CapDL C
spec.
the rootimage from within a custom command that performs the external
call to a compiler with the required include paths and input files.
require thread-local storage and basic entry point assembly code is
provided by "entry.h" which sets up a stack and then directly calls
main() as the kernel places the bootinfo pointer in the first argument
register and this is all the capdl-loader program needs to bootstrap.
instead of thread-local allocation for thread variables such as the
pointer for the seL4 IPC buffer used by libsel4.