From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 1AB6F1381F3 for ; Fri, 19 Jul 2013 10:44:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A7EB7E0B3E; Fri, 19 Jul 2013 10:44:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2846EE0B3E for ; Fri, 19 Jul 2013 10:44:54 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1A9B533E1C2 for ; Fri, 19 Jul 2013 10:44:53 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 57AF2E4B05 for ; Fri, 19 Jul 2013 10:44:50 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1374230679.88c5ee15ebcb110381f1821b89acd05d46fa7e18.mgorny@gentoo> Subject: [gentoo-commits] dev/mgorny:master commit in: sys-devel/llvm/files/, sys-devel/llvm/ X-VCS-Repository: dev/mgorny X-VCS-Files: sys-devel/llvm/files/clang-3.4-gentoo-install.patch sys-devel/llvm/files/llvm-3.4-gentoo-install.patch sys-devel/llvm/llvm-9999-r1.ebuild X-VCS-Directories: sys-devel/llvm/files/ sys-devel/llvm/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 88c5ee15ebcb110381f1821b89acd05d46fa7e18 X-VCS-Branch: master Date: Fri, 19 Jul 2013 10:44:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0a7fa007-d281-433c-a930-00a357c9ad75 X-Archives-Hash: ef57279708135bd15d9cfd9a641a5f79 commit: 88c5ee15ebcb110381f1821b89acd05d46fa7e18 Author: Michał Górny gentoo org> AuthorDate: Fri Jul 19 10:44:39 2013 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Jul 19 10:44:39 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=88c5ee15 Replace sed substitutions with patches, for -9999. --- .../llvm/files/clang-3.4-gentoo-install.patch | 71 ++++++++++++++ sys-devel/llvm/files/llvm-3.4-gentoo-install.patch | 108 +++++++++++++++++++++ sys-devel/llvm/llvm-9999-r1.ebuild | 58 ++++------- 3 files changed, 196 insertions(+), 41 deletions(-) diff --git a/sys-devel/llvm/files/clang-3.4-gentoo-install.patch b/sys-devel/llvm/files/clang-3.4-gentoo-install.patch new file mode 100644 index 0000000..b8291f2 --- /dev/null +++ b/sys-devel/llvm/files/clang-3.4-gentoo-install.patch @@ -0,0 +1,71 @@ +From 1a539a8868070e49966c6b5f5e4b9f1257acd7dc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 19 Jul 2013 10:23:57 +0200 +Subject: [PATCH] clang gentoo install + +--- + tools/clang/lib/Driver/Tools.cpp | 4 ++-- + tools/clang/tools/scan-build/scan-build | 4 ++-- + tools/clang/tools/scan-view/scan-view | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp +index e014980..6e60513 100644 +--- a/tools/clang/lib/Driver/Tools.cpp ++++ b/tools/clang/lib/Driver/Tools.cpp +@@ -219,7 +219,7 @@ static void addProfileRT(const ToolChain &TC, const ArgList &Args, + // libprofile_rt.so. We used to use the -l:libprofile_rt.a syntax, but that is + // not supported by old linkers. + std::string ProfileRT = +- std::string(TC.getDriver().Dir) + "/../lib/libprofile_rt.a"; ++ std::string(TC.getDriver().Dir) + "/../@libdir@/llvm/libprofile_rt.a"; + + CmdArgs.push_back(Args.MakeArgString(ProfileRT)); + } +@@ -6177,7 +6177,7 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, + // forward. + if (D.IsUsingLTO(Args) || Args.hasArg(options::OPT_use_gold_plugin)) { + CmdArgs.push_back("-plugin"); +- std::string Plugin = ToolChain.getDriver().Dir + "/../lib/LLVMgold.so"; ++ std::string Plugin = ToolChain.getDriver().Dir + "/../@libdir@/llvm/LLVMgold.so"; + CmdArgs.push_back(Args.MakeArgString(Plugin)); + + // Try to pass driver level flags relevant to LTO code generation down to +diff --git a/tools/clang/tools/scan-build/scan-build b/tools/clang/tools/scan-build/scan-build +index 22d5289..dcb4822 100755 +--- a/tools/clang/tools/scan-build/scan-build ++++ b/tools/clang/tools/scan-build/scan-build +@@ -410,7 +410,7 @@ sub CopyFiles { + + my $Dir = shift; + +- my $JS = Cwd::realpath("$RealBin/sorttable.js"); ++ my $JS = Cwd::realpath("@EPREFIX@/usr/share/llvm/sorttable.js"); + + DieDiag("Cannot find 'sorttable.js'.\n") + if (! -r $JS); +@@ -420,7 +420,7 @@ sub CopyFiles { + DieDiag("Could not copy 'sorttable.js' to '$Dir'.\n") + if (! -r "$Dir/sorttable.js"); + +- my $CSS = Cwd::realpath("$RealBin/scanview.css"); ++ my $CSS = Cwd::realpath("@EPREFIX@/usr/share/llvm/scanview.css"); + + DieDiag("Cannot find 'scanview.css'.\n") + if (! -r $CSS); +diff --git a/tools/clang/tools/scan-view/scan-view b/tools/clang/tools/scan-view/scan-view +index fb27da6..1f8ddb8 100755 +--- a/tools/clang/tools/scan-view/scan-view ++++ b/tools/clang/tools/scan-view/scan-view +@@ -54,7 +54,7 @@ def start_browser(port, options): + webbrowser.open(url) + + def run(port, options, root): +- import ScanView ++ from clang import ScanView + try: + print 'Starting scan-view at: http://%s:%d'%(options.host, + port) +-- +1.8.3.2 + diff --git a/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch b/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch new file mode 100644 index 0000000..2798fa7 --- /dev/null +++ b/sys-devel/llvm/files/llvm-3.4-gentoo-install.patch @@ -0,0 +1,108 @@ +From cdc2bf59ab8200a4bd6b0eb66ac5b8a8ebab67d6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 19 Jul 2013 10:10:52 +0200 +Subject: [PATCH] gentoo install fixes + +--- + Makefile.config.in | 6 +++--- + Makefile.rules | 7 +++---- + tools/gold/Makefile | 2 +- + tools/llvm-config/llvm-config.cpp | 2 +- + utils/FileCheck/Makefile | 2 +- + 5 files changed, 9 insertions(+), 10 deletions(-) + +diff --git a/Makefile.config.in b/Makefile.config.in +index dcca45f..45bf0d1 100644 +--- a/Makefile.config.in ++++ b/Makefile.config.in +@@ -95,10 +95,10 @@ PROJ_internal_prefix := $(prefix) + endif + + PROJ_bindir := $(PROJ_prefix)/bin +-PROJ_libdir := $(PROJ_prefix)/lib ++PROJ_libdir := $(PROJ_prefix)/@libdir@/llvm + PROJ_datadir := $(PROJ_prefix)/share +-PROJ_docsdir := $(PROJ_prefix)/docs/llvm +-PROJ_etcdir := $(PROJ_prefix)/etc/llvm ++PROJ_docsdir := $(PROJ_prefix)/share/doc/@PF@ ++PROJ_etcdir := @EPREFIX@/etc/llvm + PROJ_includedir := $(PROJ_prefix)/include + PROJ_infodir := $(PROJ_prefix)/info + PROJ_mandir := $(PROJ_prefix)/share/man +diff --git a/Makefile.rules b/Makefile.rules +index 1bc78f1..60cd228 100644 +--- a/Makefile.rules ++++ b/Makefile.rules +@@ -277,7 +277,7 @@ ifeq ($(ENABLE_OPTIMIZED),1) + ifneq ($(HOST_OS),FreeBSD) + ifneq ($(HOST_OS),GNU/kFreeBSD) + ifneq ($(HOST_OS),Darwin) +- OmitFramePointer := -fomit-frame-pointer ++ OmitFramePointer := + endif + endif + endif +@@ -605,7 +605,6 @@ endif + ifdef SHARED_LIBRARY + ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + ifneq ($(HOST_OS),Darwin) +- LD.Flags += $(RPATH) -Wl,'$$ORIGIN' + endif + endif + endif +@@ -643,11 +642,11 @@ endif + ifneq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW)) + ifneq ($(HOST_OS), Darwin) + ifdef TOOLNAME +- LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib' $(DynamicFlag) ++ LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)' $(DynamicFlag) + endif + else + ifneq ($(DARWIN_MAJVERS),4) +- LD.Flags += $(RPATH) -Wl,@executable_path/../lib ++ LD.Flags += $(RPATH) -Wl,'$(PROJ_libdir)' + endif + ifeq ($(RC_XBS),YES) + TempFile := $(shell mkdir -p ${OBJROOT}/dSYMs ; mktemp ${OBJROOT}/dSYMs/llvm-lto.XXXXXX) +diff --git a/tools/gold/Makefile b/tools/gold/Makefile +index 496e31c..d36b340 100644 +--- a/tools/gold/Makefile ++++ b/tools/gold/Makefile +@@ -24,7 +24,7 @@ include $(LEVEL)/Makefile.config + # Because off_t is used in the public API, the largefile parts are required for + # ABI compatibility. + CXXFLAGS += -I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +-LDFLAGS += -L$(SharedLibDir)/$(SharedPrefix) ++LDFLAGS += -L$(PROJ_libdir) + + include $(LEVEL)/Makefile.common + +diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp +index 3924e2e..d087ae0 100644 +--- a/tools/llvm-config/llvm-config.cpp ++++ b/tools/llvm-config/llvm-config.cpp +@@ -250,7 +250,7 @@ int main(int argc, char **argv) { + ActivePrefix = CurrentExecPrefix; + ActiveIncludeDir = ActivePrefix + "/include"; + ActiveBinDir = ActivePrefix + "/bin"; +- ActiveLibDir = ActivePrefix + "/lib"; ++ ActiveLibDir = ActivePrefix + "/@libdir@/llvm"; + ActiveIncludeOption = "-I" + ActiveIncludeDir; + } + +diff --git a/utils/FileCheck/Makefile b/utils/FileCheck/Makefile +index 268b7bc..e7674f9 100644 +--- a/utils/FileCheck/Makefile ++++ b/utils/FileCheck/Makefile +@@ -15,7 +15,7 @@ USEDLIBS = LLVMSupport.a + TOOL_NO_EXPORTS = 1 + + # Don't install this utility +-NO_INSTALL = 1 ++#NO_INSTALL = 1 + + include $(LEVEL)/Makefile.common + +-- +1.8.3.2 + diff --git a/sys-devel/llvm/llvm-9999-r1.ebuild b/sys-devel/llvm/llvm-9999-r1.ebuild index a06bd23..cbd1966 100644 --- a/sys-devel/llvm/llvm-9999-r1.ebuild +++ b/sys-devel/llvm/llvm-9999-r1.ebuild @@ -102,53 +102,29 @@ src_prepare() { multilib_src_prepare() { cd "${BUILD_DIR}" || die + local sub_files=( + Makefile.config.in + Makefile.rules + tools/llvm-config/llvm-config.cpp + ) + use clang && sub_files+=( + tools/clang/lib/Driver/Tools.cpp + tools/clang/tools/scan-build/scan-build + ) + # unfortunately ./configure won't listen to --mandir and the-like, so take # care of this. einfo "Fixing install dirs" - sed -e 's,^PROJ_docsdir.*,PROJ_docsdir := $(PROJ_prefix)/share/doc/'${PF}, \ - -e 's,^PROJ_etcdir.*,PROJ_etcdir := '"${EPREFIX}"'/etc/llvm,' \ - -e 's,^PROJ_libdir.*,PROJ_libdir := $(PROJ_prefix)/'$(get_libdir)/${PN}, \ - -i Makefile.config.in || die "Makefile.config sed failed" - sed -e "/ActiveLibDir = ActivePrefix/s/lib/$(get_libdir)\/${PN}/" \ - -i tools/llvm-config/llvm-config.cpp || die "llvm-config sed failed" - - einfo "Fixing rpath and CFLAGS" - sed -e 's,\$(RPATH) -Wl\,\$(\(ToolDir\|LibDir\)),$(RPATH) -Wl\,'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \ - -e '/OmitFramePointer/s/-fomit-frame-pointer//' \ - -i Makefile.rules || die "rpath sed failed" - - if use clang; then - # Set correct path for the coverage lib - sed -e "s#lib\(/libprofile_rt.a\)#$(get_libdir)/llvm\1#" \ - -i tools/clang/lib/Driver/Tools.cpp \ - || die "driver tools paths sed failed" - fi + sed -e "s,@libdir@,$(get_libdir),g" \ + -e "s,@PF@,${PF},g" \ + -e "s,@EPREFIX@,${EPREFIX},g" \ + -i "${sub_files[@]}" \ + || die "install paths sed failed" } - if use gold; then - sed -e 's,\$(SharedLibDir),'"${EPREFIX}"/usr/$(get_libdir)/${PN}, \ - -i tools/gold/Makefile || die "gold rpath sed failed" - fi - - # FileCheck is needed at least for dragonegg tests - sed -e "/NO_INSTALL = 1/s/^/#/" -i utils/FileCheck/Makefile \ - || die "FileCheck Makefile sed failed" - - if use clang; then - # fix the static analyzer for in-tree install - sed -e 's/import ScanView/from clang \0/' \ - -i tools/clang/tools/scan-view/scan-view \ - || die "scan-view sed failed" - sed -e "/scanview.css\|sorttable.js/s#\$RealBin#${EPREFIX}/usr/share/${PN}#" \ - -i tools/clang/tools/scan-build/scan-build \ - || die "scan-build sed failed" - # Set correct path for gold plugin - sed -e "/LLVMgold.so/s#lib/#$(get_libdir)/llvm/#" \ - -i tools/clang/lib/Driver/Tools.cpp \ - || die "driver tools paths sed failed" - fi - epatch "${FILESDIR}"/${PN}-3.2-nodoctargz.patch + epatch "${FILESDIR}"/${PN}-3.4-gentoo-install.patch + use clang && epatch "${FILESDIR}"/clang-3.4-gentoo-install.patch # User patches epatch_user