diff --git a/.github/workflows/autobuild.yml b/.github/workflows/autobuild.yml index 7a188d3b..fde78fd5 100644 --- a/.github/workflows/autobuild.yml +++ b/.github/workflows/autobuild.yml @@ -364,12 +364,11 @@ jobs: cd build ninja mv libretro-mkxp-z.dll "$runner_temp"/retro-phase2 - mv "$runner_temp"/retro-phase2 . - uses: actions/upload-artifact@v4 with: name: libretro-mkxp-z.windows - path: retro-phase2 + path: ${{ runner.temp }}/retro-phase2 build-retro-phase2-linux: needs: build-retro-phase1 diff --git a/meson.build b/meson.build index dc8409bd..66481554 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,7 @@ project('mkxp-z', 'c', 'cpp', version: '2.4.2', meson_version: '>=0.56.0', default_options: ['cpp_std=c++14', 'buildtype=release']) host_system = host_machine.system() +host_endian = host_machine.endian() if get_option('retro') == false and host_system == 'darwin' error('\nThis Meson project no longer supports macOS. Please use the Xcode project instead.') @@ -58,6 +59,14 @@ if get_option('retro') == true endif retro_deps += cmake.subproject('libzip', options: libzip_options).dependency('zip') + retro_defines = [ + '-DWASM_RT_TRAP_HANDLER=mkxp_sandbox_trap_handler', + '-DMKXPZ_RETRO=1', + ] + if host_endian == 'big' + retro_defines += '-DWABT_BIG_ENDIAN=1' + endif + library( 'retro-' + meson.project_name(), dependencies: retro_deps, @@ -70,11 +79,8 @@ if get_option('retro') == true '-Wno-unused-variable', '-Wno-unused-but-set-variable', '-Wno-ignored-optimization-argument', - '-DWASM_RT_TRAP_HANDLER=mkxp_sandbox_trap_handler', - ], - cpp_args: [ - '-DMKXPZ_RETRO', - ], + ] + retro_defines, + cpp_args: retro_defines, link_args: [ host_system == 'darwin' ? '' : ('-Wl,--version-script=' + join_paths(meson.current_source_dir(), 'retro/link.T')), ], diff --git a/src/sandbox/sandbox.cpp b/src/sandbox/sandbox.cpp index 7b50829c..686c6f45 100644 --- a/src/sandbox/sandbox.cpp +++ b/src/sandbox/sandbox.cpp @@ -37,7 +37,6 @@ #define WASM_NULL 0 #define WASM_MEM(address) ((void *)&ruby->w2c_memory.data[address]) #define AWAIT(statement) do statement; while (w2c_ruby_mkxp_sandbox_yield(RB)) -#define VALIDATE_MALLOC(ptr) do { if (ptr == WASM_NULL || ptr >= ruby.w2c_memory.size) throw SandboxOutOfMemoryException(); } while (0) // This function is imported by wasm-rt-impl.c from wasm2c extern "C" void mkxp_sandbox_trap_handler(wasm_rt_trap_t code) {