Conversation
c262e03 to
0ee1872
Compare
0ee1872 to
251b9ab
Compare
a22c699 to
d746c29
Compare
d746c29 to
fbbaa75
Compare
fbbaa75 to
586202a
Compare
slipher
left a comment
There was a problem hiding this comment.
Some things we aren't going to use that could be removed: MIPS, Android, and "zero-based sandbox".
| set(LD_EMUL "armelf_linux_eabi") | ||
| set(RESERVE_TOP "0x40002000") | ||
|
|
||
| if (YOKAI_CXX_COMPILER_CLANG_COMPATIBILITY) |
There was a problem hiding this comment.
You have two different spellings of CLANG_COMPATIBILITY here
There was a problem hiding this comment.
Not sure to get what you mean.
| endif() | ||
|
|
||
| # From SetUpLinuxEnvMips() from (root)/SConstruct. | ||
| if (YOKAI_TARGET_SYSTEM_LINUX_COMPATIBILITY AND YOKAI_TARGET_ARCH_MIPSEL) |
There was a problem hiding this comment.
Why is there mips stuff? We shouldn't waste our time on stuff we're not going to use.
There was a problem hiding this comment.
The reason why there was mips stuff is that when I ported it, I translated the scons files line by line by hand and I didn't want to miss anything, just in case.
I added a commit to remove that mips stuff from CMake.
| ) | ||
|
|
||
| if (YOKAI_CXX_COMPILER_MSVC) | ||
| list(APPEND PLATFORM_INPUTS "win/nacl_time.c") |
There was a problem hiding this comment.
The Windows one worked for me with MinGW. It's probably better to use this as the *nix compatibility layers might be lossy.
There was a problem hiding this comment.
Was it MinGW on Windows?
There was a problem hiding this comment.
Ah, maybe I just need -lwinmm. It builds but not link.
|
|
||
| if (YOKAI_CXX_COMPILER_MSVC) | ||
| list(APPEND PLATFORM_FLAGS "/D_CRT_RAND_S") | ||
| list(APPEND PLATFORM_FLAGS "/D_UNICODE") |
There was a problem hiding this comment.
These defines act for MinGW too. That's probably why you had to add explicit W suffixes to some function names.
There was a problem hiding this comment.
Didn't know MinGW could receive MinGW-style /X options. 🙂️
There was a problem hiding this comment.
Oh, maybe you meant to use -D 🤣️
There was a problem hiding this comment.
Well, the flag passing was also broken.
| "linux/nacl_semaphore.c" | ||
| ) | ||
|
|
||
| #TODO: kernel_version = list(map(int, platform.release().split('.', 2)[:2])) |
There was a problem hiding this comment.
Sure! 😅️
It's just that I translated from scons line by line and commented out things like that, with the TODO: flag as a generic flag to find them if I needed to review them later.…
| add_library(nrd OBJECT "nrd_xfer.c") | ||
| list(APPEND NRD_XFER_LIBS nrd) | ||
|
|
||
| if (NOT YOKAI_TARGET_SYSTEM_WINDOWS) |
There was a problem hiding this comment.
this should be NOT MSVC for the aliasing flag
| list(APPEND NRD_FLAGS "-fno-strict-aliasing") # This was only a C flag in build.scons | ||
| list(APPEND NRD_FLAGS "-Wno-missing-field-initializers") | ||
| string(REPLACE ";" " " NRD_FLAGS_STRING "${NRD_FLAGS}") | ||
| set_target_properties(nrd PROPERTIES COMPILE_FLAGS "${NRD_FLAGS_STRING}") |
There was a problem hiding this comment.
COMPILE_FLAGS is supposedly deprecated. Maybe if you use TARGET_COMPILE_OPTIONS this string replacement nonsense won't be needed?
| # sel_ldr binary | ||
| # TODO(robertm): see who really needs them and remove | ||
| if (YOKAI_TARGET_SYSTEM_WINDOWS) | ||
| # FIXME: Unused for now. |
There was a problem hiding this comment.
Probably it builds without that due to CMAKE_C(XX)_STANDARD_LIBRARIES.
| endif() | ||
|
|
||
| if (BUILD_NACL_LOADER AND YOKAI_TARGET_SYSTEM_WINDOWS) | ||
| option(FORCE_NO_TRUSTED_BUILD "Prevent use of trusted toolchain." OFF) |
There was a problem hiding this comment.
This doesn't seem to have any relevance when the build uses only one toolchain to begin with.
|
|
||
| # Using this optimization when building with GCC breaks the program on armhf: | ||
| # > Illegal instruction | ||
| if (NOT YOKAI_CXX_COMPILER_CLANG_COMPATIBILITY AND (YOKAI_TARGET_ARCH_ARMHF OR YOKAI_TARGET_ARCH_ARMEL)) |
There was a problem hiding this comment.
I think ARMEL is not really a valid target platform since the sandbox expects to be able to use a specific set up CPU instructions.
There was a problem hiding this comment.
armel is just armhf with hard-float being optional. In the end the armel topic is probably just the Android topic.
…-reorder disabled on armhf The -ftoplevel-reorder option breaks the build for armhf.
586202a to
fdff956
Compare
All of that was there because I didn't want to overlook anything when tranlasting from scons to cmake. I NUKED added commits to NUKE the MIPS support and the zero-based sandbox thing in CMake. The Android stuff, I'm less convinced. |
The only known working implementation is for i686 MSVC. - detection was already disabled and marked at not working with amd64 MSVC, - detection was already disabled on amd64 MinGW because amd64 Windows was tested, not just amd64 MSVC, - there is no MinGW implementation in the code, - this disables detection on MinGW explicitely whatever the architecture.
fdff956 to
c6430fd
Compare
Replay of:
GitHub doesn't allow me to re-open it…