fix(relinker): write Linux and macOS executables with execute permission #5695
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5695"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T07:10:25Z.
What
The relinker writes its executables with the default file mode, 0644 under a 022 umask.
USAGE.mdsays tochmod +x app.elf, but nothing covers the outputs of--executable(#4786). A title that starts one of them withsceSystemServiceLoadExecthen stops at theexecv:main.cppadds execute permission for owner, group and others to each Linux and macOS executable output after writing it, the same bits--autorunalready adds toapp.elf. If that fails, the conversion fails and names the file.relinker_executableschecks the bits onapp.elfandpicker.picker.bin.elf.USAGE.mddrops thechmodstep and keeps it for copies that lost their mode (a browser download, for example), with the error a missing bit gives.Title. RetroArch (PPSA99169, catalog release) starts its frontend picker with
sceSystemServiceLoadExec("/app0/picker/picker.bin"), and the picker then starts ES-DE (/app0/es-de/es-de.bin). Converted with--executable picker/picker.bin --executable es-de/es-de.binand run after the documentedchmod +x app.elf, it stopped with the error above as soon as it started the picker. With this PR all three outputs are-rwxr-xr-xstraight from the relinker and RetroArch starts the picker. In an earlier run with the same bits set by hand, the picker also started ES-DE (itses-de-ps5.logreachesES-DE returned 0).Tested
Linux (Bazzite 44, GCC 16.2.1, Ninja, Release,
-DBUILD_TESTING=ON), based onmaind8888df9b:ctest: 1105 of 1106 pass.agc_driver_tessellationsegfaults on unchangedmainhere too.relinker_executablesfails with the previousmain.cpp(app.elfis0o100644).chmod. Before: theexecverror and SIGABRT when the picker starts. After: the picker starts and waits on its menu.tools/check_conventions.py --base upstream/mainandtools/pr_overlap.py(no overlap) pass. macOS and Windows were not built here. Windows outputs are not touched.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by Bruggi-ch on 2026-10-14T09:17:46Z.
macOS data point for the
--executablepermission change, since the description only covers Linux.mainat66f894761with this PR merged on top (c31b519e3), relinker-only build (-DANYPS5_RELINKER_ONLY=ON -DBUILD_TESTING=ON), native arm64ctest: 149 of 149 pass, includingrelinker_executablesmain.cppchange (test kept):relinker_executablesfails on macOS with the same assertion,app.elfis0o100644. With it, it passes.I did not run a title, and the test only checks the Linux ELF outputs of
--executable; I did not check the permission of--macosoutput separately.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T09:32:28Z.
Thanks @Bruggi-ch, that covers the half I couldn't build here.
On the part you left open:
563ff6350adds a--macoscase torelinker_executables. It converts the picker case to Mach-O on the Linux runner and requires both outputs (app.elfandpicker.picker.bin.elf,cffaedfe) to be executable. With the change limited to Linux outputs (!args.toWindows && !args.toMacos), the new check fails withmacos-picker/out/app.elfat0o100644; with the PR it passes.I also built this PR together with my other open ones (#5053, #5218, #5699, #5734) on
main43349d433and ran the fullcteston Linux: 1110 of 1112 pass.agc_driver_tessellationsegfaults on this machine without any change, andagc_host_import_sparse(new onmainwith #5309) fails the same way onmainalone here (a failure at vkQueueBindSparse after the sparse path was chosen did not throw), whereUDMABUF_CREATEis refused.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T23:14:58Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/relinker/main.cppL313-318Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mddocs/user/USAGE.mdImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T12:05:14Z.
Checked on the PR merged onto current
main: build + scoped ctest (relinker) 133/133, includingrelinker_executables; the execute bits are set for Linux and macOS outputs, Windows is untouched. Relinker jobs green on ubuntu, windows and macOS; macOS also confirmed by @Bruggi-ch on Apple M5. The title run is not reproducible here. Merging.