From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1677479-garchives=archives.gentoo.org@lists.gentoo.org>
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 47F0C15807A
	for <garchives@archives.gentoo.org>; Mon,  7 Oct 2024 15:56:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1E1E8E29B0;
	Mon,  7 Oct 2024 15:56:03 +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))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id F0E8BE29B0
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Oct 2024 15:56:02 +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 04E4B3430B3
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Oct 2024 15:56:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 696FA11DF
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Oct 2024 15:56:00 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
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" <sam@gentoo.org>
Message-ID: <1728316498.fbe427b18343c5ad45bc2fd56ae691f1c95295ff.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/glibc/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/glibc/glibc-2.19-r3.ebuild sys-libs/glibc/glibc-2.31-r7.ebuild sys-libs/glibc/glibc-2.32-r8.ebuild sys-libs/glibc/glibc-2.33-r14.ebuild sys-libs/glibc/glibc-2.34-r14.ebuild sys-libs/glibc/glibc-2.35-r11.ebuild sys-libs/glibc/glibc-2.36-r8.ebuild sys-libs/glibc/glibc-2.37-r10.ebuild sys-libs/glibc/glibc-2.38-r13.ebuild sys-libs/glibc/glibc-2.39-r10.ebuild sys-libs/glibc/glibc-2.39-r6.ebuild sys-libs/glibc/glibc-2.39-r9.ebuild sys-libs/glibc/glibc-2.40-r3.ebuild sys-libs/glibc/glibc-2.40-r4.ebuild sys-libs/glibc/glibc-9999.ebuild
X-VCS-Directories: sys-libs/glibc/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: fbe427b18343c5ad45bc2fd56ae691f1c95295ff
X-VCS-Branch: master
Date: Mon,  7 Oct 2024 15:56:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 912c9c72-c79f-4b89-9bc2-59e7016f5892
X-Archives-Hash: e671c1087b109ae0f185172396dd708b

commit:     fbe427b18343c5ad45bc2fd56ae691f1c95295ff
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  7 15:53:11 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct  7 15:54:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fbe427b1

sys-libs/glibc: filter -Wl,--gc-sections

This fails to link when building static-reloc.o but it's broken in other
ways too -- amonakov points out that glibc's linker scripts aren't
ready for gc-sections (odd runtime side-effects like I/O flushing at exit
not occurring), see PR21557 comment 0 for it being mentioned as an aside.

Thanks to holgerh for reporting.

Closes: https://bugs.gentoo.org/940709
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/glibc/glibc-2.19-r3.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.31-r7.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.32-r8.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.33-r14.ebuild | 5 +++++
 sys-libs/glibc/glibc-2.34-r14.ebuild | 5 +++++
 sys-libs/glibc/glibc-2.35-r11.ebuild | 5 +++++
 sys-libs/glibc/glibc-2.36-r8.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.37-r10.ebuild | 5 +++++
 sys-libs/glibc/glibc-2.38-r13.ebuild | 5 +++++
 sys-libs/glibc/glibc-2.39-r10.ebuild | 5 +++++
 sys-libs/glibc/glibc-2.39-r6.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.39-r9.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.40-r3.ebuild  | 5 +++++
 sys-libs/glibc/glibc-2.40-r4.ebuild  | 5 +++++
 sys-libs/glibc/glibc-9999.ebuild     | 5 +++++
 15 files changed, 75 insertions(+)

