CMake plumbing to build loader#2
Conversation
Only for amd64 host and target. nacl_helper_bootstrap also builds. - Check in linux_syscall_support.h (like we did for Breakpad) - Add a hacky symlink so we don't have to include the repository's parent directory or name it "native_client" - Use LLVM from /usr/bin instead of Chromium toolchains - Remove sysroot flags (depend on host system instead) - Disable setup of NaCl-target toolchains in scons scripts
Disable GDB tests by default and when they are disabled don't try to look for a 2nd NaCl toolchain just to grab its GDB. GDB tests on Linux are broken for me anyway in upstream with the incompatibly old curses lib dependency issue.
With some minor fixes, the build is able to run and produce an irt_core binary when configured with the Saigo toolchain. Added documentation how to do this to the README. Still keeping the 'if nacltools' guards I added so that sel_ldr can be built without acquiring any NaCl toolchains.
2775579 to
993144e
Compare
|
Is it really so bad to use Scons? Unlike CMake, it can handle multiple toolchains, which makes it well-suited for this repo. Also if we keep the same build system, we can easily compare things between our version and upstream. |
Yes. 😅️
Uh, totally not. The Scons scripts are not compatible with cross-compiling to begin with. First purpose of this effort is to make possible to use multiple toolchains. |
Wrong. With Chromium |
|
How do I build with MinGW for Windows on Linux? For Linux Arm? How do I make a static This scons stuff is over-convoluted… |
With this exact command I get that: I have |
Found some documentation: https://github.com/DaemonEngine/native_client/blob/master/docs/build_systems.md. Although cross-architecture builds are supported, cross-OS builds are not. And you can't build with MinGW at all as it is designed for the MSVC toolchain. It seems building with MinGW would imply a porting effort beyond just the build system, as there is, e.g., a Microsoft assembler file. The lack of cross-OS support would seem to be a limitation of Native Client though, not a limitation of Scons.
I posted that in the previous message.
You're getting an error finding a PNaCl toolchain, which should have been downloaded by |
Why do I need a PNaCl toolchain to build an Arm
Yes, all that scons code in the repository is not meant for cross-compilation, that's what I meant.
Very annoying… I have seen they also have some Cygwin code, so I wonder if that can be used on MinGW, I haven't looked at this deeply though. |
|
Sorry, the output of |
|
This can already build |
|
This can now rebuild |
|
This can now rebuild |
|
This can now rebuild |
|
This can now rebuild |
02ffbba to
b588d34
Compare
|
By using JWasm as a MASM-compatible assembler I can cross-build (from Linux to Windows with MinGW) the I got them from: |
37f0e62 to
0c40165
Compare
|
Using the same tricks, it is now possible to rebuild It means that it is now possible to rebuild the loader for all the DæmonEngine platforms using CMake (including the related |
0c40165 to
8d956b8
Compare
This test is using some custom macros instead of googletest and ASSERT_EQ apparently double-evaluates the arguments if the assertion fails.
4ad638b to
c725772
Compare
Use --orphan-handling=unwanted when linking nacl_helper_bootstrap which makes the linker discard any sections not explicitly mentioned in the linker script. This prevents the linker from producing a defective binary with overlapping PT_LOAD headers when using GCC on certain distros such as Ubuntu and Arch that have it configured to produce a .note.gnu.property section
19d4e54 to
8a51eee
Compare
ecaccae to
a87e12d
Compare
d807a6e to
3eee880
Compare
|
I rebased on the Yokai framework: |
3eee880 to
f59e059
Compare
|
@slipher I now rebased on the latest version of Yokai, this should be ready. |
I added some
CMakeLists.txcode to rebuildsel_ldrandnacl_helper_bootstrap.This relies on some unified
DaemonPlatformframework copied from DaemonEngine/Daemon#1641 on purpose to give this CMake code the same easiness at doing cross-compiled builds.I need help to complete the
src/trusted/service_runtime/CMakeLists.txtfile.The
CMakeLists.txtfiles are a rewrite of the fileSConstructand*.sconsfiles with all unit tests deleted. Remaining unported code is commented out with lines starting with#TODO:.Build status:
sel_ldrnacl_helper_bootstraphelloworldnexeDynamically linked loader:
sel_ldrhelloworldnexeStatically linked loader:NOW REMOVED.sel_ldrhelloworldnexeThings like
linux-mipswere tested only because I ported the SCons code to CMake for completeness and make sure I forgot nothing.I tested
android-armelbecause I remember that in the past @cu-kai tried to getdaemon-ttyrunning on Android to get a console for his server.