Repository navigation
build(libkernel): keep the ELF-only module fixture options off Apple - #10660
adriadam10 merged 1 commit into
Conversation
guest_module_fixture passed -Wl,--no-as-needed on every host but
Windows, and Apple's ld64 rejects that option ("ld: unknown options:
--no-as-needed"), so the fixture failed to link on macOS. The option
keeps the DT_NEEDED entries that nid_patcher_dynamic_strings reads, and
that test parses the ELF dynamic section, so neither applies to the
Mach-O fixture: both now stay off Apple as they stay off Windows.
MarcZX10
left a comment
There was a problem hiding this comment.
The Apple guard is correct for this fixture: -Wl,--no-as-needed and the ELF dynamic-string test do not apply to Mach-O, while the Linux condition remains enabled and Windows remains excluded. The PR describes a focused macOS x86-64 reproduction showing the fixture link fails on the base and succeeds with this condition; I did not independently rerun that macOS build. Eligibility, conventions, intake, labels, and report checks pass. Product test jobs were skipped by the hosted policy.\n\nI checked the overlap with #7201: it contains the same exclusion in the same CMake block, but that PR currently conflicts with main and has no directly mergeable head. This PR is a narrow standalone fix on current main, and its body already documents the overlap.
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 5315b24f5b72a924383da3c008c814600a74ffbd. Approve; no actionable finding in this focused review.
The ELF dynamic-string fixture and GNU --no-as-needed option are now restricted to non-Windows, non-Apple builds. The surrounding symbol-version test remains outside that restriction.
Validation: Interpreted the submitted CMake block for Darwin, Linux and Windows on head and base. The head omits the ELF-only option/test on Darwin and Windows and retains both on Linux.
Scope / next step: This is CMake branch/registration evidence; no Apple linker or full libkernel build was run.
|
Checked the condition at |
What
guest_module_fixturegets-Wl,--no-as-neededon every host but Windows. Apple's ld64 doesn't know that option, so on currentmainthe fixture fails to link on macOS:The option keeps the
DT_NEEDEDentries thatnid_patcher_dynamic_stringschecks, andtest_dynamic_strings.pyreads the ELF section headers and dynamic section, so neither applies to the Mach-O fixture. The block that adds both now readsif(NOT WIN32 AND NOT APPLE), the same way it already leaves out Windows' PE fixture. Linux is unchanged. #7201 has the same condition as part of the whole macOS port, on an older form of this block (if(Python3_Interpreter_FOUND AND NOT WIN32 AND NOT APPLE), before the block was nested). Its head (6687cbac29, 2026-10-16) conflicts withmainand needs a rebase anyway, so the order proposed here is this PR first, with #7201 keepingmain's block at its rebase; both forms leave the option and the test off Apple, so either one alone is enough. If #7201 lands first, this PR is not needed and I will close it.Tested
Apple M4 Pro, macOS 27.0.1, Apple clang, x86-64 Release (
-DCMAKE_OSX_ARCHITECTURES=x86_64, Ninja), onmainfee6a14709, whoselibkernel/CMakeLists.txtmatches this branch's basec9b75825f3:cmake --build build --target guest_module_fixturefails with the error above without this change; with it,libguest_module_fixture.dyliblinks and thenid_patcherpost-build step runs without error, andctest -Nno longer listsnid_patcher_dynamic_strings.guest_dynamic_loader_tests, which loads the fixture, needslibkernel, which does not build onmainon macOS yet, so it was not run. Not built on Linux or Windows; the condition is unchanged there.check_conventions.py --base upstream/mainpasses.pr_overlap.pylists no pull request with conflicting lines, only 18 it could not compare onlibkernel/CMakeLists.txtbecause they conflict withmain; of those, only #7201 changes this block.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)