Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 788430 | Differences between
and this patch

Collapse All | Expand All

(-)a/clang/lib/Driver/ToolChains/MinGW.cpp (-3 / +24 lines)
Lines 326-332 Link Here
326
326
327
// Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.
327
// Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.
328
static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
328
static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
329
                           std::string &Ver) {
329
                           std::string &Ver,
330
                           toolchains::Generic_GCC::GCCVersion &GccVer) {
330
  auto Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0");
331
  auto Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0");
331
  std::error_code EC;
332
  std::error_code EC;
332
  for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE;
333
  for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE;
Lines 338-343 Link Here
338
      continue;
339
      continue;
339
    if (CandidateVersion <= Version)
340
    if (CandidateVersion <= Version)
340
      continue;
341
      continue;
342
    GccVer = CandidateVersion;
341
    Ver = std::string(VersionText);
343
    Ver = std::string(VersionText);
342
    GccLibDir = LI->path();
344
    GccLibDir = LI->path();
343
  }
345
  }
Lines 357-363 Link Here
357
    for (StringRef CandidateArch : Archs) {
359
    for (StringRef CandidateArch : Archs) {
358
      llvm::SmallString<1024> LibDir(Base);
360
      llvm::SmallString<1024> LibDir(Base);
359
      llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateArch);
361
      llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateArch);
360
      if (findGccVersion(LibDir, GccLibDir, Ver)) {
362
      if (findGccVersion(LibDir, GccLibDir, Ver, GccVer)) {
361
        Arch = std::string(CandidateArch);
363
        Arch = std::string(CandidateArch);
362
        return;
364
        return;
363
      }
365
      }
Lines 420-425 Link Here
420
  getFilePaths().push_back(GccLibDir);
422
  getFilePaths().push_back(GccLibDir);
421
  getFilePaths().push_back(
423
  getFilePaths().push_back(
422
      (Base + Arch + llvm::sys::path::get_separator() + "lib").str());
424
      (Base + Arch + llvm::sys::path::get_separator() + "lib").str());
425
  
426
  // Gentoo
427
  getFilePaths().push_back(
428
      (Base + Arch + llvm::sys::path::get_separator() + "mingw/lib").str());
429
  
423
  getFilePaths().push_back(Base + "lib");
430
  getFilePaths().push_back(Base + "lib");
424
  // openSUSE
431
  // openSUSE
425
  getFilePaths().push_back(Base + Arch + "/sys-root/mingw/lib");
432
  getFilePaths().push_back(Base + Arch + "/sys-root/mingw/lib");
Lines 572-577 Link Here
572
579
573
  addSystemInclude(DriverArgs, CC1Args,
580
  addSystemInclude(DriverArgs, CC1Args,
574
                   Base + Arch + llvm::sys::path::get_separator() + "include");
581
                   Base + Arch + llvm::sys::path::get_separator() + "include");
582
583
  // Gentoo
584
  addSystemInclude(DriverArgs, CC1Args,
585
                   Base + Arch + llvm::sys::path::get_separator() + "usr/include");
586
  
575
  addSystemInclude(DriverArgs, CC1Args, Base + "include");
587
  addSystemInclude(DriverArgs, CC1Args, Base + "include");
576
}
588
}
577
589
Lines 592-598 Link Here
592
    break;
604
    break;
593
605
594
  case ToolChain::CST_Libstdcxx:
606
  case ToolChain::CST_Libstdcxx:
595
    llvm::SmallVector<llvm::SmallString<1024>, 4> CppIncludeBases;
607
    llvm::SmallVector<llvm::SmallString<1024>, 7> CppIncludeBases;
596
    CppIncludeBases.emplace_back(Base);
608
    CppIncludeBases.emplace_back(Base);
597
    llvm::sys::path::append(CppIncludeBases[0], Arch, "include", "c++");
609
    llvm::sys::path::append(CppIncludeBases[0], Arch, "include", "c++");
598
    CppIncludeBases.emplace_back(Base);
610
    CppIncludeBases.emplace_back(Base);
Lines 601-606 Link Here
601
    llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver);
613
    llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver);
602
    CppIncludeBases.emplace_back(GccLibDir);
614
    CppIncludeBases.emplace_back(GccLibDir);
603
    llvm::sys::path::append(CppIncludeBases[3], "include", "c++");
615
    llvm::sys::path::append(CppIncludeBases[3], "include", "c++");
616
    CppIncludeBases.emplace_back(GccLibDir);
617
    llvm::sys::path::append(CppIncludeBases[4], "include",
618
                            "g++-v" + GccVer.Text);
619
    CppIncludeBases.emplace_back(GccLibDir);
620
    llvm::sys::path::append(CppIncludeBases[5], "include",
621
                            "g++-v" + GccVer.MajorStr + "." + GccVer.MinorStr);
622
    CppIncludeBases.emplace_back(GccLibDir);
623
    llvm::sys::path::append(CppIncludeBases[6], "include",
624
                            "g++-v" + GccVer.MajorStr);
604
    for (auto &CppIncludeBase : CppIncludeBases) {
625
    for (auto &CppIncludeBase : CppIncludeBases) {
605
      addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
626
      addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
606
      CppIncludeBase += Slash;
627
      CppIncludeBase += Slash;
(-)a/clang/lib/Driver/ToolChains/MinGW.h (+1 lines)
Lines 98-103 Link Here
98
98
99
  std::string Base;
99
  std::string Base;
100
  std::string GccLibDir;
100
  std::string GccLibDir;
101
  clang::driver::toolchains::Generic_GCC::GCCVersion GccVer;
101
  std::string Ver;
102
  std::string Ver;
102
  std::string Arch;
103
  std::string Arch;
103
  mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;
104
  mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;

Return to bug 788430