summaryrefslogtreecommitdiff
path: root/sys-devel/binutils/binutils-9999.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-07-30 22:42:58 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-07-30 22:42:58 +0100
commit3b4199328e240d392ef1f03900219cb88bdafcff (patch)
tree06007a008d485a5e0a169f2807b68f456e9df1b3 /sys-devel/binutils/binutils-9999.ebuild
parentaca0af8133e724b7edf0b5c6efe12c39077a3dc9 (diff)
gentoo auto-resync : 30:07:2023 - 22:42:58
Diffstat (limited to 'sys-devel/binutils/binutils-9999.ebuild')
-rw-r--r--sys-devel/binutils/binutils-9999.ebuild64
1 files changed, 41 insertions, 23 deletions
diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild
index ce9b9958cd11..d553da58aa63 100644
--- a/sys-devel/binutils/binutils-9999.ebuild
+++ b/sys-devel/binutils/binutils-9999.ebuild
@@ -9,7 +9,7 @@ DESCRIPTION="Tools necessary to build programs"
HOMEPAGE="https://sourceware.org/binutils/"
LICENSE="GPL-3+"
-IUSE="cet debuginfod doc gold gprofng multitarget +nls pgo +plugins static-libs test vanilla zstd"
+IUSE="cet debuginfod doc gold gprofng hardened multitarget +nls pgo +plugins static-libs test vanilla zstd"
# Variables that can be set here (ignored for live ebuilds)
# PATCH_VER - the patchset version
@@ -19,7 +19,7 @@ IUSE="cet debuginfod doc gold gprofng multitarget +nls pgo +plugins static-libs
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets
-PATCH_VER=2
+PATCH_VER=1
PATCH_DEV=dilfridge
if [[ ${PV} == 9999* ]]; then
@@ -32,7 +32,7 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2)
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
#
@@ -253,27 +253,12 @@ src_configure() {
--enable-obsolete
--enable-shared
--enable-threads
- # Newer versions (>=2.27) offer a configure flag now.
--enable-relro
- # Newer versions (>=2.24) make this an explicit option, bug #497268
--enable-install-libiberty
- # Available from 2.35 on
- --enable-textrel-check=warning
-
- # 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.
- #--enable-warn-execstack
- #--enable-warn-rwx-segments
- #--disable-default-execstack (or is it --enable-default-execstack=no? docs are confusing)
-
+ --enable-textrel-check=$(usex hardened error warning)
# Things to think about
#--enable-deterministic-archives
-
- # Works better than vapier's patch, bug #808787
--enable-new-dtags
-
--disable-jansson
--disable-werror
--with-bugurl="$(toolchain-binutils_bugurl)"
@@ -283,11 +268,9 @@ src_configure() {
# Disable modules that are in a combined binutils/gdb tree, bug #490566
--disable-{gdb,libdecnumber,readline,sim}
- # Strip out broken static link flags.
- # https://gcc.gnu.org/PR56750
+ # Strip out broken static link flags: https://gcc.gnu.org/PR56750
--without-stage1-ldflags
- # Change SONAME to avoid conflict across
- # {native,cross}/binutils, binutils-libs. bug #666100
+ # Change SONAME to avoid conflict across {native,cross}/binutils, binutils-libs. bug #666100
--with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
$(use_with debuginfod)
@@ -309,6 +292,41 @@ src_configure() {
$(use_enable gprofng)
)
+ 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-warn-execstack=yes
+ --enable-warn-rwx-segments=yes
+ )
+
+ 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
+ # work there at all. See bug #707660.
+ myconf+=(
+ --enable-textrel-check=error
+ )
+ fi
+
if ! is_cross ; then
myconf+=( $(use_enable pgo pgo-build lto) )