From 6b116320b6cbd7edc3a56c4ff85b4a7b23f7d3ea Mon Sep 17 00:00:00 2001 From: Sam James Date: Thu, 6 Nov 2025 12:22:38 +0000 Subject: [PATCH] sys-devel/binutils: don't try -static-pie at all in the sanity check rcrt1.o isn't always available and static-pie support can be buggy (which is why it's interesting to test, but if we can't rely on it being available, we also can't rely on it at least without some checking being OK in some glibc version too). Need to try again with a has_version check for glibc[static-pie] at least and possibly more. Closes: https://bugs.gentoo.org/965478 Signed-off-by: Sam James --- sys-devel/binutils/binutils-2.45-r1.ebuild | 3 ++- sys-devel/binutils/binutils-2.45.9999.ebuild | 3 ++- sys-devel/binutils/binutils-2.45.ebuild | 3 ++- sys-devel/binutils/binutils-9999.ebuild | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys-devel/binutils/binutils-2.45-r1.ebuild b/sys-devel/binutils/binutils-2.45-r1.ebuild index 4f892fd2f3c3d..d4beb896bc17f 100644 --- a/sys-devel/binutils/binutils-2.45-r1.ebuild +++ b/sys-devel/binutils/binutils-2.45-r1.ebuild @@ -553,7 +553,8 @@ binutils_sanity_check() { local opt opt2 # TODO: test multilib variants? 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 if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then :; diff --git a/sys-devel/binutils/binutils-2.45.9999.ebuild b/sys-devel/binutils/binutils-2.45.9999.ebuild index 813f206a020f0..6bef4f37b48fa 100644 --- a/sys-devel/binutils/binutils-2.45.9999.ebuild +++ b/sys-devel/binutils/binutils-2.45.9999.ebuild @@ -557,7 +557,8 @@ binutils_sanity_check() { local opt opt2 # TODO: test multilib variants? 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 if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then :; diff --git a/sys-devel/binutils/binutils-2.45.ebuild b/sys-devel/binutils/binutils-2.45.ebuild index 6218370c57638..ca5584f86d468 100644 --- a/sys-devel/binutils/binutils-2.45.ebuild +++ b/sys-devel/binutils/binutils-2.45.ebuild @@ -555,7 +555,8 @@ binutils_sanity_check() { local opt opt2 # TODO: test multilib variants? 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 if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then :; diff --git a/sys-devel/binutils/binutils-9999.ebuild b/sys-devel/binutils/binutils-9999.ebuild index 813f206a020f0..6bef4f37b48fa 100644 --- a/sys-devel/binutils/binutils-9999.ebuild +++ b/sys-devel/binutils/binutils-9999.ebuild @@ -557,7 +557,8 @@ binutils_sanity_check() { local opt opt2 # TODO: test multilib variants? 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 if "${T}"/test | grep -q "Hello Gentoo! Your magic number is: 42" ; then :;