test(libkernel): build the __tls_get_addr test only on Linux and Windows #10885
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10885"
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 imellag on 2026-10-25T07:28:01Z.
What
core/libs/tests/GuestTlsGetAddr.cppdoesn't compile on macOS. Outside Windows it includes<link.h>and finds the host's TLS module withdl_iterate_phdr, and macOS has neither:Of the steps that fail on current
mainon macOS, it is the only one that didn't fail onmain3fcb5e4d76; the test was added after that, incf27259538. On macOS the test couldn't pass anyway: there__tls_get_addrcallsNotImplemented_nid_no_patch, because the macOS relinker binds guest modules toAps5GuestTlsGetAddr_nid_no_patchand no library defines the guest TLS runtime yet. The libkernel debt file already records this.This change registers the test only on Windows and Linux, the two hosts the test is written for, with the same
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Linux")condition that libkernel'sCMakeLists.txtalready uses for other tests. Nothing changes on Windows and Linux. The__tls_get_addrentry indocs/dev/debt/libkernel.mdalready records that it throws on macOS, so the debt file is unchanged.I didn't implement
__tls_get_addron macOS here. On macOS it is part of the guest TLS runtime (Aps5GuestTlsRegister,Aps5GuestTlsAllocate,Aps5GuestTlsGetAddr), and two versions of that already exist: one in #7201 (libc/src/specifics/macos/GuestRuntime.cpp) and one in mugurc's macOS series (8b52faaba5, "feat(libkernel): thread-local storage for Mach-O guests"). The test can come back on macOS with a Mach-O case once one of them is merged.Tested
Apple M4 Pro, macOS 27.0.1, Apple clang 21, x86-64 Release (
-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja,BUILD_TESTING=ON).main61fc572ceealone: compared withmain3fcb5e4d76, the only new failed step isGuestTlsGetAddr.cpp.o.mainplus the open macOS build PRs and the parts of mugurc's series that #7201 also carries: without this change, everything builds except this test. With it, the whole build completes (cmake --build, exit 0), andctest -Nno longer listsguest_tls_get_addr.Not built on Linux or Windows. The condition keeps the test registered there exactly as before.
check_conventions.py --base upstream/mainpasses.pr_overlap.pyreports no conflicting lines. Of the pull requests it couldn't compare, only #7201 touches guest TLS, and it doesn't change this test or its CMake registration.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 MarcZX10 on 2026-10-25T07:53:19Z.
Review: APPROVED
Reviewed the updated head
b2c32d8d5dagainst current main. The change now only gates guest_tls_get_addr test registration to Windows and Linux; the adjacent debt entry was removed, so #9461 no longer overlaps this diff. The CMake condition matches the existing host gating pattern in this file. git diff --check and check_conventions.py pass locally. The PR reports a successful macOS build/CTest listing from the author; hosted Linux and Windows product jobs are skipped, so I am not claiming those ran here. No remaining blocking issue found.Imported from boykopovar/AnyPS5. Originally posted by THEMANnt on 2026-10-26T19:16:22Z.
Review: APPROVED
Reviewed
b2c32d8d5d3a25c92b37ca19b04d5ef93ba6376b. Approve; no actionable finding in this focused review.The __tls_get_addr executable, linkage and CTest properties are gated together for Linux or Windows. Apple no longer registers a fixture for an unavailable platform path; Windows keeps its library search-path property.
Validation: Executed head/base CMake branches for Darwin, Linux and Windows. Candidate omits the target/test only on Darwin and retains the Windows environment property.
Scope / next step: Configuration behavior was tested; no new guest TLS runtime execution or macOS build is claimed.