diff options
author | Fabian Groffen <grobian@gentoo.org> | 2010-09-08 17:34:54 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2010-09-08 17:34:54 +0000 |
commit | b91caef7eadc09b60e615e806ce283a75081a5d7 (patch) | |
tree | 5e2bb44ca6e2251a5c39359d7d012e73046d3c32 /sys-devel/clang | |
parent | Bumping and cleaning up (diff) | |
download | gentoo-2-b91caef7eadc09b60e615e806ce283a75081a5d7.tar.gz gentoo-2-b91caef7eadc09b60e615e806ce283a75081a5d7.tar.bz2 gentoo-2-b91caef7eadc09b60e615e806ce283a75081a5d7.zip |
Fix configurations for (newer) Darwin configurations, thanks Heiko Przybyl
(Portage version: 2.2.01.15553-prefix/cvs/Darwin powerpc)
Diffstat (limited to 'sys-devel/clang')
-rw-r--r-- | sys-devel/clang/ChangeLog | 6 | ||||
-rw-r--r-- | sys-devel/clang/clang-2.7-r2.ebuild | 9 | ||||
-rw-r--r-- | sys-devel/clang/files/clang-2.7-darwin-prefix.patch | 61 |
3 files changed, 74 insertions, 2 deletions
diff --git a/sys-devel/clang/ChangeLog b/sys-devel/clang/ChangeLog index 58d04beb18d4..e1031b2342b7 100644 --- a/sys-devel/clang/ChangeLog +++ b/sys-devel/clang/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for sys-devel/clang # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.21 2010/09/03 17:52:05 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/ChangeLog,v 1.22 2010/09/08 17:34:54 grobian Exp $ + + 08 Sep 2010; Fabian Groffen <grobian@gentoo.org> clang-2.7-r2.ebuild, + +files/clang-2.7-darwin-prefix.patch: + Fix configurations for (newer) Darwin configurations, thanks Heiko Przybyl 03 Sep 2010; Fabian Groffen <grobian@gentoo.org> clang-2.7-r2.ebuild: Marked ~amd64-linux diff --git a/sys-devel/clang/clang-2.7-r2.ebuild b/sys-devel/clang/clang-2.7-r2.ebuild index fcf9f0c8c2fb..93fd702dd73e 100644 --- a/sys-devel/clang/clang-2.7-r2.ebuild +++ b/sys-devel/clang/clang-2.7-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.7-r2.ebuild,v 1.4 2010/09/03 17:52:05 grobian Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/clang/clang-2.7-r2.ebuild,v 1.5 2010/09/08 17:34:54 grobian Exp $ EAPI=3 @@ -33,6 +33,13 @@ src_prepare() { # Same as llvm doc patches epatch "${FILESDIR}"/${PN}-2.7-fixdoc.patch + # Fix toolchain lookup for Darwin/Prefix. + epatch "${FILESDIR}"/${PN}-2.7-darwin-prefix.patch + sed -e "s|@GENTOO_PORTAGE_CHOST@|${CHOST%%-darwin*}-darwin|g" \ + -e "s|@GENTOO_PORTAGE_EPREFIX@|${EPREFIX}|g" \ + -i tools/clang/lib/Driver/ToolChains.cpp \ + || die "fixing toolchain lookup" + # multilib-strict sed -e "/PROJ_headers/s#lib/clang#$(get_libdir)/clang#" \ -i tools/clang/lib/Headers/Makefile \ diff --git a/sys-devel/clang/files/clang-2.7-darwin-prefix.patch b/sys-devel/clang/files/clang-2.7-darwin-prefix.patch new file mode 100644 index 000000000000..d44147173544 --- /dev/null +++ b/sys-devel/clang/files/clang-2.7-darwin-prefix.patch @@ -0,0 +1,61 @@ +This code looks as if it is written by Apple, lots of assumptions that +only hold for them and their scenario. + +--- llvm-2.7/tools/clang/lib/Driver/ToolChains.cpp ++++ llvm-2.7/tools/clang/lib/Driver/ToolChains.cpp +@@ -112,7 +112,7 @@ DarwinGCC::DarwinGCC(const HostInfo &Hos + GCCVersion[2] = _GCCVersion[2]; + + // Set up the tool chain paths to match gcc. +- ToolChainDir = "i686-apple-darwin"; ++ ToolChainDir = "@GENTOO_PORTAGE_CHOST@"; + ToolChainDir += llvm::utostr(DarwinVersion[0]); + ToolChainDir += "/"; + ToolChainDir += llvm::utostr(GCCVersion[0]); +@@ -122,9 +122,9 @@ DarwinGCC::DarwinGCC(const HostInfo &Hos + ToolChainDir += llvm::utostr(GCCVersion[2]); + + // Try the next major version if that tool chain dir is invalid. +- std::string Tmp = "/usr/lib/gcc/" + ToolChainDir; ++ std::string Tmp = "@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir; + if (!llvm::sys::Path(Tmp).exists()) { +- std::string Next = "i686-apple-darwin"; ++ std::string Next = "@GENTOO_PORTAGE_CHOST@"; + Next += llvm::utostr(DarwinVersion[0] + 1); + Next += "/"; + Next += llvm::utostr(GCCVersion[0]); +@@ -136,7 +136,7 @@ DarwinGCC::DarwinGCC(const HostInfo &Hos + // Use that if it exists, otherwise hope the user isn't linking. + // + // FIXME: Drop dependency on gcc's tool chain. +- Tmp = "/usr/lib/gcc/" + Next; ++ Tmp = "@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + Next; + if (llvm::sys::Path(Tmp).exists()) + ToolChainDir = Next; + } +@@ -219,19 +219,19 @@ void DarwinGCC::AddLinkSearchPathArgs(co + ArgStringList &CmdArgs) const { + // FIXME: Derive these correctly. + if (getArchName() == "x86_64") { +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir + + "/x86_64")); + // Intentionally duplicated for (temporary) gcc bug compatibility. +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir + + "/x86_64")); + } +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/" + ToolChainDir)); +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir)); ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/" + ToolChainDir)); ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir)); + // Intentionally duplicated for (temporary) gcc bug compatibility. +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir)); +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir)); ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir + + "/../../../" + ToolChainDir)); +- CmdArgs.push_back(Args.MakeArgString("-L/usr/lib/gcc/" + ToolChainDir + ++ CmdArgs.push_back(Args.MakeArgString("-L@GENTOO_PORTAGE_EPREFIX@/usr/lib/gcc/" + ToolChainDir + + "/../../..")); + } |