SHA256
1
0
forked from pool/glibc

Accepting request 824657 from home:Andreas_Schwab:Factory

- Update to glibc 2.32
  * Unicode 13.0.0 Support
  * New locale added: ckb_IQ
  * The GNU C Library now loads audit modules listed in the DT_AUDIT and
    DT_DEPAUDIT dynamic section entries of the main executable
  * powerpc64le supports IEEE128 long double libm/libc redirects when
    using the -mabi=ieeelongdouble to compile C code on supported GCC
    toolchains
  * To help detect buffer overflows and other out-of-bounds accesses
    several APIs have been annotated with GCC 'access' attribute
  * On Linux, functions the pthread_attr_setsigmask_np and
    pthread_attr_getsigmask_np have been added
  * The GNU C Library now provides the header file <sys/single_threaded.h>
    which declares the variable __libc_single_threaded
  * The functions sigabbrev_np and sigdescr_np have been added
  * The functions strerrorname_np and strerrordesc_np have been added
  * AArch64 now supports standard branch protection security hardening
    in glibc when it is built with a GCC that is configured with
    --enable-standard-branch-protection (or if -mbranch-protection=standard
    flag is passed when building both GCC target libraries and glibc,
    in either case a custom GCC is needed)
  * The deprecated <sys/sysctl.h> header and the sysctl function have been
    removed
  * The sstk function is no longer available to newly linked binaries
  * The legacy signal handling functions siginterrupt, sigpause, sighold,
    sigrelse, sigignore and sigset, and the sigmask macro have been
    deprecated
  * ldconfig now defaults to the new format for ld.so.cache
  * The deprecated arrays sys_siglist, _sys_siglist, and sys_sigabbrev
    are no longer available to newly linked binaries, and their declarations

OBS-URL: https://build.opensuse.org/request/show/824657
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=567
This commit is contained in:
Andreas Schwab 2020-08-06 09:17:04 +00:00 committed by Git OBS Bridge
parent 129004b05a
commit fcfeca27fe
12 changed files with 135 additions and 547 deletions

View File

