Skip to content

Commit 4e208a6

Browse files
authored
Merge pull request #59073 from compnerd/5.7-unarch
[5.7] Frontend: add an additional search path for swift modules
2 parents 97ab9c0 + f84627a commit 4e208a6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,15 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
188188
LibPath = SearchPathOpts.getSDKPath();
189189
llvm::sys::path::append(LibPath, "usr", "lib", "swift");
190190
if (!Triple.isOSDarwin()) {
191+
// Use the non-architecture suffixed form with directory-layout
192+
// swiftmodules.
191193
llvm::sys::path::append(LibPath, getPlatformNameForTriple(Triple));
194+
RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
195+
196+
// Compatibility with older releases - use the architecture suffixed form
197+
// for pre-directory-layout multi-architecture layout. Note that some
198+
// platforms (e.g. Windows) will use this even with directory layout in
199+
// older releases.
192200
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
193201
}
194202
RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));

0 commit comments

Comments
 (0)