Built with ffmpeg 8, libaom 3.13, x265 4.1, glibc 2.43 and clang 21,
five lanes failed on the 26.04 runners:
- AV1 fixtures: a monochrome sequence comes out full range with no
matrix whatever is asked for; the oracle takes the colour ffprobe
reads instead of assuming it.
- Preview audio oracle: ffmpeg 8 leaves a timestamp gap at every seam
of a -stream_loop copy, which the mixer honours and ffmpeg's raw
decode does not. trailing_large loops its picture and encodes its
sound as one track.
- rh265 multi-slice oracle: x265 4.1 writes unreadable slice headers
when two slices are encoded on several threads; those cases encode
on one worker.
- vkms: the kernel follows the runner's own release, its modules may
sit under /usr/lib/modules, and modules-extra is fetched only where
it exists.
- clang -std=c89 -pedantic: glibc's const-generic strchr/strstr under
_GNU_SOURCE are _Generic; -Wno-c11-extensions goes wherever
-Wno-c99-extensions already does.
ci_paths filters a file at the top of a samples tree by its own path.
rh264 and rh265 lose the parameters no instantiation reads, the 8-bit
H.264 kernels mark the depth they ignore, and the AV1 WebM fixtures
leave out the MP4 box writer they never use.
The SPA headers on ubuntu-latest now declare in for loops
(spa/pod/compare.h, spa/param/audio/layout-types.h), which -std=c89
rejects outright; reading them as system headers only lifts -pedantic.
The three PipeWire objects take -std=gnu99 after the lane's -std=c89,
and keep -Werror=declaration-after-statement for their own code.
MinGW hides float math declarations under strict C89 although its runtime supplies the functions. Force-include scoped declarations in the Win32 C89 lane so viewport rounding and matrix math retain their float return ABI. Keep strict C89 diagnostics; the GNU89 alternative accepts inline and is not used.
Give the three bundled D3DKMDT rotation helpers internal linkage to avoid duplicate definitions across C89 translation units. Add actual runtime and two-unit linkage checks plus seven rejected C99 syntax probes.
Validated through local CI on native Windows/GDB and MinGW/Wine, a fresh complete C89 frontend build, and twelve actual HEVC movie-window frames against independent FFmpeg RGB patches: 796 points, maximum channel error 3, no failures. The previous presentation had 632 failing points.
The PipeWire audio, microphone and camera drivers use positional
initializers for their event tables, plain loops in place of compound
literals and SPA_FOR_EACH_ELEMENT_VAR, and declarations at block start,
so they compile as C89. Under C89_BUILD the SPA and PipeWire include
directories are read as system headers and given __inline__, since
those headers are C99 and outside our control.
The linux-c89 job installs libpipewire-0.3-dev, so configure enables
the PipeWire drivers there and every one of their sources is held to
-std=c89 in CI.
* CI: run the qemu sinc kernel tests side by side
The four NEON sinc tests ran one after another under qemu-user on the
aarch64, aarch64+crc and armv7 legs, five to six minutes a leg, with
the runner's other CPUs idle. Each is one single-threaded qemu
process, so they now run at once, and each one's output is printed
when it is done. A failing test still fails the step.
On CI the step went from 300s to 102s on aarch64, 329s to 169s on
aarch64+crc and 318s to 249s on armv7, where one test alone sets most
of its length.
* tools/tsan-samples.sh: build each suite with every CPU
The suites were built one compile at a time. Built with -j on four
CPUs, the 68 directories in the list took 29s instead of 77s, and none
that builds without -j failed with it. The suites themselves still run
one at a time, so on CI the whole step went from 737s to 622s.
* views e2e: under Wine, each worker gets a prefix of its own
Cases run side by side in one prefix share its wineserver and moved
each other's pointer, so the Wine cases ran one at a time. Each worker
now takes a copy of the prepared prefix, and Wine runs four cases at
once like Xvfb.
On CI the D3D11 and D3D12 cases went from 1457s to 479s, all 120
passing; the pointer cases passed in three more runs on four CPUs.
* CI: one gl harness job per build, and one job for the wait checkers
The gl harness ran as 13 jobs, one per driver, API and sanitizer, but
the build depends only on the API and the sanitizer: each job set up a
runner, installed the same packages and built the same tree as two
others before its one or two minutes of harness. It now runs as 6
jobs, one per build, each running the harness on every driver that
build serves. Every driver runs even when one before it fails.
The three wait and teardown checkers, each under a minute of work,
ran as three jobs; they now share one, every checker running even
when one before it fails.
On CI these 16 jobs became 7, and 27.1 runner-minutes became 24.5.
* CI: MSYS2 installs Qt's base package only
The MSYS2 lanes installed about 40 Qt 6 modules, though configure
reports Qt support disabled on all four of them, so none of it is
built.
qt6-base still brings in the libraries configure does find (FFmpeg,
SDL2, FreeType, fontconfig, libass, glslang, SPIRV-Tools, OpenSSL).
The MinGW packages fetched drop from 198 (597MiB) to 152 (319MiB). On
CI the install steps of the four lanes went from 772s to 523s, and
configure found the same libraries on each.
* CI: sanitizer and debug builds of the tree use -g1
The samples moved to -g1 in 21635dd1, but every DEBUG=1 build of the
tree still took the Makefile's -O0 -g: the gl and Vulkan harness
sanitizer builds, pace-shadow, the TSan harness, the autoconf
sanitizer matrix and the C89 debug build. A sanitizer report needs
only line tables, which -g1 keeps.
Those jobs now set CFLAGS and CXXFLAGS to -O0 -g1 in the environment.
Where configure sees them it writes them into config.mk, and where
only make does, the Makefile's CFLAGS ?= takes them; either way they
replace DEBUG=1's -O0 -g and the Makefile's own flags are still
added, which they would not be from make's command line. The
threaded-video harness takes its compile line from the tree's, so its
run step sets the same. The one-off -O1 -g test compiles in the
workflows and the companion test scripts use -g1 as well. The Makefile
default is unchanged for local debug builds.
The ASan+UBSan DEBUG=1 build, from an empty cache on four CPUs here:
ccache 83MB -> 55MB, objects 530MB -> 424MB, 84s -> 80s. The gl
harness passed on that build, and an ASan report from a -g1 binary
still names the file and line.
* CI: print ccache's statistics in every job that keeps a cache
Only 7 of the 34 jobs that restore a ccache printed its statistics, so
for the rest a cold or missed cache was invisible. Each now prints
ccache -sv before saving, including the direct and preprocessed hit
counts, and a failure to print does not fail the job.
* Makefile, Makefile.webos: GIT_VERSION for version_git.c only
-DGIT_VERSION=<hash> went on every file's command line. ccache's direct
mode hashes the command line, so each new commit missed it for every
file, and CI's restored caches only ever hit after running the
preprocessor again: about 2.5% of hits were direct. Only version_git.c
reads the macro; the rest test HAVE_GIT_VERSION, which stays global.
Makefile.webos has its own compile rules and gets the same change.
On CI, with the cache of the commit before, the ASan+UBSan build had
418 of 418 hits direct.
* CI: the cross-arch ccache keys name their architecture
The retro-atomic-cross and crc32-cross legs shared one cache key per
commit, so only one leg's cache was saved ("Unable to reserve cache
... another job may be creating this cache") and the next run's legs
all restored whichever architecture won. Each leg now saves its own.
* CI: prune superseded ccache entries
Master pushes save each job's ccache under a key ending in the commit,
and only the newest per job is ever restored. Upstream's 10GB store
held 256 entries: 61 newest-per-job (4.24GB), 195 superseded (6.46GB),
and 2.3GB of other caches. Least recently used went first, so the
newest cache of a workflow that had not run for about four hours was
gone by its next run, which then built cold.
A workflow on each master push and hourly deletes every ccache entry
keyed on a commit that a newer one of the same job on the same branch
replaces. Other caches are left to GitHub's own eviction.
* CI: MXE builds keep a ccache
The two MXE cross builds compiled RetroArch from nothing on every run.
Their images ship ccache, so they now restore and save one like the
Linux jobs, with the compilers wrapped at configure time.
On CI, with the cache of the commit before, the compile went from 154s
to 18s on x64 and 166s to 11s on i686. A run with no cache at all is
slower than before, about 250s, as is any first build through ccache.
* CI: console builds keep a ccache
Switch, PS Vita, Wii, GameCube, DOS and the macOS PowerPC cross builds
compiled every file on every run. Their images run actions/cache but
ship no ccache, so the job installs it, and a small script reads CC
and CXX from the platform Makefile with the job's own variables and
runs make with both wrapped. The PowerPC legs each keep a cache of
their own. As in the Linux jobs, the cache is capped at 250MB, its
statistics are zeroed after the restore, and it is saved on master
pushes only. Installing ccache is retried and best effort: without it
the script runs plain make. The PS Vita and Wii Salamander builds,
which run first, are left as they were.
On CI, with the cache of the commit before:
PS Vita 120s -> 4s Switch 84s -> 2s
Wii 50s -> 9s GameCube 44s -> 9s
DOS 49s -> 4s macOS PowerPC 116s -> 2s
With no cache at all most took 5-30s longer than before; PS Vita took
148s longer.
PS2, RS90 and RetroFW are left out: their compiles did not go through
ccache this way. Miyoo is too: it hit every compile but went only from
50s to 38s, about what installing ccache costs.
* CI: webOS builds keep a ccache
The webOS job builds three configurations with make clean between
them, each from nothing. It now sets up ccache and wraps the compilers
like the console jobs.
On CI, with the cache of the commit before and before Makefile.webos
kept the commit hash to version_git.c, the three compiles went from
110s to 53s.
The compile line searches -I., libretro-common/include, deps and the
other in-tree dirs first, then pkg-config's paths, then the absolute
dirs configure found on the system (/usr/local/include on the BSDs),
so a same-named header installed on the system cannot stand in for one
of ours. tools/include_order_check.sh plants colliding headers in both
kinds of system path and compiles retroarch.c against them.
configure generates the Wayland protocol sources, so a tree configured
before a protocol was added has no way to make the new object and stops
on a missing file. config.mk depends on the generator script too, so
make asks for the reconfigure that produces it, as it already does for
configure and qb.
Every claim the surface work rests on is a statement about numbers
nobody was counting: a streaming frame allocates nothing, copies
nothing and creates no texture; an overlay page switch uploads
nothing; the direct path queues nothing. gfx_instrument.c gives those
numbers - texture loads, in-place updates and the refusals, unloads,
wrapper posts and how many of them allocated a node, completions,
synchronous commands, surface creations and slot bytes, submits by
result, animation frames decoded in place against copied out of a
canvas, overlay uploads and page switches - counted where each thing
happens. They are relaxed atomics and nothing there logs, allocates
or waits, so a counted path keeps the timing that makes its numbers
worth having. GFX_INSTRUMENT=1 builds them; without it no counter
exists and no call to one survives the preprocessor.
The threaded-video harness reads them in its surface and overlay
lanes, printing what a run cost on the driver it is pointed at and
holding the budgets the paths are written to: no post may allocate,
no submit may copy into a slot, a streaming surface keeps one
texture, and a page switch never uploads. A submit a driver drops
because its own staging is still in flight counts as neither an
update nor a load, which is the latest-frame policy working rather
than a miss. The thumbnail animation sample gains the same kind of
lane for the decode side.
metal.m was written against ARC, but only the command-line Makefile
(per-file -fobjc-arc) and the Xcode configurations inheriting
BaseConfig.xcconfig compile it that way: the griffin_objc.m unity TU
takes whatever mode the enclosing configuration sets, and the QT,
Steam, App Store and CI configurations of RetroArch_Metal.xcodeproj
set no CLANG_ENABLE_OBJC_ARC, so they build the driver as MRC -- a
mode where __weak is a hard compile error and __bridge_retained /
__bridge_transfer silently compile to no-op casts, turning every
ownership transfer in the file into a use-after-free (drawables,
command buffers and encoders stored from autoreleased factory
results and read after the pool drains; the overlay image array) or
a leak (all RARCH_STRUCT_ASSIGN teardown, the metal_free /
unload_texture / raster_font_free handle transfers, every [X new]
temporary, the BufferChain tail trim, and the alloc'd instance on
every failed init). Route every transfer through the RARCH_* ARC/MRR
ownership layer in libretro-common's defines/cocoa_defines.h --
extending it with the value and transfer forms this file needs
(RARCH_AUTORELEASE_R, RARCH_RELEASE_NIL, RARCH_ASSIGN, the bridge
transfer forms, RARCH_STRUCT_ASSIGN, RARCH_WEAK,
RARCH_RETURN_INIT_FAILURE), documented next to their definitions --
give every class a dealloc that releases
its objects under MRC, release self on init-failure paths, wrap the
driver entry points that run on the video thread outside
renderFrame's pool in @autoreleasepool, and spell out the ownership
of the Texture and BufferNode properties MRC would synthesize as
assign. This also fixes three bugs present under ARC: FrameView
teardown never freed the shader chain's bridge-retained engine slots
or the calloc'd shader struct, STRUCT_ASSIGN on the __strong HDR
texture ivars pinned an extra reference per texture, and
MetalRaster's init-failure path leaked the font driver allocation.
Fetch viewport readback rows in bounded chunks instead of one
getBytes call per scanline: readBackBuffer and readViewportHDR pull
as many whole rows per Metal call as fit in a 1 MiB scratch buffer
(stack for small captures), collapsing the 1000+ API calls per 1080p
frame the recording path pays through read_viewport into a handful
while preserving the issue #19038 overscan clamping exactly. Stop
dispatching non-mipmapped texture loads to the video thread: only
mipmap generation encodes into the shared blitCommandBuffer; plain
loads touch just the thread-safe MTLDevice, a fresh texture and the
immutable sampler table, so menu icon and thumbnail loads no longer
pay a per-icon video-thread round-trip. Both modes compile the file
warning-free against a stubbed SDK; the clang static analyzer's
retain-count checker reports no ownership defects in either mode;
the MRC macro expansions pass a GNUstep retain-count/dealloc test
under ASan+UBSan+LeakSanitizer; the chunked loop matches the per-row
implementation byte-for-byte across ten viewport/overscan cases
under the same sanitizers; and concurrent readbacks plus the
inline-load/video-thread interleaving run clean under
ThreadSanitizer.
Rewrite BufferNode/BufferChain as C89 structs with static functions,
embedded by value in Context: the per-frame transient-buffer
allocator is the one piece of driver-internal state whose accessor
dispatch multiplies with scene complexity (an allocRange per draw
batch plus node walks per frame in all three chains), and as plain
aggregates it inlines into its callers and messages only the Metal
objects themselves. Measured on the extracted allocator (clang -O2,
arm64): 556 -> 248 instructions, 38 -> 10 objc_msgSend sites (the
survivors are the irreducible MTLBuffer/MTLDevice calls), 92 -> 28
calls, and over a third fewer memory operations, since a msgSend
boundary forces every field to be reloaded after each opaque call.
The nodes lose their per-object isa and refcount words, the chains
their heap allocations, and MTLBuffer ownership runs through the
same RARCH_STRUCT_ASSIGN discipline in both modes; the extracted allocator
passes a GNUstep behavioral test (alignment stepping, node growth,
tail trim, quiescent-frame retention, zero live buffers at teardown)
under ASan+UBSan+LeakSanitizer. This also removes the unused
kConstantAlignment constant, the file's one standing warning.
The lane skipped HAVE_SHADERPIPELINE over the only thing it reported:
the GLSL sources built into gfx/drivers/gl_shaders are longer than the
509 characters C90 guarantees a compiler will take in a string literal,
which nothing in our declarations can change. -Wno-overlength-strings
covers that one diagnostic, as tools/mingw_syntax_check.sh already does,
and the lane keeps checking what it is for: declarations after
statements, C++ comments and the rest of C99. The pipeline's translation
units build and run clean under it.
HAVE_OPENGL_CORE and HAVE_VULKAN stay out. Both drivers reach the slang
filter chain in every path that draws, and it is built from glslang and
SPIRV-Cross, which are C++: gl3 compiles without them once its
scRGB and pipeline state leaves the HAVE_SLANG guard, and then segfaults
on the first frame for want of the programs that guard was hiding.
cocoa_main_thread_sync() carries its job to the main thread with
-performSelectorOnMainThread:withObject:waitUntilDone:modes: and waits
on an rthreads condition, so the macOS glue no longer needs blocks or
Grand Central Dispatch: it builds with GCC as well as clang and runs
on releases before 10.6. The dispatch header is included for iOS/tvOS
only, where the remaining GCD users live.
The GL context sends -convertRectToBacking: through objc_msgSend_stret
so SDKs that predate it still see the NSRect result; the scan-file
action in the open panel is gated on HAVE_LIBRETRODB like its
declaration; the two forward-referenced RetroArch_OSX methods are
declared. The make build only passes -fobjc-arc to clang, and links
IOKit for every macOS build since platform_darwin.m queries the power
sources unconditionally. qb takes --host=*-apple-darwin* as a Darwin
target and leaves the ARC-and-blocks CoreLocation driver out of
pre-10.7 targets unless asked, as it already does for AVFoundation.
Verified with a GCC 14.2 powerpc-apple-darwin8 cross build against the
10.6 SDK: every configured object compiles and links into a ppc
Mach-O executable.
gfx/drivers/metal.h carries everything the Metal driver shares with its
neighbours: the vertex, uniform and HDR structs that metal.m and the shaders
must agree on, plus the MetalView @interface that ui_cocoa.m and
ui_cocoatouch.m need in order to instantiate the render view. The
Objective-C half sits behind __OBJC__ so the Metal compiler sees only the
struct layouts, and the include guard keeps a single @interface in the
griffin unity build, where metal.m and the Cocoa UI driver share one
translation unit.
Shaders.metal moves alongside it into gfx/drivers/metal_shaders/, matching
the gl_shaders, d3d_shaders and vulkan_shaders layout. The commandline
metallib rules, the clean rule and the three Xcode projects that reference
either file follow the new paths.
Two playback drivers for the same hardware: coreaudio.c, C, on the
AudioUnit C API, and coreaudio3.m, Objective-C with ARC and blocks, on
AUAudioUnit and AVAudioFormat, which the Xcode builds defaulted to.
Side by side they differed in what each had missed rather than in
what either did better: 3 had no device list, ignored the device
argument, had no wait_writable() so the threaded pipeline could not
host on it, read its ring a sample at a time with a divide each, and
signalled its dispatch semaphore from every callback with no waiter
count, the pile-up fixed in coreaudio.c three commits ago. AUAudioUnit
is a wrapper over the same I/O unit and DefaultOutput can insert a
sample-rate converter that HALOutput at the device's nominal rate does
not; nothing in 3 was faster or lower in latency, and dispatch made
the file a libdispatch client for a semaphore the kernel already has.
coreaudio.c is the driver. From 3 it takes the three things worth
taking: the converter is rebuilt when the source rate changes or rate
control moves its adjustment by more than half a percent, not only
when the effective rate has drifted that far; the stream format set
is retried once, since RemoteIO has been seen to refuse the first;
and stop()/start() double as the two ends of an audio session
interruption, which is what the Cocoa side already calls at Began and
Ended - start() resets the converter, since one stopped mid-stream
can come back stuck at end-of-stream, the tvOS 13/14 symptom. The
Cocoa handler now reactivates the session before restarting and
honours ShouldResume, without which the units were restarted into a
session the system had deactivated.
The last SDK gate goes with it. Component versus AudioComponent was a
build-time choice on HAS_MACOSX_10_12, baking the build machine into
what the binary could open; both triples are resolved once at runtime
through dlsym, the modern one if the process has it and the Component
Manager's otherwise, with no header from either side needed since the
description structs share a layout and the handles are pointers. The
HAL device query asks AudioObjectHasProperty whether the output scope
answers rather than assuming from the SDK, through one helper both
the device list and the named open now share. Only TARGET_OS_IPHONE
remains, which is an ABI split and not a version.
"coreaudio3" is accepted as an alias of "coreaudio" in the driver
lookup for a release, so a config naming it lands on this driver and
not on whatever is first in the table. HAVE_COREAUDIO3 is gone from
the Makefiles, qb, griffin, the feature list, the menu, the label
tables and the Xcode config - where its OTHER_CFLAGS line had been
overriding the HAVE_COREAUDIO one above it, so Xcode builds had only
ever compiled 3.
Verified on Linux with the real coreaudio.c linked against stubs of
the Apple calls and a render thread at the device rate: the device
list and the named open through both the AudioComponent and the
Component Manager triples, the converter built once across 200 calls
with rate control jittering by a tenth of a percent and once more for
a two percent step, stop and start, and the earlier wait harness -
no stale-signal storm, blocking writes at the device's pace. Syntax
under gnu89 with mixed declarations an error and gnu99, macOS and
iOS. Linux and win32 builds of the touched frontend files clean; the
frontend runs under ASan. Wants a Mac and an iOS build before it is
trusted; the Cocoa change in particular is not compiled here.
stb_truetype.h and stb_rect_pack.h are no longer referenced by
anything in the tree (the rect packer had been unused since the
plain stb renderer was removed). Drop the vendored headers and the
dead -Ideps/stb include paths from all platform Makefiles.
The Windows GUI subsystem (-mwindows) needs an entry point that the C
runtime startup calls. Some toolchains' startup calls main (Ubuntu
mingw's crt2.o); others call WinMain (MSYS2 mingw's crtexewin.o, whose
__tmainCRTStartup references WinMain). Until now RetroArch had no
WinMain of its own -- on Windows+SDL it came from SDL's shim library
libSDL2main, via the chain WinMain -> SDL_main (RetroArch's main,
renamed by SDL_main.h's "#define main SDL_main").
That chain is gone after SDL_MAIN_HANDLED (main stays main) and after
dropping -lSDL*main. On a toolchain whose GUI startup calls WinMain
(MSYS2), the link then fails:
libmingw32.a(crtexewin.o): in function `main':
undefined reference to `WinMain'
Provide WinMain in-tree, forwarding to main() with the CRT-supplied
__argc/__argv -- exactly the one-line bridge libSDL2main used to give
us, but no longer dependent on SDL being enabled or on which startup
object the toolchain selects. Guarded to desktop Win32 (not XBOX, not
WinRT/UWP -- uwp_main.cpp already supplies wWinMain there) and given
extern "C" for CXX_BUILD. windows.h is already included in retroarch.c
so the canonical WINAPI signature is used.
A previous attempt swapped -mwindows for -Wl,--subsystem,windows on
the theory it would keep a main-calling startup; that was wrong --
MSYS2 selects crtexewin.o for the GUI subsystem regardless of which
flag requests it, so it did not help. That Makefile change is reverted
here; -mwindows is restored and the in-tree WinMain is the actual fix.
Verified with an x86_64-w64-mingw32 g++ link harness: the full chain
(SDL_MAIN_HANDLED + no libSDL*main + this WinMain, compiled as C++
with -mwindows) links, produces a Windows GUI-subsystem binary
exporting both main and WinMain, with main not renamed.
Completes the SDL/entry-point series: decdce0 / 80f343b / 0bf5d29.
The previous two commits (SDL_MAIN_HANDLED in decdce0, dropping
-lSDL*main in 80f343b) stopped main being renamed to SDL_main and
removed SDL's WinMain shim. That exposed the underlying issue: the
MinGW build links with -mwindows, which selects crtexewin.o whose
startup calls WinMain -- and RetroArch has no WinMain. With the SDL
shim gone, the link now fails the other way:
libmingw32.a(crtexewin.o): in function `main':
undefined reference to `WinMain'
RetroArch provides main() (retroarch.c) and creates its own Win32
window; it never had a WinMain. The MSVC and griffin builds already
handle this with '-SUBSYSTEM:WINDOWS -ENTRY:mainCRTStartup': GUI
subsystem (no console window) but an entry point that calls main().
Mirror that on GNU/MinGW by replacing -mwindows with
-Wl,--subsystem,windows. This sets the PE subsystem to GUI (so no
console window appears, same as before) while keeping the default
crtexe.o startup, whose entry calls main(). The build then needs
neither a WinMain nor SDL's WinMain shim, and the entry model matches
the MSVC/griffin builds.
RetroArch links the Win32 import libraries it uses explicitly
(gdi32, ole32, winmm, comdlg32, dinput8, ...), so it does not depend
on -mwindows to pull those in.
Applies to both the C and CXX_BUILD MinGW builds (it is gated only on
Win32, not on CXX_BUILD), unifying their entry-point handling.
Completes the SDL entry-point series: decdce0 / 80f343b / this.
ui_qt_widgets.cpp is compiled whenever HAVE_QT=1, independent of
HAVE_MENU, but most of the file builds widget hierarchies that call
menu_setting_find_enum / menu_displaylist_build_list and construct
helper classes (FormLayout, SettingsGroup, CheckBox, ...) whose
constructors take rarch_setting_t* or msg_hash_enums. Implementations
of those helpers live in the existing HAVE_MENU block (96..1131), so
the AchievementsCategory..FrameThrottleCategory block of *Page::widget()
and *Category implementations (5469..7162) failed to link in
--disable-menu builds.
In addition, the helper widgets and the OptionsPage/OptionsCategory
hierarchy were declared unconditionally in ui_qt_widgets.h, so moc
generated metaobject code referring to slots and dtors with no
definitions:
CheckBox::onClicked(bool)
CheckableSettingsGroup::onClicked(bool)
ShaderParamsDialog::~ShaderParamsDialog()
ShaderParamsDialog::paintEvent(QPaintEvent*)
FloatSliderAndSpinBox::onSliderValueChanged(int)
... (~30 more, plus 100+ widget-class ctor refs in widgets.o)
Fix:
1. Gate three declaration blocks in ui_qt_widgets.h under
#ifdef HAVE_MENU:
- settings widgets (FormLayout..FloatColorButton)
- ShaderPass + ShaderParamsDialog
- OptionsPage/OptionsCategory hierarchy, create_widget,
inline SimplePage::widget()
Add unconditional forward declarations of ShaderPass and
ShaderParamsDialog so ui_qt.h's QPointer<ShaderParamsDialog>
field still parses (all use sites are already HAVE_MENU-gated).
2. Gate the AchievementsCategory..FrameThrottleCategory
implementation block in ui_qt_widgets.cpp to match.
3. Pass $(DEFINES) to moc in Makefile so moc honors the new gates.
Without this, moc's preprocessor sees no defines and treats
every #ifdef HAVE_MENU as false, which would break the
HAVE_MENU=1 build (moc would skip the widget classes).
Verified by running moc with and without -DHAVE_MENU on the patched
header: with HAVE_MENU=1 moc generates 59 metaobject classes (full
set); with HAVE_MENU=0 it generates 8 (only the unconditional ones:
FileDropWidget, ThumbnailDelegate, GridView, CoreInfoDialog,
CoreOptionsDialog, ViewOptionsWidget, ViewOptionsDialog,
PlaylistEntryDialog). g++ -fsyntax-only passes both ways. nm on the
resulting widgets.o + moc_widgets.o in --disable-menu shows zero
undefined references to the previously-missing symbols (only Qt
library symbols remain, as expected).
Two more files in the same situation as audio/drivers/coreaudio3.m
(commit 3498771): written assuming ARC, but compiled under MRC
by the top-level qb Makefile. Under the Xcode builds they are
already ARC (both get pulled in via griffin/griffin_objc.m which
is compiled with CLANG_ENABLE_OBJC_ARC=YES per pkg/apple/
BaseConfig.xcconfig:182), so the qb Makefile was the outlier.
=== input/drivers/cocoa_input.m ===
ARC-shaped signals (checked against the full list in libretro-
common/include/defines/cocoa_defines.h line 85+):
[x release] 0 sites
[x retain] 0 sites
[x autorelease] 0 sites
[super dealloc] 0 sites
NSAutoreleasePool 0 sites
RARCH_RELEASE/... 0 sites
alloc] init 4 sites (lines 387, 399, 947, 1013)
'x = nil' releases 6 sites (lines 753, 754, 759, 955, 984, 985)
The file is written throughout with ARC idioms: 'x = nil' to
release (a no-op under MRC - leaks the prior value); strong-ivar
assignment 'keypressHapticPlayer = [keypressHapticEngine
createPlayerWithPattern:...]' without manual retain; no dealloc
method to release ivars (ARC synthesises one; MRC doesn't).
Concrete per-keystroke MRC leak at lines ~1001-1014: five
alloc+init pairs (CHHapticEventParameter intense/sharp,
CHHapticEvent event, CHHapticPattern pattern, [[NSArray alloc]
init]) created once on haptic-enabled key presses, none released.
Under MRC all five leak. Under ARC the locals go out of scope
and release automatically.
=== location/drivers/corelocation.m ===
Same ARC-only shape. Zero manual retain/release anywhere.
Two alloc+init sites (lines 33, 42) stored into a shared
singleton and into a strong ivar respectively:
sharedInstance = [[CoreLocationManager alloc] init]; // line 33
_locationManager = [[CLLocationManager alloc] init]; // line 42
No dealloc method defined. Under ARC the synthesised dealloc
releases the strong ivars on object destruction; under MRC
those +1 retains leak for the process lifetime.
=== Fix ===
Add both to the per-file -fobjc-arc override list alongside
metal.o, mfi_joypad.o, and coreaudio3.o. Matches the author's
clear intent and aligns qb with the Xcode build mode for these
files.
Thread-safety: unchanged - this is a compile-flag change only.
With ARC on, the existing ivar assignments and singleton setup
produce correct retain counts; under MRC they were silently
leaking.
Reachability: cocoa_input.m is always built on macOS/iOS
(Makefile.common:2625), so the qb-MRC haptic path leaks on every
keystroke for anyone who has haptic feedback enabled on iOS.
corelocation.m is opt-in via --enable-corelocation; leaks are
confined to process startup (one-shot +1 on the singleton and
its manager) and do not grow per-use.
audio/drivers/coreaudio3.m is written assuming ARC:
- Uses __bridge / __bridge_retained / __bridge_transfer casts in
the coreaudio3_init / coreaudio3_write / coreaudio3_free hooks
to move an NSObject through the void* driver-interface without
the caller needing to know its real type.
- Zero manual [x retain] / [x release] / [x autorelease] calls
anywhere in the file.
- Assigns Obj-C locals to ivars ('_au = au') and relies on ARC's
strong-ivar semantics to retain them; dealloc has no matching
releases.
- Leaks every +1 local (renderFormat at line 253 / 268, the
dispatch_semaphore at line 218) under MRC because nothing
releases them.
The file was enabled by '--enable-coreaudio3' (off by default, per
qb/config.params.sh line 127), but when enabled the top-level qb
Makefile build compiled it without -fobjc-arc - since it was not
in the per-file override list at the top of this Makefile alongside
metal.o and mfi_joypad.o. Under MRC compilation the file silently
leaks every Obj-C object it creates, which in audio-driver code
means a steady accumulation with every driver reinit (device
hotplug, latency change, etc.). The __bridge* casts still
compile under MRC (they're ARC's ownership-casts but are also
valid non-ARC syntax), so the build succeeded and nothing
fired - the leaks were invisible until you ran Instruments.
No Xcode project references this file (grepped all of pkg/apple/*/
project.pbxproj - empty result), so the Xcode-side per-file
CLANG_ENABLE_OBJC_ARC=YES path doesn't exist for it yet. If that
integration ever lands, the Xcode target would also need to flip
it on.
Added coreaudio3.o to the ARC override list alongside metal.o and
mfi_joypad.o. Also updated the now-stale 'These three Objective-C
files' comment (it had said three but only listed two) and broadened
the ARC-constructs example from '__weak, etc.' to '__weak, __bridge*,
no manual retain/release' to cover this file's shape too.
Thread-safety: unchanged - this is a compile-flag change, no
runtime behaviour is touched. With ARC on, the existing ivar
assignments and bridge casts produce the intended retain counts;
the per-init-call leaks are reclaimed when the CoreAudio3
instance is released.
Reachability: anyone who enables --enable-coreaudio3. Default
builds are unaffected.
Pre-Mavericks (< 10.9) codesign predates the '--timestamp' option, so
'make bundle' currently fails on macOS 10.5-10.8 with:
codesign: unrecognized option `--timestamp=none'
The ad-hoc signing step exists to satisfy dyld / hardened-runtime
enforcement on Apple Silicon and recent Intel. That enforcement doesn't
exist on legacy targets, so the signing step isn't just broken there
but unnecessary.
Derive MACOS_LEGACY from BUNDLE_MIN_OS (itself parsed out of
MINVERFLAGS), which means:
- Detection is automatic; no user-specified flag needed.
- Keying off the target OS rather than the build host means
cross-compiling for ppc/10.5 on a modern Mac still takes the
legacy path.
On legacy targets the entire signing block is skipped via a shell
conditional (Make directives can't interleave with recipe lines).
Modern builds are unchanged.
-ffast-math was added in ff14092d8d with a comment that it "helps SINC
resampler to auto-vectorize". The flag is an alias for "-fno-math-errno
-funsafe-math-optimizations -ffp-contract=fast -fno-honor-infinities
-fno-honor-nans". The last two of those cause compiler complaints
because while the flag was meant for this file, it's shared across the
codebase that includes statements that operate on infinities and NaNs.
GCC 13.3 with -fopt-info-vec reports 18 vectorizations for `-O3
-ffast-math`, 17 for `-O3 -fno-math-errno -funsafe-math-optimizations
-ffp-contract=fast` and also 17 for plain `-O3`. So using the subset of
-ffast-math without the offending flags buys nothing and loses 1
vectorization.
Both GCC and Clang provide the "fast-math" pragma directive, which I add
to this one file that benefits from it, under the condition that it's
supported. -ffast-math is removed from most of the makefiles.
The point of making the default "semi-silent" (each target is printed,
but not the entire invocation verbatim) was to factor out information
about invocation to a one-time target (info) and not repeating it ever
again. With V=1, the info target is silent, because each command
invocation will be printed verbatim, which needs no herald.
The undesired side effect of me introducing the info target and making
it a dependency of the default all target is that info doesn't respect
the --silent make option, so in this use case it was more noisy, not
less.
I believe the most elegant solution that satisfies all use cases is to
stop printing info unconditionally, and instead list it explicitly in
make invocations in CI, together with the all target. Then this info is
kept available for inspection from logs, but it's not repeated on each
invocation. The intention was to make the logs easier to read and scroll
in search for new compiler warnings.
* Allow disabling "Update Core Info" from Online Updater
* Add ASSETS_DIR as an alternative to DEFAULT_DIR_ASSETS
* Add FILTERS_DIR configuration option
* Fix other platform_unix.c platforms
* Conditionally use ASSETS_DIR/FILTERS_DIR