[packages/gcc] fix linking with mold on 32bit archs; rel 6

atler atler at pld-linux.org
Tue Apr 19 12:46:17 CEST 2022


commit a8e40d159d7323a6a811d1c2b92ebaa9e489d491
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Apr 19 12:39:52 2022 +0200

    fix linking with mold on 32bit archs; rel 6
    
    for some reason gcc assumes all linkers should search for libraries in
    /lib and /usr/lib and deliberately skips them when constructing linker
    command line. this assumption does not apply to mold though and does not
    seem reasonable in general hence drop this logic and pass unfiltered
    LIBRARY_PATH to linker
    
    see:
    https://github.com/rui314/mold/issues/358
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104707

 all-library-paths.patch | 20 ++++++++++++++++++++
 gcc.spec                |  4 +++-
 2 files changed, 23 insertions(+), 1 deletion(-)
---
diff --git a/gcc.spec b/gcc.spec
index 71d416c..cd514ec 100644
--- a/gcc.spec
+++ b/gcc.spec
@@ -107,7 +107,7 @@ Summary(pl.UTF-8):	Kolekcja kompilatorów GNU: kompilator C i pliki współdziel
 Summary(pt_BR.UTF-8):	Coleção dos compiladores GNU: o compilador C e arquivos compartilhados
 Name:		gcc
 Version:	%{major_ver}.%{minor_ver}
-Release:	5
+Release:	6
 Epoch:		6
 License:	GPL v3+
 Group:		Development/Languages
@@ -121,6 +121,7 @@ Source4:	branch.sh
 Patch100:	%{name}-branch.diff
 # Patch100-md5:	e4e0ccce73627de0bf6564d11c54b603
 Patch0:		%{name}-info.patch
+Patch1:		all-library-paths.patch
 Patch2:		%{name}-nodebug.patch
 Patch3:		%{name}-ada-link.patch
 Patch4:		%{name}-ada-x32.patch
@@ -2574,6 +2575,7 @@ więc wtyczki muszą być przebudowywane przy każdej aktualizacji GCC.
 %setup -q
 %patch100 -p1
 %patch0 -p1
+%patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
diff --git a/all-library-paths.patch b/all-library-paths.patch
new file mode 100644
index 0000000..66d0468
--- /dev/null
+++ b/all-library-paths.patch
@@ -0,0 +1,20 @@
+--- gcc-11.2.0/gcc/gcc.c.orig	2022-04-18 15:40:02.650553155 +0200
++++ gcc-11.2.0/gcc/gcc.c	2022-04-19 09:31:21.340818868 +0200
+@@ -7817,17 +7817,6 @@
+   *cp++ = '.';
+   *cp = '\0';
+ 
+-  /* Exclude directories that the linker is known to search.  */
+-  if (linker
+-      && IS_DIR_SEPARATOR (path[0])
+-      && ((cp - path == 6
+-	   && filename_ncmp (path + 1, "lib", 3) == 0)
+-	  || (cp - path == 10
+-	      && filename_ncmp (path + 1, "usr", 3) == 0
+-	      && IS_DIR_SEPARATOR (path[4])
+-	      && filename_ncmp (path + 5, "lib", 3) == 0)))
+-    return 0;
+-
+   return (stat (path, &st) >= 0 && S_ISDIR (st.st_mode));
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gcc.git/commitdiff/d68136677ed66b0d75883d829c69780437aaebbe



More information about the pld-cvs-commit mailing list