GNU C Library master sources branch master updated. glibc-2.28.9000-175-ga198762

jsm28@sourceware.org jsm28@sourceware.org
Thu Oct 4 12:16:00 GMT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  a19876214aa9a82ab5fe3e94f6cd3ddad88f3abc (commit)
      from  e7624d708d12c608daf179d90c0d6de74c24dd2c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a19876214aa9a82ab5fe3e94f6cd3ddad88f3abc

commit a19876214aa9a82ab5fe3e94f6cd3ddad88f3abc
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu Oct 4 12:16:05 2018 +0000

    Fix libnldbl_nonshared.a references to internal libm symbols (bug 23735).
    
    The redirection of built-in functions such as sqrt in include/math.h
    applies when the wrappers for those functions in libnldbl_nonshared.a
    are built, resulting in references to internal names such as
    __ieee754_sqrt that aren't actually exported from the shared libm.
    (This applies for sqrt in 2.28, also for the round-to-integer
    functions in current master because of my changes there.)  This patch
    arranges for NO_MATH_REDIRECT to be used for all the affected
    functions, and adds a test for those functions in
    libnldbl_nonshared.a.
    
    (We could of course choose to obsolete libnldbl_nonshared.a and
    require that people building with -mlong-double-64 either include the
    relevant headers and have a compiler supporting asm redirection, or
    have some other means of achieving that redirection at compile time if
    not including those headers.  But while we have libnldbl_nonshared.a,
    it seems appropriate to fix such bugs in it.)
    
    Tested for powerpc, and with build-many-glibcs.py.
    
    	[BZ #23735]
    	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (NO_MATH_REDIRECT):
    	Define.
    	* sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c: New file.
    	* sysdeps/ieee754/ldbl-opt/Makefile [$(subdir) = math] (tests):
    	Add test-nldbl-redirect.
    	[$(subdir) = math] (CFLAGS-test-nldbl-redirect.c): New variable.
    	[$(subdir) = math] ($(objpfx)test-nldbl-redirect): Depend on
    	$(objpfx)libnldbl_nonshared.a.

diff --git a/ChangeLog b/ChangeLog
index f770e14..8f9bac2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2018-10-04  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #23735]
+	* sysdeps/ieee754/ldbl-opt/nldbl-compat.h (NO_MATH_REDIRECT):
+	Define.
+	* sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c: New file.
+	* sysdeps/ieee754/ldbl-opt/Makefile [$(subdir) = math] (tests):
+	Add test-nldbl-redirect.
+	[$(subdir) = math] (CFLAGS-test-nldbl-redirect.c): New variable.
+	[$(subdir) = math] ($(objpfx)test-nldbl-redirect): Depend on
+	$(objpfx)libnldbl_nonshared.a.
+
 2018-10-04  Stefan Liebler  <stli@linux.ibm.com>
 
 	* support/support.h (support_objdir_elf_ldso): New variable.
diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
index ef790ad..6854413 100644
--- a/sysdeps/ieee754/ldbl-opt/Makefile
+++ b/sysdeps/ieee754/ldbl-opt/Makefile
@@ -172,7 +172,10 @@ CFLAGS-nldbl-y0.c = -fno-builtin-y0l
 CFLAGS-nldbl-y1.c = -fno-builtin-y1l
 CFLAGS-nldbl-yn.c = -fno-builtin-ynl
 
-tests += test-narrow-macros-ldbl-64
+tests += test-narrow-macros-ldbl-64 test-nldbl-redirect
 CFLAGS-test-narrow-macros-ldbl-64.c += -mlong-double-64
+CFLAGS-test-nldbl-redirect.c += -mlong-double-64
+
+$(objpfx)test-nldbl-redirect: $(objpfx)libnldbl_nonshared.a
 
 endif
diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
index 888f561..b7e938f 100644
--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
@@ -20,6 +20,10 @@
 #ifndef __NLDBL_COMPAT_H
 #define __NLDBL_COMPAT_H	1
 
+/* Ensure calls to libm functions from libnldbl_nonshared.a call
+   public names, not libm-internal names.  */
+#define NO_MATH_REDIRECT
+
 /* Avoid long double prototypes.  */
 #define __NO_LONG_DOUBLE_MATH	1
 #include <stdarg.h>
diff --git a/sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c b/sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c
new file mode 100644
index 0000000..22dc057
--- /dev/null
+++ b/sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c
@@ -0,0 +1,42 @@
+/* Test libnldbl_nonshared.a wrappers call visible functions (bug 23735).
+   Copyright (C) 2018 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
+   <http://www.gnu.org/licenses/>.  */
+
+/* To use the wrappers, this file deliberately does not include
+   <math.h>.  */
+
+long double sqrtl (long double);
+long double ceill (long double);
+long double floorl (long double);
+long double rintl (long double);
+long double truncl (long double);
+long double roundl (long double);
+
+volatile long double x = 2.25L;
+
+static int
+do_test (void)
+{
+  return (sqrtl (x) != 1.5L
+	  || ceill (x) != 3.0L
+	  || floorl (x) != 2.0L
+	  || rintl (x) != 2.0L
+	  || truncl (x) != 2.0L
+	  || roundl (x) != 2.0L);
+}
+
+#include <support/test-driver.c>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   12 +++++++
 sysdeps/ieee754/ldbl-opt/Makefile                  |    5 ++-
 sysdeps/ieee754/ldbl-opt/nldbl-compat.h            |    4 ++
 .../ieee754/ldbl-opt/test-nldbl-redirect.c         |   35 +++++++++-----------
 4 files changed, 36 insertions(+), 20 deletions(-)
 copy elf/tst-ifunc-textrel.c => sysdeps/ieee754/ldbl-opt/test-nldbl-redirect.c (61%)


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list