@@ -38,6 +38,10 @@ using namespace swift;
38
38
using namespace swift ::driver;
39
39
using namespace llvm ::opt;
40
40
41
+ // / The path for Swift libraries in the OS. (Duplicated from Immediate.cpp.
42
+ // / Eventually we should consolidate this.)
43
+ #define OS_LIBRARY_PATH " /usr/lib/swift"
44
+
41
45
std::string
42
46
toolchains::Darwin::findProgramRelativeToSwiftImpl (StringRef name) const {
43
47
StringRef swiftPath = getDriver ().getSwiftProgramPath ();
@@ -71,12 +75,15 @@ toolchains::Darwin::constructInvocation(const InterpretJobAction &job,
71
75
const JobContext &context) const {
72
76
InvocationInfo II = ToolChain::constructInvocation (job, context);
73
77
78
+ SmallString<128 > envValue (OS_LIBRARY_PATH " :" );
79
+
74
80
SmallString<128 > runtimeLibraryPath;
75
81
getRuntimeLibraryPath (runtimeLibraryPath, context.Args , /* Shared=*/ true );
82
+ envValue.append (runtimeLibraryPath);
76
83
77
84
addPathEnvironmentVariableIfNeeded (II.ExtraEnvironment , " DYLD_LIBRARY_PATH" ,
78
85
" :" , options::OPT_L, context.Args ,
79
- runtimeLibraryPath );
86
+ envValue );
80
87
addPathEnvironmentVariableIfNeeded (II.ExtraEnvironment , " DYLD_FRAMEWORK_PATH" ,
81
88
" :" , options::OPT_F, context.Args );
82
89
// FIXME: Add options::OPT_Fsystem paths to DYLD_FRAMEWORK_PATH as well.
0 commit comments