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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6289615800A for ; Sun, 30 Jul 2023 16:48:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6CE8BE0B51; Sun, 30 Jul 2023 16:48:45 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4BD13E0B51 for ; Sun, 30 Jul 2023 16:48:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 30076335D68 for ; Sun, 30 Jul 2023 16:48:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A7B68E97 for ; Sun, 30 Jul 2023 16:48:42 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1690735655.8adde117f4abc70c3ae8cd7b9d50c24e3a9e3eb8.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-devel/binutils/binutils-2.41.ebuild sys-devel/binutils/binutils-9999.ebuild X-VCS-Directories: sys-devel/binutils/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 8adde117f4abc70c3ae8cd7b9d50c24e3a9e3eb8 X-VCS-Branch: master Date: Sun, 30 Jul 2023 16:48:42 +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: 2d23300b-ec43-4a6f-ad5f-23d2a957411d X-Archives-Hash: 15f560b7e315dbf20341269327b8bc46 commit: 8adde117f4abc70c3ae8cd7b9d50c24e3a9e3eb8 Author: Sam James gentoo org> AuthorDate: Sun Jul 30 16:47:35 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sun Jul 30 16:47:35 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8adde117 sys-devel/binutils: use case on CTARGET instead 'use' isn't reliable for cross. Signed-off-by: Sam James gentoo.org> sys-devel/binutils/binutils-2.41.ebuild | 44 ++++++++++++++++++--------------- sys-devel/binutils/binutils-9999.ebuild | 44 ++++++++++++++++++--------------- 2 files changed, 48 insertions(+), 40 deletions(-) diff --git a/sys-devel/binutils/binutils-2.41.ebuild b/sys-devel/binutils/binutils-2.41.ebuild index 143d9cf7857b..925731fdf56b 100644 --- a/sys-devel/binutils/binutils-2.41.ebuild +++ b/sys-devel/binutils/binutils-2.41.ebuild @@ -301,28 +301,32 @@ src_configure() { $(use_enable gprofng) ) - if use amd64 || use arm64 || use x86 ; then - # These hardening options are available from 2.39+ but - # they unconditionally enable the behaviour even on arches - # where e.g. execstacks can't be avoided. - # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592. - # - # TODO: Get the logic for this fixed upstream so it doesn't - # create impossible broken combinations on some arches, like mips. - # - # TODO: Get the logic for this fixed upstream so --disable-* works - # as expected. - myconf+=( - --enable-warn-execstack=yes - --enable-warn-rwx-segments=yes - ) - - if use hardened ; then + case ${CTARGET} in + x86_64-*|aarch64*|arm64*|i[3456]*) + # These hardening options are available from 2.39+ but + # they unconditionally enable the behaviour even on arches + # where e.g. execstacks can't be avoided. + # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592. + # + # TODO: Get the logic for this fixed upstream so it doesn't + # create impossible broken combinations on some arches, like mips. + # + # TODO: Get the logic for this fixed upstream so --disable-* works + # as expected. myconf+=( - --enable-default-execstack=no + --enable-warn-execstack=yes + --enable-warn-rwx-segments=yes ) - fi - fi + + if use hardened ; then + myconf+=( + --enable-default-execstack=no + ) + fi + ;; + *) + ;; + esac if use elibc_musl ; then # Override our earlier setting for musl, as textrels don't diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild index 143d9cf7857b..925731fdf56b 100644 --- a/sys-devel/binutils/binutils-9999.ebuild +++ b/sys-devel/binutils/binutils-9999.ebuild @@ -301,28 +301,32 @@ src_configure() { $(use_enable gprofng) ) - if use amd64 || use arm64 || use x86 ; then - # These hardening options are available from 2.39+ but - # they unconditionally enable the behaviour even on arches - # where e.g. execstacks can't be avoided. - # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592. - # - # TODO: Get the logic for this fixed upstream so it doesn't - # create impossible broken combinations on some arches, like mips. - # - # TODO: Get the logic for this fixed upstream so --disable-* works - # as expected. - myconf+=( - --enable-warn-execstack=yes - --enable-warn-rwx-segments=yes - ) - - if use hardened ; then + case ${CTARGET} in + x86_64-*|aarch64*|arm64*|i[3456]*) + # These hardening options are available from 2.39+ but + # they unconditionally enable the behaviour even on arches + # where e.g. execstacks can't be avoided. + # See https://sourceware.org/bugzilla/show_bug.cgi?id=29592. + # + # TODO: Get the logic for this fixed upstream so it doesn't + # create impossible broken combinations on some arches, like mips. + # + # TODO: Get the logic for this fixed upstream so --disable-* works + # as expected. myconf+=( - --enable-default-execstack=no + --enable-warn-execstack=yes + --enable-warn-rwx-segments=yes ) - fi - fi + + if use hardened ; then + myconf+=( + --enable-default-execstack=no + ) + fi + ;; + *) + ;; + esac if use elibc_musl ; then # Override our earlier setting for musl, as textrels don't