@ -20,23 +20,24 @@ the buffer end.
4 files changed, 58 insertions(+), 9 deletions(-)
create mode 100644 iconvdata/bug-iconv13.c
Index: glibc-2.30/iconvdata/Makefile
Index: glibc-2.32/iconvdata/Makefile
===================================================================
--- glibc-2.30.orig/iconvdata/Makefile
+++ glibc-2.30/iconvdata/Makefile
@@ -73,7 +73,7 @@ modules.so := $(addsuffix .so, $(modules
--- glibc-2.32.orig/iconvdata/Makefile
+++ glibc-2.32/iconvdata/Makefile
@@ -73,7 +73,8 @@ modules.so := $(addsuffix .so, $(modules
ifeq (yes,$(build-shared))
tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9 \
- bug-iconv10 bug-iconv11 bug-iconv12
+ bug-iconv10 bug-iconv11 bug-iconv12 bug-iconv13
- bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4
+ bug-iconv10 bug-iconv11 bug-iconv12 tst-iconv-big5-hkscs-to-2ucs4 \
+ bug-iconv13
ifeq ($(have-thread-library),yes)
tests += bug-iconv3
endif
Index: glibc-2.30/iconvdata/bug-iconv13.c
Index: glibc-2.32/iconvdata/bug-iconv13.c
===================================================================
--- /dev/null
+++ glibc-2.30/iconvdata/bug-iconv13.c
+++ glibc-2.32/iconvdata/bug-iconv13.c
@@ -0,0 +1,53 @@
+/* bug 24973: Test EUC-KR module
+ Copyright (C) 2019 Free Software Foundation, Inc.
@ -91,10 +92,10 @@ Index: glibc-2.30/iconvdata/bug-iconv13.c
+}
+
+#include <support/test-driver.c>
Index: glibc-2.30/iconvdata/euc-kr.c
Index: glibc-2.32/iconvdata/euc-kr.c
===================================================================
--- glibc-2.30.orig/iconvdata/euc-kr.c
+++ glibc-2.30/iconvdata/euc-kr.c
--- glibc-2.32.orig/iconvdata/euc-kr.c
+++ glibc-2.32/iconvdata/euc-kr.c
@@ -80,11 +80,7 @@ euckr_from_ucs4 (uint32_t ch, unsigned c
\
if (ch <= 0x9f) \
@ -108,10 +109,10 @@ Index: glibc-2.30/iconvdata/euc-kr.c
{ \
/* This is illegal. */ \
STANDARD_FROM_LOOP_ERR_HANDLER (1); \
Index: glibc-2.30/iconvdata/ksc5601.h
Index: glibc-2.32/iconvdata/ksc5601.h
===================================================================
--- glibc-2.30.orig/iconvdata/ksc5601.h
+++ glibc-2.30/iconvdata/ksc5601.h
--- glibc-2.32.orig/iconvdata/ksc5601.h
+++ glibc-2.32/iconvdata/ksc5601.h
@@ -50,15 +50,15 @@ ksc5601_to_ucs4 (const unsigned char **s
unsigned char ch2;
int idx;

View File

@ -5,10 +5,10 @@ the stdio streams anywhere. This fixes a conformance issue and potential
heap corruption during exit. The test nptl/tst-stdio1 is removed as that
was expecting the problematic behaviour.
Index: glibc-2.31/libio/genops.c
Index: glibc-2.32/libio/genops.c
===================================================================
--- glibc-2.31.orig/libio/genops.c
+++ glibc-2.31/libio/genops.c
--- glibc-2.32.orig/libio/genops.c
+++ glibc-2.32/libio/genops.c
@@ -682,7 +682,7 @@ _IO_adjust_column (unsigned start, const
libc_hidden_def (_IO_adjust_column)
@ -114,10 +114,10 @@ Index: glibc-2.31/libio/genops.c
/* We currently don't have a reliable mechanism for making sure that
C++ static destructors are executed in the correct order.
Index: glibc-2.31/libio/libioP.h
Index: glibc-2.32/libio/libioP.h
===================================================================
--- glibc-2.31.orig/libio/libioP.h
+++ glibc-2.31/libio/libioP.h
--- glibc-2.32.orig/libio/libioP.h
+++ glibc-2.32/libio/libioP.h
@@ -487,7 +487,6 @@ extern int _IO_new_do_write (FILE *, con
extern int _IO_old_do_write (FILE *, const char *, size_t);
extern int _IO_wdo_write (FILE *, const wchar_t *, size_t);
@ -126,22 +126,22 @@ Index: glibc-2.31/libio/libioP.h
extern int _IO_flush_all (void);
libc_hidden_proto (_IO_flush_all)
extern int _IO_cleanup (void);
Index: glibc-2.31/nptl/Makefile
Index: glibc-2.32/sysdeps/pthread/Makefile
===================================================================
--- glibc-2.31.orig/nptl/Makefile
+++ glibc-2.31/nptl/Makefile
@@ -295,7 +295,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 ts
tst-signal6 \
tst-exec1 tst-exec2 tst-exec3 tst-exec4 tst-exec5 \
tst-exit1 tst-exit2 tst-exit3 \
- tst-stdio1 tst-stdio2 \
+ tst-stdio2 \
tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \
tst-pthread-attr-affinity tst-pthread-mutexattr \
tst-unload \
Index: glibc-2.31/nptl/tst-stdio1.c
--- glibc-2.32.orig/sysdeps/pthread/Makefile
+++ glibc-2.32/sysdeps/pthread/Makefile
@@ -99,7 +99,7 @@ tests += tst-cnd-basic tst-mtx-trylock t
tst-signal4 tst-signal5 tst-signal6 tst-signal8 \
tst-spin1 tst-spin2 tst-spin3 tst-spin4 \
tst-stack1 \
- tst-stdio1 tst-stdio2 \
+ tst-stdio2 \
tst-pt-sysconf \
tst-pt-tls1 tst-pt-tls2 \
tst-tsd1 tst-tsd2 tst-tsd5 tst-tsd6 \
Index: glibc-2.32/sysdeps/pthread/tst-stdio1.c
===================================================================
--- glibc-2.31.orig/nptl/tst-stdio1.c
--- glibc-2.32.orig/sysdeps/pthread/tst-stdio1.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Copyright (C) 2002-2020 Free Software Foundation, Inc.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9246fe44f68feeec8c666bb87973d590ce0137cca145df014c72ec95be9ffd17
size 16676764

View File

@ -1,11 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEvHxzcmN+wQxX16plecQ9+/HPIYcFAl41bZQACgkQecQ9+/HP
IYfUQgf/d5dAUK871suOXNfFcw67sHEPsnLami/WPXyyw/pXDjuLZYLNTGOmpQol
VdV38p1BxaJs0A5EBSVm32xhgMR2Jum6qKu/mpEnfy5ac1lGiTxO1pVMDDXjdPaK
S8+nJXTf3MVYUCmu4W426DdRkdsBmP0KlKo8ZFBlhAJoPXeikJMGOf/uUR5VimNE
VY2EPDHEaqrBco/lm3LqZ6RWu7+B7K5GXR2EMLBDLIKirYd17nIqzjhFjv0pcS/e
UE2K0vxA5ip59ep4xxRmDu8bOshlZlfhHGuAiD+B2iwxwWFv6D75IyrtqB5KHWtD
/crvu7njsCsgWJKNA83pkt19nj9mxQ==
=TAIE
-----END PGP SIGNATURE-----

3
glibc-2.32.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1627ea54f5a1a8467032563393e0901077626dc66f37f10ee6363bb722222836
size 16744512

16
glibc-2.32.tar.xz.sig Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEcnNUKzmWLfeymZMUFnkrTqJTQPgFAl8rekMACgkQFnkrTqJT
QPhHYhAAkiVohx/PgarNM+CWOjVAfI/vjvZ9ETUNvSpdKDkTKqScwJyRMxSHGHqW
ri1WBv+NRq5HHwpceEHw3PrAT22sDMHEiB9A7Aeu4Yf1TimZ9+tvZdzUPQBnbbZT
3vE5LZmCepoX+kRWKpUPS8hGwwlZQbR/OKgAwOa/mHnK1A5ySvRryELPoBhlSpL2
PyDUmnwvfNPkF3RsLf1GGAKUrgQqg9dYbJwRUaukOn0+VKiLmVLsYZIdBdYt589M
Cfj7IUdNfY1wb0CpZJWZZGRtkopxYvRDeb6g7LCoe16zUAzEUhXdumlxeXYSh7Ge
ouqdln7a0GHtQS90sdrFeHgqqhbCfxn4bvKs9Ny33T1I4Al4mI5PiPiryjsPpdjH
TA5uNKAyFRmy5WuPCFTirRGy6EldrAQ1o/2icbqHhknzz+/9ctUr0mVW3supCmSZ
DoLp5SG3CjGY9phTZcobBlIFuaFTEU8jV80LiK5glc/GTHa4czPxnc0MXaxy8WWF
taZZZ67IAbY/EfuVfQC1NPTHOmrEszfxKQ8CYKisfGP/XYNfYLyjdf7JyyjkKHEH
xt904YYMsi6aw2lsq39Ajb3Ub3BZ63QEYPuD9yp0BizwTaQTnX5rtXROqxDkwdSi
hauXkCvU1ubuBJ3s+u9ljxveWV6TGHfDgqkxmJj2SpYgBYwBcXw=
=vBEx
-----END PGP SIGNATURE-----

View File

@ -1,7 +1,7 @@
Index: glibc-2.27/sunrpc/bindrsvprt.c
Index: glibc-2.32/inet/bindresvport.c
===================================================================
--- glibc-2.27.orig/sunrpc/bindrsvprt.c
+++ glibc-2.27/sunrpc/bindrsvprt.c
--- glibc-2.32.orig/inet/bindresvport.c
+++ glibc-2.32/inet/bindresvport.c
@@ -29,6 +29,9 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

View File

@ -1,3 +1,65 @@
-------------------------------------------------------------------
Thu Aug 6 08:08:04 UTC 2020 - Andreas Schwab <schwab@suse.de>
- Update to glibc 2.32
* Unicode 13.0.0 Support
* New locale added: ckb_IQ
* The GNU C Library now loads audit modules listed in the DT_AUDIT and
DT_DEPAUDIT dynamic section entries of the main executable
* powerpc64le supports IEEE128 long double libm/libc redirects when
using the -mabi=ieeelongdouble to compile C code on supported GCC
toolchains
* To help detect buffer overflows and other out-of-bounds accesses
several APIs have been annotated with GCC 'access' attribute
* On Linux, functions the pthread_attr_setsigmask_np and
pthread_attr_getsigmask_np have been added
* The GNU C Library now provides the header file <sys/single_threaded.h>
which declares the variable __libc_single_threaded
* The functions sigabbrev_np and sigdescr_np have been added
* The functions strerrorname_np and strerrordesc_np have been added
* AArch64 now supports standard branch protection security hardening
in glibc when it is built with a GCC that is configured with
--enable-standard-branch-protection (or if -mbranch-protection=standard
flag is passed when building both GCC target libraries and glibc,
in either case a custom GCC is needed)
* The deprecated <sys/sysctl.h> header and the sysctl function have been
removed
* The sstk function is no longer available to newly linked binaries
* The legacy signal handling functions siginterrupt, sigpause, sighold,
sigrelse, sigignore and sigset, and the sigmask macro have been
deprecated
* ldconfig now defaults to the new format for ld.so.cache
* The deprecated arrays sys_siglist, _sys_siglist, and sys_sigabbrev
are no longer available to newly linked binaries, and their declarations
have been removed from <string.h>
* The deprecated symbols sys_errlist, _sys_errlist, sys_nerr, and _sys_nerr
are no longer available to newly linked binaries, and their declarations
have been removed from from <stdio.h>
* Both strerror and strerror_l now share the same internal buffer in the
calling thread, meaning that the returned string pointer may be invalided
or contents might be overwritten on subsequent calls in the same thread or
if the thread is terminated
* Using weak references to libpthread functions such as pthread_create
or pthread_key_create to detect the singled-threaded nature of a
program is an obsolescent feature
* The "files" NSS module no longer supports the "key" database (used for
secure RPC)
* The __morecore and __after_morecore_hook malloc hooks and the default
implementation __default_morecore have been deprecated
* The hesiod NSS module has been deprecated and will be removed in a
future version of glibc
* CVE-2016-10228: An infinite loop has been fixed in the iconv program when
invoked with the -c option and when processing invalid multi-byte input
sequences
* CVE-2020-10029: Trigonometric functions on x86 targets suffered from stack
corruption when they were passed a pseudo-zero argument
* CVE-2020-1752: A use-after-free vulnerability in the glob function when
expanding ~user has been fixed.
* CVE-2020-6096: A signed comparison vulnerability in the ARMv7 memcpy and
memmove functions has been fixed
- riscv-syscall-clobber.patch, ldbl-96-rem-pio2l.patch,
long-double-alias.patch: Removed
-------------------------------------------------------------------
Tue Jun 23 08:32:23 UTC 2020 - Andreas Schwab <schwab@suse.de>

View File

@ -131,7 +131,7 @@ BuildArch: i686
%define powerpc_optimize_cpu_power6 0
%define powerpc_optimize_cpu_power7 0
%define powerpc_optimize_cpu_cell 0
%endif # ppc, ppc64
%endif
# glibc requires at least kernel 3.2
%define enablekernel 3.2
# some architectures need a newer kernel
@ -148,7 +148,7 @@ BuildArch: i686
%define enablekernel 4.15
%endif
Version: 2.31
Version: 2.32
Release: 0
%if !%{build_snapshot}
%define git_id 0a8262a1b2
@ -259,12 +259,6 @@ Patch306: glibc-fix-double-loopback.diff
###
# Patches from upstream
###
# PATCH-FIX-UPSTREAM riscv: Avoid clobbering register parameters in syscall
Patch1000: riscv-syscall-clobber.patch
# PATCH-FIX-UPSTREAM Avoid ldbl-96 stack corruption from range reduction of pseudo-zero (CVE-2020-10029, BZ #25487)
Patch1001: ldbl-96-rem-pio2l.patch
# PATCH-FIX-UPSTREAM Fix build with GCC 10 when long double = double
Patch1002: long-double-alias.patch
###
# Patches awaiting upstream approval
@ -454,7 +448,7 @@ are not essential but recommend to use.
makedb: A program to create a database for nss
%lang_package
%endif # main
%endif
%prep
%setup -n glibc-%{version} -q -a 4
@ -477,10 +471,6 @@ makedb: A program to create a database for nss
%patch304 -p1
%patch306 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch2000 -p1
%patch2001 -p1
%patch2002 -p1
@ -689,8 +679,8 @@ configure_and_build_glibc() {
%if %{powerpc_optimize_cpu_cell}
configure_and_build_glibc ppc-cell-be "$BuildFlags -mcpu=cell"
%endif
%endif # %{build_variants}
%endif # optimize_power
%endif
%endif
#
# Build html documentation
@ -811,7 +801,7 @@ cc-base/elf/ldconfig -vn $destdir
cc-base/elf/ldconfig -vn %{buildroot}/%{_lib}/power6x
fi
%endif
%endif # optimize_power
%endif
# Install locales
%if %{build_locales}
@ -933,7 +923,7 @@ rm -rf %{buildroot}%{_libdir}/audit
rm -rf %{buildroot}%{_infodir} %{buildroot}%{_prefix}/share/i18n
rm -f %{buildroot}%{_bindir}/makedb %{buildroot}/var/lib/misc/Makefile
rm -f %{buildroot}%{_sbindir}/nscd
%endif # i686
%endif
%ifnarch i686
# /var/lib/misc is incompatible with transactional updates (bsc#1138726)
@ -942,7 +932,7 @@ mv %{buildroot}/var/lib/misc/Makefile %{buildroot}%{_prefix}/share/misc/Makefile
ln -s %{_prefix}/share/misc/Makefile.makedb %{buildroot}/var/lib/misc/Makefile
%endif
%endif # !utils
%endif
# LSB
%ifarch %ix86
@ -964,7 +954,7 @@ ln -sf /%{_lib}/ld.so.1 $RPM_BUILD_ROOT/%{_lib}/ld-lsb-s390.so.3
ln -sf /%{_lib}/ld64.so.1 $RPM_BUILD_ROOT/%{_lib}/ld-lsb-s390x.so.3
%endif
%else # !main
%else
%if %{build_utils}
@ -982,9 +972,9 @@ rm -rf %{buildroot}/sbin %{buildroot}%{_includedir}
rm %{buildroot}/%{_lib}/lp64d %{buildroot}%{_libdir}/lp64d
%endif
%endif # utils
%endif
%endif # !main
%endif
%if %{build_main}
@ -1211,7 +1201,7 @@ exit 0
%if %{powerpc_optimize_cpu_cell}
%{optimized_libs ppc-cell-be}
%endif
%endif # optimize_power
%endif
%dir %attr(0700,root,root) /var/cache/ldconfig
/sbin/ldconfig
%{_bindir}/gencat
@ -1319,7 +1309,7 @@ exit 0
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/hosts
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/services
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/nscd/netgroup
%endif # !i686
%endif
%if %{build_profile}
%files profile
@ -1346,9 +1336,9 @@ exit 0
/var/lib/misc/Makefile
%files lang -f libc.lang
%endif # !i686
%endif
%endif # main
%endif
%if %{build_utils}
%files -n glibc-utils
@ -1364,6 +1354,6 @@ exit 0
%{_bindir}/sotruss
%{_bindir}/xtrace
%{_bindir}/pldd
%endif # utils
%endif
%changelog

View File

@ -1,123 +0,0 @@
From 9f997ceca28f0634ad78a1ca95b84265f7801ff4 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Wed, 12 Feb 2020 23:31:56 +0000
Subject: [PATCH] Avoid ldbl-96 stack corruption from range reduction of
pseudo-zero (bug 25487).
Bug 25487 reports stack corruption in ldbl-96 sinl on a pseudo-zero
argument (an representation where all the significand bits, including
the explicit high bit, are zero, but the exponent is not zero, which
is not a valid representation for the long double type).
Although this is not a valid long double representation, existing
practice in this area (see bug 4586, originally marked invalid but
subsequently fixed) is that we still seek to avoid invalid memory
accesses as a result, in case of programs that treat arbitrary binary
data as long double representations, although the invalid
representations of the ldbl-96 format do not need to be consistently
handled the same as any particular valid representation.
This patch makes the range reduction detect pseudo-zero and unnormal
representations that would otherwise go to __kernel_rem_pio2, and
returns a NaN for them instead of continuing with the range reduction
process. (Pseudo-zero and unnormal representations whose unbiased
exponent is less than -1 have already been safely returned from the
function before this point without going through the rest of range
reduction.) Pseudo-zero representations would previously result in
the value passed to __kernel_rem_pio2 being all-zero, which is
definitely unsafe; unnormal representations would previously result in
a value passed whose high bit is zero, which might well be unsafe
since that is not a form of input expected by __kernel_rem_pio2.
Tested for x86_64.
(cherry picked from commit 9333498794cde1d5cca518badf79533a24114b6f)
---
NEWS | 5 +++
sysdeps/ieee754/ldbl-96/Makefile | 3 +-
sysdeps/ieee754/ldbl-96/e_rem_pio2l.c | 12 +++++++
sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c | 41 ++++++++++++++++++++++
4 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c
Index: glibc-2.31/sysdeps/ieee754/ldbl-96/Makefile
===================================================================
--- glibc-2.31.orig/sysdeps/ieee754/ldbl-96/Makefile
+++ glibc-2.31/sysdeps/ieee754/ldbl-96/Makefile
@@ -17,5 +17,6 @@
# <https://www.gnu.org/licenses/>.
ifeq ($(subdir),math)
-tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96
+tests += test-canonical-ldbl-96 test-totalorderl-ldbl-96 test-sinl-pseudo
+CFLAGS-test-sinl-pseudo.c += -fstack-protector-all
endif
Index: glibc-2.31/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
===================================================================
--- glibc-2.31.orig/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
+++ glibc-2.31/sysdeps/ieee754/ldbl-96/e_rem_pio2l.c
@@ -210,6 +210,18 @@ __ieee754_rem_pio2l (long double x, long
return 0;
}
+ if ((i0 & 0x80000000) == 0)
+ {
+ /* Pseudo-zero and unnormal representations are not valid
+ representations of long double. We need to avoid stack
+ corruption in __kernel_rem_pio2, which expects input in a
+ particular normal form, but those representations do not need
+ to be consistently handled like any particular floating-point
+ value. */
+ y[1] = y[0] = __builtin_nanl ("");
+ return 0;
+ }
+
/* Split the 64 bits of the mantissa into three 24-bit integers
stored in a double array. */
exp = j0 - 23;
Index: glibc-2.31/sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c
===================================================================
--- /dev/null
+++ glibc-2.31/sysdeps/ieee754/ldbl-96/test-sinl-pseudo.c
@@ -0,0 +1,41 @@
+/* Test sinl for pseudo-zeros and unnormals for ldbl-96 (bug 25487).
+ Copyright (C) 2020 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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, see
+ <https://www.gnu.org/licenses/>. */
+
+#include <math.h>
+#include <math_ldbl.h>
+#include <stdint.h>
+
+static int
+do_test (void)
+{
+ for (int i = 0; i < 64; i++)
+ {
+ uint64_t sig = i == 63 ? 0 : 1ULL << i;
+ long double ld;
+ SET_LDOUBLE_WORDS (ld, 0x4141,
+ sig >> 32, sig & 0xffffffffULL);
+ /* The requirement is that no stack overflow occurs when the
+ pseudo-zero or unnormal goes through range reduction. */
+ volatile long double ldr;
+ ldr = sinl (ld);
+ (void) ldr;
+ }
+ return 0;
+}
+
+#include <support/test-driver.c>

View File

@ -1,166 +0,0 @@
From 49348beafe9ba150c9bd48595b3f372299bddbb0 Mon Sep 17 00:00:00 2001
From: Joseph Myers <joseph@codesourcery.com>
Date: Tue, 17 Mar 2020 22:57:42 +0000
Subject: [PATCH] Fix build with GCC 10 when long double = double.
On platforms where long double has the same ABI as double, glibc
defines long double functions as aliases for the corresponding double
functions. The declarations of those functions in <math.h> are
disabled to avoid problems with aliases having incompatible types, but
GCC 10 now gives errors for incompatible types when the long double
function is known to GCC as a built-in function, not just when there
is an incompatible header declaration.
This patch fixes those errors by using appropriate
-fno-builtin-<function> options to compile the double functions. The
list of CFLAGS-* settings is an appropriately adapted version of that
in sysdeps/ieee754/ldbl-opt/Makefile used there for building nldbl-*.c
files; in particular, the options are used even if GCC does not
currently have a built-in function of a given function, so that adding
such a built-in function in future will not break the glibc build.
Thus, various of the CFLAGS-* settings are only for future-proofing
and may not currently be needed (and it's possible some could be
irrelevant for other reasons).
Tested with build-many-glibcs.py for arm-linux-gnueabi (compilers and
glibcs builds), where it fixes the build that previously failed.
---
math/Makefile | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 122 insertions(+)
diff --git a/math/Makefile b/math/Makefile
index 84a8b94c74..0a5a40430e 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -650,6 +650,128 @@ ifneq ($(long-double-fcts),yes)
# We won't compile the `long double' code at all. Tell the `double' code
# to define aliases for the `FUNCl' names.
math-CPPFLAGS += -DNO_LONG_DOUBLE
+# GCC 10 diagnoses aliases with types conflicting with built-in
+# functions.
+CFLAGS-w_acos.c += -fno-builtin-acosl
+CFLAGS-w_acosh.c += -fno-builtin-acoshl
+CFLAGS-w_asin.c += -fno-builtin-asinl
+CFLAGS-s_asinh.c += -fno-builtin-asinhl
+CFLAGS-s_atan.c += -fno-builtin-atanl
+CFLAGS-w_atan2.c += -fno-builtin-atan2l
+CFLAGS-w_atanh.c += -fno-builtin-atanhl
+CFLAGS-s_cabs.c += -fno-builtin-cabsl
+CFLAGS-s_cacos.c += -fno-builtin-cacosl
+CFLAGS-s_cacosh.c += -fno-builtin-cacoshl
+CFLAGS-s_canonicalize.c += -fno-builtin-canonicalizel
+CFLAGS-s_carg.c += -fno-builtin-cargl
+CFLAGS-s_casin.c += -fno-builtin-casinl
+CFLAGS-s_casinh.c += -fno-builtin-casinhl
+CFLAGS-s_catan.c += -fno-builtin-catanl
+CFLAGS-s_catanh.c += -fno-builtin-catanhl
+CFLAGS-s_cbrt.c += -fno-builtin-cbrtl
+CFLAGS-s_ccos.c += -fno-builtin-ccosl
+CFLAGS-s_ccosh.c += -fno-builtin-ccoshl
+CFLAGS-s_ceil.c += -fno-builtin-ceill
+CFLAGS-s_cexp.c += -fno-builtin-cexpl
+CFLAGS-s_cimag.c += -fno-builtin-cimagl
+CFLAGS-s_clog.c += -fno-builtin-clogl
+CFLAGS-s_clog10.c += -fno-builtin-clog10l
+CFLAGS-s_conj.c += -fno-builtin-conjl
+CFLAGS-s_copysign.c += -fno-builtin-copysignl
+CFLAGS-s_cos.c += -fno-builtin-cosl
+CFLAGS-w_cosh.c += -fno-builtin-coshl
+CFLAGS-s_cpow.c += -fno-builtin-cpowl
+CFLAGS-s_cproj.c += -fno-builtin-cprojl
+CFLAGS-s_creal.c += -fno-builtin-creall
+CFLAGS-s_csin.c += -fno-builtin-csinl
+CFLAGS-s_csinh.c += -fno-builtin-csinhl
+CFLAGS-s_csqrt.c += -fno-builtin-csqrtl
+CFLAGS-s_ctan.c += -fno-builtin-ctanl
+CFLAGS-s_ctanh.c += -fno-builtin-ctanhl
+CFLAGS-s_dadd.c += -fno-builtin-daddl
+CFLAGS-s_ddiv.c += -fno-builtin-ddivl
+CFLAGS-s_dmul.c += -fno-builtin-dmull
+CFLAGS-s_dsub.c += -fno-builtin-dsubl
+CFLAGS-s_erf.c += -fno-builtin-erfl
+CFLAGS-s_erfc.c += -fno-builtin-erfcl
+CFLAGS-e_exp.c += -fno-builtin-expl
+CFLAGS-w_exp10.c += -fno-builtin-exp10l
+CFLAGS-e_exp2.c += -fno-builtin-exp2l
+CFLAGS-s_expm1.c += -fno-builtin-expm1l
+CFLAGS-s_fabs.c += -fno-builtin-fabsl
+CFLAGS-s_fadd.c += -fno-builtin-faddl
+CFLAGS-s_fdim.c += -fno-builtin-fdiml
+CFLAGS-s_fdiv.c += -fno-builtin-fdivl
+CFLAGS-s_finite.c += -fno-builtin-finitel
+CFLAGS-s_floor.c += -fno-builtin-floorl
+CFLAGS-s_fma.c += -fno-builtin-fmal
+CFLAGS-s_fmax.c += -fno-builtin-fmaxl
+CFLAGS-s_fmaxmag.c += -fno-builtin-fmaxmagl
+CFLAGS-s_fmin.c += -fno-builtin-fminl
+CFLAGS-s_fminmag.c += -fno-builtin-fminmagl
+CFLAGS-w_fmod.c += -fno-builtin-fmodl
+CFLAGS-s_fmul.c += -fno-builtin-fmull
+CFLAGS-s_frexp.c += -fno-builtin-frexpl
+CFLAGS-s_fromfp.c += -fno-builtin-fromfpl
+CFLAGS-s_fromfpx.c += -fno-builtin-fromfpxl
+CFLAGS-s_fsub.c += -fno-builtin-fsubl
+CFLAGS-s_gamma.c += -fno-builtin-gammal
+CFLAGS-s_getpayload.c += -fno-builtin-getpayloadl
+CFLAGS-w_hypot.c += -fno-builtin-hypotl
+CFLAGS-w_ilogb.c += -fno-builtin-ilogbl
+CFLAGS-s_isinf.c += -fno-builtin-isinfl
+CFLAGS-s_isnan.c += -fno-builtin-isnanl
+CFLAGS-w_j0.c += -fno-builtin-j0l
+CFLAGS-w_j1.c += -fno-builtin-j1l
+CFLAGS-w_jn.c += -fno-builtin-jnl
+CFLAGS-s_ldexp.c += -fno-builtin-ldexpl
+CFLAGS-w_lgamma.c += -fno-builtin-lgammal
+CFLAGS-w_lgamma_r.c += -fno-builtin-lgammal_r
+CFLAGS-w_llogb.c += -fno-builtin-llogbl
+CFLAGS-s_llrint.c += -fno-builtin-llrintl
+CFLAGS-s_llround.c += -fno-builtin-llroundl
+CFLAGS-e_log.c += -fno-builtin-logl
+CFLAGS-w_log10.c += -fno-builtin-log10l
+CFLAGS-w_log1p.c += -fno-builtin-log1pl
+CFLAGS-e_log2.c += -fno-builtin-log2l
+CFLAGS-s_logb.c += -fno-builtin-logbl
+CFLAGS-s_lrint.c += -fno-builtin-lrintl
+CFLAGS-s_lround.c += -fno-builtin-lroundl
+CFLAGS-s_modf.c += -fno-builtin-modfl
+CFLAGS-s_nan.c += -fno-builtin-nanl
+CFLAGS-s_nearbyint.c += -fno-builtin-nearbyintl
+CFLAGS-s_nextafter.c += -fno-builtin-nextafterl
+CFLAGS-s_nextdown.c += -fno-builtin-nextdownl
+CFLAGS-s_nexttoward.c += -fno-builtin-nexttoward -fno-builtin-nexttowardl
+CFLAGS-s_nexttowardf.c += -fno-builtin-nexttowardf
+CFLAGS-s_nextup.c += -fno-builtin-nextupl
+CFLAGS-e_pow.c += -fno-builtin-powl
+CFLAGS-w_remainder.c += -fno-builtin-remainderl -fno-builtin-dreml
+CFLAGS-s_remquo.c += -fno-builtin-remquol
+CFLAGS-s_rint.c += -fno-builtin-rintl
+CFLAGS-s_round.c += -fno-builtin-roundl
+CFLAGS-s_roundeven.c += -fno-builtin-roundevenl
+CFLAGS-w_scalb.c += -fno-builtin-scalbl
+CFLAGS-w_scalbln.c += -fno-builtin-scalblnl
+CFLAGS-s_scalbn.c += -fno-builtin-scalbnl
+CFLAGS-s_setpayload.c += -fno-builtin-setpayloadl
+CFLAGS-s_setpayloadsig.c += -fno-builtin-setpayloadsigl
+CFLAGS-s_significand.c += -fno-builtin-significandl
+CFLAGS-s_sin.c += -fno-builtin-sinl
+CFLAGS-s_sincos.c += -fno-builtin-sincosl
+CFLAGS-w_sinh.c += -fno-builtin-sinhl
+CFLAGS-w_sqrt.c += -fno-builtin-sqrtl
+CFLAGS-s_tan.c += -fno-builtin-tanl
+CFLAGS-s_tanh.c += -fno-builtin-tanhl
+CFLAGS-w_tgamma.c += -fno-builtin-tgammal
+CFLAGS-s_totalorder.c += -fno-builtin-totalorderl
+CFLAGS-s_totalordermag.c += -fno-builtin-totalordermagl
+CFLAGS-s_trunc.c += -fno-builtin-truncl
+CFLAGS-s_ufromfp.c += -fno-builtin-ufromfpl
+CFLAGS-s_ufromfpx.c += -fno-builtin-ufromfpxl
+CFLAGS-s_y0.c += -fno-builtin-y0l
+CFLAGS-s_y1.c += -fno-builtin-y1l
+CFLAGS-s_yn.c += -fno-builtin-ynl
endif
# These files quiet sNaNs in a way that is optimized away without
--
2.26.2

View File

@ -1,181 +0,0 @@
From be74b42ee2a97009a6cd4fc90126add4a41c583b Mon Sep 17 00:00:00 2001
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon, 10 Feb 2020 10:32:14 -0300
Subject: [PATCH] riscv: Avoid clobbering register parameters in syscall
The riscv INTERNAL_SYSCALL macro might clobber the register
parameter if the argument itself might clobber any register (a function
call for instance).
This patch fixes it by using temporary variables for the expressions
between the register assignments (as indicated by GCC documentation,
6.47.5.2 Specifying Registers for Local Variables).
It is similar to the fix done for MIPS (bug 25523).
Checked with riscv64-linux-gnu-rv64imafdc-lp64d build.
---
sysdeps/unix/sysv/linux/riscv/sysdep.h | 84 +++++++++++++++++---------
1 file changed, 56 insertions(+), 28 deletions(-)
diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h
index 201bf9a91b..2bd9b16f32 100644
--- a/sysdeps/unix/sysv/linux/riscv/sysdep.h
+++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h
@@ -176,10 +176,11 @@
# define internal_syscall1(number, err, arg0) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
+ register long int __a0 asm ("a0") = _arg0; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
@@ -193,11 +194,13 @@
# define internal_syscall2(number, err, arg0, arg1) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
+ long int _arg1 = (long int) (arg1); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
- register long int __a1 asm ("a1") = (long int) (arg1); \
+ register long int __a0 asm ("a0") = _arg0; \
+ register long int __a1 asm ("a1") = _arg1; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
@@ -211,12 +214,15 @@
# define internal_syscall3(number, err, arg0, arg1, arg2) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
+ long int _arg1 = (long int) (arg1); \
+ long int _arg2 = (long int) (arg2); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
- register long int __a1 asm ("a1") = (long int) (arg1); \
- register long int __a2 asm ("a2") = (long int) (arg2); \
+ register long int __a0 asm ("a0") = _arg0; \
+ register long int __a1 asm ("a1") = _arg1; \
+ register long int __a2 asm ("a2") = _arg2; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
@@ -230,13 +236,17 @@
# define internal_syscall4(number, err, arg0, arg1, arg2, arg3) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
+ long int _arg1 = (long int) (arg1); \
+ long int _arg2 = (long int) (arg2); \
+ long int _arg3 = (long int) (arg3); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
- register long int __a1 asm ("a1") = (long int) (arg1); \
- register long int __a2 asm ("a2") = (long int) (arg2); \
- register long int __a3 asm ("a3") = (long int) (arg3); \
+ register long int __a0 asm ("a0") = _arg0; \
+ register long int __a1 asm ("a1") = _arg1; \
+ register long int __a2 asm ("a2") = _arg2; \
+ register long int __a3 asm ("a3") = _arg3; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
@@ -250,14 +260,19 @@
# define internal_syscall5(number, err, arg0, arg1, arg2, arg3, arg4) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
+ long int _arg1 = (long int) (arg1); \
+ long int _arg2 = (long int) (arg2); \
+ long int _arg3 = (long int) (arg3); \
+ long int _arg4 = (long int) (arg4); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
- register long int __a1 asm ("a1") = (long int) (arg1); \
- register long int __a2 asm ("a2") = (long int) (arg2); \
- register long int __a3 asm ("a3") = (long int) (arg3); \
- register long int __a4 asm ("a4") = (long int) (arg4); \
+ register long int __a0 asm ("a0") = _arg0; \
+ register long int __a1 asm ("a1") = _arg1; \
+ register long int __a2 asm ("a2") = _arg2; \
+ register long int __a3 asm ("a3") = _arg3; \
+ register long int __a4 asm ("a4") = _arg4; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
@@ -271,15 +286,21 @@
# define internal_syscall6(number, err, arg0, arg1, arg2, arg3, arg4, arg5) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
+ long int _arg1 = (long int) (arg1); \
+ long int _arg2 = (long int) (arg2); \
+ long int _arg3 = (long int) (arg3); \
+ long int _arg4 = (long int) (arg4); \
+ long int _arg5 = (long int) (arg5); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
- register long int __a1 asm ("a1") = (long int) (arg1); \
- register long int __a2 asm ("a2") = (long int) (arg2); \
- register long int __a3 asm ("a3") = (long int) (arg3); \
- register long int __a4 asm ("a4") = (long int) (arg4); \
- register long int __a5 asm ("a5") = (long int) (arg5); \
+ register long int __a0 asm ("a0") = _arg0; \
+ register long int __a1 asm ("a1") = _arg1; \
+ register long int __a2 asm ("a2") = _arg2; \
+ register long int __a3 asm ("a3") = _arg3; \
+ register long int __a4 asm ("a4") = _arg4; \
+ register long int __a5 asm ("a5") = _arg5; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
@@ -294,16 +315,23 @@
# define internal_syscall7(number, err, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \
({ \
long int _sys_result; \
+ long int _arg0 = (long int) (arg0); \
+ long int _arg1 = (long int) (arg1); \
+ long int _arg2 = (long int) (arg2); \
+ long int _arg3 = (long int) (arg3); \
+ long int _arg4 = (long int) (arg4); \
+ long int _arg5 = (long int) (arg5); \
+ long int _arg6 = (long int) (arg6); \
\
{ \
register long int __a7 asm ("a7") = number; \
- register long int __a0 asm ("a0") = (long int) (arg0); \
- register long int __a1 asm ("a1") = (long int) (arg1); \
- register long int __a2 asm ("a2") = (long int) (arg2); \
- register long int __a3 asm ("a3") = (long int) (arg3); \
- register long int __a4 asm ("a4") = (long int) (arg4); \
- register long int __a5 asm ("a5") = (long int) (arg5); \
- register long int __a6 asm ("a6") = (long int) (arg6); \
+ register long int __a0 asm ("a0") = _arg0; \
+ register long int __a1 asm ("a1") = _arg1; \
+ register long int __a2 asm ("a2") = _arg2; \
+ register long int __a3 asm ("a3") = _arg3; \
+ register long int __a4 asm ("a4") = _arg4; \
+ register long int __a5 asm ("a5") = _arg5; \
+ register long int __a6 asm ("a6") = _arg6; \
__asm__ volatile ( \
"scall\n\t" \
: "+r" (__a0) \
--
2.25.1