Commit graph

245 commits

Author SHA1 Message Date
刘皓
70c5b3dad4
Fix undefined symbol error in libretro Nintendo 3DS build 2025-03-30 00:03:03 -04:00
刘皓
afec0dc50d
Use -mword-relocations -fno-optimize-sibling-calls in libretro PlayStation Vita builds
The Vita builds of RetroArch and some libretro cores use these two
flags, supposedly to fix relocation-related bugs.

(cherry picked from commit 3c43cd5747b19bd4d9c0202fec1a68677ddbd5af)
2025-03-29 22:23:39 -04:00
刘皓
5754c8b4f1
Use -march=armv6k in libretro Nintendo 3DS builds 2025-03-29 22:17:03 -04:00
刘皓
81b94d1498
Remove dependency on SDL headers in libretro builds
I'd already removed the SDL static libraries from libretro builds for
portability, but kept the headers to make it easier to port the codebase
to libretro. Eventually it was time to stop using the SDL headers as a
crutch.
2025-03-29 12:37:07 -04:00
刘皓
b9e54fbb28
Fix libretro builds with CMake 4 2025-03-27 23:02:49 -04:00
刘皓
eeef9ff943
Don't make sandbox_malloc into a coroutine
Okay, the coroutine implementation of `sandbox_malloc` is clearly
broken. It would be working if Asyncify instrumented the `memory.grow`
WebAssembly instruction, but it doesn't instrument it.

This commit reverts commit 42c4ff9497 and
also increases the default VM memory allocation from 64 MiB to 96 MiB to
account for the lack of ability to increase the memory allocation at run
time. I'll find some new way to implement increasing the memory
allocation later.
2025-03-18 13:49:41 -04:00
刘皓
54e819f89c
Remove PortableGL support
I was planning on using PortableGL as a software implementation of
OpenGL, but it's really slow (at least when compared to actual 2D
graphics software renderers). I'll have to actually add a separate
rendering backend for software rendering later instead of trying to
emulate OpenGL in software.
2025-03-16 22:15:24 -04:00
刘皓
96e44e285f
Prevent type conflicts between Khronos OpenGL headers and PortableGL headers 2025-03-15 01:29:12 -04:00
刘皓
2cd8202af3
Convert GLSL shaders to PortableGL's shader format
PortableGL supports shaders, but requires them to be compiled
ahead-of-time to C or C++.

I'll write a compiler later to translate from GLSL to this format
automatically at build time.
2025-03-13 16:16:17 -04:00
刘皓
969ef0612f
Start implementing PortableGL bindings for libretro builds 2025-03-11 14:07:20 -04:00
刘皓
497d6788c6
Use Khronos OpenGL headers in libretro builds instead of SDL OpenGL headers
SDL disables OpenGL headers when building for iOS and tvOS, but that
causes our builds to fail. I'm getting conflicting answers on whether or
not OpenGL is supported on iOS and tvOS, but it's the libretro
frontend's job to care about this, not mine. Regardless, I'm gonna need
these OpenGL headers for software rendering on platforms with no OpenGL
support, so I can't tolerate the headers being disabled.
2025-03-10 17:31:39 -04:00
刘皓
ccceeeb75b
Merge branch 'libretro-compat' into libretro 2025-03-09 21:23:50 -04:00
刘皓
549193cb1f
Remove -fno-optimize-sibling-calls from Ruby in libretro builds
The only reason why WABT suggests this flag be used is because it
guarantees that infinite recursion will crash the program instead of
running in an infinite loop.

Honestly, who cares? It's not like either of these things are supposed
to happen, so from the viewpoint of the end user, they're basically the
same thing. I think we can afford to deviate from the WebAssembly
Specification here if it means allowing the compiler to do more
optimizations.
2025-03-08 14:21:08 -05:00
刘皓
9677ab899b
Merge branch 'libretro-compat' into libretro 2025-03-07 21:01:48 -05:00
刘皓
c25175778e
Prevent PhysFS from using lstat() on platforms where it's not supported 2025-03-07 12:10:26 -05:00
刘皓
f810489a15
Enable LTO only for libruby in libretro PlayStation 3 build 2025-03-07 11:27:27 -05:00
刘皓
516c706a66
Convert all CMake subprojects' object libraries into static libraries
CMake object libraries keep building with position-independent code
enabled even when it's explicitly disabled! We do, in fact, have to
build with position-independent code disabled on some targets, such as
PlayStation Vita, since some targets support position-independent code.

