mkxp-z/libretro
刘皓 5a5fcd26c5
Delete copy constructor for stack_frame_guard and stack_frame
The copy constructors are causing problems when the `fiber.stack` vector
gets reallocated when its capacity is full, since when vectors are
reallocated, the elements are moved (or copied if there's no usable move
constructor) to the reallocated memory and then the original elements
are destroyed.

This premature calling of destructors leads to double-free and
use-after-free errors.

I fixed it by deleting the copy constructors and explicitly defining
move constructors.
2025-04-16 21:39:04 -04:00
..
.gitignore Change some of the nomenclature in libretro builds 2025-02-14 12:05:30 -05:00
core.info Change some of the nomenclature in libretro builds 2025-02-14 12:05:30 -05:00
link.T Change some of the nomenclature in libretro builds 2025-02-14 12:05:30 -05:00
Makefile Apply patches from https://github.com/mkxp-z/ruby in libretro builds 2025-04-10 14:00:32 -04:00
README.md Remove dependency on xxd 2025-02-27 23:32:30 -05:00
ruby-bindings.h Allow adjusting Ruby GC parameters in libretro builds 2025-03-21 11:56:45 -04:00
ruby-compat.patch Apply patches from https://github.com/mkxp-z/ruby in libretro builds 2025-04-10 14:00:32 -04:00
sandbox-bindgen.rb Delete copy constructor for stack_frame_guard and stack_frame 2025-04-16 21:39:04 -04:00

The build process for the libretro core is divided into two stages.

Stage 1

All the files produced by this stage are platform-agnostic, so you can run this build stage on any computer, regardless of which operating system or CPU architecture the libretro core is for.

Required software:

Go to the directory that this README.md is in and run this command, filling in the paths to WASI SDK, wasm-opt from Binaryen, wasm2c from WABT and ctags from Universal Ctags or Exuberant Ctags accordingly:

make WASI_SDK=/path/to/wasi-sdk WASM_OPT=/path/to/binaryen/bin/wasm-opt WASM2C=/path/to/wabt/bin/wasm2c CTAGS=/path/to/ctags

This will produce the directory "libretro/build/libretro-stage1".

Stage 2

This stage produces the actual core file.

Required software:

No software libraries are required other than the system libraries.

Go to the root directory of this repository and run:

meson setup build -Dlibretro=true
cd build
ninja