This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch google/grte/v5-2.27/master updated. glibc-2.27-153-ge1c1d33


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, google/grte/v5-2.27/master has been updated
       via  e1c1d33725d946279400af6d812a339fb9c8fa47 (commit)
       via  e50d14b607000d7d7ca0ba581f80e851ab101586 (commit)
       via  5c23202b75a11ef95f8e0e95ed67416b4a7be1b2 (commit)
      from  91f441abb64ef8b51f6d99a227ded8ed3d1a1880 (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=e1c1d33725d946279400af6d812a339fb9c8fa47

commit e1c1d33725d946279400af6d812a339fb9c8fa47
Author: Stan Shebs <stanshebs@google.com>
Date:   Tue Sep 25 10:52:37 2018 -0700

    Add workaround for infinite looping in ppc vsyscalls

diff --git a/sysdeps/posix/clock_getres.c b/sysdeps/posix/clock_getres.c
index 8bc7e81..3f6fdcf 100644
--- a/sysdeps/posix/clock_getres.c
+++ b/sysdeps/posix/clock_getres.c
@@ -73,6 +73,19 @@ realtime_getres (struct timespec *res)
   return -1;
 }
 
+#if defined __clang__ && defined __powerpc64__
+/* On ppc, __clock_getres's body eventually expands into asm code
+   that does a bctrl, but clang does not recognize the need to save
+   the link register, so calls loop infinitely instead of returning.
+   As workaround, make a dummy function call that forces a link
+   register save.  */
+volatile int clock_getres_dummy_glob;
+
+void __attribute__((noinline)) clock_getres_dummy ()
+{
+  clock_getres_dummy_glob = 45;
+}
+#endif
 
 /* Get resolution of clock.  */
 int
@@ -80,6 +93,10 @@ __clock_getres (clockid_t clock_id, struct timespec *res)
 {
   int retval = -1;
 
+#if defined __clang__ && defined __powerpc64__
+  clock_getres_dummy ();
+#endif
+
   switch (clock_id)
     {
 #ifdef SYSDEP_GETRES
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index 96df78a..7ef4330 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -86,6 +86,19 @@ realtime_gettime (struct timespec *tp)
   return retval;
 }
 
+#if defined __clang__ && defined __powerpc64__
+/* On ppc, __clock_gettime's body eventually expands into asm code
+   that does a bctrl, but clang does not recognize the need to save
+   the link register, so calls loop infinitely instead of returning.
+   As workaround, make a dummy function call that forces a link
+   register save.  */
+volatile int clock_gettime_dummy_glob;
+
+void __attribute__((noinline)) clock_gettime_dummy ()
+{
+  clock_gettime_dummy_glob = 45;
+}
+#endif
 
 /* Get current value of CLOCK and store it in TP.  */
 int
@@ -93,6 +106,10 @@ __clock_gettime (clockid_t clock_id, struct timespec *tp)
 {
   int retval = -1;
 
+#if defined __clang__ && defined __powerpc64__
+  clock_gettime_dummy ();
+#endif
+
   switch (clock_id)
     {
 #ifdef SYSDEP_GETTIME

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

commit e50d14b607000d7d7ca0ba581f80e851ab101586
Author: Stan Shebs <stanshebs@google.com>
Date:   Tue Sep 25 08:04:10 2018 -0700

    Work around clang crash by skipping apparently-unneeded asm

diff --git a/sysdeps/powerpc/powerpc64/backtrace.c b/sysdeps/powerpc/powerpc64/backtrace.c
index c0c4b48..b438560 100644
--- a/sysdeps/powerpc/powerpc64/backtrace.c
+++ b/sysdeps/powerpc/powerpc64/backtrace.c
@@ -70,8 +70,12 @@ __backtrace (void **array, int size)
   struct layout *current;
   int count;
 
+  /* The following asm causes a clang crash, and does not seem to be
+     needed anyway; clang always saves link register.  */
+#if !defined __clang__
   /* Force gcc to spill LR.  */
   asm volatile ("" : "=l"(current));
+#endif
 
   /* Get the address on top-of-stack.  */
   asm volatile ("ld %0,0(1)" : "=r"(current));

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5c23202b75a11ef95f8e0e95ed67416b4a7be1b2

commit 5c23202b75a11ef95f8e0e95ed67416b4a7be1b2
Author: Stan Shebs <stanshebs@google.com>
Date:   Tue Sep 25 07:58:13 2018 -0700

    Work around clang problem with ifuncs and vdso

diff --git a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
index 994a926..868e091 100644
--- a/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/powerpc/gettimeofday.c
@@ -23,7 +23,7 @@
 
 #include <sys/time.h>
 
-#ifdef SHARED
+#if defined(SHARED) && !defined(__clang__)
 
 # include <dl-vdso.h>
 # include <libc-vdso.h>
diff --git a/sysdeps/unix/sysv/linux/powerpc/time.c b/sysdeps/unix/sysv/linux/powerpc/time.c
index 8814bcc..61965fe 100644
--- a/sysdeps/unix/sysv/linux/powerpc/time.c
+++ b/sysdeps/unix/sysv/linux/powerpc/time.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifdef SHARED
+#if defined(SHARED) && !defined(__clang__)
 # ifndef __powerpc64__
 #  define time __redirect_time
 # else

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

Summary of changes:
 sysdeps/posix/clock_getres.c                   |   17 +++++++++++++++++
 sysdeps/powerpc/powerpc64/backtrace.c          |    4 ++++
 sysdeps/unix/clock_gettime.c                   |   17 +++++++++++++++++
 sysdeps/unix/sysv/linux/powerpc/gettimeofday.c |    2 +-
 sysdeps/unix/sysv/linux/powerpc/time.c         |    2 +-
 5 files changed, 40 insertions(+), 2 deletions(-)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]