ModuleInterface: sanitize arch when interface file name and encoded flags disagree

It's a known issue that we are using arm64e interfaces contents for the arm64 target,
meaning the encoded module flags are specifying -target arm64e-x-x instead of
-target arm64-x-x. Fortunately, we can tell the target arch from the interface file
name, so we could sanitize the target to use by inferring arch from the file name.
This commit is contained in:
Xi Ge
2021-06-16 19:28:48 -07:00
parent 5cd7d74775
commit 49c64cf902
4 changed files with 41 additions and 4 deletions

View File

@@ -1346,7 +1346,7 @@ bool InterfaceSubContextDelegateImpl::extractSwiftInterfaceVersionAndArgs(
diag::error_extracting_version_from_module_interface);
return true;
}
if (extractCompilerFlagsFromInterface(SB, ArgSaver, SubArgs)) {
if (extractCompilerFlagsFromInterface(interfacePath, SB, ArgSaver, SubArgs)) {
diagnose(interfacePath, diagnosticLoc,
diag::error_extracting_version_from_module_interface);
return true;