patches/glibc/2.3.2/glibc-2.3.2-without-fp.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/glibc/2.3.2/glibc-2.3.2-without-fp.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,89 @@
     1.4 +Sender: libc-alpha-owner@sources.redhat.com
     1.5 +Date: Tue, 29 Jul 2003 17:49:47 -0400
     1.6 +From: Daniel Jacobowitz <drow@mvista.com>
     1.7 +To: GNU C Library <libc-alpha@sources.redhat.com>
     1.8 +Subject: Re: __sim_exceptions undefined when linking glibc-2.3.2's libm.so with --without-fp
     1.9 +Message-ID: <20030729214947.GA29932@nevyn.them.org>
    1.10 +
    1.11 +On Tue, Jul 29, 2003 at 02:53:33PM -0700, Dan Kegel wrote:
    1.12 +> On ppc405, I'm getting the following when linking glibc's libm:
    1.13 +> /gcc-3.3-glibc-2.3.2/build-glibc/math/libm_pic.a(fclrexcpt.os)(.text+0x1a): 
    1.14 +> In function `feclearexcept@GLIBC_2.1':
    1.15 +> : undefined reference to `__sim_exceptions'
    1.16 +> 
    1.17 +> That symbol seems to be present in libc.so.  nm shows
    1.18 +
    1.19 +--without-fp doesn't work.  Try this.  Make up a changelog entry if it
    1.20 +works.
    1.21 +
    1.22 +Date: Tue, 29 Jul 2003 14:56:50 -0700
    1.23 +Message-Id: <200307292156.h6TLuol24356@magilla.sf.frob.com>
    1.24 +From: Roland McGrath <roland@redhat.com>
    1.25 +To: Daniel Jacobowitz <drow@mvista.com>
    1.26 +Cc: GNU C Library <libc-alpha@sources.redhat.com>
    1.27 +Subject: Re: __sim_exceptions undefined when linking glibc-2.3.2's libm.so with --without-fp
    1.28 +In-Reply-To: Daniel Jacobowitz's message of  Tuesday, 29 July 2003 17:49:47 -0400 <20030729214947.GA29932@nevyn.them.org>
    1.29 +
    1.30 +> +int __sim_exceptions __attribute__ ((section(".bss")));
    1.31 +
    1.32 +Use __attribute__ ((nocommon)) instead (and please watch the standard
    1.33 +whitespace conventions, i.e. ``section ('').
    1.34 +
    1.35 +diff -purN glibc-2.3.2.orig/sysdeps/powerpc/nofpu/sim-full.c glibc-2.3.2/sysdeps/powerpc/nofpu/sim-full.c
    1.36 +--- glibc-2.3.2.orig/sysdeps/powerpc/nofpu/sim-full.c	2002-10-19 16:06:29.000000000 -0400
    1.37 ++++ glibc-2.3.2/sysdeps/powerpc/nofpu/sim-full.c	2003-05-14 15:10:42.000000000 -0400
    1.38 +@@ -24,11 +24,14 @@
    1.39 + 
    1.40 + /* Global to store sticky exceptions.  */
    1.41 +-int __sim_exceptions;
    1.42 ++int __sim_exceptions __attribute__ ((nocommon));
    1.43 ++libc_hidden_data_def (__sim_exceptions);
    1.44 + 
    1.45 + /* By default, no exceptions should trap.  */
    1.46 + int __sim_disabled_exceptions = 0xffffffff;
    1.47 ++libc_hidden_data_def (__sim_disabled_exceptions);
    1.48 + 
    1.49 +-int __sim_round_mode;
    1.50 ++int __sim_round_mode __attribute__ ((nocommon));
    1.51 ++libc_hidden_data_def (__sim_round_mode);
    1.52 + 
    1.53 + void
    1.54 + __simulate_exceptions (int x)
    1.55 +diff -purN glibc-2.3.2.orig/sysdeps/powerpc/nofpu/soft-supp.h glibc-2.3.2/sysdeps/powerpc/nofpu/soft-supp.h
    1.56 +--- glibc-2.3.2.orig/sysdeps/powerpc/nofpu/soft-supp.h	2002-10-19 16:06:29.000000000 -0400
    1.57 ++++ glibc-2.3.2/sysdeps/powerpc/nofpu/soft-supp.h	2003-05-14 15:09:53.000000000 -0400
    1.58 +@@ -27,7 +27,11 @@ typedef union
    1.59 + } fenv_union_t;
    1.60 + 
    1.61 + 
    1.62 +-extern int __sim_exceptions attribute_hidden;
    1.63 +-extern int __sim_disabled_exceptions attribute_hidden;
    1.64 +-extern int __sim_round_mode attribute_hidden;
    1.65 ++extern int __sim_exceptions;
    1.66 ++libc_hidden_proto (__sim_exceptions);
    1.67 ++extern int __sim_disabled_exceptions;
    1.68 ++libc_hidden_proto (__sim_disabled_exceptions);
    1.69 ++extern int __sim_round_mode;
    1.70 ++libc_hidden_proto (__sim_round_mode);
    1.71 ++
    1.72 + extern void __simulate_exceptions (int x) attribute_hidden;
    1.73 +diff -urp glibc-2.3.2.orig/sysdeps/powerpc/soft-fp/sfp-machine.h glibc-2.3.2/sysdeps/powerpc/soft-fp/sfp-machine.h
    1.74 +--- glibc-2.3.2.orig/sysdeps/powerpc/soft-fp/sfp-machine.h	2002-10-17 18:36:14.000000000 -0400
    1.75 ++++ glibc-2.3.2/sysdeps/powerpc/soft-fp/sfp-machine.h	2003-05-14 16:48:13.000000000 -0400
    1.76 +@@ -52,7 +52,11 @@
    1.77 + #define FP_HANDLE_EXCEPTIONS  __simulate_exceptions (_fex)
    1.78 + #define FP_ROUNDMODE          __sim_round_mode
    1.79 + 
    1.80 +-extern int __sim_exceptions attribute_hidden;
    1.81 +-extern int __sim_disabled_exceptions attribute_hidden;
    1.82 +-extern int __sim_round_mode attribute_hidden;
    1.83 ++extern int __sim_exceptions;
    1.84 ++libc_hidden_proto (__sim_exceptions);
    1.85 ++extern int __sim_disabled_exceptions;
    1.86 ++libc_hidden_proto (__sim_disabled_exceptions);
    1.87 ++extern int __sim_round_mode;
    1.88 ++libc_hidden_proto (__sim_round_mode);
    1.89 ++
    1.90 + extern void __simulate_exceptions (int x) attribute_hidden;
    1.91 +
    1.92 +