79 Commits
Author SHA1 Message Date
LibretroAdmin 7a3b7befdb Build with -ffunction-sections: 1796176 -> 1592424 bytes, 11.3% off
This core links whole vendored trees for the sake of a few entry points.
libspectrum calls BZ2_bzBuffToBuffDecompress and BZ2_bzDecompress*, and
nothing else in bzip2: its compression half and the FILE* API are dead.
Of libretro-common only the VFS, path and string helpers are used;
filestream_vscanf, filestream_copy and
fill_pathname_abbreviated_or_relative are not. Without -ffunction-sections
the linker's unit is the whole object file, so one live symbol keeps every
dead one beside it.

Trimming those functions out of the vendored sources would work and is the
wrong fix. Divergence between this tree's deps/libretro-common and
upstream is exactly what broke the six build-static jobs three commits
ago, and hand-editing bzip2's internals to split decompress from compress
buys the same problem in a second dependency. Give the linker per-symbol
granularity and let it decide instead of the source.

Dropped from the shared build, verified with nm: BZ2_hbMakeCodeLengths,
mainSort, fallbackSort, bzopen_or_bzdopen, filestream_vscanf,
filestream_copy, fill_pathname_abbreviated_or_relative. The export set is
unchanged - the same 47 retro_* symbols before and after, diffed
symbol for symbol.

Static-linking platforms get the compile flags but not --gc-sections: they
produce an archive and it is the frontend's link that resolves it, so the
sections are there for RetroArch's linker to use. The findstring guard on
SHARED keeps the link flag off emscripten, which sets no SHARED, and
theos_ios, which links through its own rules.
2026-08-11 18:06:00 +02:00
libretroadmin 8cce09e6af Fix upgrade builds broken by the UI removal: stale config.h kept USE_WIDGET
c6b73c1 removed USE_WIDGET from src/config_fuse.h, but fuse/config.h -
the file the compiler actually reads - is a build-time copy of that
template made by a rule with no prerequisites, so it is created once
and never refreshed. Every tree that had built any earlier commit
still had the old copy defining USE_WIDGET, which sent ui/ui.h:295
into the deleted ui/widget/widget.h and broke the build. make clean
does not remove the generated config either, so a clean rebuild in an
existing checkout failed the same way; only a fresh clone - the one
path that got tested - worked.

Three fixes, each closing a different layer of the hole:

  - ui/ui.h no longer references the deleted header under any
    preprocessor condition: the USE_WIDGET block is gone, along with
    the ui_widget_finish() macro and the ui_widget_init()/
    ui_widget_end() declarations and stubs, none of which had any
    remaining caller. Even a config that still defines USE_WIDGET now
    builds. fuse/menu.h (which included the deleted scaler.h) and
    fuse/menu_data.pl (which generated the deleted widget menu data)
    were the only other survivors referencing deleted files, verified
    by sweeping every include in every tracked source against the
    full 277-file deletion list; both are gone.

  - The config.h copy rules now list their templates as
    prerequisites, so a template change propagates into existing
    trees instead of applying only to fresh clones. Without this,
    no edit to src/config_fuse.h or src/config_libspectrum.h has
    ever reached an already-built checkout.

  - $(OBJS) now depends on both generated configs. They were fellow
    prerequisites of $(TARGET), which under -j lets objects compile
    concurrently with - and therefore possibly before - the config
    regeneration, racing stale against fresh. This also gives the
    dependency-tracking-free build the right semantic that a config
    change rebuilds every object.

Verified on the actual failure path and its neighbours: a tree built
at the border-modes commit then upgraded to master builds with make
alone and with make clean, a tree built before the __LIBRETRO__
removal upgrades the same way, a fresh clone builds, and forcing
-DUSE_WIDGET onto the compiler builds too since nothing consults the
symbol any more. The upgraded-tree binary is byte-identical to the
fresh-clone binary, and the full issue #176/#177 verification matrix
plus border modes, savestate round trip and machine boots produce
identical results to the pre-breakage build.
2026-08-11 07:11:32 +02:00
libretroadmin 5e3762d4e1 Remove __LIBRETRO__: this core only ever builds for libretro
Every one of the 46 __LIBRETRO__ conditionals in the tree guarded a
choice between "the libretro build" and "a build that cannot exist":
this repository has no other frontend, no configure script, and no way
to compile without the define. Keep the libretro side of each one,
delete the other, and stop defining the symbol in Makefile.libretro,
the 22 build/Makefile.* platform files, etc/mkmake.lua and
build/jni/Android.mk.

