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

(-)file_not_specified_in_diff (-6 / +27 lines)
Line  Link Here
0
-- a/clang/lib/Driver/ToolChains/MinGW.cpp
0
++ b/clang/lib/Driver/ToolChains/MinGW.cpp
Lines 334-341 Link Here
334
334
335
// Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.
335
// Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple.
336
static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
336
static bool findGccVersion(StringRef LibDir, std::string &GccLibDir,
337
                           std::string &Ver) {
337
                           std::string &Ver,
338
  auto Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0");
338
                           toolchains::Generic_GCC::GCCVersion &Version) {
339
  Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0");
339
  std::error_code EC;
340
  std::error_code EC;
340
  for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE;
341
  for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE;
341
       LI = LI.increment(EC)) {
342
       LI = LI.increment(EC)) {
Lines 366-372 Link Here
366
    for (StringRef CandidateSysroot : SubdirNames) {
367
    for (StringRef CandidateSysroot : SubdirNames) {
367
      llvm::SmallString<1024> LibDir(Base);
368
      llvm::SmallString<1024> LibDir(Base);
368
      llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateSysroot);
369
      llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateSysroot);
369
      if (findGccVersion(LibDir, GccLibDir, Ver)) {
370
      if (findGccVersion(LibDir, GccLibDir, Ver, GccVer)) {
370
        SubdirName = std::string(CandidateSysroot);
371
        SubdirName = std::string(CandidateSysroot);
371
        return;
372
        return;
372
      }
373
      }
Lines 433-438 Link Here
433
  getFilePaths().push_back(GccLibDir);
434
  getFilePaths().push_back(GccLibDir);
434
  getFilePaths().push_back(
435
  getFilePaths().push_back(
435
      (Base + SubdirName + llvm::sys::path::get_separator() + "lib").str());
436
      (Base + SubdirName + llvm::sys::path::get_separator() + "lib").str());
437
438
  // Gentoo
439
  getFilePaths().push_back(
440
      (Base + SubdirName + llvm::sys::path::get_separator() + "mingw/lib").str());
441
436
  getFilePaths().push_back(Base + "lib");
442
  getFilePaths().push_back(Base + "lib");
437
  // openSUSE
443
  // openSUSE
438
  getFilePaths().push_back(Base + SubdirName + "/sys-root/mingw/lib");
444
  getFilePaths().push_back(Base + SubdirName + "/sys-root/mingw/lib");
Lines 587-592 Link Here
587
  addSystemInclude(DriverArgs, CC1Args,
593
  addSystemInclude(DriverArgs, CC1Args,
588
                   Base + SubdirName + llvm::sys::path::get_separator() +
594
                   Base + SubdirName + llvm::sys::path::get_separator() +
589
                       "include");
595
                       "include");
596
597
  // Gentoo
598
  addSystemInclude(DriverArgs, CC1Args,
599
                   Base + SubdirName + llvm::sys::path::get_separator() + "usr/include");
600
590
  addSystemInclude(DriverArgs, CC1Args, Base + "include");
601
  addSystemInclude(DriverArgs, CC1Args, Base + "include");
591
}
602
}
592
603
Lines 614-620 Link Here
614
  }
625
  }
615
626
616
  case ToolChain::CST_Libstdcxx:
627
  case ToolChain::CST_Libstdcxx:
617
    llvm::SmallVector<llvm::SmallString<1024>, 4> CppIncludeBases;
628
    llvm::SmallVector<llvm::SmallString<1024>, 7> CppIncludeBases;
618
    CppIncludeBases.emplace_back(Base);
629
    CppIncludeBases.emplace_back(Base);
619
    llvm::sys::path::append(CppIncludeBases[0], SubdirName, "include", "c++");
630
    llvm::sys::path::append(CppIncludeBases[0], SubdirName, "include", "c++");
620
    CppIncludeBases.emplace_back(Base);
631
    CppIncludeBases.emplace_back(Base);
Lines 624-629 Link Here
624
    llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver);
635
    llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver);
625
    CppIncludeBases.emplace_back(GccLibDir);
636
    CppIncludeBases.emplace_back(GccLibDir);
626
    llvm::sys::path::append(CppIncludeBases[3], "include", "c++");
637
    llvm::sys::path::append(CppIncludeBases[3], "include", "c++");
638
    CppIncludeBases.emplace_back(GccLibDir);
639
    llvm::sys::path::append(CppIncludeBases[4], "include",
640
                            "g++-v" + GccVer.Text);
641
    CppIncludeBases.emplace_back(GccLibDir);
642
    llvm::sys::path::append(CppIncludeBases[5], "include",
643
                            "g++-v" + GccVer.MajorStr + "." + GccVer.MinorStr);
644
    CppIncludeBases.emplace_back(GccLibDir);
645
    llvm::sys::path::append(CppIncludeBases[6], "include",
646
                            "g++-v" + GccVer.MajorStr);
627
    for (auto &CppIncludeBase : CppIncludeBases) {
647
    for (auto &CppIncludeBase : CppIncludeBases) {
628
      addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
648
      addSystemInclude(DriverArgs, CC1Args, CppIncludeBase);
629
      CppIncludeBase += Slash;
649
      CppIncludeBase += Slash;
630
-- a/clang/lib/Driver/ToolChains/MinGW.h
650
++ b/clang/lib/Driver/ToolChains/MinGW.h
Lines 103-108 Link Here
103
103
104
  std::string Base;
104
  std::string Base;
105
  std::string GccLibDir;
105
  std::string GccLibDir;
106
  clang::driver::toolchains::Generic_GCC::GCCVersion GccVer;
106
  std::string Ver;
107
  std::string Ver;
107
  std::string SubdirName;
108
  std::string SubdirName;
108
  mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;
109
  mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;

Return to bug 788430