Skip to content

Commit 5edfa5c

Browse files
committed
Only support dynamic linking until static is tested
1 parent 56ef48b commit 5edfa5c

File tree

1 file changed

+2
-44
lines changed

1 file changed

+2
-44
lines changed

lib/Driver/ToolChains.cpp

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,24 +1567,14 @@ toolchains::Windows::constructInvocation(const LinkJobAction &job,
15671567
Arguments.push_back(context.Args.MakeArgString(Target));
15681568
}
15691569

1570-
bool staticExecutable = context.Args.hasFlag(
1571-
options::OPT_static_executable, options::OPT_no_static_executable, false);
1572-
bool staticStdlib = context.Args.hasFlag(
1573-
options::OPT_static_stdlib, options::OPT_no_static_stdlib, false);
1574-
15751570
SmallString<128> SharedRuntimeLibPath;
15761571
getRuntimeLibraryPath(SharedRuntimeLibPath, context.Args, *this);
15771572

1578-
SmallString<128> StaticRuntimeLibPath;
1579-
getRuntimeStaticLibraryPath(StaticRuntimeLibPath, context.Args, *this);
1580-
15811573
// Add the runtime library link path, which is platform-specific and found
15821574
// relative to the compiler.
1583-
if (!(staticExecutable || staticStdlib)) {
1584-
Arguments.push_back("-L");
1585-
Arguments.push_back(context.Args.MakeArgString(SharedRuntimeLibPath + "/"
1575+
Arguments.push_back("-L");
1576+
Arguments.push_back(context.Args.MakeArgString(SharedRuntimeLibPath + "/"
15861577
+ getTriple().getArchName()));
1587-
}
15881578

15891579
addPrimaryInputsOfType(Arguments, context.Inputs, types::TY_Object);
15901580
addInputsOfType(Arguments, context.InputActions, types::TY_Object);
@@ -1603,38 +1593,6 @@ toolchains::Windows::constructInvocation(const LinkJobAction &job,
16031593
Arguments.push_back(context.Args.MakeArgString(context.OI.SDKPath));
16041594
}
16051595

1606-
// Link the standard library.
1607-
Arguments.push_back("-L");
1608-
1609-
if (staticExecutable) {
1610-
Arguments.push_back(context.Args.MakeArgString(StaticRuntimeLibPath));
1611-
1612-
SmallString<128> linkFilePath = StaticRuntimeLibPath;
1613-
llvm::sys::path::append(linkFilePath, "static-executable-args.lnk");
1614-
auto linkFile = linkFilePath.str();
1615-
1616-
if (llvm::sys::fs::is_regular_file(linkFile)) {
1617-
Arguments.push_back(context.Args.MakeArgString(Twine("@") + linkFile));
1618-
} else {
1619-
llvm::report_fatal_error(
1620-
"-static-executable not supported on this platform");
1621-
}
1622-
} else if (staticStdlib) {
1623-
Arguments.push_back(context.Args.MakeArgString(StaticRuntimeLibPath));
1624-
1625-
SmallString<128> linkFilePath = StaticRuntimeLibPath;
1626-
llvm::sys::path::append(linkFilePath, "static-stdlib-args.lnk");
1627-
auto linkFile = linkFilePath.str();
1628-
if (llvm::sys::fs::is_regular_file(linkFile)) {
1629-
Arguments.push_back(context.Args.MakeArgString(Twine("@") + linkFile));
1630-
} else {
1631-
llvm::report_fatal_error(linkFile + " not found");
1632-
}
1633-
} else {
1634-
Arguments.push_back(
1635-
context.Args.MakeArgString(SharedRuntimeLibPath + "/swiftCore.lib"));
1636-
}
1637-
16381596
if (job.getKind() == LinkKind::Executable) {
16391597
if (context.OI.SelectedSanitizers & SanitizerKind::Address)
16401598
addLinkSanitizerLibArgsForWindows(context.Args, Arguments, "asan", *this);

0 commit comments

Comments
 (0)