[arch-commits] Commit in glibc/trunk (PKGBUILD glibc-2.15-math64crash.patch)

Allan McRae allan at archlinux.org
Fri Dec 30 08:02:03 UTC 2011


    Date: Friday, December 30, 2011 @ 03:02:02
  Author: allan
Revision: 145762

upgpkg: glibc 2.15-3

deal with some crashes in x86_64 math...

Added:
  glibc/trunk/glibc-2.15-math64crash.patch
Modified:
  glibc/trunk/PKGBUILD

------------------------------+
 PKGBUILD                     |    8 +
 glibc-2.15-math64crash.patch |  184 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 191 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-12-30 06:09:32 UTC (rev 145761)
+++ PKGBUILD	2011-12-30 08:02:02 UTC (rev 145762)
@@ -6,7 +6,7 @@
 
 pkgname=glibc
 pkgver=2.15
-pkgrel=2
+pkgrel=3
 _glibcdate=20111227
 pkgdesc="GNU C Library"
 arch=('i686' 'x86_64')
@@ -31,6 +31,7 @@
         glibc-2.14-reinstall-nis-rpc-headers.patch
         glibc-2.15-lddebug-scopes.patch
         glibc-2.15-revert-c5a0802a.patch
+        glibc-2.15-math64crash.patch
         nscd
         locale.gen.txt
         locale-gen)
@@ -45,6 +46,7 @@
          '55febbb72139ac7b65757df085024b83'
          '3c219ddfb619b6df903cac4cc42c611d'
          '7ae3e426251ae33e73dbad71f9c91378'
+         'dc7550e659ddd685bd78a930d15a01f2'
          'b587ee3a70c9b3713099295609afde49'
          '07ac979b6ab5eeb778d55f041529d623'
          '476e9113489f93b348b21e144b6a8fcf')
@@ -100,6 +102,10 @@
   # https://bugzilla.redhat.com/show_bug.cgi?id=769421
   patch -Np1 -i ${srcdir}/glibc-2.15-revert-c5a0802a.patch
 
+  # revert optimized math routines that can cause crashes (FS#27736, FS#27743)
+  # obviously not a real fix...
+  patch -Np1 -i ${srcdir}/glibc-2.15-math64crash.patch
+
   install -dm755 ${pkgdir}/etc
   touch ${pkgdir}/etc/ld.so.conf
 

