SHA256
3
0
forked from pool/glibc

Accepting request 519281 from home:Andreas_Schwab:Factory

- math-c++-compat.patch: Do not use __builtin_types_compatible_p in C++
  mode (BZ #21930)

- Add iconvconfig to baselibs.conf (bsc#1051042)

- resolv-context-leak.patch: Fix leaks of resolver contexts
- dl-runtime-resolve-opt-avx512f.patch: Use _dl_runtime_resolve_opt only
  with AVX512F (BZ #21871)
- libpthread-compat-wrappers.patch: Don't use IFUNC resolver for longjmp
  or system in libpthread (BZ #21041)

OBS-URL: https://build.opensuse.org/request/show/519281
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=472
This commit is contained in:
Andreas Schwab 2017-08-29 08:02:22 +00:00 committed by Git OBS Bridge
parent 20ef0d1c4d
commit f869647ca8
11 changed files with 437 additions and 63 deletions

View File

@ -7,6 +7,7 @@ glibc
targettype ia32 "/lib/ld-linux.so.2 -> <prefix>/lib/ld-linux.so.2"
prereq -glibc-x86
+/usr/lib/getconf/[^g]
+/usr/sbin/iconvconfig -> /usr/sbin/iconvconfig-<extension>
glibc-locale
arch i586 block!
+/usr/lib(64)?/gconv/gconv-modules

View File

@ -0,0 +1,26 @@
2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
[BZ #21871]
* sysdeps/x86/cpu-features.c (init_cpu_features): Set
bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.
Index: glibc-2.26/sysdeps/x86/cpu-features.c
===================================================================
--- glibc-2.26.orig/sysdeps/x86/cpu-features.c
+++ glibc-2.26/sysdeps/x86/cpu-features.c
@@ -244,10 +244,13 @@ init_cpu_features (struct cpu_features *
|= bit_arch_Prefer_No_AVX512;
/* To avoid SSE transition penalty, use _dl_runtime_resolve_slow.
- If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt. */
+ If XGETBV suports ECX == 1, use _dl_runtime_resolve_opt.
+ Use _dl_runtime_resolve_opt only with AVX512F since it is
+ slower than _dl_runtime_resolve_slow with AVX. */
cpu_features->feature[index_arch_Use_dl_runtime_resolve_slow]
|= bit_arch_Use_dl_runtime_resolve_slow;
- if (cpu_features->max_cpuid >= 0xd)
+ if (CPU_FEATURES_ARCH_P (cpu_features, AVX512F_Usable)
+ && cpu_features->max_cpuid >= 0xd)
{
unsigned int eax;

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue Aug 29 07:13:42 UTC 2017 - schwab@suse.de
- math-c++-compat.patch: Do not use __builtin_types_compatible_p in C++
mode (BZ #21930)
-------------------------------------------------------------------
Thu Aug 17 12:46:46 UTC 2017 - schwab@suse.de
- Add iconvconfig to baselibs.conf (bsc#1051042)
-------------------------------------------------------------------
Thu Aug 10 08:05:15 UTC 2017 - schwab@suse.de
- resolv-context-leak.patch: Fix leaks of resolver contexts
- dl-runtime-resolve-opt-avx512f.patch: Use _dl_runtime_resolve_opt only
with AVX512F (BZ #21871)
- libpthread-compat-wrappers.patch: Don't use IFUNC resolver for longjmp
or system in libpthread (BZ #21041)
-------------------------------------------------------------------
Wed Aug 2 14:32:58 UTC 2017 - schwab@suse.de
@ -760,7 +780,7 @@ Mon Feb 9 09:26:01 UTC 2015 - schwab@suse.de
* i386 memcpy functions optimized with SSE2 unaligned load/store
* New locales: tu_IN, bh_IN, raj_IN, ce_RU
* The obsolete sigvec function has been removed
* CVE-2015-1472 CVE-2015-1473 CVE-2104-7817 CVE-2012-3406 CVE-2014-9402
* CVE-2015-1472 CVE-2015-1473 CVE-2012-3406 CVE-2014-9402
CVE-2014-7817 bsc#864081 bsc#906371 bsc#909053 bsc#910599 bsc#916222
- Patches from upstream removed
* ifunc-x86-slow-sse4.patch
@ -995,7 +1015,7 @@ Tue Mar 25 09:26:44 UTC 2014 - schwab@suse.de
- resolv-dont-ignore-second-answer.patch: don't ignore second answer from
nameserver if the first one was empty (bnc#767266, BZ #13651)
- ldd-system-interp.patch: Never try to execute the file in ldd
(bnc#677787, BZ #16750)
(CVE-2009-5064, bnc#677787, BZ #16750)
-------------------------------------------------------------------
Mon Mar 24 12:26:50 UTC 2014 - schwab@suse.de

View File

@ -269,6 +269,14 @@ Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts
Patch1000: resolv-context-leak.patch
# PATCH-FIX-UPSTREAM Use _dl_runtime_resolve_opt only with AVX512F (BZ #21871)
Patch1001: dl-runtime-resolve-opt-avx512f.patch
# PATCH-FIX-UPSTREAM Don't use IFUNC resolver for longjmp or system in libpthread (BZ #21041)
Patch1002: libpthread-compat-wrappers.patch
# PATCH-FIX-UPSTREAM Do not use __builtin_types_compatible_p in C++ mode (BZ #21930)
Patch1003: math-c++-compat.patch
###
# Patches awaiting upstream approval
@ -498,6 +506,11 @@ rm nscd/s-stamp
%patch304 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%patch2000 -p1
%patch2001 -p1
%patch2002 -p1
@ -528,12 +541,6 @@ rm nscd/s-stamp
rm -fv sysdeps/powerpc/powerpc32/power4/hp-timing.c sysdeps/powerpc/powerpc32/power4/hp-timing.h
find . -name configure | xargs touch
#######################################################################
###
### BUILD
###
#######################################################################
%build
if [ -x /bin/uname.bin ]; then
/bin/uname.bin -a
@ -804,12 +811,6 @@ make -C cc-base -k check || {
make %{?_smp_mflags} -C cc-base check-abi
%endif
#######################################################################
###
### INSTALL
###
#######################################################################
%install
%if %{build_main}
# We don't want to strip the .symtab from our libraries in find-debuginfo.sh,
@ -1071,12 +1072,6 @@ rm -rf %{buildroot}/sbin %{buildroot}%{_includedir}
%endif # !main
#######################################################################
###
### ...
###
#######################################################################
%post -p %{_sbindir}/glibc_post_upgrade
%postun -p /sbin/ldconfig
@ -1116,8 +1111,8 @@ exit 0
%service_del_postun nscd.service
exit 0
%files
%if %{build_main}
%files
# glibc
%defattr(-,root,root)
%doc LICENSES
@ -1396,6 +1391,7 @@ exit 0
%endif # main
%if %{build_utils}
%files
%defattr(-,root,root)
/%{_lib}/libmemusage.so
/%{_lib}/libpcprofile.so

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue Aug 29 07:13:42 UTC 2017 - schwab@suse.de
- math-c++-compat.patch: Do not use __builtin_types_compatible_p in C++
mode (BZ #21930)
-------------------------------------------------------------------
Thu Aug 17 12:46:46 UTC 2017 - schwab@suse.de
- Add iconvconfig to baselibs.conf (bsc#1051042)
-------------------------------------------------------------------
Thu Aug 10 08:05:15 UTC 2017 - schwab@suse.de
- resolv-context-leak.patch: Fix leaks of resolver contexts
- dl-runtime-resolve-opt-avx512f.patch: Use _dl_runtime_resolve_opt only
with AVX512F (BZ #21871)
- libpthread-compat-wrappers.patch: Don't use IFUNC resolver for longjmp
or system in libpthread (BZ #21041)
-------------------------------------------------------------------
Wed Aug 2 14:32:58 UTC 2017 - schwab@suse.de
@ -760,7 +780,7 @@ Mon Feb 9 09:26:01 UTC 2015 - schwab@suse.de
* i386 memcpy functions optimized with SSE2 unaligned load/store
* New locales: tu_IN, bh_IN, raj_IN, ce_RU
* The obsolete sigvec function has been removed
* CVE-2015-1472 CVE-2015-1473 CVE-2104-7817 CVE-2012-3406 CVE-2014-9402
* CVE-2015-1472 CVE-2015-1473 CVE-2012-3406 CVE-2014-9402
CVE-2014-7817 bsc#864081 bsc#906371 bsc#909053 bsc#910599 bsc#916222
- Patches from upstream removed
* ifunc-x86-slow-sse4.patch
@ -995,7 +1015,7 @@ Tue Mar 25 09:26:44 UTC 2014 - schwab@suse.de
- resolv-dont-ignore-second-answer.patch: don't ignore second answer from
nameserver if the first one was empty (bnc#767266, BZ #13651)
- ldd-system-interp.patch: Never try to execute the file in ldd
(bnc#677787, BZ #16750)
(CVE-2009-5064, bnc#677787, BZ #16750)
-------------------------------------------------------------------
Mon Mar 24 12:26:50 UTC 2014 - schwab@suse.de

View File

@ -269,6 +269,14 @@ Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts
Patch1000: resolv-context-leak.patch
# PATCH-FIX-UPSTREAM Use _dl_runtime_resolve_opt only with AVX512F (BZ #21871)
Patch1001: dl-runtime-resolve-opt-avx512f.patch
# PATCH-FIX-UPSTREAM Don't use IFUNC resolver for longjmp or system in libpthread (BZ #21041)
Patch1002: libpthread-compat-wrappers.patch
# PATCH-FIX-UPSTREAM Do not use __builtin_types_compatible_p in C++ mode (BZ #21930)
Patch1003: math-c++-compat.patch
###
# Patches awaiting upstream approval
@ -498,6 +506,11 @@ rm nscd/s-stamp
%patch304 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%patch2000 -p1
%patch2001 -p1
%patch2002 -p1
@ -528,12 +541,6 @@ rm nscd/s-stamp
rm -fv sysdeps/powerpc/powerpc32/power4/hp-timing.c sysdeps/powerpc/powerpc32/power4/hp-timing.h
find . -name configure | xargs touch
#######################################################################
###
### BUILD
###
#######################################################################
%build
if [ -x /bin/uname.bin ]; then
/bin/uname.bin -a
@ -804,12 +811,6 @@ make -C cc-base -k check || {
make %{?_smp_mflags} -C cc-base check-abi
%endif
#######################################################################
###
### INSTALL
###
#######################################################################
%install
%if %{build_main}
# We don't want to strip the .symtab from our libraries in find-debuginfo.sh,
@ -1071,12 +1072,6 @@ rm -rf %{buildroot}/sbin %{buildroot}%{_includedir}
%endif # !main
#######################################################################
###
### ...
###
#######################################################################
%post -p %{_sbindir}/glibc_post_upgrade
%postun -p /sbin/ldconfig
@ -1116,8 +1111,8 @@ exit 0
%service_del_postun nscd.service
exit 0
%files
%if %{build_main}
%files
# glibc
%defattr(-,root,root)
%doc LICENSES
@ -1396,6 +1391,7 @@ exit 0
%endif # main
%if %{build_utils}
%files
%defattr(-,root,root)
/%{_lib}/libmemusage.so
/%{_lib}/libpcprofile.so

View File

@ -1,3 +1,23 @@
-------------------------------------------------------------------
Tue Aug 29 07:13:42 UTC 2017 - schwab@suse.de
- math-c++-compat.patch: Do not use __builtin_types_compatible_p in C++
mode (BZ #21930)
-------------------------------------------------------------------
Thu Aug 17 12:46:46 UTC 2017 - schwab@suse.de
- Add iconvconfig to baselibs.conf (bsc#1051042)
-------------------------------------------------------------------
Thu Aug 10 08:05:15 UTC 2017 - schwab@suse.de
- resolv-context-leak.patch: Fix leaks of resolver contexts
- dl-runtime-resolve-opt-avx512f.patch: Use _dl_runtime_resolve_opt only
with AVX512F (BZ #21871)
- libpthread-compat-wrappers.patch: Don't use IFUNC resolver for longjmp
or system in libpthread (BZ #21041)
-------------------------------------------------------------------
Wed Aug 2 14:32:58 UTC 2017 - schwab@suse.de
@ -760,7 +780,7 @@ Mon Feb 9 09:26:01 UTC 2015 - schwab@suse.de
* i386 memcpy functions optimized with SSE2 unaligned load/store
* New locales: tu_IN, bh_IN, raj_IN, ce_RU
* The obsolete sigvec function has been removed
* CVE-2015-1472 CVE-2015-1473 CVE-2104-7817 CVE-2012-3406 CVE-2014-9402
* CVE-2015-1472 CVE-2015-1473 CVE-2012-3406 CVE-2014-9402
CVE-2014-7817 bsc#864081 bsc#906371 bsc#909053 bsc#910599 bsc#916222
- Patches from upstream removed
* ifunc-x86-slow-sse4.patch
@ -995,7 +1015,7 @@ Tue Mar 25 09:26:44 UTC 2014 - schwab@suse.de
- resolv-dont-ignore-second-answer.patch: don't ignore second answer from
nameserver if the first one was empty (bnc#767266, BZ #13651)
- ldd-system-interp.patch: Never try to execute the file in ldd
(bnc#677787, BZ #16750)
(CVE-2009-5064, bnc#677787, BZ #16750)
-------------------------------------------------------------------
Mon Mar 24 12:26:50 UTC 2014 - schwab@suse.de

View File

@ -275,6 +275,14 @@ Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM Fix leaks of resolver contexts
Patch1000: resolv-context-leak.patch
# PATCH-FIX-UPSTREAM Use _dl_runtime_resolve_opt only with AVX512F (BZ #21871)
Patch1001: dl-runtime-resolve-opt-avx512f.patch
# PATCH-FIX-UPSTREAM Don't use IFUNC resolver for longjmp or system in libpthread (BZ #21041)
Patch1002: libpthread-compat-wrappers.patch
# PATCH-FIX-UPSTREAM Do not use __builtin_types_compatible_p in C++ mode (BZ #21930)
Patch1003: math-c++-compat.patch
###
# Patches awaiting upstream approval
@ -504,6 +512,11 @@ rm nscd/s-stamp
%patch304 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%patch2000 -p1
%patch2001 -p1
%patch2002 -p1
@ -534,12 +547,6 @@ rm nscd/s-stamp
rm -fv sysdeps/powerpc/powerpc32/power4/hp-timing.c sysdeps/powerpc/powerpc32/power4/hp-timing.h
find . -name configure | xargs touch
#######################################################################
###
### BUILD
###
#######################################################################
%build
if [ -x /bin/uname.bin ]; then
/bin/uname.bin -a
@ -810,12 +817,6 @@ make -C cc-base -k check || {
make %{?_smp_mflags} -C cc-base check-abi
%endif
#######################################################################
###
### INSTALL
###
#######################################################################
%install
%if %{build_main}
# We don't want to strip the .symtab from our libraries in find-debuginfo.sh,
@ -1077,12 +1078,6 @@ rm -rf %{buildroot}/sbin %{buildroot}%{_includedir}
%endif # !main
#######################################################################
###
### ...
###
#######################################################################
%post -p %{_sbindir}/glibc_post_upgrade
%postun -p /sbin/ldconfig
@ -1122,8 +1117,8 @@ exit 0
%service_del_postun nscd.service
exit 0
%files
%if %{build_main}
%files
# glibc
%defattr(-,root,root)
%doc LICENSES
@ -1402,6 +1397,7 @@ exit 0
%endif # main
%if %{build_utils}
%files
%defattr(-,root,root)
/%{_lib}/libmemusage.so
/%{_lib}/libpcprofile.so

View File

@ -0,0 +1,120 @@
2017-08-09 Andreas Schwab <schwab@suse.de>
[BZ #21041]
* sysdeps/unix/sysv/linux/s390/pt-longjmp.c: Update reference to
renamed alias.
2017-08-08 Andreas Schwab <schwab@suse.de>
[BZ #21041]
* nptl/pt-longjmp.c (longjmp, siglongjmp): Don't use IFUNC resolver.
* nptl/pt-system.c (system): Likewise.
Index: glibc-2.26/nptl/pt-longjmp.c
===================================================================
--- glibc-2.26.orig/nptl/pt-longjmp.c
+++ glibc-2.26/nptl/pt-longjmp.c
@@ -25,21 +25,14 @@
symbol in libpthread, but the historical ABI requires it. For static
linking, there is no need to provide anything here--the libc version
will be linked in. For shared library ABI compatibility, there must be
- longjmp and siglongjmp symbols in libpthread.so; so we define them using
- IFUNC to redirect to the libc function. */
+ longjmp and siglongjmp symbols in libpthread.so.
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-
-# if HAVE_IFUNC
-
-# undef INIT_ARCH
-# define INIT_ARCH()
-# define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp)
-
-extern __typeof(longjmp) longjmp_ifunc;
-extern __typeof(siglongjmp) siglongjmp_ifunc;
+ With an IFUNC resolver, it would be possible to avoid the indirection,
+ but the IFUNC resolver might run before the __libc_longjmp symbol has
+ been relocated, in which case the IFUNC resolver would not be able to
+ provide the correct address. */
-# else /* !HAVE_IFUNC */
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
static void __attribute__ ((noreturn, used))
longjmp_compat (jmp_buf env, int val)
@@ -47,14 +40,10 @@ longjmp_compat (jmp_buf env, int val)
__libc_longjmp (env, val);
}
-# define DEFINE_LONGJMP(name) strong_alias (longjmp_compat, name)
-
-# endif /* HAVE_IFUNC */
-
-DEFINE_LONGJMP (longjmp_ifunc)
-compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0);
+strong_alias (longjmp_compat, longjmp_alias)
+compat_symbol (libpthread, longjmp_alias, longjmp, GLIBC_2_0);
-strong_alias (longjmp_ifunc, siglongjmp_ifunc)
-compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0);
+strong_alias (longjmp_alias, siglongjmp_alias)
+compat_symbol (libpthread, siglongjmp_alias, siglongjmp, GLIBC_2_0);
#endif
Index: glibc-2.26/nptl/pt-system.c
===================================================================
--- glibc-2.26.orig/nptl/pt-system.c
+++ glibc-2.26/nptl/pt-system.c
@@ -25,29 +25,21 @@
libpthread, but the historical ABI requires it. For static linking,
there is no need to provide anything here--the libc version will be
linked in. For shared library ABI compatibility, there must be a
- 'system' symbol in libpthread.so; so we define it using IFUNC to
- redirect to the libc function. */
+ 'system' symbol in libpthread.so.
-#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
-
-# if HAVE_IFUNC
-
-extern __typeof(system) system_ifunc;
-# undef INIT_ARCH
-# define INIT_ARCH()
-libc_ifunc (system_ifunc, &__libc_system)
+ With an IFUNC resolver, it would be possible to avoid the indirection,
+ but the IFUNC resolver might run before the __libc_system symbol has
+ been relocated, in which case the IFUNC resolver would not be able to
+ provide the correct address. */
-# else /* !HAVE_IFUNC */
+#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)
static int __attribute__ ((used))
system_compat (const char *line)
{
return __libc_system (line);
}
-strong_alias (system_compat, system_ifunc)
-
-# endif /* HAVE_IFUNC */
-
-compat_symbol (libpthread, system_ifunc, system, GLIBC_2_0);
+strong_alias (system_compat, system_alias)
+compat_symbol (libpthread, system_alias, system, GLIBC_2_0);
#endif
Index: glibc-2.26/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
===================================================================
--- glibc-2.26.orig/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
+++ glibc-2.26/sysdeps/unix/sysv/linux/s390/pt-longjmp.c
@@ -26,8 +26,8 @@
/* In glibc release 2.19 new versions of longjmp-functions were introduced,
but were reverted before 2.20. Thus both versions are the same function. */
-strong_alias (longjmp_ifunc, __v2longjmp)
+strong_alias (longjmp_alias, __v2longjmp)
compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19);
-strong_alias (siglongjmp_ifunc, __v2siglongjmp)
+strong_alias (siglongjmp_alias, __v2siglongjmp)
compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19);
#endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */

126
math-c++-compat.patch Normal file
View File

@ -0,0 +1,126 @@
2017-08-28 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
[BZ #21930]
* math/math.h [defined __cplusplus && defined __SUPPORT_SNAN__]
(iszero): New C++ implementation that does not use
fpclassify/__MATH_TG/__builtin_types_compatible_p, when
signaling nans are enabled, since __builtin_types_compatible_p
is a C-only feature.
2017-08-24 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
* math/math.h [defined __cplusplus] (issignaling): In the long
double case, call __issignalingl only if __NO_LONG_DOUBLE_MATH
is not defined. Call __issignaling, otherwise.
2017-08-22 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
* math/math.h [defined __cplusplus] (issignaling): Provide a C++
definition for issignaling that does not rely on __MATH_TG,
since __MATH_TG uses __builtin_types_compatible_p, which is only
available in C mode.
2017-08-18 Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
[BZ #21930]
* math/math.h (isinf): Check if in C or C++ mode before using
__builtin_types_compatible_p, since this is a C mode feature.
Index: glibc-2.26/math/math.h
===================================================================
--- glibc-2.26.orig/math/math.h
+++ glibc-2.26/math/math.h
@@ -442,8 +442,12 @@ enum
/* Return nonzero value if X is positive or negative infinity. */
# if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
- && !defined __SUPPORT_SNAN__
- /* __builtin_isinf_sign is broken for float128 only before GCC 7.0. */
+ && !defined __SUPPORT_SNAN__ && !defined __cplusplus
+ /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
+ use the helper function, __isinff128, with older compilers. This is
+ only provided for C mode, because in C++ mode, GCC has no support
+ for __builtin_types_compatible_p (and when in C++ mode, this macro is
+ not used anyway, because libstdc++ headers undefine it). */
# define isinf(x) \
(__builtin_types_compatible_p (__typeof (x), _Float128) \
? __isinff128 (x) : __builtin_isinf_sign (x))
@@ -470,7 +474,32 @@ enum
# include <bits/iscanonical.h>
/* Return nonzero value if X is a signaling NaN. */
-# define issignaling(x) __MATH_TG ((x), __issignaling, (x))
+# ifndef __cplusplus
+# define issignaling(x) __MATH_TG ((x), __issignaling, (x))
+# else
+ /* In C++ mode, __MATH_TG cannot be used, because it relies on
+ __builtin_types_compatible_p, which is a C-only builtin. On the
+ other hand, overloading provides the means to distinguish between
+ the floating-point types. The overloading resolution will match
+ the correct parameter (regardless of type qualifiers (i.e.: const
+ and volatile). */
+extern "C++" {
+inline int issignaling (float __val) { return __issignalingf (__val); }
+inline int issignaling (double __val) { return __issignaling (__val); }
+inline int
+issignaling (long double __val)
+{
+# ifdef __NO_LONG_DOUBLE_MATH
+ return __issignaling (__val);
+# else
+ return __issignalingl (__val);
+# endif
+}
+# if __HAVE_DISTINCT_FLOAT128
+inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
+# endif
+} /* extern C++ */
+# endif
/* Return nonzero value if X is subnormal. */
# define issubnormal(x) (fpclassify (x) == FP_SUBNORMAL)
@@ -484,15 +513,40 @@ enum
# endif
# else /* __cplusplus */
extern "C++" {
+# ifdef __SUPPORT_SNAN__
+inline int
+iszero (float __val)
+{
+ return __fpclassifyf (__val) == FP_ZERO;
+}
+inline int
+iszero (double __val)
+{
+ return __fpclassify (__val) == FP_ZERO;
+}
+inline int
+iszero (long double __val)
+{
+# ifdef __NO_LONG_DOUBLE_MATH
+ return __fpclassify (__val) == FP_ZERO;
+# else
+ return __fpclassifyl (__val) == FP_ZERO;
+# endif
+}
+# if __HAVE_DISTINCT_FLOAT128
+inline int
+iszero (_Float128 __val)
+{
+ return __fpclassifyf128 (__val) == FP_ZERO;
+}
+# endif
+# else
template <class __T> inline bool
iszero (__T __val)
{
-# ifdef __SUPPORT_SNAN__
- return fpclassify (__val) == FP_ZERO;
-# else
return __val == 0;
-# endif
}
+# endif
} /* extern C++ */
# endif /* __cplusplus */
#endif /* Use IEC_60559_BFP_EXT. */

53
resolv-context-leak.patch Normal file
View File

@ -0,0 +1,53 @@
2017-08-09 Florian Weimer <fweimer@redhat.com>
[BZ #21932]
* nss/getXXbyYY_r.c (REENTRANT_NAME): Call __resolv_context_put
before early return.
2017-08-03 Florian Weimer <fweimer@redhat.com>
[BZ #21885]
* sysdeps/posix/getaddrinfo.c (gethosts): Release resolver context
on memory allocation failure.
Index: glibc-2.26/nss/getXXbyYY_r.c
===================================================================
--- glibc-2.26.orig/nss/getXXbyYY_r.c
+++ glibc-2.26/nss/getXXbyYY_r.c
@@ -234,6 +234,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
H_ERRNO_VAR_P))
{
case -1:
+# ifdef NEED__RES
+ __resolv_context_put (res_ctx);
+# endif
return errno;
case 1:
#ifdef NEED_H_ERRNO
@@ -253,7 +256,12 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, L
nscd_status = NSCD_NAME (ADD_VARIABLES, resbuf, buffer, buflen, result
H_ERRNO_VAR);
if (nscd_status >= 0)
- return nscd_status;
+ {
+# ifdef NEED__RES
+ __resolv_context_put (res_ctx);
+# endif
+ return nscd_status;
+ }
}
#endif
Index: glibc-2.26/sysdeps/posix/getaddrinfo.c
===================================================================
--- glibc-2.26.orig/sysdeps/posix/getaddrinfo.c
+++ glibc-2.26/sysdeps/posix/getaddrinfo.c
@@ -255,6 +255,8 @@ convert_hostent_to_gaih_addrtuple (const
break; \
if (!scratch_buffer_grow (tmpbuf)) \
{ \
+ __resolv_context_enable_inet6 (res_ctx, res_enable_inet6); \
+ __resolv_context_put (res_ctx); \
result = -EAI_MEMORY; \
goto free_and_return; \
} \