diff --git a/sys-libs/glibc/glibc-2.19-r3.ebuild b/sys-libs/glibc/glibc-2.19-r3.ebuild
index c0f528d06063..7d492b72364a 100644
--- a/sys-libs/glibc/glibc-2.19-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.19-r3.ebuild
@@ -346,6 +346,11 @@ setup_flags() {
 	# glibc aborts if rpath is set by LDFLAGS
 	filter-ldflags '-Wl,-rpath=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# #492892
 	filter-flags -frecord-gcc-switches
 

diff --git a/sys-libs/glibc/glibc-2.31-r7.ebuild b/sys-libs/glibc/glibc-2.31-r7.ebuild
index 0c3ee20d2b3e..7df8f5816447 100644
--- a/sys-libs/glibc/glibc-2.31-r7.ebuild
+++ b/sys-libs/glibc/glibc-2.31-r7.ebuild
@@ -378,6 +378,11 @@ setup_flags() {
 	# glibc aborts if rpath is set by LDFLAGS
 	filter-ldflags '-Wl,-rpath=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# #492892
 	filter-flags -frecord-gcc-switches
 

diff --git a/sys-libs/glibc/glibc-2.32-r8.ebuild b/sys-libs/glibc/glibc-2.32-r8.ebuild
index e787a3de2ef7..656ad5161a27 100644
--- a/sys-libs/glibc/glibc-2.32-r8.ebuild
+++ b/sys-libs/glibc/glibc-2.32-r8.ebuild
@@ -395,6 +395,11 @@ setup_flags() {
 	# glibc aborts if rpath is set by LDFLAGS
 	filter-ldflags '-Wl,-rpath=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# #492892
 	filter-flags -frecord-gcc-switches
 

diff --git a/sys-libs/glibc/glibc-2.33-r14.ebuild b/sys-libs/glibc/glibc-2.33-r14.ebuild
index ca3fb42335ea..5e23df0069e8 100644
--- a/sys-libs/glibc/glibc-2.33-r14.ebuild
+++ b/sys-libs/glibc/glibc-2.33-r14.ebuild
@@ -411,6 +411,11 @@ setup_flags() {
 	# https://sourceware.org/PR27837
 	filter-ldflags '-Wl,--relax'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# #492892
 	filter-flags -frecord-gcc-switches
 

diff --git a/sys-libs/glibc/glibc-2.34-r14.ebuild b/sys-libs/glibc/glibc-2.34-r14.ebuild
index 3a2d7ac313da..e23b9ae35e9c 100644
--- a/sys-libs/glibc/glibc-2.34-r14.ebuild
+++ b/sys-libs/glibc/glibc-2.34-r14.ebuild
@@ -415,6 +415,11 @@ setup_flags() {
 	# https://sourceware.org/PR27837
 	filter-ldflags '-Wl,--relax'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# #492892
 	filter-flags -frecord-gcc-switches
 

diff --git a/sys-libs/glibc/glibc-2.35-r11.ebuild b/sys-libs/glibc/glibc-2.35-r11.ebuild
index e51499d04e05..0c2aec0025e0 100644
--- a/sys-libs/glibc/glibc-2.35-r11.ebuild
+++ b/sys-libs/glibc/glibc-2.35-r11.ebuild
@@ -428,6 +428,11 @@ setup_flags() {
 	# https://sourceware.org/PR27837
 	filter-ldflags '-Wl,--relax'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# #492892
 	filter-flags -frecord-gcc-switches
 

diff --git a/sys-libs/glibc/glibc-2.36-r8.ebuild b/sys-libs/glibc/glibc-2.36-r8.ebuild
index 471ede5408d3..cb6ddba38eb7 100644
--- a/sys-libs/glibc/glibc-2.36-r8.ebuild
+++ b/sys-libs/glibc/glibc-2.36-r8.ebuild
@@ -434,6 +434,11 @@ setup_flags() {
 	# https://sourceware.org/PR27837
 	filter-ldflags '-Wl,--relax'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.37-r10.ebuild b/sys-libs/glibc/glibc-2.37-r10.ebuild
index e5de30df953c..e323ee8ae32d 100644
--- a/sys-libs/glibc/glibc-2.37-r10.ebuild
+++ b/sys-libs/glibc/glibc-2.37-r10.ebuild
@@ -449,6 +449,11 @@ setup_flags() {
 	# https://sourceware.org/PR27837
 	filter-ldflags '-Wl,--relax'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.38-r13.ebuild b/sys-libs/glibc/glibc-2.38-r13.ebuild
index 01d2fa89a416..5bba661e9e91 100644
--- a/sys-libs/glibc/glibc-2.38-r13.ebuild
+++ b/sys-libs/glibc/glibc-2.38-r13.ebuild
@@ -454,6 +454,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.39-r10.ebuild b/sys-libs/glibc/glibc-2.39-r10.ebuild
index ed17d3d931d1..ab91a718940c 100644
--- a/sys-libs/glibc/glibc-2.39-r10.ebuild
+++ b/sys-libs/glibc/glibc-2.39-r10.ebuild
@@ -465,6 +465,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.39-r6.ebuild b/sys-libs/glibc/glibc-2.39-r6.ebuild
index 2c6ad99b5569..d6ca7cba9e5b 100644
--- a/sys-libs/glibc/glibc-2.39-r6.ebuild
+++ b/sys-libs/glibc/glibc-2.39-r6.ebuild
@@ -472,6 +472,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.39-r9.ebuild b/sys-libs/glibc/glibc-2.39-r9.ebuild
index 2f0b1d9a004d..e0df00dcd639 100644
--- a/sys-libs/glibc/glibc-2.39-r9.ebuild
+++ b/sys-libs/glibc/glibc-2.39-r9.ebuild
@@ -465,6 +465,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.40-r3.ebuild b/sys-libs/glibc/glibc-2.40-r3.ebuild
index 038ecf46f641..a33b62687f2e 100644
--- a/sys-libs/glibc/glibc-2.40-r3.ebuild
+++ b/sys-libs/glibc/glibc-2.40-r3.ebuild
@@ -465,6 +465,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-2.40-r4.ebuild b/sys-libs/glibc/glibc-2.40-r4.ebuild
index 56088868f4f3..d4fc0765e8cc 100644
--- a/sys-libs/glibc/glibc-2.40-r4.ebuild
+++ b/sys-libs/glibc/glibc-2.40-r4.ebuild
@@ -465,6 +465,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index aa6d07cbace3..dee2d1b66c49 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -465,6 +465,11 @@ setup_flags() {
 	# anyway because glibc already handles this by itself.
 	filter-ldflags '-Wl,--dynamic-linker=*'
 
+	# Fails to link (bug #940709) in some cases but even if it manages to,
+	# subtle runtime breakage will occur because the linker scripts need
+	# adaptation. Mentioned in PR21557#c0.
+	filter-ldflags '-Wl,--gc-sections'
+
 	# some weird software relies on sysv hashes in glibc, bug 863863, bug 864100
 	# we have to do that here already so mips can filter it out again :P
 	if use hash-sysv-compat ; then