Removed redundant global.params.os field.

I hope I have untangled the checks for "native" Windows (Triple::Win32)
vs. Windows/MinGW/Cygwin (Triple::isOSWindows) correctly.

MinGW needs some default libraries as well, has to be fixed later.
This commit is contained in:
David Nadlinger 2013-02-07 17:13:24 +01:00
parent 4e02f41f31
commit d4b391249d
15 changed files with 71 additions and 59 deletions

View file

@ -220,32 +220,30 @@ int linkObjToBinaryGcc(bool sharedLib)
// default libs
bool addSoname = false;
switch(global.params.os) {
case OSLinux:
switch (global.params.targetTriple.getOS()) {
case llvm::Triple::Linux:
addSoname = true;
args.push_back("-lrt");
// fallthrough
case OSMacOSX:
case llvm::Triple::Darwin:
case llvm::Triple::MacOSX:
args.push_back("-ldl");
// fallthrough
case OSFreeBSD:
case llvm::Triple::FreeBSD:
addSoname = true;
args.push_back("-lpthread");
args.push_back("-lm");
break;
case OSSolaris:
case llvm::Triple::Solaris:
args.push_back("-lm");
args.push_back("-lumem");
// solaris TODO
break;
case OSWindows:
// FIXME: I'd assume kernel32 etc
break;
default:
// OS not yet handled, will probably lead to linker errors.
// FIXME: Win32, MinGW.
break;
}