support c++ tools on macos (#2063)

Running reference tests/decompiler should now be possible on macos
(arm). Most of the changes were just cleaning up places where we were
sloppy with ifdefs, but there were two interesting ones:
- `Printer.cpp` was updated to not use a recursive function for printing
lists, to avoid stack overflow
- I replaced xxhash with another version of the same library that
supports arm (the one that comes in zstd). The interface is C instead of
C++ but it's not bad to use. I confirmed that the extractor succeeds on
jak 1 iso so it looks like this gives us the same results as the old
library.
This commit is contained in:
water111
2022-12-22 17:12:05 -05:00
committed by GitHub
parent 98c2291102
commit 73561f10a3
36 changed files with 254 additions and 2050 deletions
+7 -1
View File
@@ -3,7 +3,8 @@
* Setup and launcher for the runtime.
*/
#ifdef __linux__
#include "common/common_types.h"
#ifdef OS_POSIX
#include <unistd.h>
#include <sys/mman.h>
@@ -129,7 +130,12 @@ void ee_runner(SystemThreadInterface& iface) {
if (EE_MEM_LOW_MAP) {
g_ee_main_mem =
(u8*)mmap((void*)0x10000000, EE_MAIN_MEM_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,
#ifdef __APPLE__
// has no map_populate
MAP_ANONYMOUS | MAP_32BIT | MAP_PRIVATE, 0, 0);
#else
MAP_ANONYMOUS | MAP_32BIT | MAP_PRIVATE | MAP_POPULATE, 0, 0);
#endif
} else {
g_ee_main_mem =
(u8*)mmap((void*)EE_MAIN_MEM_MAP, EE_MAIN_MEM_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE,