]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
gcc: Fix linking against libgcc on ARM.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Dec 2011 23:15:18 +0000 (00:15 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Dec 2011 23:15:18 +0000 (00:15 +0100)
The shared version of libgcc (libgcc_s) does not provide all symbols
and so we need to the static version as well. That is done by a simple
linker script.

gcc/gcc.nm

index 575cd893d9dc420f62a77f55520467de93696baf..c650b71946ca23913c50bd806f8b9afc15c80971 100644 (file)
@@ -8,7 +8,7 @@ build_cloog_ppl = 1
 
 name       = gcc
 version    = 4.6.2
-release    = 4
+release    = 6
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Compilers
@@ -221,7 +221,21 @@ build
 
                # Move libgcc_s to /lib
                mv -vf %{BUILDROOT}/usr/lib/libgcc_s.so.1 %{BUILDROOT}/lib/
-               ln -svf ../../lib/libgcc_s.so.1 %{BUILDROOT}/usr/lib/libgcc_s.so
+               case "%{DISTRO_ARCH}" in
+                       arm*)
+                               rm -f ${FULLPATH}/libgcc_s.so %{BUILDROOT}/usr/lib/libgcc_s.so
+                               cat <<EOF >${FULLPATH}/libgcc_s.so
+               /* GNU ld script
+                  Use the shared library, but some functions are only in
+                  the static library, so try that secondarily.  */
+               OUTPUT_FORMAT(elf32-littlearm)
+               GROUP ( /lib/libgcc_s.so.1 libgcc.a )
+               EOF
+                               ;;
+                       *)
+                               ln -svf ../../lib/libgcc_s.so.1 ${FULLPATH}/libgcc_s.so
+                               ;;
+               esac
 
                # Remove some GNU debugger stuff.
                rm -vf %{BUILDROOT}/usr/lib/lib*.py