Everything was stripped mechanically with unifdef -D__LIBRETRO__; the
only hand edits are in fuse/peripherals/joystick.c, where the comment
above the now-unconditional joy_kempston enable described the deleted
condition, and libspectrum/snap_accessors.txt, where the %ifdef around
the TurboSound fields is gone so accessor.pl regenerates exactly the
stripped snap_accessors.c (verified: the regenerated file is
byte-identical).

What falls out:

  - machine.h/spectrum.h/periph.c/unittests.c: one
    spectrum_unattached_port signature (taking the port, for floating
    bus emulation) instead of two.
  - ay.c/ay.h/machine.h/szx.c/snap_accessors.*/z80.c: the TurboSound
    second AY and its AY2 snapshot chunk are simply part of the core.
  - joystick.c/settings.c/widget.c: the libretro joystick-mapping
    behaviour (frontend port wiring is authoritative, joy_kempston
    always enabled on snapshot load, no joystick_N_output defaults) is
    now the only behaviour, unconditionally.
  - snapshot.c/snapshot.h: the peripheral-override hook from ad7e52f
    is unconditional.
  - szx.c: the fixed-size savestate padding (0xFF tail and fake
    0xFFFFFFFF chunk) and AY2 chunk read/write are unconditional.

No functional change. The built core contains no __LIBRETRO__ string,
and the full verification matrix from issues #176 and #177 - Kempston
Mouse hotplug and Fuller joystick wiring with and without fastload,
option flips mid-autoload, all five border modes measured from the
framebuffer, machine boots, and a savestate round trip - produces
identical reset counts, port reads, framebuffer hashes and audio
sample counts to the build before this change.
2026-08-11 06:57:45 +02:00
LibretroAdmin a890516c6b Fix libnx build: do not set RARCH_INTERNAL for vendored libretro-common
The libnx platform block defines RARCH_INTERNAL for the whole build.
compat/strl.h reads that as "we are being compiled inside RetroArch's
source tree" and reacts by pulling in RetroArch's own config.h:

  #if defined(RARCH_INTERNAL) && defined(HAVE_CONFIG_H)
  #include "../../../config.h"
  #endif

That relative path only resolves in RetroArch's layout. Here
libretro-common is vendored under deps/, so it lands on deps/config.h and
the build stops:

  ./deps/libretro-common/include/compat/strl.h:39:10: fatal error:
    ../../../config.h: No such file or directory
  make: *** [deps/libretro-common/vfs/vfs_implementation.o] Error 1

The condition needs both macros, which is why this only shows up on
libnx: every other platform sets HAVE_CONFIG_H but not RARCH_INTERNAL,
so the include is skipped and the same sources compile.

