mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-09-10 12:02:53 +02:00
Enable prelinking in static libretro builds
This commit is contained in:
parent
157689225d
commit
4fdb7316b2
5 changed files with 28 additions and 7 deletions
10
.github/workflows/autobuild.yml
vendored
10
.github/workflows/autobuild.yml
vendored
|
@ -895,7 +895,7 @@ jobs:
|
|||
echo "endian = 'little'" | tee -a ~/cross.ini
|
||||
echo '--------------------------------------------------------------------------------'
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=false -Dretro_phase1_path=retro/build/retro-phase1
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=true -Dretro_phase1_path=retro/build/retro-phase1
|
||||
|
||||
- name: Build core
|
||||
run: |
|
||||
|
@ -961,7 +961,7 @@ jobs:
|
|||
echo "endian = 'big'" | tee -a ~/cross.ini
|
||||
echo '--------------------------------------------------------------------------------'
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=false -Dretro_phase1_path=retro/build/retro-phase1
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=true -Dretro_phase1_path=retro/build/retro-phase1
|
||||
|
||||
- name: Build core
|
||||
run: |
|
||||
|
@ -1024,7 +1024,7 @@ jobs:
|
|||
echo "endian = 'little'" | tee -a ~/cross.ini
|
||||
echo '--------------------------------------------------------------------------------'
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=false -Dretro_phase1_path=retro/build/retro-phase1
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=true -Dretro_phase1_path=retro/build/retro-phase1
|
||||
|
||||
- name: Build core
|
||||
run: |
|
||||
|
@ -1089,7 +1089,7 @@ jobs:
|
|||
echo "endian = 'big'" | tee -a ~/cross.ini
|
||||
echo '--------------------------------------------------------------------------------'
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=false -Dretro_phase1_path=retro/build/retro-phase1
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=true -Dretro_phase1_path=retro/build/retro-phase1
|
||||
|
||||
- name: Build core
|
||||
run: |
|
||||
|
@ -1217,7 +1217,7 @@ jobs:
|
|||
echo "endian = 'little'" | tee -a ~/cross.ini
|
||||
echo '--------------------------------------------------------------------------------'
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=false -Dretro_phase1_path=retro/build/retro-phase1
|
||||
CLICOLOR_FORCE=1 meson setup build --cross-file ~/cross.ini --buildtype release -Db_lto=true -Dretro_phase1_path=retro/build/retro-phase1
|
||||
|
||||
- name: Build core
|
||||
run: |
|
||||
|
|
10
meson.build
10
meson.build
|
@ -7,6 +7,15 @@ is_retro = get_option('retro_phase1_path') != ''
|
|||
is_emscripten = host_system == 'emscripten'
|
||||
core_is_static = host_system == 'bare' or host_system == 'none'
|
||||
|
||||
# Meson for some reason does not support prelinking when using non-Apple Clang even though it's supported by Clang. Remove the Darwin and Clang check once Meson gets Clang prelinking support.
|
||||
compiler_id = meson.get_compiler('cpp').get_id()
|
||||
is_clang = compiler_id == 'clang' or compiler_id == 'armclang' or compiler_id == 'clang-cl'
|
||||
core_is_prelinked = core_is_static and (host_system == 'darwin' or not is_clang)
|
||||
|
||||
if is_retro and core_is_static and not core_is_prelinked and get_option('b_lto') == true
|
||||
error('\nCannot use LTO on this platform.')
|
||||
endif
|
||||
|
||||
if not is_retro and host_system == 'darwin'
|
||||
error('\nThis Meson project no longer supports macOS. Please use the Xcode project instead.')
|
||||
endif
|
||||
|
@ -297,6 +306,7 @@ if is_retro
|
|||
cpp_args: ['-Wno-unused-command-line-argument'] + retro_cppflags + retro_defines,
|
||||
link_args: retro_link_args,
|
||||
gnu_symbol_visibility: 'hidden',
|
||||
prelink: core_is_prelinked,
|
||||
install: true, # Prevents Meson from creating thin archives; see https://github.com/mesonbuild/meson/issues/9479
|
||||
include_directories: [
|
||||
include_directories('.'),
|
||||
|
|
|
@ -41,7 +41,7 @@ No software libraries are required other than the system libraries.
|
|||
Go to the root directory of this repository and run:
|
||||
|
||||
```
|
||||
meson setup build -Dretro=true -Dretro_phase1_path=path/to/retro-phase1
|
||||
meson setup build -Dretro_phase1_path=path/to/retro-phase1
|
||||
cd build
|
||||
ninja
|
||||
```
|
||||
|
|
|
@ -4,4 +4,4 @@ url = https://github.com/madebr/mpg123
|
|||
revision = 45fbaaeb00072d689b9c2ac4b7d109343f30abee
|
||||
depth = 1
|
||||
patch_directory = mpg123
|
||||
diff_files = mpg123-emscripten-endian.patch, mpg123-intrinsics.patch, mpg123-libsyn123.patch, mpg123-offset.patch, mpg123-signal.patch
|
||||
diff_files = mpg123-compat-str.patch, mpg123-emscripten-endian.patch, mpg123-intrinsics.patch, mpg123-libsyn123.patch, mpg123-offset.patch, mpg123-signal.patch
|
||||
|
|
11
subprojects/packagefiles/mpg123-compat-str.patch
Normal file
11
subprojects/packagefiles/mpg123-compat-str.patch
Normal file
|
@ -0,0 +1,11 @@
|
|||
# Removes the duplicate inclusion of compat_str.c because it results in duplicate symbol errors when building a static libretro core.
|
||||
|
||||
--- a/ports/cmake/src/compat/CMakeLists.txt
|
||||
+++ b/ports/cmake/src/compat/CMakeLists.txt
|
||||
@@ -8,6 +8,3 @@ add_library(${TARGET}_dl OBJECT
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/compat/compat_dl.c")
|
||||
set_target_properties(${TARGET}_dl PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
-add_library(${TARGET}_str OBJECT
|
||||
- "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/compat/compat_str.c")
|
||||
-set_target_properties(${TARGET}_str PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
Loading…
Add table
Reference in a new issue