fix(build): run guest_unused_import_dependencies without the ASan link order check #9238

Merged
milescoviello merged 1 commit from upstream-pr/9238 into main 2026-10-24 03:09:00 +00:00
milescoviello commented 2026-10-21 16:11:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T16:11:41Z.


What

In an ANYPS5_ENABLE_ASAN build, guest_unused_import_dependencies fails before its guest runs:

AssertionError: ('referenced', 1, '', '==…==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.\n')

The test loads guest_module_args_host into a relinked guest, like guest_module_args, guest_deferred_dependencies, guest_module_fini and guest_zero_initializer. #7147 gave those tests verify_asan_link_order=0 through add_asan_test_options, which explains why. #6903 added this test two days later, without the option. It now gets the option too.

add_asan_test_options does nothing outside an ASan build, so other builds don't change.

Tested

Ubuntu 24.04, GCC 13.3, on main cecb540a63.

  • ANYPS5_ENABLE_ASAN build, ctest -R '^guest_unused_import_dependencies$':
    • main: fails 3 of 3 with the message above.
    • With this change: passes 3 of 3.
  • Normal test build: the test passes, and its environment has no ASAN_OPTIONS.

It came up in an ASan sweep of the CPU-side tests on main. #9236 fixes a test buffer over-read found in the same sweep.

Not tested: Windows, macOS (where add_asan_test_options adds nothing unless ASan is on).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: none needed (test registration only)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4954681561 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9238). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-21T16:11:41Z. --- ### What In an `ANYPS5_ENABLE_ASAN` build, `guest_unused_import_dependencies` fails before its guest runs: ``` AssertionError: ('referenced', 1, '', '==…==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.\n') ``` The test loads `guest_module_args_host` into a relinked guest, like `guest_module_args`, `guest_deferred_dependencies`, `guest_module_fini` and `guest_zero_initializer`. #7147 gave those tests `verify_asan_link_order=0` through `add_asan_test_options`, which explains why. #6903 added this test two days later, without the option. It now gets the option too. `add_asan_test_options` does nothing outside an ASan build, so other builds don't change. ### Tested Ubuntu 24.04, GCC 13.3, on `main` cecb540a63. - `ANYPS5_ENABLE_ASAN` build, `ctest -R '^guest_unused_import_dependencies$'`: - `main`: fails 3 of 3 with the message above. - With this change: passes 3 of 3. - Normal test build: the test passes, and its environment has no `ASAN_OPTIONS`. It came up in an ASan sweep of the CPU-side tests on `main`. #9236 fixes a test buffer over-read found in the same sweep. Not tested: Windows, macOS (where `add_asan_test_options` adds nothing unless ASan is on). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: none needed (test registration only) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!9238
No description provided.