Added: glibc-2.15-math64crash.patch
===================================================================
--- glibc-2.15-math64crash.patch	                        (rev 0)
+++ glibc-2.15-math64crash.patch	2011-12-30 08:02:02 UTC (rev 145762)
@@ -0,0 +1,184 @@
+diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
+index be68903..a032da8 100644
+--- a/sysdeps/x86_64/fpu/multiarch/Makefile
++++ b/sysdeps/x86_64/fpu/multiarch/Makefile
+@@ -1,5 +1,5 @@
+ ifeq ($(subdir),math)
+-libm-sysdep_routines += s_floor-c s_ceil-c s_floorf-c s_ceilf-c \
++libm-sysdep_routines += s_floorf-c s_ceilf-c \
+ 			s_rint-c s_rintf-c s_nearbyint-c s_nearbyintf-c
+ 
+ ifeq ($(have-mfma4),yes)
+diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c b/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c
+deleted file mode 100644
+index 6a5ea3f..0000000
+--- a/sysdeps/x86_64/fpu/multiarch/s_ceil-c.c
++++ /dev/null
+@@ -1,2 +0,0 @@
+-#define __ceil __ceil_c
+-#include <sysdeps/ieee754/dbl-64/wordsize-64/s_ceil.c>
+diff --git a/sysdeps/x86_64/fpu/multiarch/s_ceil.S b/sysdeps/x86_64/fpu/multiarch/s_ceil.S
+deleted file mode 100644
+index d0f8da3..0000000
+--- a/sysdeps/x86_64/fpu/multiarch/s_ceil.S
++++ /dev/null
+@@ -1,40 +0,0 @@
+-/* Copyright (C) 2011 Free Software Foundation, Inc.
+-   This file is part of the GNU C Library.
+-   Contributed by Ulrich Drepper <drepper at gmail.come>, 2011.
+-
+-   The GNU C Library is free software; you can redistribute it and/or
+-   modify it under the terms of the GNU Lesser General Public
+-   License as published by the Free Software Foundation; either
+-   version 2.1 of the License, or (at your option) any later version.
+-
+-   The GNU C Library is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-   Lesser General Public License for more details.
+-
+-   You should have received a copy of the GNU Lesser General Public
+-   License along with the GNU C Library; if not, write to the Free
+-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-   02111-1307 USA.  */
+-
+-#include <machine/asm.h>
+-#include <init-arch.h>
+-
+-
+-ENTRY(__ceil)
+-	.type	__ceil, @gnu_indirect_function
+-	call	__get_cpu_features at plt
+-	movq	%rax, %rdx
+-	leaq	__ceil_sse41(%rip), %rax
+-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+-	jnz	2f
+-	leaq	__ceil_c(%rip), %rax
+-2:	ret
+-END(__ceil)
+-weak_alias (__ceil, ceil)
+-
+-
+-ENTRY(__ceil_sse41)
+-	roundsd	$2, %xmm0, %xmm0
+-	ret
+-END(__ceil_sse41)
+diff --git a/sysdeps/x86_64/fpu/multiarch/s_floor-c.c b/sysdeps/x86_64/fpu/multiarch/s_floor-c.c
+deleted file mode 100644
+index 68733b6..0000000
+--- a/sysdeps/x86_64/fpu/multiarch/s_floor-c.c
++++ /dev/null
+@@ -1,3 +0,0 @@
+-#undef __floor
+-#define __floor __floor_c
+-#include <sysdeps/ieee754/dbl-64/wordsize-64/s_floor.c>
+diff --git a/sysdeps/x86_64/fpu/multiarch/s_floor.S b/sysdeps/x86_64/fpu/multiarch/s_floor.S
+deleted file mode 100644
+index 514ea95..0000000
+--- a/sysdeps/x86_64/fpu/multiarch/s_floor.S
++++ /dev/null
+@@ -1,40 +0,0 @@
+-/* Copyright (C) 2011 Free Software Foundation, Inc.
+-   This file is part of the GNU C Library.
+-   Contributed by Ulrich Drepper <drepper at gmail.come>, 2011.
+-
+-   The GNU C Library is free software; you can redistribute it and/or
+-   modify it under the terms of the GNU Lesser General Public
+-   License as published by the Free Software Foundation; either
+-   version 2.1 of the License, or (at your option) any later version.
+-
+-   The GNU C Library is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+-   Lesser General Public License for more details.
+-
+-   You should have received a copy of the GNU Lesser General Public
+-   License along with the GNU C Library; if not, write to the Free
+-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+-   02111-1307 USA.  */
+-
+-#include <machine/asm.h>
+-#include <init-arch.h>
+-
+-
+-ENTRY(__floor)
+-	.type	__floor, @gnu_indirect_function
+-	call	__get_cpu_features at plt
+-	movq	%rax, %rdx
+-	leaq	__floor_sse41(%rip), %rax
+-	testl	$bit_SSE4_1, CPUID_OFFSET+index_SSE4_1(%rdx)
+-	jnz	2f
+-	leaq	__floor_c(%rip), %rax
+-2:	ret
+-END(__floor)
+-weak_alias (__floor, floor)
+-
+-
+-ENTRY(__floor_sse41)
+-	roundsd	$1, %xmm0, %xmm0
+-	ret
+-END(__floor_sse41)
+diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c
+deleted file mode 100644
+index 1ba9dbc..0000000
+--- a/sysdeps/x86_64/fpu/multiarch/s_sin.c
++++ /dev/null
+@@ -1,31 +0,0 @@
+-#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT
+-# include <init-arch.h>
+-# include <math.h>
+-# undef NAN
+-
+-extern double __cos_sse2 (double);
+-extern double __sin_sse2 (double);
+-extern double __cos_avx (double);
+-extern double __sin_avx (double);
+-# ifdef HAVE_FMA4_SUPPORT
+-extern double __cos_fma4 (double);
+-extern double __sin_fma4 (double);
+-# else
+-#  undef HAS_FMA4
+-#  define HAS_FMA4 0
+-#  define __cos_fma4 ((void *) 0)
+-#  define __sin_fma4 ((void *) 0)
+-# endif
+-
+-libm_ifunc (__cos, HAS_FMA4 ? __cos_fma4 : HAS_AVX ? __cos_avx : __cos_sse2);
+-weak_alias (__cos, cos)
+-
+-libm_ifunc (__sin, HAS_FMA4 ? __sin_fma4 : HAS_AVX ? __sin_avx : __sin_sse2);
+-weak_alias (__sin, sin)
+-
+-# define __cos __cos_sse2
+-# define __sin __sin_sse2
+-#endif
+-
+-
+-#include <sysdeps/ieee754/dbl-64/s_sin.c>
+diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c
+deleted file mode 100644
+index 8f6601e..0000000
+--- a/sysdeps/x86_64/fpu/multiarch/s_tan.c
++++ /dev/null
+@@ -1,21 +0,0 @@
+-#if defined HAVE_FMA4_SUPPORT || defined HAVE_AVX_SUPPORT
+-# include <init-arch.h>
+-# include <math.h>
+-
+-extern double __tan_sse2 (double);
+-extern double __tan_avx (double);
+-# ifdef HAVE_FMA4_SUPPORT
+-extern double __tan_fma4 (double);
+-# else
+-#  undef HAS_FMA4
+-#  define HAS_FMA4 0
+-#  define __tan_fma4 ((void *) 0)
+-# endif
+-
+-libm_ifunc (tan, HAS_FMA4 ? __tan_fma4 : HAS_AVX ? __tan_avx : __tan_sse2);
+-
+-# define tan __tan_sse2
+-#endif
+-
+-
+-#include <sysdeps/ieee754/dbl-64/s_tan.c>




More information about the arch-commits mailing list