-
Notifications
You must be signed in to change notification settings - Fork 1
Write a CMakeLists.txt to build the NaCl loader #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
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 |
8d956b8 to
11e641b
Compare
|
In fact, only the single file |
|
Even better, those two obvious macros are enough: push_reg macro Reg
push Reg
.pushreg Reg
endm
alloc_stack macro Size
sub rsp, Size
.allocstack Size
endmSo I provided a file named On MSVC with original MASM, it is meant to use system's |
|
So this repository can now cross-compile |
|
I added a commit to statically link the I don't know if that's a problem for us. |
12459bb to
4340799
Compare
|
I removed everything that wasn't CMake, other things like the MinGW compatibility code will be submitted in a separate PR. |
|
The CMake code already includes stuff for MinGW: So this part references files that aren't there yet. |
Thanks. I will continue to use the Scons build since I am interested in running the tests, among other things. So I won't have to review this super closely since it is only CMake files which can't break the other build. Are you really using all those Daemon |
No, it's just meant to be kept in sync with the made-reusable code from: |
4340799 to
3eba6d5
Compare
4ad638b to
c725772
Compare
19d4e54 to
8a51eee
Compare
ecaccae to
a87e12d
Compare
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.