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 C41761381F3 for ; Sun, 26 May 2013 22:02:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5433CE0B7C; Sun, 26 May 2013 22:02:03 +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 A220EE0B62 for ; Sun, 26 May 2013 22:02:02 +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 6644F33DF65 for ; Sun, 26 May 2013 22:02:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id E6E75E4402 for ; Sun, 26 May 2013 22:01:59 +0000 (UTC) From: "Vadim A. Misbakh-Soloviov" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Vadim A. Misbakh-Soloviov" Message-ID: <1369605701.e56daa8f6ad249645ad73ed48d8e04b13b883fec.mva@gentoo> Subject: [gentoo-commits] proj/lua:master commit in: dev-lang/luajit/ X-VCS-Repository: proj/lua X-VCS-Files: dev-lang/luajit/luajit-2.0.1.ebuild dev-lang/luajit/luajit-9999.ebuild X-VCS-Directories: dev-lang/luajit/ X-VCS-Committer: mva X-VCS-Committer-Name: Vadim A. Misbakh-Soloviov X-VCS-Revision: e56daa8f6ad249645ad73ed48d8e04b13b883fec X-VCS-Branch: master Date: Sun, 26 May 2013 22:01:59 +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: 6c1150da-e1e1-4963-a8d5-6acb0944790c X-Archives-Hash: 2e9eb20651dd1e78edbdbbaf37450080 commit: e56daa8f6ad249645ad73ed48d8e04b13b883fec Author: Vadim A. Misbakh-Soloviov mva name> AuthorDate: Sun May 26 22:01:41 2013 +0000 Commit: Vadim A. Misbakh-Soloviov mva name> CommitDate: Sun May 26 22:01:41 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/lua.git;a=commit;h=e56daa8f [dev-lang/luajit] added lua52compat useflag + rare-case compilation failure fix Signed-off-by: Vadim A. Misbakh-Soloviov mva.name> --- dev-lang/luajit/luajit-2.0.1.ebuild | 43 ++++++++++++++++++++++++++++++--- dev-lang/luajit/luajit-9999.ebuild | 45 +++++++++++++++++++++++++++++++---- 2 files changed, 79 insertions(+), 9 deletions(-) diff --git a/dev-lang/luajit/luajit-2.0.1.ebuild b/dev-lang/luajit/luajit-2.0.1.ebuild index 2c71761..fe44275 100644 --- a/dev-lang/luajit/luajit-2.0.1.ebuild +++ b/dev-lang/luajit/luajit-2.0.1.ebuild @@ -4,7 +4,7 @@ EAPI="5" -inherit eutils multilib check-reqs pax-utils +inherit eutils multilib flag-o-matic check-reqs pax-utils MY_P="LuaJIT-${PV/_/-}" DESCRIPTION="Just-In-Time Compiler for the Lua programming language" @@ -17,9 +17,6 @@ LICENSE="MIT" SLOT="2" IUSE="emacs +optimization +interactive" -#CDEPEND=" -# || ( =dev-lang/lua-headers-5.1* dev-lang/lua ) -#" DEPEND=" ${CDEPEND} emacs? ( app-emacs/lua-mode ) @@ -56,6 +53,10 @@ src_prepare(){ -e "s|lib/|$(get_libdir)/|" \ -i src/luaconf.h || die "failed to fix prefix in luaconf.h" + use lua52compat && sed \ + -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ + -i src/Makefile || die + # removing strip sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ || die "failed to remove forced strip" @@ -67,6 +68,40 @@ src_prepare(){ } src_compile() { + if has_version '=sys-devel/gcc-4.7.3' && gcc-specs-pie && has ccache ${FEATURES}; then + # It is three ways to avoid compilation breaking + # in case, when user use gcc-4.7.3+pie+ccache: + # a) append -fPIC to CFLAGS, to use it even for temporary + # build-time only static host/* bins and luajit binary itself. + # b) append -nopie to LDFLAGS + # (for same binaries and same reason) + # c) disable ccache (even in per-package basis). + # This will slow down amalgamated build, but is prefered and + # recommended by upstream method. + # So, since it is impossible to use method "c" directly from + # ebuild, I choose method "a" + # (since it is more secure on hardened systems, imho) + + # + ewarn user, that he really should disable ccache. + +# append-ldflags -nopie + append-cflags -fPIC + ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," + ewarn "we need to either:" + ewarn " a) add -fPIC to CFLAGS, or" + ewarn " b) add -nopie to LDFLAGS, or" + ewarn " c) disable ccache (even on per-package basis)." + ewarn "" + ewarn "We suggest you to use variant 'c' and disable it via" + ewarn "/etc/portage/{,package.}env (read portage manual)" + ewarn "" + ewarn "But, since we can't do that from ebuild, we'll continue" + ewarn "with -fPIC (variant 'a') for now, since it gives more security" + ewarn "on hardened systems (in our opinion)." + ewarn "" + ewarn "But, anyway, we still *HIGHLY* recommend you" + ewarn "to disable ccache instead." + fi + if use optimization; then emake amalg || die "emake failed!" else diff --git a/dev-lang/luajit/luajit-9999.ebuild b/dev-lang/luajit/luajit-9999.ebuild index dfeaf1c..bda8a63 100644 --- a/dev-lang/luajit/luajit-9999.ebuild +++ b/dev-lang/luajit/luajit-9999.ebuild @@ -4,7 +4,7 @@ EAPI="5" -inherit eutils multilib check-reqs pax-utils git-2 +inherit eutils multilib flag-o-matic check-reqs pax-utils git-2 DESCRIPTION="Just-In-Time Compiler for the Lua programming language" HOMEPAGE="http://luajit.org/" @@ -14,11 +14,8 @@ EGIT_REPO_URI="http://luajit.org/git/luajit-2.0.git" LICENSE="MIT" SLOT="2" KEYWORDS="" -IUSE="emacs +optimization +interactive" +IUSE="emacs +optimization +interactive lua52compat" -#CDEPEND=" -# || ( =dev-lang/lua-headers-5.1* dev-lang/lua ) -#" DEPEND=" ${CDEPEND} emacs? ( app-emacs/lua-mode ) @@ -53,6 +50,10 @@ src_prepare(){ -e "s|lib/|$(get_libdir)/|" \ -i src/luaconf.h || die "failed to fix prefix in luaconf.h" + use lua52compat && sed \ + -e "/LUAJIT_ENABLE_LUA52COMPAT/s|#||" \ + -i src/Makefile || die + # removing strip sed -e '/$(Q)$(TARGET_STRIP)/d' -i src/Makefile \ || die "failed to remove forced strip" @@ -62,6 +63,40 @@ src_prepare(){ } src_compile() { + if has_version '=sys-devel/gcc-4.7.3' && gcc-specs-pie && has ccache ${FEATURES}; then + # It is three ways to avoid compilation breaking + # in case, when user use gcc-4.7.3+pie+ccache: + # a) append -fPIC to CFLAGS, to use it even for temporary + # build-time only static host/* bins and luajit binary itself. + # b) append -nopie to LDFLAGS + # (for same binaries and same reason) + # c) disable ccache (even in per-package basis). + # This will slow down amalgamated build, but is prefered and + # recommended by upstream method. + # So, since it is impossible to use method "c" directly from + # ebuild, I choose method "a" + # (since it is more secure on hardened systems, imho) + + # + ewarn user, that he really should disable ccache. + +# append-ldflags -nopie + append-cflags -fPIC + ewarn "As we detected, that you're using gcc-4.7.3+pie+ccache," + ewarn "we need to either:" + ewarn " a) add -fPIC to CFLAGS, or" + ewarn " b) add -nopie to LDFLAGS, or" + ewarn " c) disable ccache (even on per-package basis)." + ewarn "" + ewarn "We suggest you to use variant 'c' and disable it via" + ewarn "/etc/portage/{,package.}env (read portage manual)" + ewarn "" + ewarn "But, since we can't do that from ebuild, we'll continue" + ewarn "with -fPIC (variant 'a') for now, since it gives more security" + ewarn "on hardened systems (in our opinion)." + ewarn "" + ewarn "But, anyway, we still *HIGHLY* recommend you" + ewarn "to disable ccache instead." + fi + if use optimization; then emake amalg || die "emake failed!" else