Skip to content

Conversation

@lhames
Copy link
Contributor

@lhames lhames commented Nov 18, 2025

When scanning an interface source (dylib or TBD file), consider "fallback" architectures (CPUType / CPUSubType pairs) in addition to the process's CPUType / CPUSubType.

Background:

When dyld loads a dylib into a process it may load dylib or slice whose CPU type / subtype isn't an exact match for the process's CPU type / subtype. E.g. arm64 processes can load arm64e dylibs / slices.

When building an interface we need to follow the same logic, otherwise we risk generating a spurious "does not contain a compatible slice" error. E.g. If we're running an arm64 JIT'd program and loading an interface from a TBD file, and if no arm64 slice is present in that file, then we should fall back to looking for an arm64e slice.

rdar://164510783

When scanning an interface source (dylib or TBD file), consider "fallback"
architectures (CPUType / CPUSubType pairs) in addition to the process's
CPUType / CPUSubType.

Background:

When dyld loads a dylib into a process it may load dylib or slice whose
CPU type / subtype isn't an exact match for the process's CPU type / subtype.
E.g. arm64 processes can load arm64e dylibs / slices.

When building an interface we need to follow the same logic, otherwise we risk
generating a spurious "does not contain a compatible slice" error. E.g. If
we're running an arm64 JIT'd program and loading an interface from a TBD file,
and if no arm64 slice is present in that file, then we should fall back to
looking for an arm64e slice.

rdar://164510783
@github-actions
Copy link

🐧 Linux x64 Test Results

  • 186267 tests passed
  • 4848 tests skipped

@lhames lhames merged commit 4b0d422 into llvm:main Nov 18, 2025
11 checks passed
@lhames lhames deleted the macho-fallback-archs branch November 18, 2025 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant