Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 706245 Details for
Bug 788430
sys-devel/clang: paths not set correctly for mingw
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix issue
mingw.patch (text/plain), 3.54 KB, created by
Mark Harmstone
on 2021-05-05 21:30:29 UTC
(
hide
)
Description:
patch to fix issue
Filename:
MIME Type:
Creator:
Mark Harmstone
Created:
2021-05-05 21:30:29 UTC
Size:
3.54 KB
patch
obsolete
>--- a/clang/lib/Driver/ToolChains/MinGW.cpp 2021-05-05 03:19:56.148093452 +0100 >+++ b/clang/lib/Driver/ToolChains/MinGW.cpp 2021-05-05 03:21:54.686095364 +0100 >@@ -326,7 +326,8 @@ > > // Simplified from Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple. > static bool findGccVersion(StringRef LibDir, std::string &GccLibDir, >- std::string &Ver) { >+ std::string &Ver, >+ toolchains::Generic_GCC::GCCVersion &GccVer) { > auto Version = toolchains::Generic_GCC::GCCVersion::Parse("0.0.0"); > std::error_code EC; > for (llvm::sys::fs::directory_iterator LI(LibDir, EC), LE; !EC && LI != LE; >@@ -338,6 +339,7 @@ > continue; > if (CandidateVersion <= Version) > continue; >+ GccVer = CandidateVersion; > Ver = std::string(VersionText); > GccLibDir = LI->path(); > } >@@ -357,7 +359,7 @@ > for (StringRef CandidateArch : Archs) { > llvm::SmallString<1024> LibDir(Base); > llvm::sys::path::append(LibDir, CandidateLib, "gcc", CandidateArch); >- if (findGccVersion(LibDir, GccLibDir, Ver)) { >+ if (findGccVersion(LibDir, GccLibDir, Ver, GccVer)) { > Arch = std::string(CandidateArch); > return; > } >@@ -420,6 +422,11 @@ > getFilePaths().push_back(GccLibDir); > getFilePaths().push_back( > (Base + Arch + llvm::sys::path::get_separator() + "lib").str()); >+ >+ // Gentoo >+ getFilePaths().push_back( >+ (Base + Arch + llvm::sys::path::get_separator() + "mingw/lib").str()); >+ > getFilePaths().push_back(Base + "lib"); > // openSUSE > getFilePaths().push_back(Base + Arch + "/sys-root/mingw/lib"); >@@ -572,6 +579,11 @@ > > addSystemInclude(DriverArgs, CC1Args, > Base + Arch + llvm::sys::path::get_separator() + "include"); >+ >+ // Gentoo >+ addSystemInclude(DriverArgs, CC1Args, >+ Base + Arch + llvm::sys::path::get_separator() + "usr/include"); >+ > addSystemInclude(DriverArgs, CC1Args, Base + "include"); > } > >@@ -592,7 +604,7 @@ > break; > > case ToolChain::CST_Libstdcxx: >- llvm::SmallVector<llvm::SmallString<1024>, 4> CppIncludeBases; >+ llvm::SmallVector<llvm::SmallString<1024>, 7> CppIncludeBases; > CppIncludeBases.emplace_back(Base); > llvm::sys::path::append(CppIncludeBases[0], Arch, "include", "c++"); > CppIncludeBases.emplace_back(Base); >@@ -601,6 +613,15 @@ > llvm::sys::path::append(CppIncludeBases[2], "include", "c++", Ver); > CppIncludeBases.emplace_back(GccLibDir); > llvm::sys::path::append(CppIncludeBases[3], "include", "c++"); >+ CppIncludeBases.emplace_back(GccLibDir); >+ llvm::sys::path::append(CppIncludeBases[4], "include", >+ "g++-v" + GccVer.Text); >+ CppIncludeBases.emplace_back(GccLibDir); >+ llvm::sys::path::append(CppIncludeBases[5], "include", >+ "g++-v" + GccVer.MajorStr + "." + GccVer.MinorStr); >+ CppIncludeBases.emplace_back(GccLibDir); >+ llvm::sys::path::append(CppIncludeBases[6], "include", >+ "g++-v" + GccVer.MajorStr); > for (auto &CppIncludeBase : CppIncludeBases) { > addSystemInclude(DriverArgs, CC1Args, CppIncludeBase); > CppIncludeBase += Slash; >--- a/clang/lib/Driver/ToolChains/MinGW.h 2021-05-05 03:19:56.148093452 +0100 >+++ b/clang/lib/Driver/ToolChains/MinGW.h 2021-05-05 03:21:54.686095364 +0100 >@@ -98,6 +98,7 @@ > > std::string Base; > std::string GccLibDir; >+ clang::driver::toolchains::Generic_GCC::GCCVersion GccVer; > std::string Ver; > std::string Arch; > mutable std::unique_ptr<tools::gcc::Preprocessor> Preprocessor;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 788430
: 706245 |
786824