fix(relinker): validate Linux guest runpaths with target syntax #4801
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4801"
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 ArjenS-LA on 2026-10-12T22:21:31Z.
What
Converting bundled guest modules to Linux output on Windows rejects
--rpath /opt/libs, while accepting Windows drive paths as Linux search paths. Validate the target's leading/root independently of the host filesystem. Existing$ORIGINbehavior remains covered.Tested
Windows x64 build 26200, supported WinLibs MinGW-w64 GCC 15.2.0 r7, Python 3.13.7, CMake 4.3.1, Ninja 1.13.2. The same final
test_guest_runpath.pyfails against a separately preserved main binary at/opt/absolute libs; the fix passes 32 module/path combinations and rejects four invalid paths before output creation. Tests inspect emitted ELFDT_RUNPATH.Release relinker-only build with
ANYPS5_RELINKER_ONLY=ON,BUILD_TESTING=ON, and an explicit workingPython3_EXECUTABLE;ctest -Nconfirmsinput_magicis registered. Fullctest --test-dir build-relinker --output-on-failure -j 4: 138/138 passed, 34.78 seconds, with no groups excluded. Individual suites retain host-specific and Windows symlink-privilege skips.git diff --checkand committed-object conventions checks pass.Original regression baseline:
ee496219007b05e054a469fe12330f7e38e5451a. Rebased onto current main43e3a70f8143f014f621c48abbdb137fffd7346eand reran fixed validation. Fixed:e148cc6f9bb42c9d7ed83f7817f31879aeade835onfix/guest-posix-runpath. No title, GPU, native Linux/macOS runtime, full library build, or upstream CI result is claimed.Refreshed 472 open PRs across 5 pages, including full changed-file lists, against main
43e3a70f8143f014f621c48abbdb137fffd7346e. Shared-file implementations are unrelated SELF diagnostics: #4501 at429c9421be7f85a22d6f4b14fe5f5fa3ac93120b, #4623 at8fb0c165981020479fd458057ed095bed787b6b5. Tree-only merge previews on the explicit current-main base are clean. The three proposed changes also merge cleanly with one another. Related issue searches were reviewed; no issue matched this regression.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T04:52:37Z.
Windows test: head
e148cc6f9merged onto currentmaine51428bf2(clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release,-j2: full build 0 errors; ctest with the filter^guest_runpath$: guest_runpath passed (1 test(s), 0 failed);python tools/check_conventions.py --base upstream/mainpassed. I did not run the new tests againstmainwithout the change. The title names Linux, so this Windows run only shows that the change builds and the tests still pass on Windows.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by ArjenS-LA on 2026-10-13T17:42:42Z.
@Ondra97: #5302 and this PR apply the same change in
GuestModuleBuilder::Build: replace the host-dependentstd::filesystem::path(runPath).is_absolute()check withrunPath.starts_with('/')for non-Windows output. Could we agree which PR should carry the shared fix and combine the regression coverage?I compared #4801 at
e148cc6f9bb42c9d7ed83f7817f31879aeade835with #5302 at446a5893b73e1bcad0e7b60bd28f512cd55bc571, against main8cf6a0bc3a17782e8f1063d1127f72419260230b. This PR additionally tests/, a colon-separated absolute path list, a relative path, and a backslash drive path; #5302 additionally inspects Mach-O executable and guest-module runpaths. Both touchcore/relinker/relinker/src/guest/GuestModuleBuilder.cppandcore/relinker/relinker/tests/test_guest_runpath.py.This PR already conflicts with main in
GuestModuleBuilder.cpp; #5302's main preview is clean. The normalized pair preview reports both files, but this PR's pre-existing main conflict makes that pair result inconclusive. The duplicate predicate is established by source inspection. No dependency order is agreed, and I have not built or run a combined tree. AI-assisted: OpenAI Codex.Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-13T18:30:47Z.
@ArjenS-LA You are right: #5302 duplicates the predicate change already in #4801. I overlooked your PR during source review. I have closed #5302 so your older PR carries the shared fix.
Here is a test-only supplement against your unchanged head
e148cc6f9bb42c9d7ed83f7817f31879aeade835. It preserves your 32 ELF module/path combinations and four invalid-path cases, and adds 12 Mach-O executable/guest-module checks for Unix absolute paths and/.Validation: Windows, supported WinLibs GCC 15.2. The combined test passed all 32 ELF combinations, 12 Mach-O checks and four rejection cases. The validation binary was the previously built seven-fix combined checkout on main
61b8742b6, containing the identical target-path predicate; its full relinker-only suite passed 150/150. Please rerun this supplement against your rebased PR before merging. The Mach-O checks inspect output structure on Windows.I also verified that the patch applies to your exact head. The shared production change remains in #4801.
AI-assisted: yes, OpenAI Codex.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T01:20:16Z.
Rebased onto main to resolve the conflict in
core/relinker/relinker/src/guest/GuestModuleBuilder.cppafter #5044; no other change.