CMake static libraries don't seem to forcibly enable
position-independent code, so I've converted all the object libraries
into static libraries and added the new static libraries as dependencies
in Meson.
2025-03-06 22:55:26 -05:00
刘皓
740dfd51c9
Start integrating font code into libretro builds 2025-03-04 18:52:20 -05:00
刘皓
1ae5e0e4a0
Merge branch 'libretro-compat' into libretro 2025-03-04 00:18:51 -05:00
刘皓
0f684b5416
Move libretro Ruby WASI build into a separate static library 2025-03-04 00:17:14 -05:00
刘皓
a37997a6ac
Add FreeType to libretro builds 2025-03-03 23:26:57 -05:00
刘皓
f3419a9c16
Merge branch 'libretro-compat' into libretro 2025-03-03 12:08:13 -05:00
刘皓
8d574dfe64
Merge branch 'misc-fixes' into libretro-compat 2025-03-03 10:46:44 -05:00
刘皓
7182a57fe1
Use std::ios::binary mode in embedtool.cpp
Required for it to work properly on Windows.
2025-03-03 10:41:01 -05:00
刘皓
d1230aab74
Merge branch 'libretro-compat' into libretro 2025-02-28 00:42:05 -05:00
刘皓
99d4748227
Merge branch 'misc-fixes' into libretro-compat 2025-02-28 00:41:06 -05:00
刘皓
5be1f6962e
Explicitly request 7-character Git hash in meson.build
It seems the length of the hash generated by
`git rev-parse --short HEAD` is nondeterministic. GitHub Actions
generates 7-character hashes, while my computer currently generates
8-character hashes. To be consistent, I'm forcing the hashes to be 7
characters long.
2025-02-28 00:40:32 -05:00
刘皓
5c0e06eaf4
Use vcs_tag to get Git version instead of run_command
This way Meson will automatically keep the Git hash updated as you make
new Git commits, rather than forcing you to reconfigure the build again
every time you make a new commit to keep the commit hash updated.

(cherry picked from commit b9bb3535ae)
2025-02-27 23:41:40 -05:00
刘皓
66152bf5c5
Merge branch 'libretro-compat' into libretro 2025-02-27 23:34:08 -05:00
刘皓
20f806abef
Remove dependency on xxd 2025-02-27 23:32:30 -05:00
刘皓
ecc5cb5de3
Merge branch 'misc-fixes' into libretro-compat 2025-02-27 22:56:24 -05:00
刘皓
f162e8a494
Replace xxd with a custom executable
This removes the need to have xxd installed and provides a portable way
to specify the name of the output array (xxd has an `-n` option for
this, but it isn't present in older versions of xxd), which helps reduce
the possibility of symbol conflicts in libretro builds and also prevents
portability issues since the name of xxd's output array depends on the
relative path to the input file, which can break if Meson changes the
structure of the build directory or if the user sets the build directory
to a different location.

Also, this custom executable declares the array as const so that it goes
into the read-only data section of the binary instead of the data
section.
2025-02-27 22:55:22 -05:00
刘皓
ba68b8fa5b
Move libretro headers and SDL headers to meson.build 2025-02-27 20:39:17 -05:00
刘皓
e17abc9b6c
Enable -ffunction-sections -fdata-sections -Wl,--gc-sections in libretro builds 2025-02-27 18:38:52 -05:00
刘皓
01fce50d97
Remove most of the #ifndef MKXPZ_RETRO macros in graphics-related code 2025-02-27 12:19:34 -05:00
刘皓
9f33a0acea
Implement image loading in libretro builds 2025-02-25 12:53:57 -05:00
刘皓
8ed8dd14ee
Add stb_image and PortableGL to libretro builds 2025-02-24 23:22:00 -05:00
刘皓
2029539ece
Replace pixman with pixman-region in libretro builds 2025-02-24 17:13:25 -05:00
刘皓
3506ce6cc6
Make sure pixman inherits compiler flags in libretro builds 2025-02-24 16:44:00 -05:00
刘皓
81c272cb9f
Add libpng and pixman to libretro builds 2025-02-24 15:32:02 -05:00
刘皓
4a810730f1
Merge branch 'libretro-compat' into libretro 2025-02-22 23:16:58 -05:00
刘皓
07780d4702
Require LTO when building for PowerPC 2025-02-22 23:16:37 -05:00
刘皓
9ed11ecffa
Use libretro's PlayStation 3 Docker image instead of ScummVM's 2025-02-22 16:04:51 -05:00
刘皓
8a8860912a
Merge branch 'libretro-compat' into libretro 2025-02-21 23:56:52 -05:00
刘皓
9e4a221240
Fix many, many compilation errors in libretro PlayStation 3 builds 2025-02-21 14:06:28 -05:00
刘皓
f8d5fc06f5
Disable PIC in static libretro builds
Apparently Vita SDK doesn't support PIC. It throws "Invalid relocation
type 25!" while creating the .self file when building RetroArch.
2025-02-21 00:17:01 -05:00
刘皓
6cbf1b34ca
Move the FLAC fix for Vita SDK into meson.build 2025-02-20 19:20:01 -05:00
刘皓
8559091afd
Fix mpg123-related libsndfile linking error in libretro Vita SDK builds 2025-02-20 18:36:02 -05:00
刘皓
fc26ac927b
Add a pthreads shim for libretro builds on platforms without pthreads 2025-02-20 12:49:36 -05:00
刘皓
20c8f6d463
Get Graphics::update() working (probably) in libretro builds 2025-02-19 18:16:08 -05:00