[glibc/f17] - Fix fenv.h to work with -m32.

Jeffrey Law law at fedoraproject.org
Wed Nov 7 19:53:02 UTC 2012


commit 7c988d1351d7b8444dbff6b4c222164e91e8dc2c
Author: Jeff Law <law at redhat.com>
Date:   Wed Nov 7 12:52:46 2012 -0700

      - Fix fenv.h to work with -m32.

 glibc-fenvfix.patch |   42 ++++++++++++++++++++++++++++++++++++++++++
 glibc.spec          |    7 ++++++-
 2 files changed, 48 insertions(+), 1 deletions(-)
---
diff --git a/glibc-fenvfix.patch b/glibc-fenvfix.patch
new file mode 100644
index 0000000..c48cc44
--- /dev/null
+++ b/glibc-fenvfix.patch
@@ -0,0 +1,42 @@
+commit a728a38fb658f8b2f0acbea8a586db8bd054f3fe
+Author: H.J. Lu <hjl.tools at gmail.com>
+Date:   Wed Jun 6 10:11:14 2012 -0700
+
+    Check __SSE_MATH__ in x86_64 feraiseexcept
+
+2012-06-06  H.J. Lu  <hongjiu.lu at intel.com>
+
+	[BZ #14117]
+	* sysdeps/x86_64/fpu/bits/fenv.h (feraiseexcept): Check
+	__SSE_MATH__.
+
+diff --git a/sysdeps/x86_64/fpu/bits/fenv.h b/sysdeps/x86_64/fpu/bits/fenv.h
+index bb790c9..b2c01c4 100644
+--- a/sysdeps/x86_64/fpu/bits/fenv.h
++++ b/sysdeps/x86_64/fpu/bits/fenv.h
+@@ -109,7 +109,12 @@ __NTH (feraiseexcept (int __excepts))
+ 	  /* One example of a invalid operation is 0.0 / 0.0.  */
+ 	  float __f = 0.0;
+ 
++# ifdef __SSE_MATH__
+ 	  __asm__ __volatile__ ("divss %0, %0 " : : "x" (__f));
++# else
++	  __asm__ __volatile__ ("fdiv %%st, %%st(0); fwait"
++				: "=t" (__f) : "0" (__f));
++# endif
+ 	  (void) &__f;
+ 	}
+       if ((FE_DIVBYZERO & __excepts) != 0)
+@@ -117,7 +122,12 @@ __NTH (feraiseexcept (int __excepts))
+ 	  float __f = 1.0;
+ 	  float __g = 0.0;
+ 
++# ifdef __SSE_MATH__
+ 	  __asm__ __volatile__ ("divss %1, %0" : : "x" (__f), "x" (__g));
++# else
++	  __asm__ __volatile__ ("fdivp %%st, %%st(1); fwait"
++				: "=t" (__f) : "0" (__f), "u" (__g) : "st(1)");
++# endif
+ 	  (void) &__f;
+ 	}
+ 
diff --git a/glibc.spec b/glibc.spec
index a137519..976b39d 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -28,7 +28,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 57%{?dist}
+Release: 58%{?dist}
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -120,6 +120,7 @@ Patch1052: %{name}-sw13979.patch
 Patch1053: %{name}-rh817276.patch
 Patch1054: %{name}-rh808014.patch
 Patch1068: %{name}-rh845960.patch
+Patch1071: glibc-fenvfix.patch
 
 #
 # Patches submitted, but not yet approved upstream.
@@ -511,6 +512,7 @@ popd
 %patch1068 -p1
 %patch2069 -p1
 %patch2070 -p1
+%patch1071 -p1
 
 # A lot of programs still misuse memcpy when they have to use
 # memmove. The memcpy implementation below is not tolerant at
@@ -1377,6 +1379,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Wed Nov 7 2012 Jeff Law <law at redhat.com> - 2.15.58
+  - Fix fenv.h to work with -m32.
+
 * Fri Sep 14 2012 Jeff Law <law at redhat.com> - 2.15.57
   - Fix prototype of sigsetjmp in pthread.h (#857236).
 


More information about the scm-commits mailing list