Skip to content

Commit 6073126

Browse files
committed
Don't add rpath to swift with statically linking
This updates the rpath linking logic to only add the rpath that points to the swift dylibs in the case that the libraries are not statically linked into the binary.
1 parent 1ca7f68 commit 6073126

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,10 @@ toolchains::Darwin::constructInvocation(const LinkJobAction &job,
12451245
Arguments.push_back("-force_load_swift_libs");
12461246
} else {
12471247
Arguments.push_back(context.Args.MakeArgString(RuntimeLibPath));
1248+
// FIXME: We probably shouldn't be adding an rpath here unless we know ahead
1249+
// of time the standard library won't be copied. SR-1967
1250+
Arguments.push_back("-rpath");
1251+
Arguments.push_back(context.Args.MakeArgString(RuntimeLibPath));
12481252
}
12491253

12501254
if (context.Args.hasArg(options::OPT_profile_generate)) {
@@ -1283,11 +1287,6 @@ toolchains::Darwin::constructInvocation(const LinkJobAction &job,
12831287
Arguments.push_back(context.Args.MakeArgString(LibProfile));
12841288
}
12851289

1286-
// FIXME: We probably shouldn't be adding an rpath here unless we know ahead
1287-
// of time the standard library won't be copied.
1288-
Arguments.push_back("-rpath");
1289-
Arguments.push_back(context.Args.MakeArgString(RuntimeLibPath));
1290-
12911290
// FIXME: Properly handle deployment targets.
12921291
assert(Triple.isiOS() || Triple.isWatchOS() || Triple.isMacOSX());
12931292
if (Triple.isiOS()) {

0 commit comments

Comments
 (0)