patches/gcc/4.2.1/250-softfloat-fix.patch
changeset 747 d3e603e7c17c
parent 313 2f223aafc7cb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.2.1/250-softfloat-fix.patch	Mon Jul 28 21:32:33 2008 +0000
     1.3 @@ -0,0 +1,58 @@
     1.4 +This patch (C) 2007 Yann E. MORIN
     1.5 +Licensed under GPL v2.
     1.6 +
     1.7 +First hunk of this patch solves compiling uClibc:
     1.8 +
     1.9 +make[1]: Entering directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
    1.10 +  LD libuClibc-0.9.29.so
    1.11 +libc/libc_so.a(difftime.os): In function `difftime':
    1.12 +difftime.c:(.text+0x8): undefined reference to `__floatsidf'
    1.13 +difftime.c:(.text+0x2c): undefined reference to `__subdf3'
    1.14 +libc/libc_so.a(_fpmaxtostr.os): In function `_fpmaxtostr':
    1.15 +_fpmaxtostr.c:(.text+0xd4): undefined reference to `__nedf2'
    1.16 +_fpmaxtostr.c:(.text+0xf8): undefined reference to `__eqdf2'
    1.17 +_fpmaxtostr.c:(.text+0x114): undefined reference to `__divdf3'
    1.18 +_fpmaxtostr.c:(.text+0x120): undefined reference to `__ltdf2'
    1.19 +_fpmaxtostr.c:(.text+0x1c4): undefined reference to `__muldf3'
    1.20 +_fpmaxtostr.c:(.text+0x388): undefined reference to `__gedf2'
    1.21 +_fpmaxtostr.c:(.text+0x430): undefined reference to `__adddf3'
    1.22 +libc/libc_so.a(__psfs_do_numeric.os): In function `__psfs_do_numeric':
    1.23 +__psfs_do_numeric.c:(.text+0x520): undefined reference to `__truncdfsf2'
    1.24 +libc/libc_so.a(strtof.os): In function `strtof':
    1.25 +strtof.c:(.text+0x1c): undefined reference to `__extendsfdf2'
    1.26 +/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/cc_core_prefix/lib/gcc/arm-linux-uclibc/4.1.1/libgcc.a(_fixunsdfsi.o):
    1.27 +In function `__fixunsdfsi':
    1.28 +libgcc2.c:(.text+0x34): undefined reference to `__fixdfsi'
    1.29 +make[2]: *** [lib/libc.so] Error 1
    1.30 +make[1]: *** [lib/libc.so.0] Error 2
    1.31 +make[1]: Leaving directory `/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc'
    1.32 +make: *** [/home/ymorin/x-tools/build/armeb-unknown-linux-uclibc/gcc-4.1.1-uClibc-0.9.28.1/build-libc/lib/libc.a]
    1.33 +Error 2
    1.34 +
    1.35 +The second hunk fixes building final gcc because soft-float implies using -lfloat (which we don't have).
    1.36 +
    1.37 +
    1.38 +diff -dur gcc-4.2.0.orig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
    1.39 +--- gcc-4.2.0.orig/gcc/config.gcc	2007-07-15 11:24:18.000000000 +0200
    1.40 ++++ gcc-4.2.0/gcc/config.gcc	2007-07-15 11:26:02.000000000 +0200
    1.41 +@@ -721,7 +721,7 @@
    1.42 + 	    default_use_cxa_atexit=yes
    1.43 + 	    ;;
    1.44 + 	*)
    1.45 +-	    tmake_file="$tmake_file arm/t-linux"
    1.46 ++	    tmake_file="$tmake_file arm/t-linux arm/t-arm-elf"
    1.47 + 	    ;;
    1.48 + 	esac
    1.49 + 	tm_file="$tm_file arm/aout.h arm/arm.h"
    1.50 +diff -dur gcc-4.2.0.orig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
    1.51 +--- gcc-4.2.0.orig/gcc/config/arm/linux-elf.h	2007-07-15 11:24:18.000000000 +0200
    1.52 ++++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2007-07-15 11:26:02.000000000 +0200
    1.53 +@@ -63,7 +63,7 @@
    1.54 +    %{shared:-lc} \
    1.55 +    %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
    1.56 + 
    1.57 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
    1.58 ++#define LIBGCC_SPEC "-lgcc"
    1.59 + 
    1.60 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
    1.61 +