Skip to content

radlink: honor explicitly supplied ASan runtime libraries - #941

Open
honkstar1 wants to merge 1 commit into
EpicGames:devfrom
honkstar1:codex/radlink-asan-runtime-pr
Open

radlink: honor explicitly supplied ASan runtime libraries#941
honkstar1 wants to merge 1 commit into
EpicGames:devfrom
honkstar1:codex/radlink-asan-runtime-pr

Conversation

@honkstar1

Copy link
Copy Markdown

Summary

Honor already-requested ASan runtime libraries instead of inferring a second, differently named SDK runtime.

A FortniteClient ASan link explicitly supplies EpicClang's clang_rt.asan_dynamic.lib and clang_rt.asan_dynamic_runtime_thunk.lib. The old inference path additionally requests the MSVC *-x86_64.lib variants and whole-archives the SDK thunk. Loading both produces multiply-defined __asan_globals_start and weak-registration symbols.

Changes

  • Recognize requested components using either Windows naming convention: unsuffixed names in architecture-specific directories, or the existing architecture-suffixed names.
  • Reuse those requests instead of introducing another runtime.
  • If only one component is supplied, infer its matching companion and naming convention, preferring the supplied component's directory and then normal LIBPATH lookup.
  • Keep existing SDK defaults when neither component was requested.
  • Continue whole-archiving the selected thunk, preserving otherwise unreferenced registration members.
  • Preserve the dynamic/static CRT distinction and optional VC-ASan support libraries. Do not remove user inputs or suppress genuine multiply-defined-symbol errors.

The lookup runs only during ASan inference, not per object or relocation.

Regression coverage

Synthetic COFF libraries exercise 12 positive combinations: dynamic/static CRTs, explicit pairs, either component alone, unchanged defaults, explicit canonical names, and companion fallback through LIBPATH. Paths with spaces and whole-archive registration are checked. A negative case explicitly loads conflicting thunks and must still report the duplicate.

Validation

  • Standalone against dev@47de6bf3, without the optimization/compressed-object stack.
  • Clang/LLD 20.1.8 Release build; upstream linker suite: 141 passed, 0 failed/crashed, 1 excluded (import_export, whose assertion was separately reproduced on the unmodified upstream baseline).
  • The new regression reproduces Error(024) with the previous 5f2c8d69 linker and passes with this change.
  • Equivalent combined candidate 0ff079a6: 184 passed, 0 failed/crashed, 1 existing Microsoft-linker-comparison exclusion. It retains the earlier radlink: match MSVC for discarded associative COMDAT relocations #940 associative-metadata correction.
  • The supplied FortniteClient response reproduced the two reported duplicate definitions on 5f2c8d69; the fixed combined linker completes it with no diagnostics. The generated image imports clang_rt.asan_dynamic.dll, not the SDK's second ASan DLL. Original response and input size/timestamp metadata remained unchanged; outputs were redirected to an isolated directory.

No proprietary Engine objects/libraries are added as fixtures. The game executable was not launched; no runtime ASan/farm/UBA/Wine or performance result is claimed. No installed Engine linker is replaced by this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant