sys-devel/binutils: Sync with Gentoo

It's from Gentoo commit 2cb80d55644f40cddf9869e4f02b5ae72d7c578a.

Signed-off-by: Flatcar Buildbot <buildbot@flatcar-linux.org>
This commit is contained in:
Flatcar Buildbot 2025-11-17 07:13:11 +00:00 committed by Krzesimir Nowak
parent 5b79c16a71
commit e20aef69dc
19 changed files with 96 additions and 54 deletions

View File

@ -26,4 +26,6 @@ DIST binutils-2.44-patches-4.tar.xz 83612 BLAKE2B caa71849dbbfe1181072c84985c786
DIST binutils-2.44.tar.xz 27285788 BLAKE2B 0eb031ace9fb5a7047b81b5a05b1760f7d332c8ed67f98899f153a45f181b83e661a484551af05c0a9b2adc422da84619103c7b1f3c9fad5327872832b5446aa SHA512 b85d3bbc0e334cf67a96219d3c7c65fbf3e832b2c98a7417bf131f3645a0307057ec81cd2b29ff2563cec53e3d42f73e2c60cc5708e80d4a730efdcc6ae14ad7 DIST binutils-2.44.tar.xz 27285788 BLAKE2B 0eb031ace9fb5a7047b81b5a05b1760f7d332c8ed67f98899f153a45f181b83e661a484551af05c0a9b2adc422da84619103c7b1f3c9fad5327872832b5446aa SHA512 b85d3bbc0e334cf67a96219d3c7c65fbf3e832b2c98a7417bf131f3645a0307057ec81cd2b29ff2563cec53e3d42f73e2c60cc5708e80d4a730efdcc6ae14ad7
DIST binutils-2.45-patches-1.tar.xz 15588 BLAKE2B b88c62a6483807dfb24c97c534aadc1f930ea2d6cd8ad86734c40458a0e3ac4d149c0ee47c6ba541c462ce0e619dfaa5328c3dd5ffbd94511c487956866c7a38 SHA512 05c890a71d465539b3d066c2fd92930e4d6c9003147395a4c2cb9cc514f412fa392892e2c3b8887493a56b00453ac383612d0cac42e4cacce983e65886537149 DIST binutils-2.45-patches-1.tar.xz 15588 BLAKE2B b88c62a6483807dfb24c97c534aadc1f930ea2d6cd8ad86734c40458a0e3ac4d149c0ee47c6ba541c462ce0e619dfaa5328c3dd5ffbd94511c487956866c7a38 SHA512 05c890a71d465539b3d066c2fd92930e4d6c9003147395a4c2cb9cc514f412fa392892e2c3b8887493a56b00453ac383612d0cac42e4cacce983e65886537149
DIST binutils-2.45-patches-3.tar.xz 31264 BLAKE2B 3fda1843a13a3ea7d6a2bbfe5826c01f588c28c24c19158e1556d52b472125964a67af6fba14ba5ff3cb61586823c5a839c6fe8e249e85d4a480c30e69e68051 SHA512 2b44300ecef4bac7d0192aa20e561f4c062c49948028753c6aa6e8fd2a34292443d68d1c3adb2f79aba6c65d1bae8005f8174fc8c8833864d9633bd0f6d936b6 DIST binutils-2.45-patches-3.tar.xz 31264 BLAKE2B 3fda1843a13a3ea7d6a2bbfe5826c01f588c28c24c19158e1556d52b472125964a67af6fba14ba5ff3cb61586823c5a839c6fe8e249e85d4a480c30e69e68051 SHA512 2b44300ecef4bac7d0192aa20e561f4c062c49948028753c6aa6e8fd2a34292443d68d1c3adb2f79aba6c65d1bae8005f8174fc8c8833864d9633bd0f6d936b6
DIST binutils-2.45.1-patches-1.tar.xz 9172 BLAKE2B 37fd7f0d7d231223a88637691bcf6bdec5481a573b47e6385e4dba7f7895b94ceae308c7875bbdc1c6e537c6ff0cb5f222c782f04b5f2757a5730aa83edf1d32 SHA512 c1251d7baf352f5909570e1ee45021eeabffb68222bc80991f4a53faee97857471a68aec664bfbf35cbd3b96ea9e8d0bfa52c3d0e5bbfdbb94daf590957cd89c
DIST binutils-2.45.1.tar.xz 27962312 BLAKE2B 1ccab38659ec47f9100b61322627345fe79ebd04ed0b1e872c988edded4d292d7c9ac33d9f6ea47bf265ec823dfba60da0e84374900c15ec89e3aa9280ac020c SHA512 ea030419eba387579ab717be7e3223fc99e93b586860b06003c12489f93441640d4082736f76aa5e98233db4f46e232f536a45e471486de1f5b64e1b827c167e
DIST binutils-2.45.tar.xz 27868232 BLAKE2B 1ce72346b1f531c89feb86b407e2c649151b506ffbd1a02d413411d36f7ede98fa9a1adf75dd941c01df5fe7e6bf151828b269eeb7c278315ca8004bff22eb7f SHA512 c7b10a7466d9fd398d7a0b3f2a43318432668d714f2ec70069a31bdc93c86d28e0fe83792195727167743707fbae45337c0873a0786416db53bbf22860c16ce7 DIST binutils-2.45.tar.xz 27868232 BLAKE2B 1ce72346b1f531c89feb86b407e2c649151b506ffbd1a02d413411d36f7ede98fa9a1adf75dd941c01df5fe7e6bf151828b269eeb7c278315ca8004bff22eb7f SHA512 c7b10a7466d9fd398d7a0b3f2a43318432668d714f2ec70069a31bdc93c86d28e0fe83792195727167743707fbae45337c0873a0786416db53bbf22860c16ce7

