From 92899dff969a31b6531056d280b976a1eccdca2a Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 14 Feb 2013 18:14:49 +0100 Subject: [PATCH] Link in ws2_32 by default on MinGW. --- driver/linker.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/driver/linker.cpp b/driver/linker.cpp index f61e7b77..052aa9ae 100644 --- a/driver/linker.cpp +++ b/driver/linker.cpp @@ -172,9 +172,16 @@ static int linkObjToBinaryGcc(bool sharedLib) // solaris TODO break; + case llvm::Triple::MinGW32: + // This is really more of a kludge, as linking in the Winsock functions + // should be handled by the pragma(lib, ...) in std.socket, but it + // makes LDC behave as expected for now. + args.push_back("-lws2_32"); + break; + default: // OS not yet handled, will probably lead to linker errors. - // FIXME: Win32, MinGW. + // FIXME: Win32. break; }