1Prevents a user-visible warning on every compilation:
2
3 ld: warning: directory not found for option '-L.../MacOSX11.0.sdk/usr/lib/swift'
4
5--- a/lib/Driver/ToolChains.cpp
6+++ b/lib/Driver/ToolChains.cpp
7@@ -1455,9 +1455,11 @@ void ToolChain::getRuntimeLibraryPaths(SmallVectorImpl<std::string> &runtimeLibP
8 runtimeLibPaths.push_back(std::string(scratchPath.str()));
9 }
10
11+ if (!SDKPath.startswith("@storeDir@")) {
12 scratchPath = SDKPath;
13 llvm::sys::path::append(scratchPath, "usr", "lib", "swift");
14 runtimeLibPaths.push_back(std::string(scratchPath.str()));
15+ }
16 }
17 }
18
19--- a/lib/Frontend/CompilerInvocation.cpp
20+++ b/lib/Frontend/CompilerInvocation.cpp
21@@ -185,7 +185,9 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
22 RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
23 }
24
25- LibPath = SearchPathOpts.getSDKPath();
26+ auto SDKPath = SearchPathOpts.getSDKPath();
27+ if (!SDKPath.startswith("@storeDir@")) {
28+ LibPath = SDKPath;
29 llvm::sys::path::append(LibPath, "usr", "lib", "swift");
30 if (!Triple.isOSDarwin()) {
31 // Use the non-architecture suffixed form with directory-layout
32@@ -200,6 +202,7 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
33 llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
34 }
35 RuntimeLibraryImportPaths.push_back(std::string(LibPath.str()));
36+ }
37 }
38 SearchPathOpts.setRuntimeLibraryImportPaths(RuntimeLibraryImportPaths);
39 }