View File

@ -70,7 +70,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
doc? ( sys-apps/texinfo ) doc? ( sys-apps/texinfo )

View File

@ -62,7 +62,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND} DEPEND="${RDEPEND}
doc? ( sys-apps/texinfo ) doc? ( sys-apps/texinfo )

View File

@ -62,7 +62,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="

View File

@ -52,7 +52,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
" "
DEPEND="${RDEPEND}" DEPEND="${RDEPEND}"
BDEPEND=" BDEPEND="

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )

View File

@ -51,7 +51,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )

View File

@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )

View File

@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )

View File

@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )
@ -528,9 +528,6 @@ src_install() {
# Simple test to make sure our new binutils isn't completely broken. # Simple test to make sure our new binutils isn't completely broken.
# Skip if this binutils is a cross compiler. # Skip if this binutils is a cross compiler.
#
# If coreutils is built with USE=multicall, some of these files
# will just be wrapper scripts, not actual ELFs we can test.
binutils_sanity_check() { binutils_sanity_check() {
pushd "${T}" >/dev/null pushd "${T}" >/dev/null
@ -556,7 +553,8 @@ binutils_sanity_check() {
local opt opt2 local opt opt2
# TODO: test multilib variants? # TODO: test multilib variants?
for opt in '' '-O2' ; do for opt in '' '-O2' ; do
for opt2 in '-static' '-static-pie' '-fno-PIE -no-pie' ; do # TODO: add static-pie? we need to check if support exists, though (bug #965478)
for opt2 in '-static' '-fno-PIE -no-pie' ; do
$(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test $(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test
if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then
:; :;
@ -571,6 +569,7 @@ binutils_sanity_check() {
pkg_preinst() { pkg_preinst() {
[[ -n ${ROOT} ]] && return 0 [[ -n ${ROOT} ]] && return 0
[[ -n ${EPREFIX} ]] && return 0
[[ -d ${ED}${BINPATH} ]] || return 0 [[ -d ${ED}${BINPATH} ]] || return 0
[[ -n ${BOOTSTRAP_RAP} ]] || return 0 [[ -n ${BOOTSTRAP_RAP} ]] || return 0
is_cross && return 0 is_cross && return 0

View File

@ -19,8 +19,8 @@ IUSE="cet debuginfod doc gprofng hardened multitarget +nls pgo +plugins static-l
# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/... # PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
# for the patchsets # for the patchsets
PATCH_VER=4 PATCH_VER=1
PATCH_DEV=dilfridge PATCH_DEV=sam
if [[ ${PV} == 9999 ]]; then if [[ ${PV} == 9999 ]]; then
inherit git-r3 inherit git-r3
@ -35,7 +35,7 @@ else
[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI} [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz" https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
SLOT=$(ver_cut 1-2) SLOT=$(ver_cut 1-2)
#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi fi
# #
@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )
@ -134,12 +134,6 @@ src_prepare() {
if [[ -n ${PATCH_VER} ]] || [[ ${PV} == *9999 ]] ; then if [[ -n ${PATCH_VER} ]] || [[ ${PV} == *9999 ]] ; then
if ! use vanilla; then if ! use vanilla; then
# We backported a patch in 2.44 but it needed a few
# followups. Better to just handle it in 2.45 instead.
rm "${WORKDIR}/patch/0007-strip-Add-GCC-LTO-IR-support.patch" \
"${WORKDIR}/patch/0008-ld-testsuite-Use-plug_opt-for-plugin-option.patch" \
"${WORKDIR}/patch/0009-binutils-Don-t-complain-plugin-with-all-LTO-sections.patch" || die
einfo "Applying binutils patchset ${patchsetname}" einfo "Applying binutils patchset ${patchsetname}"
eapply "${WORKDIR}/patch" eapply "${WORKDIR}/patch"
einfo "Done." einfo "Done."
@ -148,7 +142,7 @@ src_prepare() {
# It should be okay on non-prefix systems though. See bug #892549. # It should be okay on non-prefix systems though. See bug #892549.
if is_cross || use prefix; then if is_cross || use prefix; then
eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \ eapply "${FILESDIR}"/binutils-2.40-linker-search-path.patch \
"${FILESDIR}"/binutils-2.41-linker-prefix.patch "${FILESDIR}"/binutils-2.43-linker-prefix.patch
fi fi
fi fi
fi fi
@ -198,8 +192,6 @@ src_configure() {
# Keep things sane # Keep things sane
strip-flags strip-flags
# Adds a property which confuses tests (PR33267)
filter-flags '-mno-direct-extern-access'
use cet && filter-flags -mindirect-branch -mindirect-branch=* use cet && filter-flags -mindirect-branch -mindirect-branch=*
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152 use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
lto-guarantee-fat lto-guarantee-fat
@ -303,9 +295,9 @@ src_configure() {
# We can enable this by default in future, but it's brand new # We can enable this by default in future, but it's brand new
# in 2.39 with several bugs: # in 2.39 with several bugs:
# - Doesn't build on musl (https://sourceware.org/bugzilla/show_bug.cgi?id=29477) # - Doesn't build on musl (https://sourceware.org/PR29477)
# - No man pages (https://sourceware.org/bugzilla/show_bug.cgi?id=29521) # - No man pages (https://sourceware.org/PR29521)
# - Broken at runtime without Java (https://sourceware.org/bugzilla/show_bug.cgi?id=29479) # - Broken at runtime without Java (https://sourceware.org/PR29479)
# - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113) # - binutils-config (and this ebuild?) needs adaptation first (https://bugs.gentoo.org/865113)
$(use_enable gprofng) $(use_enable gprofng)
@ -319,7 +311,7 @@ src_configure() {
# These hardening options are available from 2.39+ but # These hardening options are available from 2.39+ but
# they unconditionally enable the behaviour even on arches # they unconditionally enable the behaviour even on arches
# where e.g. execstacks can't be avoided. # where e.g. execstacks can't be avoided.
# See https://sourceware.org/bugzilla/show_bug.cgi?id=29592. # See https://sourceware.org/PR29592.
# #
# TODO: Get the logic for this fixed upstream so it doesn't # TODO: Get the logic for this fixed upstream so it doesn't
# create impossible broken combinations on some arches, like mips. # create impossible broken combinations on some arches, like mips.
@ -534,6 +526,56 @@ src_install() {
find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
} }
# Simple test to make sure our new binutils isn't completely broken.
# Skip if this binutils is a cross compiler.
binutils_sanity_check() {
pushd "${T}" >/dev/null
einfo "Last-minute run tests with binutils in ${ED}${BINPATH} ..."
cat <<-EOF > "${T}"/number.c
int get_magic_number() {
return 42;
}
EOF
cat <<-EOF > "${T}"/test.c
#include <stdio.h>
int get_magic_number();
int main() {
printf("Hello Gentoo! Your magic number is: %d\n", get_magic_number());
}
EOF
local -x LD_LIBRARY_PATH="${ED}${LIBPATH}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
local opt opt2
# TODO: test multilib variants?
for opt in '' '-O2' ; do
# TODO: add static-pie? we need to check if support exists, though (bug #965478)
for opt2 in '-static' '-fno-PIE -no-pie' ; do
$(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test
if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then
:;
else
die "Test with '${opt} ${opt2}' failed! Aborting to avoid broken binutils!"
fi
done
done
popd >/dev/null
}
pkg_preinst() {
[[ -n ${ROOT} ]] && return 0
[[ -n ${EPREFIX} ]] && return 0
[[ -d ${ED}${BINPATH} ]] || return 0
[[ -n ${BOOTSTRAP_RAP} ]] || return 0
is_cross && return 0
binutils_sanity_check
}
pkg_postinst() { pkg_postinst() {
# Make sure this ${CTARGET} has a binutils version selected # Make sure this ${CTARGET} has a binutils version selected
[[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0 [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0

View File

@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )
@ -92,10 +92,12 @@ src_unpack() {
" "
EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
git-r3_src_unpack git-r3_src_unpack
mv patches-git/9999 patch || die
if [[ ${PV} != 9999 ]] ; then if [[ ${PV} != 9999 ]] ; then
EGIT_BRANCH=binutils-$(ver_cut 1)_$(ver_cut 2)-branch EGIT_BRANCH=binutils-$(ver_cut 1)_$(ver_cut 2)-branch
mv patches-git/${PV%*.9999} patch || die
else
mv patches-git/9999 patch || die
fi fi
EGIT_REPO_URI=" EGIT_REPO_URI="
https://sourceware.org/git/binutils-gdb.git https://sourceware.org/git/binutils-gdb.git
@ -530,9 +532,6 @@ src_install() {
# Simple test to make sure our new binutils isn't completely broken. # Simple test to make sure our new binutils isn't completely broken.
# Skip if this binutils is a cross compiler. # Skip if this binutils is a cross compiler.
#
# If coreutils is built with USE=multicall, some of these files
# will just be wrapper scripts, not actual ELFs we can test.
binutils_sanity_check() { binutils_sanity_check() {
pushd "${T}" >/dev/null pushd "${T}" >/dev/null
@ -558,7 +557,8 @@ binutils_sanity_check() {
local opt opt2 local opt opt2
# TODO: test multilib variants? # TODO: test multilib variants?
for opt in '' '-O2' ; do for opt in '' '-O2' ; do
for opt2 in '-static' '-static-pie' '-fno-PIE -no-pie' ; do # TODO: add static-pie? we need to check if support exists, though (bug #965478)
for opt2 in '-static' '-fno-PIE -no-pie' ; do
$(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test $(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test
if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then
:; :;
@ -573,6 +573,7 @@ binutils_sanity_check() {
pkg_preinst() { pkg_preinst() {
[[ -n ${ROOT} ]] && return 0 [[ -n ${ROOT} ]] && return 0
[[ -n ${EPREFIX} ]] && return 0
[[ -d ${ED}${BINPATH} ]] || return 0 [[ -d ${ED}${BINPATH} ]] || return 0
[[ -n ${BOOTSTRAP_RAP} ]] || return 0 [[ -n ${BOOTSTRAP_RAP} ]] || return 0
is_cross && return 0 is_cross && return 0

View File

@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )
@ -530,9 +530,6 @@ src_install() {
# Simple test to make sure our new binutils isn't completely broken. # Simple test to make sure our new binutils isn't completely broken.
# Skip if this binutils is a cross compiler. # Skip if this binutils is a cross compiler.
#
# If coreutils is built with USE=multicall, some of these files
# will just be wrapper scripts, not actual ELFs we can test.
binutils_sanity_check() { binutils_sanity_check() {
pushd "${T}" >/dev/null pushd "${T}" >/dev/null
@ -558,7 +555,8 @@ binutils_sanity_check() {
local opt opt2 local opt opt2
# TODO: test multilib variants? # TODO: test multilib variants?
for opt in '' '-O2' ; do for opt in '' '-O2' ; do
for opt2 in '-static' '-static-pie' '-fno-PIE -no-pie' ; do # TODO: add static-pie? we need to check if support exists, though (bug #965478)
for opt2 in '-static' '-fno-PIE -no-pie' ; do
$(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test $(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test
if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then
:; :;
@ -573,6 +571,7 @@ binutils_sanity_check() {
pkg_preinst() { pkg_preinst() {
[[ -n ${ROOT} ]] && return 0 [[ -n ${ROOT} ]] && return 0
[[ -n ${EPREFIX} ]] && return 0
[[ -d ${ED}${BINPATH} ]] || return 0 [[ -d ${ED}${BINPATH} ]] || return 0
[[ -n ${BOOTSTRAP_RAP} ]] || return 0 [[ -n ${BOOTSTRAP_RAP} ]] || return 0
is_cross && return 0 is_cross && return 0

View File

@ -54,7 +54,7 @@ is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
# #
RDEPEND=" RDEPEND="
>=sys-devel/binutils-config-3 >=sys-devel/binutils-config-3
sys-libs/zlib virtual/zlib:=
debuginfod? ( debuginfod? (
dev-libs/elfutils[debuginfod(-)] dev-libs/elfutils[debuginfod(-)]
) )
@ -92,10 +92,12 @@ src_unpack() {
" "
EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
git-r3_src_unpack git-r3_src_unpack
mv patches-git/9999 patch || die
if [[ ${PV} != 9999 ]] ; then if [[ ${PV} != 9999 ]] ; then
EGIT_BRANCH=binutils-$(ver_cut 1)_$(ver_cut 2)-branch EGIT_BRANCH=binutils-$(ver_cut 1)_$(ver_cut 2)-branch
mv patches-git/${PV%*.9999} patch || die
else
mv patches-git/9999 patch || die
fi fi
EGIT_REPO_URI=" EGIT_REPO_URI="
https://sourceware.org/git/binutils-gdb.git https://sourceware.org/git/binutils-gdb.git
@ -192,8 +194,6 @@ src_configure() {
# Keep things sane # Keep things sane
strip-flags strip-flags
# Adds a property which confuses tests (PR33267)
filter-flags '-mno-direct-extern-access'
use cet && filter-flags -mindirect-branch -mindirect-branch=* use cet && filter-flags -mindirect-branch -mindirect-branch=*
use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152 use elibc_musl && append-ldflags -Wl,-z,stack-size=2097152
lto-guarantee-fat lto-guarantee-fat
@ -530,9 +530,6 @@ src_install() {
# Simple test to make sure our new binutils isn't completely broken. # Simple test to make sure our new binutils isn't completely broken.
# Skip if this binutils is a cross compiler. # Skip if this binutils is a cross compiler.
#
# If coreutils is built with USE=multicall, some of these files
# will just be wrapper scripts, not actual ELFs we can test.
binutils_sanity_check() { binutils_sanity_check() {
pushd "${T}" >/dev/null pushd "${T}" >/dev/null
@ -558,7 +555,8 @@ binutils_sanity_check() {
local opt opt2 local opt opt2
# TODO: test multilib variants? # TODO: test multilib variants?
for opt in '' '-O2' ; do for opt in '' '-O2' ; do
for opt2 in '-static' '-static-pie' '-fno-PIE -no-pie' ; do # TODO: add static-pie? we need to check if support exists, though (bug #965478)
for opt2 in '-static' '-fno-PIE -no-pie' ; do
$(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test $(tc-getCC) ${opt} ${opt2} -B"${ED}${BINPATH}" "${T}"/number.c "${T}"/test.c -o "${T}"/test
if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then
:; :;
@ -573,6 +571,7 @@ binutils_sanity_check() {
pkg_preinst() { pkg_preinst() {
[[ -n ${ROOT} ]] && return 0 [[ -n ${ROOT} ]] && return 0
[[ -n ${EPREFIX} ]] && return 0
[[ -d ${ED}${BINPATH} ]] || return 0 [[ -d ${ED}${BINPATH} ]] || return 0
[[ -n ${BOOTSTRAP_RAP} ]] || return 0 [[ -n ${BOOTSTRAP_RAP} ]] || return 0
is_cross && return 0 is_cross && return 0