Update build system to use cmake
We should update the SGX-LKL build system from hand-written Makefiles to something more modern, such as cmake.
This will make the build system more robust and easier to maintain in the long-term.
This should also support automatic code formatting with clang-format.
There is a branch that contains some initial work in this direction. So far it can:
- Download and extract all of the third party dependencies
- Copy the LKL source tree into the build tree and patch it, keeping it up to date if any source files change.
- Build LKL
- Build the host components
- Pick up OE components from the OE CMake packages.
- Build the ecall / ocall interfaces
Unlike the current build system, it does not touch anything in the source tree and it tracks all dependencies and so incremental builds should work.
It cannot yet build musl. Once the relayering work is done, we will link LKL and the src/{enclave,lkl,shared} code into an SGX-LKL kernel library that exposes only the lkl_syscall symbol. We will also link an init library, and a musl library, each of which has lkl_syscall as its only undefined symbol, then link the three together to give libsgxlkl.so.
I cannot yet build the rest of the in-enclave code.