mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Frontend: Fix -target-variant subarch normalization.
In https://github.com/swiftlang/swift/pull/77156, normalization was introduced for -target-variant triples. That PR also caused -target-variant arguments to be inherited from the main compilation options whenever building dependency modules from their interfaces, which is incorrect. The -target-variant option must only be specified when compiling a "zippered" module, but the dependencies of zippered modules are not necessarily zippered themselves and indiscriminantly propagating the option can cause miscompilation. The new, more targeted approach to normalizing arm64e triples simply uses the arch and subarch of the -target argument of the main compile to decide whether the subarch of both the -target and -target-variant arguments of a dependency need adjustment. Resolves rdar://135322077 and rdar://141640919.
This commit is contained in:
@@ -573,8 +573,7 @@ public:
|
||||
bool extractCompilerFlagsFromInterface(
|
||||
StringRef interfacePath, StringRef buffer, llvm::StringSaver &ArgSaver,
|
||||
SmallVectorImpl<const char *> &SubArgs,
|
||||
std::optional<llvm::Triple> PreferredTarget = std::nullopt,
|
||||
std::optional<llvm::Triple> PreferredTargetVariant = std::nullopt);
|
||||
std::optional<llvm::Triple> PreferredTarget = std::nullopt);
|
||||
|
||||
/// Extract the user module version number from an interface file.
|
||||
llvm::VersionTuple extractUserModuleVersionFromInterface(StringRef moduleInterfacePath);
|
||||
|
||||
Reference in New Issue
Block a user