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 701431382C5 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 83C49E08E8; Fri, 26 Feb 2021 08:04:49 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 6C650E08E8 for ; Fri, 26 Feb 2021 08:04:49 +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 E6431340F17 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 43E16530 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: <1614326679.80732e30b491ef045fab6c0be2f8d4b7ac4ad3a4.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gdb/, sys-devel/gdb/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/gdb/files/gdb-10.1-cet.patch sys-devel/gdb/gdb-10.1.ebuild X-VCS-Directories: sys-devel/gdb/ sys-devel/gdb/files/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 80732e30b491ef045fab6c0be2f8d4b7ac4ad3a4 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: b2b3ada4-84ae-4e1d-988d-c98818426ea9 X-Archives-Hash: 036d7e287a593104d52542bb500cd2a1 commit: 80732e30b491ef045fab6c0be2f8d4b7ac4ad3a4 Author: Sergei Trofimovich gentoo org> AuthorDate: Fri Feb 26 08:02:23 2021 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Fri Feb 26 08:04:39 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80732e30 sys-devel/gdb: 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/gdb/files/gdb-10.1-cet.patch | 103 +++++++++++++++++++++++++++++++++ sys-devel/gdb/gdb-10.1.ebuild | 1 + 2 files changed, 104 insertions(+) diff --git a/sys-devel/gdb/files/gdb-10.1-cet.patch b/sys-devel/gdb/files/gdb-10.1-cet.patch new file mode 100644 index 00000000000..7477ff90ac9 --- /dev/null +++ b/sys-devel/gdb/files/gdb-10.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 + diff --git a/sys-devel/gdb/gdb-10.1.ebuild b/sys-devel/gdb/gdb-10.1.ebuild index 68826d3db64..f3521cbb070 100644 --- a/sys-devel/gdb/gdb-10.1.ebuild +++ b/sys-devel/gdb/gdb-10.1.ebuild @@ -84,6 +84,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-8.3.1-verbose-build.patch + "${FILESDIR}"/${PN}-10.1-cet.patch ) pkg_setup() {