Compile the vendored objects with RARCH_INTERNAL undefined via their own
pattern rule, leaving the rest of the build untouched - the core's own
objects still see the platform's flags exactly as before. Verified by
compiling all twelve vendored sources with -DRARCH_INTERNAL
-DHAVE_CONFIG_H (the libnx combination) and by confirming the rule fires
only for deps/libretro-common. The unix build is unchanged, warning set
and oracles included.
2026-07-30 21:14:32 +02:00
Eric Warmenhoven dc116e51af ios/tvos: properly set min supported version (#148) 2024-10-21 14:38:40 -07:00
Ploggy 4d511d7fc3 [WiiU] Aroma CFW Compatibility (#144)
* Update Makefile.libretro

* Update Makefile.libretro
2024-06-28 15:53:03 -07:00
salvacam 6f6687546c Add OpenDingux build target 2022-04-02 01:44:57 +02:00
unknown fde13fc7ac PS3/PSL1GHT build fix 2022-02-12 12:32:54 +01:00
Autechre 4f6a1560c6 Merge pull request #116 from jdorigao/rpi_64
Added rpi3/4_64 to makefile
2021-10-13 18:21:08 +02:00
Salvador 9958d13a31 Miyoo (#119)
* add Miyoo target

* add Miyoo target
2021-10-13 18:20:40 +02:00
Juliano Dorigão d674f8f4fb Added rpi3/4_64 to makefile 2021-09-11 16:36:38 -04:00
Poligraf 91cae022a3 add retrofw target 2021-08-03 22:23:27 +12:00
twinaphex 1bcb6ab1ce Add ios targets 2021-03-18 06:57:48 +01:00
twinaphex 6164ae257c Fix Mac builds 2021-01-28 17:21:06 +01:00
liberodark 2f25b38a44 Add armv8 support 2021-01-13 16:59:46 +01:00
Autechre 128767a213 Update Makefile.libretro 2020-12-25 01:35:21 +01:00
twinaphex c13251006f Try to see if this is actually necessary 2020-12-24 15:08:16 +01:00
Twinaphex ef603d1659 Merge pull request #76 from yoshisuga/tvos_support
(tvOS) support building with tvOS SDK
2020-02-07 12:00:48 +01:00
Yoshi Sugawara a0b3968f0b (tvOS) support building with tvOS SDK 2019-09-14 01:24:18 -07:00
Aaron Kling 97e2b12a86 libretro: fix wiiu compile 2019-08-17 11:27:54 -05:00
Aaron Kling 53656280e7 libretro: allow mingw cross compile 2019-08-17 11:27:49 -05:00
funbars 96853b281e makefile cleanup 2019-05-31 11:45:40 -05:00
Ryan 'Swingflip' Hamlin 530c562ad4 Added A7A7 2018-11-04 22:13:45 +00:00
leiradel 5148386d80 Added libnx support 2018-10-03 21:17:54 +01:00
Andre Leiradella 9e5c770aaa Updated cross-makefiles 2018-09-09 16:14:09 +01:00
not6 120b26ed22 add bigendian flags 2017-11-28 00:20:11 +01:00
Yoshi Sugawara aa6954e40a Add ios-arm64 build target; Added forward declarations for a couple compression related methods needed to fix compile issues; fixing zlib header for ios-arm64 2017-07-23 19:09:29 -10:00
twinaphex 144aadb1b0 (3DS) Add these parameters 2017-06-13 13:56:54 +02:00
Andre Leiradella 5973157a75 Added required flags to the Vita platform 2017-06-11 23:03:57 +01:00
Andre Leiradella e558a11337 Add the 3DS and Vita platforms; fix the Emscripten build 2017-06-11 22:42:59 +01:00
aliaspider f834c9b9d0 (ngc/Wii/WiiU) buildfix for devkitpro r29. 2017-01-23 19:21:17 +01:00
Gregor Richards 39ab5d570f No need to recalculate git version, it was already in version.c! 2016-12-09 19:16:54 -05:00
Gregor Richards f758a29420 Report git version with library_version 2016-12-09 18:35:15 -05:00
twinaphex 6cda7ed2fc Add wiiu target 2016-11-07 02:45:38 +01:00
Andre Leiradella 12b2072211 Make Makefile.libretro accept platform=ps3_ppc 2016-09-10 19:14:16 +01:00
Andre Leiradella 894adecbc1 Removed all built-in rules instead of just the yacc and flex ones 2016-09-06 23:45:53 +01:00
Andre Leiradella a3d9c46435 Fixed GNU make calling yacc and/or lex because of its implicit rules 2016-09-06 23:06:38 +01:00
Andre Leiradella 0ef1365ca2 update to make the core build for vita 2016-08-27 19:33:24 +01:00
vanfanel f0167949dd Added Rpi3 platform 2016-05-24 14:23:19 +02:00
vanfanel 624f57d486 rpi2 and rpi1 platform definitions corrections 2016-02-27 03:18:39 +01:00
vanfanel 492232f8d6 Add rpi 2 platform definitions 2016-02-27 03:11:07 +01:00
twinaphex c87195323b Add iOS 9 rules 2015-10-16 03:06:42 +02:00
Andre Leiradella 1f83ca5f12 removed vita handling since there's a makefile specifically for it 2015-08-31 21:44:17 -03:00
Andre Leiradella f2b297511f added vita_arm platform 2015-08-31 21:17:07 -03:00
twinaphex f02256a583 (Vita) Add target - not finished 2015-08-31 23:17:40 +02:00
twinaphex bb17b2e3e0 Remove Emscripten rule 2015-08-29 06:01:00 +02:00
Andre Leiradella bad88268df added makefiles for osx 2015-08-17 00:10:53 -03:00
Andre Leiradella 2ad8fdc461 fixed included makefile names 2015-08-16 22:37:32 -03:00
Andre Leiradella 94306080a9 moved to latest cross-makefiles 2015-08-13 21:08:08 -03:00
Andre Leiradella 54bbd19a1d update to latest makefiles 2015-08-02 19:58:37 -03:00