From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-882730-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id BB00A138263
	for <garchives@archives.gentoo.org>; Sat, 21 May 2016 18:19:18 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9242921C060;
	Sat, 21 May 2016 18:19:15 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 2DA0221C060
	for <gentoo-commits@lists.gentoo.org>; Sat, 21 May 2016 18:19:15 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id D7CBF340B4D
	for <gentoo-commits@lists.gentoo.org>; Sat, 21 May 2016 18:19:13 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 9A34A332
	for <gentoo-commits@lists.gentoo.org>; Sat, 21 May 2016 18:19:10 +0000 (UTC)
From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" <zorry@gentoo.org>
Message-ID: <1463853552.2e55308331d26b93a2dd2a0b6be1760db27e40d4.zorry@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/grub/, sys-boot/grub/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch sys-boot/grub/grub-2.02_beta3-r1.ebuild
X-VCS-Directories: sys-boot/grub/ sys-boot/grub/files/
X-VCS-Committer: zorry
X-VCS-Committer-Name: Magnus Granberg
X-VCS-Revision: 2e55308331d26b93a2dd2a0b6be1760db27e40d4
X-VCS-Branch: master
Date: Sat, 21 May 2016 18:19:10 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 533c5237-a721-4d2c-812e-e425d1a1357d
X-Archives-Hash: 78188a771e6b28139d1e1219171f6d6a

commit:     2e55308331d26b93a2dd2a0b6be1760db27e40d4
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Sat May 21 17:57:34 2016 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Sat May 21 17:59:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2e553083

sys-boot/grub-2.02_beta3 Add fix for gcc-6.1.0[pie] #583042

Package-Manager: portage-2.2.27

 .../grub/files/2.02_beta3-gcc6-ld-no-pie.patch     | 57 ++++++++++++++++++++++
 sys-boot/grub/grub-2.02_beta3-r1.ebuild            |  1 +
 2 files changed, 58 insertions(+)

diff --git a/sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch b/sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch
new file mode 100644
index 0000000..0d81415
--- /dev/null
+++ b/sys-boot/grub/files/2.02_beta3-gcc6-ld-no-pie.patch
@@ -0,0 +1,57 @@
+2016-05-21  Magnus Granberg  <zorry@gentoo.org>
+
+	#583042 sys-boot/grub-2.02_beta3-r1: building w/gcc-6[pie]: error:
+	x86_64-pc-linux-gnu/bin/ld: -r and -shared may not be used together
+
+	* acinclude.m4: Add -no-pie check.
+	* configure.ac: Add -no-pie to TARGET_LDFLAGS if needed.
+
+--- a/acinclude.m4	2015-11-11 20:56:52.000000000 +0100
++++ b/acinclude.m4	2016-05-17 00:08:22.000000000 +0200
+@@ -390,6 +390,24 @@ else
+ [fi]
+ ])
+ 
++dnl Check if the Linker supports `-no-pie'.
++AC_DEFUN([grub_CHECK_NO_PIE],
++[AC_MSG_CHECKING([whether linker accepts -no-pie])
++AC_CACHE_VAL(grub_cv_cc_ld_nopie,
++[save_LDFLAGS="$LDFLAGS"
++LDFLAGS="$LDFLAGS -no-pie"
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++	       [grub_cv_cc_ld_no_pie=yes],
++	       [grub_cv_cc_ld_no_pie=no])
++LDFLAGS="$save_LDFLAGS"
++])
++AC_MSG_RESULT([$grub_cv_cc_ld_no_pie])
++nopie_possible=no
++if test "x$grub_cv_cc_ld_no_pie" = xyes ; then
++  nopie_possible=yes
++fi
++])
++
+ dnl Check if the C compiler supports `-fPIC'.
+ AC_DEFUN([grub_CHECK_PIC],[
+ [# Position independent executable.
+--- a/configure.ac	2016-02-27 13:40:56.000000000 +0100
++++ b/configure.ac	2016-05-17 00:57:29.471000000 +0200
+@@ -1184,13 +1184,18 @@ CFLAGS="$TARGET_CFLAGS"
+ 
+ # Position independent executable.
+ grub_CHECK_PIE
++grub_CHECK_NO_PIE
+ [# Need that, because some distributions ship compilers that include
+-# `-fPIE' in the default specs.
++# `-fPIE' and '-pie' in the default specs.
+ if [ x"$pie_possible" = xyes ]; then
+   TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
++fi
++if [ x"$nopie_possible" = xyes ] &&  [ x"$pie_possible" = xyes ]; then
++  TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie"
+ fi]
+ 
+ CFLAGS="$TARGET_CFLAGS"
++LDFLAGS="$TARGET_LDFLAGS"
+ 
+ # Position independent executable.
+ grub_CHECK_PIC

diff --git a/sys-boot/grub/grub-2.02_beta3-r1.ebuild b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
index ab05794..7fd67ee 100644
--- a/sys-boot/grub/grub-2.02_beta3-r1.ebuild
+++ b/sys-boot/grub/grub-2.02_beta3-r1.ebuild
@@ -35,6 +35,7 @@ PATCHES=(
 	"${FILESDIR}"/grub-2.02_beta2-KERNEL_GLOBS.patch
 	"${FILESDIR}"/2.02_beta3-10_linux-UUID.patch
 	"${FILESDIR}"/2.02_beta3-sysmacros.patch
+	"${FILESDIR}"/2.02_beta3-gcc6-ld-no-pie.patch
 )
 
 DEJAVU=dejavu-sans-ttf-2.35