Bug#1082624: gcc-14: Please add sparc64 to gcc-as-needed.diff

Adrian Bunk <[email protected]>
Newsgroups gmane.linux.debian.ports.sparc
Message-ID <172709909017.26639.2339709221692687500.reportbug__46460.7600866415$1727099307$gmane$org@localhost>
Package: gcc-14
Version: 14.2.0-5
Severity: normal
Tags: patch
X-Debbugs-Cc: [email protected]

sparc64 has some spurious library dependencies due to gcc-as-needed.diff
currently only adding --as-needed to 32bit-only sparc builds, please
append the attached patch to gcc-as-needed.diff

(this is the same change as #1070766 was in gcc-13)

Thanks in advance
0001-as-needed-for-sparc64.patch (text/plain, 787 B)
--- a/src/gcc/config/sparc/linux64.h
+++ b/src/gcc/config/sparc/linux64.h
@@ -90,7 +90,7 @@ along with GCC; see the file COPYING3.  If not see
   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
   { "link_arch",	 LINK_ARCH_SPEC },
 
-#define LINK_ARCH32_SPEC "-m elf32_sparc %{shared:-shared} \
+#define LINK_ARCH32_SPEC "-m elf32_sparc %{shared:-shared} %{!fsanitize=*:--as-needed} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
@@ -98,7 +98,7 @@ along with GCC; see the file COPYING3.  If not see
       %{static:-static}} \
 "
 
-#define LINK_ARCH64_SPEC "-m elf64_sparc %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc %{shared:-shared} %{!fsanitize=*:--as-needed} \
   %{!shared: \
     %{!static: \
       %{rdynamic:-export-dynamic} \
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.