This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[SH][PATCH] __fpscr_values broken
- From: Andrew Stubbs <ams at codesourcery dot com>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 29 Jan 2009 15:07:04 +0000
- Subject: [SH][PATCH] __fpscr_values broken
The SH4 needs to flip a mode bit in the FPSCR register each time it
wants to do single precision FP, rather than double precision. These
registers values are always stored in a symbol named __fpscr_values.
Unfortunately, due to the special way that shared libraries work, the
__fpscr_values symbol is not always visible.
[...]/math/libm_pic.a(e_lgamma_r.os): In function `__ieee754_lgamma_r':
[...]/math/../sysdeps/ieee754/dbl-64/e_lgamma_r.c:247: undefined reference to `__fpscr_values'
[...]/math/libm_pic.a(e_acosf.os): In function `__ieee754_acosf':
[...]/math/../sysdeps/ieee754/flt-32/e_acosf.c:55: undefined reference to `__fpscr_values'
[...]/math/../sysdeps/ieee754/flt-32/e_acosf.c:74: undefined reference to `__fpscr_values'
[...]/math/libm_pic.a(e_acoshf.os): In function `__ieee754_acoshf':
[...]/math/../sysdeps/ieee754/flt-32/e_acoshf.c:52: undefined reference to `__fpscr_values'
[...]/math/libm_pic.a(e_asinf.os): In function `__ieee754_asinf':
[...]/math/../sysdeps/ieee754/flt-32/e_asinf.c:109: undefined reference to `__fpscr_values'
[...]/math/libm_pic.a(e_atan2f.os):[...]/math/../sysdeps/ieee754/flt-32/e_atan2f.c:91: more undefined references to `__fpscr_values' follow
Please apply this patch to fix the problem.
Many thanks
Andrew Stubbs
2009-01-29 Andrew Stubbs <ams@codesourcery.com>
glibc/
* sysdeps/sh/sh4/Makefile: New file.
* sysdeps/sh/sh4/sh-fpscr.S: New file.
---
src/glibc-mainline/sysdeps/sh/sh4/Makefile | 3 +++
src/glibc-mainline/sysdeps/sh/sh4/sh-fpscr.S | 6 ++++++
2 files changed, 9 insertions(+)
Index: src/glibc-mainline/sysdeps/sh/sh4/Makefile
===================================================================
--- /dev/null
+++ src/glibc-mainline/sysdeps/sh/sh4/Makefile
@@ -0,0 +1,3 @@
+ifeq ($(subdir),math)
+libm-support+= sh-fpscr
+endif
Index: src/glibc-mainline/sysdeps/sh/sh4/sh-fpscr.S
===================================================================
--- /dev/null
+++ src/glibc-mainline/sysdeps/sh/sh4/sh-fpscr.S
@@ -0,0 +1,6 @@
+ .data
+ .weak __fpscr_values
+ .global __fpscr_values
+__fpscr_values:
+ .long 0
+ .long 0x80000