From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 02FCD1382C5 for ; Fri, 26 Feb 2021 08:04:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3CE75E08CE; Fri, 26 Feb 2021 08:04:49 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F0138E08CE for ; Fri, 26 Feb 2021 08:04:48 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C234B335D73 for ; Fri, 26 Feb 2021 08:04:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1C1C3C3 for ; Fri, 26 Feb 2021 08:04:46 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1614326677.c4e8d909d36eae58cc8aa9e69259179d666b1458.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils/files/, sys-devel/binutils/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/binutils/binutils-2.35.1-r1.ebuild sys-devel/binutils/binutils-2.35.2.ebuild sys-devel/binutils/binutils-2.36.1.ebuild sys-devel/binutils/files/binutils-2.35.1-cet.patch X-VCS-Directories: sys-devel/binutils/files/ sys-devel/binutils/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: c4e8d909d36eae58cc8aa9e69259179d666b1458 X-VCS-Branch: master Date: Fri, 26 Feb 2021 08:04:46 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c1e004e0-cf34-4247-aa60-8c7bd90d07f2 X-Archives-Hash: 8695e052c086517e521e8dc02a2f7e02 commit: c4e8d909d36eae58cc8aa9e69259179d666b1458 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Feb 26 07:56:43 2021 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Feb 26 08:04:37 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4e8d909 sys-devel/binutils: fix 'cet' detection on i586 Reported-by: Worx Bug: https://bugs.gentoo.org/771765 Package-Manager: Portage-3.0.15, Repoman-3.0.2 Signed-off-by: Sergei Trofimovich gentoo.org> sys-devel/binutils/binutils-2.35.1-r1.ebuild | 2 + sys-devel/binutils/binutils-2.35.2.ebuild | 2 + sys-devel/binutils/binutils-2.36.1.ebuild | 2 + sys-devel/binutils/files/binutils-2.35.1-cet.patch | 103 +++++++++++++++++++++ 4 files changed, 109 insertions(+) diff --git a/sys-devel/binutils/binutils-2.35.1-r1.ebuild b/sys-devel/binutils/binutils-2.35.1-r1.ebuild index feee11a5ded..18c80a28f88 100644 --- a/sys-devel/binutils/binutils-2.35.1-r1.ebuild +++ b/sys-devel/binutils/binutils-2.35.1-r1.ebuild @@ -68,6 +68,8 @@ BDEPEND=" RESTRICT="!test? ( test )" +PATCHES=("${FILESDIR}"/${PN}-2.35.1-cet.patch) + MY_BUILDDIR=${WORKDIR}/build src_unpack() { diff --git a/sys-devel/binutils/binutils-2.35.2.ebuild b/sys-devel/binutils/binutils-2.35.2.ebuild index 2aff2770014..215e42f2c73 100644 --- a/sys-devel/binutils/binutils-2.35.2.ebuild +++ b/sys-devel/binutils/binutils-2.35.2.ebuild @@ -67,6 +67,8 @@ BDEPEND=" RESTRICT="!test? ( test )" +PATCHES=("${FILESDIR}"/${PN}-2.35.1-cet.patch) + MY_BUILDDIR=${WORKDIR}/build src_unpack() { diff --git a/sys-devel/binutils/binutils-2.36.1.ebuild b/sys-devel/binutils/binutils-2.36.1.ebuild index 3d820fcc6f8..95875f24d78 100644 --- a/sys-devel/binutils/binutils-2.36.1.ebuild +++ b/sys-devel/binutils/binutils-2.36.1.ebuild @@ -67,6 +67,8 @@ BDEPEND=" RESTRICT="!test? ( test )" +PATCHES=("${FILESDIR}"/${PN}-2.35.1-cet.patch) + MY_BUILDDIR=${WORKDIR}/build src_unpack() { diff --git a/sys-devel/binutils/files/binutils-2.35.1-cet.patch b/sys-devel/binutils/files/binutils-2.35.1-cet.patch new file mode 100644 index 00000000000..7477ff90ac9 --- /dev/null +++ b/sys-devel/binutils/files/binutils-2.35.1-cet.patch @@ -0,0 +1,103 @@ +https://bugs.gentoo.org/771765 +https://sourceware.org/PR27397 + +On i586-like CPUs endbr32 added by -Wl,-z,ibt,-z,shstk +generates crashing binaries and causes ./configure failure. + +From 847e4b3207f97762dc641db8d3b188081c3370c3 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Fri, 12 Feb 2021 16:30:23 -0800 +Subject: [PATCH] GCC_CET_HOST_FLAGS: Check if host supports multi-byte NOPs + +--- + config/cet.m4 | 19 ++++++++++++++++--- + libiberty/configure | 29 +++++++++++++++++++++++++++++ + 2 files changed, 45 insertions(+), 3 deletions(-) + +diff --git a/config/cet.m4 b/config/cet.m4 +index c67fb4f35b6..7718be1afe8 100644 +--- a/config/cet.m4 ++++ b/config/cet.m4 +@@ -130,6 +130,18 @@ fi + if test x$may_have_cet = xyes; then + if test x$cross_compiling = xno; then + AC_TRY_RUN([ ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ], ++ [have_multi_byte_nop=yes], ++ [have_multi_byte_nop=no]) ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ AC_TRY_RUN([ + static void + foo (void) + { +@@ -155,9 +167,10 @@ main () + bar (); + return 0; + } +- ], +- [have_cet=no], +- [have_cet=yes]) ++ ], ++ [have_cet=no], ++ [have_cet=yes]) ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host]) + fi +diff --git a/libiberty/configure b/libiberty/configure +index 160b8c9e8b1..29a690d44fc 100755 +--- a/libiberty/configure ++++ b/libiberty/configure +@@ -5539,6 +5539,34 @@ else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + ++int ++main () ++{ ++ asm ("endbr32"); ++ return 0; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ have_multi_byte_nop=yes ++else ++ have_multi_byte_nop=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ have_cet=no ++ if test x$have_multi_byte_nop = xyes; then ++ if test "$cross_compiling" = yes; then : ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run test program while cross compiling ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ + static void + foo (void) + { +@@ -5575,6 +5603,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + ++ fi + if test x$enable_cet = xno -a x$have_cet = xyes; then + as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5 + fi +-- +2.29.2 +