diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-10-13 07:34:11 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-10-13 07:34:11 +0000 |
commit | 75f76c0a4ca8e57774bf6c6b540a6ab4f516ddd1 (patch) | |
tree | 36c8293c8b7c55477db8c34d39fe89dc1db35ca1 /sys-devel | |
parent | Bump libclc dep for multilib. (diff) | |
download | gentoo-2-75f76c0a4ca8e57774bf6c6b540a6ab4f516ddd1.tar.gz gentoo-2-75f76c0a4ca8e57774bf6c6b540a6ab4f516ddd1.tar.bz2 gentoo-2-75f76c0a4ca8e57774bf6c6b540a6ab4f516ddd1.zip |
Backport g++-X.Y header location support. Fixes bug #487584.
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
Diffstat (limited to 'sys-devel')
-rw-r--r-- | sys-devel/llvm/ChangeLog | 6 | ||||
-rw-r--r-- | sys-devel/llvm/files/clang-3.3-gcc-header-path.patch | 90 | ||||
-rw-r--r-- | sys-devel/llvm/llvm-3.3-r1.ebuild | 8 |
3 files changed, 101 insertions, 3 deletions
diff --git a/sys-devel/llvm/ChangeLog b/sys-devel/llvm/ChangeLog index 133c9a498bab..83a7fe6970b8 100644 --- a/sys-devel/llvm/ChangeLog +++ b/sys-devel/llvm/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-devel/llvm # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.138 2013/10/04 15:43:44 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/ChangeLog,v 1.139 2013/10/13 07:34:11 mgorny Exp $ + + 13 Oct 2013; Michał Górny <mgorny@gentoo.org> + +files/clang-3.3-gcc-header-path.patch, llvm-3.3-r1.ebuild: + Backport g++-X.Y header location support. Fixes bug #487584. 04 Oct 2013; Michał Górny <mgorny@gentoo.org> llvm-3.3-r1.ebuild, llvm-9999.ebuild: diff --git a/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch b/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch new file mode 100644 index 000000000000..dc9a4f7bb79c --- /dev/null +++ b/sys-devel/llvm/files/clang-3.3-gcc-header-path.patch @@ -0,0 +1,90 @@ +Backport handling of 'g++-vX.Y' header location. + +Fixes: https://bugs.gentoo.org/show_bug.cgi?id=487584 +--- + tools/clang/lib/Driver/ToolChains.cpp | 20 ++++++++++++-------- + tools/clang/lib/Driver/ToolChains.h | 3 +++ + 2 files changed, 15 insertions(+), 8 deletions(-) + +diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp +index 7c9e9c0..e38d42d 100644 +--- a/tools/clang/lib/Driver/ToolChains.cpp ++++ b/tools/clang/lib/Driver/ToolChains.cpp +@@ -917,17 +917,19 @@ Darwin_Generic_GCC::ComputeEffectiveClangTriple(const ArgList &Args, + /// This is the primary means of forming GCCVersion objects. + /*static*/ + Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) { +- const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "" }; ++ const GCCVersion BadVersion = { VersionText.str(), -1, -1, -1, "", "", "" }; + std::pair<StringRef, StringRef> First = VersionText.split('.'); + std::pair<StringRef, StringRef> Second = First.second.split('.'); + +- GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "" }; ++ GCCVersion GoodVersion = { VersionText.str(), -1, -1, -1, "", "", "" }; + if (First.first.getAsInteger(10, GoodVersion.Major) || + GoodVersion.Major < 0) + return BadVersion; ++ GoodVersion.MajorStr = First.first.str(); + if (Second.first.getAsInteger(10, GoodVersion.Minor) || + GoodVersion.Minor < 0) + return BadVersion; ++ GoodVersion.MinorStr = Second.first.str(); + + // First look for a number prefix and parse that if present. Otherwise just + // stash the entire patch string in the suffix, and leave the number +@@ -945,7 +947,7 @@ Generic_GCC::GCCVersion Linux::GCCVersion::Parse(StringRef VersionText) { + if (PatchText.slice(0, EndNumber).getAsInteger(10, GoodVersion.Patch) || + GoodVersion.Patch < 0) + return BadVersion; +- GoodVersion.PatchSuffix = PatchText.substr(EndNumber).str(); ++ GoodVersion.PatchSuffix = PatchText.substr(EndNumber); + } + } + +@@ -2590,11 +2592,11 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, + // equivalent to '/usr/include/c++/X.Y' in almost all cases. + StringRef LibDir = GCCInstallation.getParentLibPath(); + StringRef InstallDir = GCCInstallation.getInstallPath(); +- StringRef Version = GCCInstallation.getVersion().Text; + StringRef TripleStr = GCCInstallation.getTriple().str(); ++ const GCCVersion &Version = GCCInstallation.getVersion(); + + if (addLibStdCXXIncludePaths(LibDir.str() + "/../include", +- "/c++/" + Version.str(), ++ "/c++/" + Version.Text, + TripleStr, + GCCInstallation.getMultiarchSuffix(), + DriverArgs, CC1Args)) +@@ -2602,10 +2604,12 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, + + const std::string IncludePathCandidates[] = { + // Gentoo is weird and places its headers inside the GCC install, so if the +- // first attempt to find the headers fails, try this pattern. +- InstallDir.str() + "/include/g++-v4", ++ // first attempt to find the headers fails, try these patterns. ++ InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." + ++ Version.MinorStr, ++ InstallDir.str() + "/include/g++-v" + Version.MajorStr, + // Android standalone toolchain has C++ headers in yet another place. +- LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.str(), ++ LibDir.str() + "/../" + TripleStr.str() + "/include/c++/" + Version.Text, + // Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++, + // without a subdirectory corresponding to the gcc version. + LibDir.str() + "/../include/c++", +diff --git a/tools/clang/lib/Driver/ToolChains.h b/tools/clang/lib/Driver/ToolChains.h +index 3afd8dd..04cf467 100644 +--- a/tools/clang/lib/Driver/ToolChains.h ++++ b/tools/clang/lib/Driver/ToolChains.h +@@ -48,6 +48,9 @@ protected: + /// \brief The parsed major, minor, and patch numbers. + int Major, Minor, Patch; + ++ /// \brief The text of the parsed major, and major+minor versions. ++ std::string MajorStr, MinorStr; ++ + /// \brief Any textual suffix on the patch number. + std::string PatchSuffix; + +-- +1.8.3.2 + diff --git a/sys-devel/llvm/llvm-3.3-r1.ebuild b/sys-devel/llvm/llvm-3.3-r1.ebuild index ab0651ddb65c..f88426e707e1 100644 --- a/sys-devel/llvm/llvm-3.3-r1.ebuild +++ b/sys-devel/llvm/llvm-3.3-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.3-r1.ebuild,v 1.13 2013/10/04 15:43:44 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/llvm/llvm-3.3-r1.ebuild,v 1.14 2013/10/13 07:34:11 mgorny Exp $ EAPI=5 @@ -165,7 +165,11 @@ src_prepare() { epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch epatch "${FILESDIR}"/${P}-R600_debug.patch epatch "${FILESDIR}"/${PN}-3.3-gentoo-install.patch - use clang && epatch "${FILESDIR}"/clang-3.3-gentoo-install.patch + if use clang; then + epatch "${FILESDIR}"/clang-3.3-gentoo-install.patch + # backport support for g++-X.Y header location + epatch "${FILESDIR}"/clang-3.3-gcc-header-path.patch + fi local sub_files=( Makefile.config.in |