[ORC] Support scanning "fallback" slices for interfaces. #168472
Merged
+157
−49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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