SHA256
1
0
forked from pool/glibc

Accepting request 122032 from home:a_jaeger:my-factory-packages

Update to current 2.15 branch

OBS-URL: https://build.opensuse.org/request/show/122032
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=186
This commit is contained in:
Andreas Jaeger 2012-05-24 09:00:17 +00:00 committed by Git OBS Bridge
parent 6e69a3e1cf
commit debe11fafa
8 changed files with 413 additions and 319 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65aacbb4b5218b686da63994150e7e34e71d85c45cc7c264b1d6ee55207d0b05
size 15776871

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2cb9ee564d4afe68d4dceac5f07cc6cbd155df2cd5a021a795b92d7877bf32ef
size 15778016

369
glibc-2.15-avx2.patch Normal file
View File

@ -0,0 +1,369 @@
commit 56f6f6a2403cfa7267cad722597113be35ecf70d
Author: Ulrich Drepper <drepper@gmail.com>
Date: Sat Jan 28 14:48:46 2012 -0500
Use -msse2avx option for x86-64 libm functions
2012-01-28 Ulrich Drepper <drepper@gmail.com>
* config.h.in: Define HAVE_SSE2AVX_SUPPORT.
* math/math_private.h: Remove libc_fegetround* and
libc_fesetround*.
* sysdeps/i386/configure.in: Check for -msse2avx.
* sysdeps/x86_64/fpu/math_private.h: Use VEX-encoded instructions
also if SSE2AVX is defined.
Remove libc_fegetround* and libc_fesetround*.
* sysdeps/x86_64/fpu/multiarch/Makefile: Compile *-avx functions
if config-cflags-sse2avx is yes. Also add -DSSE2AVX to defines.
* sysdeps/x86_64/fpu/multiarch/e_atan2.c: Use HAS_AVX again instead
of HAS_YMM_USABLE.
* sysdeps/x86_64/fpu/multiarch/e_exp.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/e_log.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_atan.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_sin.c: Likewise.
* sysdeps/x86_64/fpu/multiarch/s_tan.c: Likewise.
diff --git a/config.h.in b/config.h.in
index 50d53d4..1489476 100644
--- a/config.h.in
+++ b/config.h.in
@@ -90,7 +90,7 @@
certain registers (CR0, MQ, CTR, LR) in asm statements. */
#undef BROKEN_PPC_ASM_CR0
-/* Defined on SPARC if ld doesn't handle R_SPARC_WDISP22 against .hidden
+/* Defined on SPARC if ld does not handle R_SPARC_WDISP22 against .hidden
symbol. sysdeps/sparc/sparc32/elf/configure. */
#undef BROKEN_SPARC_WDISP22
@@ -106,17 +106,20 @@
/* Define if gcc supports AVX. */
#undef HAVE_AVX_SUPPORT
+/* Define if gcc supports VEX encoding. */
+#undef HAVE_SSE2AVX_SUPPORT
+
/* Define if gcc supports FMA4. */
#undef HAVE_FMA4_SUPPORT
-/* Define if the compiler's exception support is based on libunwind. */
+/* Define if the compiler\'s exception support is based on libunwind. */
#undef HAVE_CC_WITH_LIBUNWIND
/* Define if the access to static and hidden variables is position independent
and does not need relocations. */
#undef PI_STATIC_AND_HIDDEN
-/* Define this to disable the `hidden_proto' et al macros in
+/* Define this to disable the 'hidden_proto' et al macros in
include/libc-symbols.h that avoid PLT slots in the shared objects. */
#undef NO_HIDDEN
diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure
index ae494e2..bc7900e 100644
--- a/sysdeps/i386/configure
+++ b/sysdeps/i386/configure
@@ -756,6 +756,29 @@ if test $libc_cv_cc_avx = yes; then
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5
+$as_echo_n "checking for AVX encoding of SSE instructions... " >&6; }
+if ${libc_cv_cc_sse2avx+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ libc_cv_cc_sse2avx=yes
+else
+ libc_cv_cc_sse2avx=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5
+$as_echo "$libc_cv_cc_sse2avx" >&6; }
+if test $libc_cv_cc_sse2avx = yes; then
+ $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5
$as_echo_n "checking for FMA4 support... " >&6; }
if ${libc_cv_cc_fma4+:} false; then :
diff --git a/sysdeps/i386/configure.in b/sysdeps/i386/configure.in
index 5a9840e..59a4cd6 100644
--- a/sysdeps/i386/configure.in
+++ b/sysdeps/i386/configure.in
@@ -67,6 +67,17 @@ if test $libc_cv_cc_avx = yes; then
AC_DEFINE(HAVE_AVX_SUPPORT)
fi
+dnl Check if -msse2avx works.
+AC_CACHE_CHECK(for AVX encoding of SSE instructions, libc_cv_cc_sse2avx, [dnl
+if AC_TRY_COMMAND([${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null]); then
+ libc_cv_cc_sse2avx=yes
+else
+ libc_cv_cc_sse2avx=no
+fi])
+if test $libc_cv_cc_sse2avx = yes; then
+ AC_DEFINE(HAVE_SSE2AVX_SUPPORT)
+fi
+
dnl Check if -mfma4 works.
AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl
if AC_TRY_COMMAND([${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null]); then
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index be68903..4b5c173 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -34,21 +34,21 @@ CFLAGS-s_sin-fma4.c = -mfma4
CFLAGS-s_tan-fma4.c = -mfma4
endif
-ifeq ($(config-cflags-avx),yes)
+ifeq ($(config-cflags-sse2avx),yes)
libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \
e_atan2-avx s_sin-avx s_tan-avx \
mplog-avx mpa-avx slowexp-avx \
mpexp-avx
-CFLAGS-e_atan2-avx.c = -mavx
-CFLAGS-e_exp-avx.c = -mavx
-CFLAGS-e_log-avx.c = -mavx
-CFLAGS-mpa-avx.c = -mavx
-CFLAGS-mpexp-avx.c = -mavx
-CFLAGS-mplog-avx.c = -mavx
-CFLAGS-s_atan-avx.c = -mavx
-CFLAGS-s_sin-avx.c = -mavx
-CFLAGS-slowexp-avx.c = -mavx
-CFLAGS-s_tan-avx.c = -mavx
+CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-mpa-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-slowexp-avx.c = -sse2mavx -DSSE2AVX
+CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
endif
endif
diff --git a/sysdeps/x86_64/fpu/multiarch/e_atan2.c b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
index 3a615fc..6867c6e 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_atan2.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_atan2.c
@@ -14,7 +14,7 @@ extern double __ieee754_atan2_fma4 (double, double);
libm_ifunc (__ieee754_atan2,
HAS_FMA4 ? __ieee754_atan2_fma4
- : (HAS_YMM_USABLE ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
+ : (HAS_AVX ? __ieee754_atan2_avx : __ieee754_atan2_sse2));
strong_alias (__ieee754_atan2, __atan2_finite)
# define __ieee754_atan2 __ieee754_atan2_sse2
diff --git a/sysdeps/x86_64/fpu/multiarch/e_exp.c b/sysdeps/x86_64/fpu/multiarch/e_exp.c
index 7b2320a..3c65028 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_exp.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_exp.c
@@ -14,7 +14,7 @@ extern double __ieee754_exp_fma4 (double);
libm_ifunc (__ieee754_exp,
HAS_FMA4 ? __ieee754_exp_fma4
- : (HAS_YMM_USABLE ? __ieee754_exp_avx : __ieee754_exp_sse2));
+ : (HAS_AVX ? __ieee754_exp_avx : __ieee754_exp_sse2));
strong_alias (__ieee754_exp, __exp_finite)
# define __ieee754_exp __ieee754_exp_sse2
diff --git a/sysdeps/x86_64/fpu/multiarch/e_log.c b/sysdeps/x86_64/fpu/multiarch/e_log.c
index ab277d6..05f3668 100644
--- a/sysdeps/x86_64/fpu/multiarch/e_log.c
+++ b/sysdeps/x86_64/fpu/multiarch/e_log.c
@@ -14,8 +14,7 @@ extern double __ieee754_log_fma4 (double);
libm_ifunc (__ieee754_log,
HAS_FMA4 ? __ieee754_log_fma4
- : (HAS_YMM_USABLE ? __ieee754_log_avx
- : __ieee754_log_sse2));
+ : (HAS_AVX ? __ieee754_log_avx : __ieee754_log_sse2));
strong_alias (__ieee754_log, __log_finite)
# define __ieee754_log __ieee754_log_sse2
diff --git a/sysdeps/x86_64/fpu/multiarch/s_atan.c b/sysdeps/x86_64/fpu/multiarch/s_atan.c
index 78c7e09..ae16d7c 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_atan.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_atan.c
@@ -13,7 +13,7 @@ extern double __atan_fma4 (double);
# endif
libm_ifunc (atan, (HAS_FMA4 ? __atan_fma4 :
- HAS_YMM_USABLE ? __atan_avx : __atan_sse2));
+ HAS_AVX ? __atan_avx : __atan_sse2));
# define atan __atan_sse2
#endif
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin.c b/sysdeps/x86_64/fpu/multiarch/s_sin.c
index 417acd0..a0c2521 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_sin.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_sin.c
@@ -18,11 +18,11 @@ extern double __sin_fma4 (double);
# endif
libm_ifunc (__cos, (HAS_FMA4 ? __cos_fma4 :
- HAS_YMM_USABLE ? __cos_avx : __cos_sse2));
+ HAS_AVX ? __cos_avx : __cos_sse2));
weak_alias (__cos, cos)
libm_ifunc (__sin, (HAS_FMA4 ? __sin_fma4 :
- HAS_YMM_USABLE ? __sin_avx : __sin_sse2));
+ HAS_AVX ? __sin_avx : __sin_sse2));
weak_alias (__sin, sin)
# define __cos __cos_sse2
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan.c b/sysdeps/x86_64/fpu/multiarch/s_tan.c
index 3047155..904308f 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tan.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan.c
@@ -13,7 +13,7 @@ extern double __tan_fma4 (double);
# endif
libm_ifunc (tan, (HAS_FMA4 ? __tan_fma4 :
- HAS_YMM_USABLE ? __tan_avx : __tan_sse2));
+ HAS_AVX ? __tan_avx : __tan_sse2));
# define tan __tan_sse2
#endif
commit 7998fa7899a29803ad4512002636332dfee48451
Author: Andreas Schwab <schwab@linux-m68k.org>
Date: Fri Mar 16 16:07:57 2012 +0100
Disable use of FMA instructions in branred
2012-03-21 Andreas Schwab <schwab@linux-m68k.org>
* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Remove brandred-fma4.
(CFLAGS-brandred-fma4.c): Remove.
* sysdeps/x86_64/fpu/multiarch/brandred-fma4.c: Remove.
* sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c (__branred): Don't
define.
* sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c (__branred): Don't
define.
* stdio-common/_itoa.c: Check _ITOA_NEEDED instead of
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 2a38ffc..12b0526 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -7,10 +7,9 @@ libm-sysdep_routines += e_exp-fma4 e_log-fma4 e_pow-fma4 s_atan-fma4 \
e_asin-fma4 e_atan2-fma4 s_sin-fma4 s_tan-fma4 \
mplog-fma4 mpa-fma4 slowexp-fma4 slowpow-fma4 \
sincos32-fma4 doasin-fma4 dosincos-fma4 \
- brandred-fma4 halfulp-fma4 mpexp-fma4 \
+ halfulp-fma4 mpexp-fma4 \
mpatan2-fma4 mpatan-fma4 mpsqrt-fma4 mptan-fma4
-CFLAGS-brandred-fma4.c = -mfma4
CFLAGS-doasin-fma4.c = -mfma4
CFLAGS-dosincos-fma4.c = -mfma4
CFLAGS-e_asin-fma4.c = -mfma4
diff --git a/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c b/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c
deleted file mode 100644
index f4f68ac..0000000
--- a/sysdeps/x86_64/fpu/multiarch/brandred-fma4.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#define __branred __branred_fma4
-#define SECTION __attribute__ ((section (".text.fma4")))
-
-#include <sysdeps/ieee754/dbl-64/branred.c>
diff --git a/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c
index 2501af9..4c35739 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_sin-fma4.c
@@ -1,6 +1,5 @@
#define __cos __cos_fma4
#define __sin __sin_fma4
-#define __branred __branred_fma4
#define __docos __docos_fma4
#define __dubsin __dubsin_fma4
#define __mpcos __mpcos_fma4
diff --git a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
index d7dab3c..a805440 100644
--- a/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
+++ b/sysdeps/x86_64/fpu/multiarch/s_tan-fma4.c
@@ -1,5 +1,4 @@
#define tan __tan_fma4
-#define __branred __branred_fma4
#define __dbl_mp __dbl_mp_fma4
#define __mpranred __mpranred_fma4
#define __mptan __mptan_fma4
commit 3b1004624e54cc2fefd034ff80d5dea4b6db764f
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon Jan 30 19:55:15 2012 +0000
Fix makefile/configure problems with sse2avx changes.
2012-01-30 Joseph Myers <joseph@codesourcery.com>
* configure.in (libc_cv_cc_sse2avx): AC_SUBST.
* configure: Regenerate.
* config.make.in (config-cflags-sse2avx): Define.
* sysdeps/x86_64/fpu/multiarch/Makefile (CFLAGS-slowexp-avx.c):
Fix typo.
* scripts/config.guess: Update from upstream config git repository.
diff --git a/config.make.in b/config.make.in
index d937952..75061f6 100644
--- a/config.make.in
+++ b/config.make.in
@@ -36,6 +36,7 @@ asflags-cpu = @libc_cv_cc_submachine@
config-cflags-sse4 = @libc_cv_cc_sse4@
config-cflags-avx = @libc_cv_cc_avx@
+config-cflags-sse2avx = @libc_cv_cc_sse2avx@
config-cflags-novzeroupper = @libc_cv_cc_novzeroupper@
config-asflags-i686 = @libc_cv_as_i686@
diff --git a/configure b/configure
index 71e8de1..508e1bb 100755
--- a/configure
+++ b/configure
@@ -620,6 +620,7 @@ use_ldconfig
libc_cv_as_i686
libc_cv_cc_fma4
libc_cv_cc_novzeroupper
+libc_cv_cc_sse2avx
libc_cv_cc_avx
libc_cv_cc_sse4
libc_cv_cpp_asm_debuginfo
diff --git a/configure.in b/configure.in
index 5fd6d85..0499d3c 100644
--- a/configure.in
+++ b/configure.in
@@ -2154,6 +2154,7 @@ dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
AC_SUBST(libc_cv_cpp_asm_debuginfo)
AC_SUBST(libc_cv_cc_sse4)
AC_SUBST(libc_cv_cc_avx)
+AC_SUBST(libc_cv_cc_sse2avx)
AC_SUBST(libc_cv_cc_novzeroupper)
AC_SUBST(libc_cv_cc_fma4)
AC_SUBST(libc_cv_as_i686)
diff --git a/sysdeps/x86_64/fpu/multiarch/Makefile b/sysdeps/x86_64/fpu/multiarch/Makefile
index 4b5c173..2a38ffc 100644
--- a/sysdeps/x86_64/fpu/multiarch/Makefile
+++ b/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -48,7 +48,7 @@ CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX
CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX
CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
-CFLAGS-slowexp-avx.c = -sse2mavx -DSSE2AVX
+CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX
CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
endif
endif

