-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Serialization] Use full target architectures for swiftmodule files #21053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci Please test |
Build failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
@swift-ci Please clean test Linux |
@@ -142,6 +142,23 @@ bool SerializedModuleLoader::maybeDiagnoseArchitectureMismatch( | |||
return true; | |||
} | |||
|
|||
static std::pair<llvm::SmallString<16>, llvm::SmallString<16>> | |||
getArchSpecificModuleFileNames(StringRef archName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pass along the Triple rather than StringRef? It feels like it would be nicer to derive that from the triple rather than the architecture name specifically. We could have a boolean flag for whether it should do the fallback or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that actually makes the call sites nicer, and as a helper function that's the important thing.
archDocFile += file_types::getExtension(file_types::TY_SwiftModuleDocFile); | ||
} | ||
// FIXME: We used to use "major architecture" names for these files---the | ||
// names checked in "#if os(...)". Fall back to that name in the one case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you really mean #if os(...)
or do you mean #if arch(...)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, thanks!
Previously these used the same "major architecture" names that the `#if os(...)` query accepts, but that can be a problem when building for, say, both armv7 and armv7s, even if the content is "the same". For a transition period where external build tools are involved, the compiler will look for "arm.swiftmodule" if it fails to find "armv7.swiftmodule" or any other 32-bit ARM architecture. No other Apple platform architectures are affected, and AFAIK no one's using the architecture-based layout on Linux or any other platforms. rdar://problem/45174692
3fea4f4
to
040357a
Compare
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
…wiftlang#21053) Previously these used the same "major architecture" names that the `#if os(...)` query accepts, but that can be a problem when building for, say, both armv7 and armv7s, even if the content is "the same". For a transition period where external build tools are involved, the compiler will look for "arm.swiftmodule" if it fails to find "armv7.swiftmodule" or any other 32-bit ARM architecture. No other Apple platform architectures are affected, and AFAIK no one's using the architecture-based layout on Linux or any other platforms. rdar://problem/45174692 (cherry picked from commit 06f3c11)
Previously these used the same "major architecture" names that the
#if os(...)
query accepts, but that can be a problem when building for, say, both armv7 and armv7s, even if the content is "the same".For a transition period where external build tools are involved, the compiler will look for "arm.swiftmodule" if it fails to find "armv7.swiftmodule" or any other 32-bit ARM architecture. No other Apple platform architectures are affected, and AFAIK no one's using the architecture-based layout on Linux or any other platforms.
rdar://problem/45174692