Linux: three loader tests fail when GCC does not default to PIE (Fedora) #2803
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 ThatsLeo on 2026-10-10T15:34:44Z.
On Linux the loader treats the unnamed main image as guest code:
FromGuestModulecomparesdladdr'sdli_fbasewith the main program'sdlpi_addr, andIsRelinkedImagetakes the unnamed image as relinked. Both hold for theET_DYNexecutables the relinker emits. Fedora's GCC does not default to PIE, so the library test executables wereET_EXECat0x400000:dlpi_addris 0 there, and the address of a libkernel function is a canonical PLT entry inside the test executable.core/libssetsCMAKE_POSITION_INDEPENDENT_CODEon Linux aftercheck_pie_supported, so its executables link as PIE whatever the compiler default.Fix:
ThatsLeo/AnyPS5:fix/linux-test-executables-pie(one commit,0c505d42, onmain5edae353). Details: #2798 (closed by the intake pause).Tested: Fedora 44, GCC 16.2.1, Release.
guest_dynamic_loader,guest_unwind_module_infoandguest_unwind_module_info_failurefail onmainand pass.ctestonmain(5edae353) and on this branch, on Intel Arc (Meteor Lake, Mesa 26.2.3) and lavapipe: Intel Arc 9 failures onmain, 6 here; lavapipe 4 and 1; no new failure. The remaining failures also fail onmain: on Intel Arcagc_driver_mesh,agc_driver_f64_fma_subnormals,agc_driver_vop1_float_unary,agc_driver_vopc_compare,agc_pipeline_cache,agc_driver_lds_beyond_device_limit; on lavapipeagc_driver_f64_fma_subnormals.Happy for anyone with intake access to carry it.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-10T15:40:16Z.
I carried ThatsLeo’s author-attributed Linux test PIE fix onto current upstream
main(de5e541d) incodex/linux-test-pie-2803, commit230ff18eb1e663b6bd76166cae9faf71f7b5a147.I configured a fresh Release build with
CMAKE_EXE_LINKER_FLAGS=-no-pieto emulate a toolchain that does not default to PIE, then built the three affected test executables. All three were ELFDYNposition-independent executables, and the tests passed:guest_dynamic_loaderguest_unwind_module_infoguest_unwind_module_info_failuretools/check_conventions.py --base upstream/mainandgit diff --checkalso pass. I have not run this on Fedora 44/GCC 16; the validation here used Debian GCC 12.2 with the explicit non-PIE linker default.I did not open an upstream PR because the intake workflow requires 20 PRs merged into
main; my current merged count is 15. The fork branch is ready for review or cherry-pick.