View File

@ -1,248 +0,0 @@
qcommit afc5ed09cbce5d6fd48b3a8c5ec427b31f996880
Author: Ulrich Drepper <drepper@gmail.com>
Date: Thu Jan 26 07:45:14 2012 -0500
Reset bit_AVX in __cpu_features is OS support is missing
2012-01-26 Ulrich Drepper <drepper@gmail.com>
[BZ #13583]
* sysdeps/x86_64/multiarch/init-arch.h: Define bit_OSXSAVE.
* sysdeps/x86_64/multiarch/init-arch.c (__init_cpu_features): If
bit_AVX is set also check OSXAVE/XCR0 and reset bit_AVX if necessary.
Also contains selected changes from commits 08cf777f9e7f6d826658a99c7d77a359f73a45bf
and 56f6f6a2403cfa7267cad722597113be35ecf70d.
diff --git a/sysdeps/x86_64/multiarch/init-arch.c b/sysdeps/x86_64/multiarch/init-arch.c
index 65b0ee9..4fabbee 100644
--- a/sysdeps/x86_64/multiarch/init-arch.c
+++ b/sysdeps/x86_64/multiarch/init-arch.c
@@ -1,6 +1,6 @@
/* Initialize CPU feature data.
This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
Contributed by Ulrich Drepper <drepper@redhat.com>.
The GNU C Library is free software; you can redistribute it and/or
@@ -144,6 +144,18 @@ __init_cpu_features (void)
else
kind = arch_kind_other;
+ if (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX)
+ {
+ /* Reset the AVX bit in case OSXSAVE is disabled. */
+ if ((__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_OSXSAVE) == 0
+ || ({ unsigned int xcrlow;
+ unsigned int xcrhigh;
+ asm ("xgetbv"
+ : "=a" (xcrlow), "=d" (xcrhigh) : "c" (0));
+ (xcrlow & 6) != 6; }))
+ __cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~bit_AVX;
+ }
+
__cpu_features.family = family;
__cpu_features.model = model;
atomic_write_barrier ();
diff --git a/sysdeps/x86_64/multiarch/init-arch.h b/sysdeps/x86_64/multiarch/init-arch.h
index 2a1df39..408e5ae 100644
--- a/sysdeps/x86_64/multiarch/init-arch.h
+++ b/sysdeps/x86_64/multiarch/init-arch.h
@@ -1,5 +1,5 @@
/* This file is part of the GNU C Library.
- Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -27,6 +27,7 @@
#define bit_SSSE3 (1 << 9)
#define bit_SSE4_1 (1 << 19)
#define bit_SSE4_2 (1 << 20)
+#define bit_OSXSAVE (1 << 27)
#define bit_AVX (1 << 28)
#define bit_POPCOUNT (1 << 23)
#define bit_FMA (1 << 12)
Index: glibc-2.15/config.h.in
===================================================================
--- glibc-2.15.orig/config.h.in
+++ glibc-2.15/config.h.in
@@ -102,7 +102,7 @@
certain registers (CR0, MQ, CTR, LR) in asm statements. */
#undef BROKEN_PPC_ASM_CR0
-/* Defined on SPARC if ld doesn't handle R_SPARC_WDISP22 against .hidden
+/* Defined on SPARC if ld does not handle R_SPARC_WDISP22 against .hidden
symbol. sysdeps/sparc/sparc32/elf/configure. */
#undef BROKEN_SPARC_WDISP22
@@ -118,17 +118,20 @@
/* Define if gcc supports AVX. */
#undef HAVE_AVX_SUPPORT
+/* Define if gcc supports VEX encoding. */
+#undef HAVE_SSE2AVX_SUPPORT
+
/* Define if gcc supports FMA4. */
#undef HAVE_FMA4_SUPPORT
-/* Define if the compiler's exception support is based on libunwind. */
+/* Define if the compiler\'s exception support is based on libunwind. */
#undef HAVE_CC_WITH_LIBUNWIND
/* Define if the access to static and hidden variables is position independent
and does not need relocations. */
#undef PI_STATIC_AND_HIDDEN
-/* Define this to disable the `hidden_proto' et al macros in
+/* Define this to disable the 'hidden_proto' et al macros in
include/libc-symbols.h that avoid PLT slots in the shared objects. */
#undef NO_HIDDEN
Index: glibc-2.15/sysdeps/i386/configure
===================================================================
--- glibc-2.15.orig/sysdeps/i386/configure
+++ glibc-2.15/sysdeps/i386/configure
@@ -756,6 +756,29 @@ if test $libc_cv_cc_avx = yes; then
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX encoding of SSE instructions" >&5
+$as_echo_n "checking for AVX encoding of SSE instructions... " >&6; }
+if ${libc_cv_cc_sse2avx+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if { ac_try='${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ libc_cv_cc_sse2avx=yes
+else
+ libc_cv_cc_sse2avx=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cc_sse2avx" >&5
+$as_echo "$libc_cv_cc_sse2avx" >&6; }
+if test $libc_cv_cc_sse2avx = yes; then
+ $as_echo "#define HAVE_SSE2AVX_SUPPORT 1" >>confdefs.h
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FMA4 support" >&5
$as_echo_n "checking for FMA4 support... " >&6; }
if ${libc_cv_cc_fma4+:} false; then :
Index: glibc-2.15/sysdeps/i386/configure.in
===================================================================
--- glibc-2.15.orig/sysdeps/i386/configure.in
+++ glibc-2.15/sysdeps/i386/configure.in
@@ -67,6 +67,17 @@ if test $libc_cv_cc_avx = yes; then
AC_DEFINE(HAVE_AVX_SUPPORT)
fi
+dnl Check if -msse2avx works.
+AC_CACHE_CHECK(for AVX encoding of SSE instructions, libc_cv_cc_sse2avx, [dnl
+if AC_TRY_COMMAND([${CC-cc} -msse2avx -xc /dev/null -S -o /dev/null]); then
+ libc_cv_cc_sse2avx=yes
+else
+ libc_cv_cc_sse2avx=no
+fi])
+if test $libc_cv_cc_sse2avx = yes; then
+ AC_DEFINE(HAVE_SSE2AVX_SUPPORT)
+fi
+
dnl Check if -mfma4 works.
AC_CACHE_CHECK(for FMA4 support, libc_cv_cc_fma4, [dnl
if AC_TRY_COMMAND([${CC-cc} -mfma4 -xc /dev/null -S -o /dev/null]); then
Index: glibc-2.15/sysdeps/x86_64/fpu/multiarch/Makefile
===================================================================
--- glibc-2.15.orig/sysdeps/x86_64/fpu/multiarch/Makefile
+++ glibc-2.15/sysdeps/x86_64/fpu/multiarch/Makefile
@@ -34,21 +34,21 @@ CFLAGS-s_sin-fma4.c = -mfma4
CFLAGS-s_tan-fma4.c = -mfma4
endif
-ifeq ($(config-cflags-avx),yes)
+ifeq ($(config-cflags-sse2avx),yes)
libm-sysdep_routines += e_exp-avx e_log-avx s_atan-avx \
e_atan2-avx s_sin-avx s_tan-avx \
mplog-avx mpa-avx slowexp-avx \
mpexp-avx
-CFLAGS-e_atan2-avx.c = -mavx
-CFLAGS-e_exp-avx.c = -mavx
-CFLAGS-e_log-avx.c = -mavx
-CFLAGS-mpa-avx.c = -mavx
-CFLAGS-mpexp-avx.c = -mavx
-CFLAGS-mplog-avx.c = -mavx
-CFLAGS-s_atan-avx.c = -mavx
-CFLAGS-s_sin-avx.c = -mavx
-CFLAGS-slowexp-avx.c = -mavx
-CFLAGS-s_tan-avx.c = -mavx
+CFLAGS-e_atan2-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-e_exp-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-e_log-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-mpa-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-mpexp-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-mplog-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-s_atan-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-s_sin-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-slowexp-avx.c = -msse2avx -DSSE2AVX
+CFLAGS-s_tan-avx.c = -msse2avx -DSSE2AVX
endif
endif
Index: glibc-2.15/config.make.in
===================================================================
--- glibc-2.15.orig/config.make.in
+++ glibc-2.15/config.make.in
@@ -36,6 +36,7 @@ asflags-cpu = @libc_cv_cc_submachine@
config-cflags-sse4 = @libc_cv_cc_sse4@
config-cflags-avx = @libc_cv_cc_avx@
+config-cflags-sse2avx = @libc_cv_cc_sse2avx@
config-cflags-novzeroupper = @libc_cv_cc_novzeroupper@
config-asflags-i686 = @libc_cv_as_i686@
Index: glibc-2.15/configure
===================================================================
--- glibc-2.15.orig/configure
+++ glibc-2.15/configure
@@ -625,6 +625,7 @@ use_ldconfig
libc_cv_as_i686
libc_cv_cc_fma4
libc_cv_cc_novzeroupper
+libc_cv_cc_sse2avx
libc_cv_cc_avx
libc_cv_cc_sse4
libc_cv_cpp_asm_debuginfo
Index: glibc-2.15/configure.in
===================================================================
--- glibc-2.15.orig/configure.in
+++ glibc-2.15/configure.in
@@ -2338,6 +2338,7 @@ dnl sysdeps/CPU/configure.in checks set
AC_SUBST(libc_cv_cpp_asm_debuginfo)
AC_SUBST(libc_cv_cc_sse4)
AC_SUBST(libc_cv_cc_avx)
+AC_SUBST(libc_cv_cc_sse2avx)
AC_SUBST(libc_cv_cc_novzeroupper)
AC_SUBST(libc_cv_cc_fma4)
AC_SUBST(libc_cv_as_i686)
--- eglibc-2.15-fma4-orig/sysdeps/x86_64/multiarch/init-arch.c 2012-05-07 10:02:38.869334673 -0700
+++ eglibc-2.15-fma4-orig/sysdeps/x86_64/multiarch/init-arch.c 2012-05-07 10:01:16.217334959 -0700
@@ -156,6 +156,11 @@
__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx &= ~bit_AVX;
}
+ /* FMA4 depends on AVX support */
+ if (__cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx & bit_FMA4
+ && (__cpu_features.cpuid[COMMON_CPUID_INDEX_1].ecx & bit_AVX) == 0)
+ __cpu_features.cpuid[COMMON_CPUID_INDEX_80000001].ecx &= ~bit_FMA4;
+
__cpu_features.family = family;
__cpu_features.model = model;
atomic_write_barrier ();

View File

@ -1,33 +0,0 @@
commit 7c35ffedf144417ba2787322c7b75b4db5c3cb7a
Author: Thomas Schwinge <thomas@codesourcery.com>
Date: Fri Feb 10 21:05:54 2012 +0100
Fix x86 PLT slot usage for feraiseexcept.
Then we're elf/check-localplt.out-clean again.
2012-02-10 Thomas Schwinge <thomas@codesourcery.com>
* sysdeps/i386/fpu/feupdateenv.c (__feupdateenv) Invoke __feraiseexcept
instead of feraiseexcept.
Index: glibc-2.15/sysdeps/i386/fpu/feupdateenv.c
===================================================================
--- glibc-2.15.orig/sysdeps/i386/fpu/feupdateenv.c
+++ glibc-2.15/sysdeps/i386/fpu/feupdateenv.c
@@ -1,5 +1,5 @@
/* Install given floating-point environment and raise exceptions.
- Copyright (C) 1997,99,2000,01,07,2010 Free Software Foundation, Inc.
+ Copyright (C) 1997,99,2000,01,07,2010,2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -45,7 +45,7 @@ __feupdateenv (const fenv_t *envp)
/* Raise the saved exception. Incidently for us the implementation
defined format of the values in objects of type fexcept_t is the
same as the ones specified using the FE_* constants. */
- feraiseexcept ((int) temp);
+ __feraiseexcept ((int) temp);
/* Success. */
return 0;

View File

@ -8,7 +8,7 @@ Index: glibc-2.15/csu/version.c
static const char banner[] =
-"GNU C Library "RELEASE" release version "VERSION", by Roland McGrath et al.\n\
+"GNU C Library "RELEASE" release version "VERSION" ("CVSDATE"), by Roland McGrath et al.\n\
Copyright (C) 2011 Free Software Foundation, Inc.\n\
Copyright (C) 2012 Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions.\n\
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
PARTICULAR PURPOSE.\n\

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed May 23 20:00:55 UTC 2012 - aj@suse.de
- Update to current git of glibc 2.15 branch:
* obsoletes glibc-2.16-avx.patch,
glibc-2.16-fix-check-localplt.patch
* Fixes for math functions.
-------------------------------------------------------------------
Wed May 23 11:51:02 UTC 2012 - aj@suse.de

View File

@ -115,7 +115,8 @@ Provides: ld-linux.so.3(GLIBC_2.4)
%endif
Version: 2.15
Release: 0
%define git_id 2ba92745c36e
%define glibc_major_version 2.15
%define git_id 60ff996420f9
%define glibc_ports_ver 2.15
%define ports_git_id 8a70b2dcabbf
Url: http://www.gnu.org/software/libc/libc.html
@ -263,16 +264,12 @@ Patch1001: glibc-2.16-scanf.patch
Patch1002: glibc-ppc-getcontext.patch
# PATCH-FIX-UPSTREAM Fix ifunc relocations (bnc#740109) - aj@suse.de
Patch1003: glibc-ifunc-2.16.patch
# PATCH-FIX-UPSTREAM Fix tests for AVX features - aj@suse.de
Patch1004: glibc-2.16-avx.patch
# PATCH-FIX-UPSTREAM vfprintf: validate nargs and maybe allocate from heap bnc#747768 - aj@suse.de
Patch1005: vfprintf-nargs.patch
# PATCH-FIX-UPSTREAM Add Arm dependency on libmemusage - bwiedemann@suse.de
Patch1006: glibc-add-arm-dependency-libmemusage.patch
# PATCH-FIX-UPSTREAM Fix check abi - aj@suse.de
Patch1007: glibc-2.16-fix-check-abi.patch
# PATCH-FIX-UPSTREAM Fix check-localelfplt - aj@suse.de
Patch1008: glibc-2.16-fix-check-localplt.patch
# PATCH-FIX-UPSTREAM - Allow compilation with -altivec aj@suse.de
Patch1009: glibc-uio-cell.diff
# PATCH-FIX-UPSTREAM - do not use initfini anymore
@ -283,6 +280,8 @@ Patch1011: armhf-ld-so.patch
Patch1012: glibc-nscd-foreground.patch
# PATCH-FIX-UPSTREAM Fix confstr use of local buffer outside its extent
Patch1013: confstr.patch
# PATCH-FIX-UPSTREAM Use HAS_AVX - aj@suse.de
Patch1014: glibc-2.15-avx2.patch
###
# Patches awaiting upstream approval
@ -544,11 +543,9 @@ rm nscd/s-stamp
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%patch1004 -p1
%patch1005 -p1
%patch1006 -p1
%patch1007 -p1
%patch1008 -p1
%patch1009 -p1
%ifarch ppc ppc64
# to support further architectures, some more changes are needed
@ -560,6 +557,7 @@ rm nscd/s-stamp
%endif
%patch1012 -p1
%patch1013 -p1
%patch1014 -p1
%patch2001 -p1
%patch2003 -p1
@ -952,7 +950,7 @@ cp -av bits/stdio-lock.h %{buildroot}%{_includedir}/bits/stdio-lock.h
%ifarch s390x
# s390x is different ...
mkdir %{buildroot}/lib
ln -sf ../%{_lib}/ld-%{version}.so %{buildroot}/lib/ld64.so.1
ln -sf ../%{_lib}/ld-%{glibc_major_version}.so %{buildroot}/lib/ld64.so.1
%endif
# Miscelanna:
@ -1041,7 +1039,7 @@ install -m 644 %{SOURCE22} %{buildroot}/lib/systemd/system
%ifarch armv7l armv7hl
# Provide compatibility link
ln -s ld-%{version}.so %{buildroot}/lib/ld-linux.so.3
ln -s ld-%{glibc_major_version}.so %{buildroot}/lib/ld-linux.so.3
%endif
#######################################################################
@ -1115,7 +1113,7 @@ exit 0
%doc %{_mandir}/man1/getent.1.gz
%doc %{_mandir}/man1/localedef.1.gz
%doc %{_mandir}/man5/*
/%{_lib}/ld-%{version}.so
/%{_lib}/ld-%{glibc_major_version}.so
# Each architecture has a different name for the dynamic linker:
%ifarch %arm
@ -1147,56 +1145,56 @@ exit 0
/%{_lib}/ld-linux.so.2
%endif
/%{_lib}/libBrokenLocale-%{version}.so
/%{_lib}/libBrokenLocale-%{glibc_major_version}.so
/%{_lib}/libBrokenLocale.so.1
/%{_lib}/libSegFault.so
/%{_lib}/libanl-%{version}.so
/%{_lib}/libanl-%{glibc_major_version}.so
/%{_lib}/libanl.so.1
/%{_lib}/libc-%{version}.so
/%{_lib}/libc-%{glibc_major_version}.so
/%{_lib}/libc.so.6*
/%{_lib}/libcidn-%{version}.so
/%{_lib}/libcidn-%{glibc_major_version}.so
/%{_lib}/libcidn.so.1
/%{_lib}/libcrypt-%{version}.so
/%{_lib}/libcrypt-%{glibc_major_version}.so
/%{_lib}/libcrypt.so.1
/%{_lib}/libdl-%{version}.so
/%{_lib}/libdl-%{glibc_major_version}.so
/%{_lib}/libdl.so.2*
/%{_lib}/libm-%{version}.so
/%{_lib}/libm-%{glibc_major_version}.so
/%{_lib}/libm.so.6*
/%{_lib}/libnsl-%{version}.so
/%{_lib}/libnsl-%{glibc_major_version}.so
/%{_lib}/libnsl.so.1
/%{_lib}/libnss_compat-%{version}.so
/%{_lib}/libnss_compat-%{glibc_major_version}.so
/%{_lib}/libnss_compat.so.2
/%{_lib}/libnss_db-%{version}.so
/%{_lib}/libnss_db-%{glibc_major_version}.so
/%{_lib}/libnss_db.so.2
/%{_lib}/libnss_dns-%{version}.so
/%{_lib}/libnss_dns-%{glibc_major_version}.so
/%{_lib}/libnss_dns.so.2
/%{_lib}/libnss_files-%{version}.so
/%{_lib}/libnss_files-%{glibc_major_version}.so
/%{_lib}/libnss_files.so.2
/%{_lib}/libnss_hesiod-%{version}.so
/%{_lib}/libnss_hesiod-%{glibc_major_version}.so
/%{_lib}/libnss_hesiod.so.2
/%{_lib}/libnss_nis-%{version}.so
/%{_lib}/libnss_nis-%{glibc_major_version}.so
/%{_lib}/libnss_nis.so.2
/%{_lib}/libnss_nisplus-%{version}.so
/%{_lib}/libnss_nisplus-%{glibc_major_version}.so
/%{_lib}/libnss_nisplus.so.2
/%{_lib}/libpthread-%{version}.so
/%{_lib}/libpthread-%{glibc_major_version}.so
/%{_lib}/libpthread.so.0
/%{_lib}/libresolv-%{version}.so
/%{_lib}/libresolv-%{glibc_major_version}.so
/%{_lib}/libresolv.so.2
/%{_lib}/librt-%{version}.so
/%{_lib}/librt-%{glibc_major_version}.so
/%{_lib}/librt.so.1
/%{_lib}/libthread_db-1.0.so
/%{_lib}/libthread_db.so.1
/%{_lib}/libutil-%{version}.so
/%{_lib}/libutil-%{glibc_major_version}.so
/%{_lib}/libutil.so.1
%define optimized_libs() \
%dir %attr(0755,root,root) /%{_lib}/%1\
/%{_lib}/%1/libc-%{version}.so\
/%{_lib}/%1/libc-%{glibc_major_version}.so\
/%{_lib}/%1/libc.so.6*\
/%{_lib}/%1/libm-%{version}.so\
/%{_lib}/%1/libm-%{glibc_major_version}.so\
/%{_lib}/%1/libm.so.6*\
/%{_lib}/%1/libpthread-%{version}.so\
/%{_lib}/%1/libpthread-%{glibc_major_version}.so\
/%{_lib}/%1/libpthread.so.0\
/%{_lib}/%1/librt-%{version}.so\
/%{_lib}/%1/librt-%{glibc_major_version}.so\
/%{_lib}/%1/librt.so.1\
/%{_lib}/%1/libthread_db-1.0.so\
/%{_lib}/%1/libthread_db.so.1
@ -1245,7 +1243,7 @@ exit 0
%defattr (755,root,root,755)
%dir /%{_lib}/obsolete/
%dir /%{_lib}/obsolete/noversion
/%{_lib}/obsolete/noversion/libNoVersion-%{version}.so
/%{_lib}/obsolete/noversion/libNoVersion-%{glibc_major_version}.so
/%{_lib}/obsolete/noversion/libNoVersion.so.1
%endif