Index: MscBuilder.icpp =================================================================== --- MscBuilder.icpp (revisione 4411) +++ MscBuilder.icpp (copia locale) @@ -314,7 +314,7 @@ c = cc_speed; int slot = AllocSlot(); if(slot < 0 || !Run(c + PdbPch(package, slot, !sContainsPchOptions(cc) && !sContainsPchOptions(soptions[i])) - + soptions[i] + (ext == ".c" ? " -Tc " : " -Tp ") + + " " + soptions[i] + (ext == ".c" ? " -Tc " : " -Tp ") + GetHostPathQ(fn) + " -Fo" + GetHostPathQ(objfile), slot, GetHostPath(objfile), 1)) execerr = true; } @@ -373,9 +373,10 @@ Vector objinfo = host->GetFileInfo(obj); for(int i = 0; i < obj.GetCount(); i++) if(objinfo[i] > producttime) { - String lib; + String linker, lib; if(is_shared) { - lib << LinkerName() << " -dll -nologo -machine:" << MachineName() + linker << LinkerName() << "-dll -nologo "; + lib << "-machine:" << MachineName() << " -pdb:" << GetHostPathQ(ForceExt(product, ".pdb")) << " -out:" << GetHostPathQ(product); if(!HasFlag("MSC10") && !HasFlag("MSC10X64")) @@ -435,7 +436,7 @@ } } else{ - lib << (HasFlag("INTEL") ? "xilib" : "link /lib") << " -nologo"; + linker << (HasFlag("INTEL") ? "xilib" : "link /lib") << " -nologo "; if(HasFlag("FORCE_SIZE")){ if(sContainsPchOptions(release_size_options)) lib << " -ltcg"; @@ -451,7 +452,41 @@ PutConsole("Creating library..."); IdeConsoleEndGroup(); DeleteFile(product); - if(Execute(lib)) { + String tmpFileName; + if(linker.GetCount() + lib.GetCount() >= 8192) + { + tmpFileName = GetTempFileName(); + // we can't simply put all data on a single line + // as it has a limit of around 130000 chars too, so we split + // in multiple lines + FileOut f(tmpFileName); + while(lib != "") + { + int found = 0; + bool quotes = false; + int lim = min(8192, lib.GetCount()); + for(int i = 0; i < lim; i++) + { + char c = lib[i]; + if(isspace(c) && !quotes) + found = i; + else if(c == '"') + quotes = !quotes; + } + if(!found) + found = lib.GetCount(); + f.PutLine(lib.Left(found)); + lib.Remove(0, found); + } + f.Close(); + linker << "@" << tmpFileName; + } + else + linker << lib; + bool res = Execute(linker); + if(tmpFileName != "") + FileDelete(tmpFileName); + if(res) { DeleteFile(product); return false; }