Bug#358772: glibc can not be cross-compiled with softfloat for ARM
Package: glibc
Severity: minor
Tags: patch
--- glibc-2.3.6/debian/patches/series 2006-03-23 00:07:51.000000000 +0100
+++ glibc-2.3.6-4.my/debian/patches/series 2006-03-23 17:58:40.000000000 +0100
@@ -34,6 +34,7 @@
50_glibc232-m68k-dwarf2-buildfix.diff -p0
#arm-output-format.diff -p0 # g: suspended
arm-ioperm.diff -p0
+arm-softfloat.diff -p0
arm-float-byteorder.diff -p0
#glibc-make-check-perms.diff -p1 # g: suspended
glibc-2.3.2-ldconfig-tls.diff -p1
--- glibc-2.3.6/debian/patches/arm-softfloat.diff 1970-01-01 01:00:00.000000000 +0100
+++ glibc-2.3.6-4.my/debian/patches/arm-softfloat.diff 2006-03-24 00:00:25.000000000 +0100
@@ -0,0 +1,99 @@
+#! /bin/sh -e
+
+# All lines beginning with `# DP:' are a description of the patch.
+# DP: Description: fix ioperm build error on arm
+
+if [ $# -ne 2 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -d "$2" -f --no-backup-if-mismatch -p0 < $0;;
+ -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p0 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+esac
+exit 0
+
+--- Makeconfig.orig 2006-03-23 17:32:26.000000000 +0100
++++ Makeconfig 2006-03-23 14:13:10.000000000 +0100
+@@ -904,7 +904,7 @@
+ # is more or less arbitrary. The sorting step will take care of the
+ # dependencies. Only the $(binfmt-subdir) should always be kept at the
+ # end of the list.
+-all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
++all-subdirs = soft-fp csu assert ctype locale intl catgets math setjmp signal \
+ stdlib stdio-common libio malloc string wcsmbs time dirent \
+ grp pwd posix io termios resource misc socket sysvipc gmon \
+ gnulib iconv iconvdata wctype manual shadow po argp \
+--- sysdeps/arm/sfp-machine.h 1970-01-01 01:00:00.000000000 +0100
++++ sysdeps/arm/sfp-machine.h 2000-09-05 10:41:37.000000000 +0200
+@@ -0,0 +1,47 @@
++#define _FP_W_TYPE_SIZE 32
++#define _FP_W_TYPE unsigned long
++#define _FP_WS_TYPE signed long
++#define _FP_I_TYPE long
++
++#define _FP_MUL_MEAT_S(R,X,Y) \
++ _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_D(R,X,Y) \
++ _FP_MUL_MEAT_2_wide(_FP_WFRACBITS_D,R,X,Y,umul_ppmm)
++#define _FP_MUL_MEAT_Q(R,X,Y) \
++ _FP_MUL_MEAT_4_wide(_FP_WFRACBITS_Q,R,X,Y,umul_ppmm)
++
++#define _FP_DIV_MEAT_S(R,X,Y) _FP_DIV_MEAT_1_udiv_norm(S,R,X,Y)
++#define _FP_DIV_MEAT_D(R,X,Y) _FP_DIV_MEAT_2_udiv(D,R,X,Y)
++#define _FP_DIV_MEAT_Q(R,X,Y) _FP_DIV_MEAT_4_udiv(Q,R,X,Y)
++
++#define _FP_NANFRAC_S ((_FP_QNANBIT_S << 1) - 1)
++#define _FP_NANFRAC_D ((_FP_QNANBIT_D << 1) - 1), -1
++#define _FP_NANFRAC_Q ((_FP_QNANBIT_Q << 1) - 1), -1, -1, -1
++#define _FP_NANSIGN_S 0
++#define _FP_NANSIGN_D 0
++#define _FP_NANSIGN_Q 0
++
++#define _FP_KEEPNANFRACP 1
++/* From my experiments it seems X is chosen unless one of the
++ NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */
++#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
++ do { \
++ if ((_FP_FRAC_HIGH_RAW_##fs(X) | \
++ _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \
++ { \
++ R##_s = _FP_NANSIGN_##fs; \
++ _FP_FRAC_SET_##wc(R,_FP_NANFRAC_##fs); \
++ } \
++ else \
++ { \
++ R##_s = X##_s; \
++ _FP_FRAC_COPY_##wc(R,X); \
++ } \
++ R##_c = FP_CLS_NAN; \
++ } while (0)
++
++#define FP_EX_INVALID (1 << 4)
++#define FP_EX_DIVZERO (1 << 3)
++#define FP_EX_OVERFLOW (1 << 2)
++#define FP_EX_UNDERFLOW (1 << 1)
++#define FP_EX_INEXACT (1 << 0)
+--- soft-fp/Makefile.orig 2006-03-23 23:58:48.000000000 +0100
++++ soft-fp/Makefile 2006-03-23 23:59:22.000000000 +0100
+@@ -35,10 +35,14 @@
+ fixunstfdi floatditf extendsftf2 trunctfsf2 extenddftf2 \
+ trunctfdf2 sqrttf2
+
++routines = $(gcc-single-routines) \
++ $(gcc-double-routines) \
++ $(gcc-quad-routines)
++
++static-only-routines = $(routines)
++
+ distribute := double.h op-1.h op-2.h op-4.h op-common.h quad.h \
+ single.h soft-fp.h extended.h Banner op-8.h testit.c \
+- $(addsuffix .c,$(gcc-single-routines)) \
+- $(addsuffix .c,$(gcc-double-routines)) \
+- $(addsuffix .c,$(gcc-quad-routines))
++ $(addsuffix .c,$(routines))
+
+ include ../Rules
--- glibc-2.3.6/debian/control 2006-03-23 00:07:51.000000000 +0100
+++ glibc-2.3.6-4.my/debian/control 2006-03-24 01:07:16.000000000 +0100
@@ -45,7 +45,7 @@
by default. This created a package that unpacked to an excess of 30 megs.
Package: nscd
-Architecture: alpha amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc ia64 hppa s390 sh3 sh4 sh3eb sh4eb kfreebsd-i386 kfreebsd-amd64
+Architecture: alpha amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc ia64 hppa s390 sh3 sh4 sh3eb sh4eb kfreebsd-i386 kfreebsd-amd64
Section: admin
Priority: optional
Depends: libc6 (>= ${Source-Version})
@@ -56,7 +56,7 @@
slow Services like LDAP, NIS or NIS+
Package: libc6
-Architecture: amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: libs
Priority: required
Provides: ${locale-compat:Depends}
@@ -67,7 +67,7 @@
Timezone data is also included.
Package: libc6-dev
-Architecture: amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: libdevel
Priority: standard
Depends: libc6 (= ${Source-Version})
@@ -77,7 +77,7 @@
and link programs which use the standard C library.
Package: libc6-dbg
-Architecture: amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: libdevel
Priority: extra
Provides: libc-dbg
@@ -91,7 +91,7 @@
Most people will not need this package.
Package: libc6-prof
-Architecture: amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: libdevel
Priority: extra
Depends: libc6 (= ${Source-Version})
@@ -100,7 +100,7 @@
with gprof.
Package: libc6-pic
-Architecture: amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: libdevel
Priority: optional
Conflicts: libc-pic
@@ -115,7 +115,7 @@
Package: libc6-udeb
XC-Package-Type: udeb
-Architecture: amd64 arm armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
+Architecture: amd64 arm arm-softfloat armeb i386 m68k mips mipsel powerpc ppc64 sparc s390 hppa sh3 sh4 sh3eb sh4eb
Section: debian-installer
Priority: extra
Provides: libc6, libc-udeb, ${locale-compat:Depends}
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-rc3
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)
Reply to: