vapier      16/03/07 17:59:32

  Modified:             README.history
  Added:               
                        
00_all_0042-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch
                        
00_all_0043-powerpc-Fix-macro-usage-of-htm-builtins.patch
                        
00_all_0044-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch
                        00_all_0045-sln-use-stat64.patch
  Log:
  pull few more fixes from upstream

Revision  Changes    Path
1.12                 src/patchsets/glibc/2.22/README.history

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/README.history?rev=1.12&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/README.history?rev=1.12&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/README.history?r1=1.11&r2=1.12

Index: README.history
===================================================================
RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.22/README.history,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- README.history      17 Feb 2016 03:54:51 -0000      1.11
+++ README.history      7 Mar 2016 17:59:32 -0000       1.12
@@ -1,5 +1,9 @@
-11             [pending]
+11             07 Mar 2016
        + 00_all_0041-CVE-2015-7547-getaddrinfo-stack-based-buffer-overflo.patch
+       + 00_all_0042-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch
+       + 00_all_0043-powerpc-Fix-macro-usage-of-htm-builtins.patch
+       + 00_all_0044-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch
+       + 00_all_0045-sln-use-stat64.patch
        D 10_all_glibc-CVE-2015-7547.patch
 
 10             16 Feb 2016



1.1                  
src/patchsets/glibc/2.22/00_all_0042-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0042-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0042-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch?rev=1.1&content-type=text/plain

Index: 00_all_0042-powerpc-Enforce-compiler-barriers-on-hardware-transa.patch
===================================================================
>From e012eafca47020da292f828fe128f3aca50026e1 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <[email protected]>
Date: Mon, 28 Dec 2015 12:24:43 -0200
Subject: [PATCH] powerpc: Enforce compiler barriers on hardware transactions

Work around a GCC behavior with hardware transactional memory built-ins.
GCC doesn't treat the PowerPC transactional built-ins as compiler
barriers, moving instructions past the transaction boundaries and
altering their atomicity.

(cherry picked from commit 42bf1c897170ff951c7fd0ee9da25f97ff787396)

Conflicts:
        sysdeps/unix/sysv/linux/powerpc/elision-trylock.c

(cherry picked from commit 3803874b4a368eb8245fbf091651b6c8edd90b23)
---
 sysdeps/powerpc/nptl/elide.h                      |  8 ++---
 sysdeps/powerpc/sysdep.h                          |  2 +-
 sysdeps/unix/sysv/linux/powerpc/elision-lock.c    |  4 +--
 sysdeps/unix/sysv/linux/powerpc/elision-trylock.c |  6 ++--
 sysdeps/unix/sysv/linux/powerpc/elision-unlock.c  |  2 +-
 sysdeps/unix/sysv/linux/powerpc/htm.h             | 39 ++++++++++++++++++++---
 6 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/sysdeps/powerpc/nptl/elide.h b/sysdeps/powerpc/nptl/elide.h
index 2e1e443..02f8f3b 100644
--- a/sysdeps/powerpc/nptl/elide.h
+++ b/sysdeps/powerpc/nptl/elide.h
@@ -68,14 +68,14 @@ __get_new_count (uint8_t *adapt_count, int attempt)
     else                                                               \
       for (int i = __elision_aconf.try_tbegin; i > 0; i--)             \
        {                                                               \
-         if (__builtin_tbegin (0))                                     \
+         if (__libc_tbegin (0))                                        \
            {                                                           \
              if (is_lock_free)                                         \
                {                                                       \
                  ret = 1;                                              \
                  break;                                                \
                }                                                       \
-             __builtin_tabort (_ABORT_LOCK_BUSY);                      \
+             __libc_tabort (_ABORT_LOCK_BUSY);                         \
            }                                                           \
          else                                                          \
            if (!__get_new_count (&adapt_count,i))                      \
@@ -90,7 +90,7 @@ __get_new_count (uint8_t *adapt_count, int attempt)
     if (__elision_aconf.try_tbegin > 0)                                \
       {                                                                \
        if (write)                                              \
-         __builtin_tabort (_ABORT_NESTED_TRYLOCK);             \
+         __libc_tabort (_ABORT_NESTED_TRYLOCK);                \
        ret = ELIDE_LOCK (adapt_count, is_lock_free);           \
       }                                                                \
     ret;                                                       \
@@ -102,7 +102,7 @@ __elide_unlock (int is_lock_free)
 {
   if (is_lock_free)
     {
-      __builtin_tend (0);
+      __libc_tend (0);
       return true;
     }
   return false;
diff --git a/sysdeps/powerpc/sysdep.h b/sysdeps/powerpc/sysdep.h
index e32168e..f424fe4 100644
--- a/sysdeps/powerpc/sysdep.h
+++ b/sysdeps/powerpc/sysdep.h
@@ -180,7 +180,7 @@
 # define ABORT_TRANSACTION \
   ({                                           \
     if (THREAD_GET_TM_CAPABLE ())              \
-      __builtin_tabort (_ABORT_SYSCALL);       \
+      __libc_tabort (_ABORT_SYSCALL);  \
   })
 #else
 # define ABORT_TRANSACTION
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c 
b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
index c6731ca..e11ad1d 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-lock.c
@@ -74,12 +74,12 @@ __lll_lock_elision (int *lock, short *adapt_count, EXTRAARG 
int pshared)
 
   for (int i = aconf.try_tbegin; i > 0; i--)
     {
-      if (__builtin_tbegin (0))
+      if (__libc_tbegin (0))
        {
          if (*lock == 0)
            return 0;
          /* Lock was busy.  Fall back to normal locking.  */
-         __builtin_tabort (_ABORT_LOCK_BUSY);
+         __libc_tabort (_ABORT_LOCK_BUSY);
        }
       else
        {
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c 
b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
index 7b6d1b9..edec155 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-trylock.c
@@ -31,7 +31,7 @@ int
 __lll_trylock_elision (int *futex, short *adapt_count)
 {
   /* Implement POSIX semantics by forbiding nesting elided trylocks.  */
-  __builtin_tabort (_ABORT_NESTED_TRYLOCK);
+  __libc_tabort (_ABORT_NESTED_TRYLOCK);
 
   /* Only try a transaction if it's worth it.  */
   if (*adapt_count > 0)
@@ -40,13 +40,13 @@ __lll_trylock_elision (int *futex, short *adapt_count)
       goto use_lock;
     }
 
-  if (__builtin_tbegin (0))
+  if (__libc_tbegin (0))
     {
       if (*futex == 0)
        return 0;
 
       /* Lock was busy.  Fall back to normal locking.  */
-      __builtin_tabort (_ABORT_LOCK_BUSY);
+      __libc_tabort (_ABORT_LOCK_BUSY);
     }
   else
     {
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c 
b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
index f04c339..7234db6 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
@@ -25,7 +25,7 @@ __lll_unlock_elision(int *lock, int pshared)
 {
   /* When the lock was free we're in a transaction.  */
   if (*lock == 0)
-    __builtin_tend (0);
+    __libc_tend (0);
   else
     lll_unlock ((*lock), pshared);
   return 0;
diff --git a/sysdeps/unix/sysv/linux/powerpc/htm.h 
b/sysdeps/unix/sysv/linux/powerpc/htm.h
index 57d5cd6..f9a2587 100644
--- a/sysdeps/unix/sysv/linux/powerpc/htm.h
+++ b/sysdeps/unix/sysv/linux/powerpc/htm.h
@@ -118,13 +118,44 @@
      __ret;                            \
   })
 
-#define __builtin_tbegin(tdb)       _tbegin ()
-#define __builtin_tend(nested)      _tend ()
-#define __builtin_tabort(abortcode) _tabort (abortcode)
-#define __builtin_get_texasru()     _texasru ()
+#define __libc_tbegin(tdb)       _tbegin ()
+#define __libc_tend(nested)      _tend ()
+#define __libc_tabort(abortcode) _tabort (abortcode)
+#define __builtin_get_texasru()  _texasru ()
 
 #else
 # include <htmintrin.h>
+
+# ifdef __TM_FENCE__
+   /* New GCC behavior.  */
+#  define __libc_tbegin(R)  __builtin_tbegin (R);
+#  define __libc_tend(R)    __builtin_tend (R);
+#  define __libc_tabort(R)  __builtin_tabort (R);
+# else
+   /* Workaround an old GCC behavior. Earlier releases of GCC 4.9 and 5.0,
+      didn't use to treat __builtin_tbegin, __builtin_tend and
+      __builtin_tabort as compiler barriers, moving instructions into and
+      out the transaction.
+      Remove this when glibc drops support for GCC 5.0.  */
+#  define __libc_tbegin(R)                     \
+   ({ __asm__ volatile("" ::: "memory");       \
+     unsigned int __ret = __builtin_tbegin (R);        \
+     __asm__ volatile("" ::: "memory");                \
+     __ret;                                    \
+   })
+#  define __libc_tabort(R)                     \
+  ({ __asm__ volatile("" ::: "memory");                \
+    unsigned int __ret = __builtin_tabort (R); \
+    __asm__ volatile("" ::: "memory");         \
+    __ret;                                     \
+  })
+#  define __libc_tend(R)                       \
+   ({ __asm__ volatile("" ::: "memory");       \
+     unsigned int __ret = __builtin_tend (R);  \
+     __asm__ volatile("" ::: "memory");                \
+     __ret;                                    \
+   })
+# endif /* __TM_FENCE__  */
 #endif /* __HTM__  */
 
 #endif /* __ASSEMBLER__ */
-- 
2.6.2




1.1                  
src/patchsets/glibc/2.22/00_all_0043-powerpc-Fix-macro-usage-of-htm-builtins.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0043-powerpc-Fix-macro-usage-of-htm-builtins.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0043-powerpc-Fix-macro-usage-of-htm-builtins.patch?rev=1.1&content-type=text/plain

Index: 00_all_0043-powerpc-Fix-macro-usage-of-htm-builtins.patch
===================================================================
>From 78b80a22769f07fcd83763d5b8b3625fe4920574 Mon Sep 17 00:00:00 2001
From: "Paul E. Murphy" <[email protected]>
Date: Wed, 20 Jan 2016 10:33:19 -0600
Subject: [PATCH] powerpc: Fix macro usage of htm builtins

Some extraneous semicolons were included in a
recent patch which causes a build failure with
newer compilers.

(cherry picked from commit af8ea0f449af7d3847351a4a5bafcd435a22ac31)
(cherry picked from commit a33d347c181cfa0d84c37e9961ebf030495ed248)
---
 sysdeps/unix/sysv/linux/powerpc/htm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/powerpc/htm.h 
b/sysdeps/unix/sysv/linux/powerpc/htm.h
index f9a2587..7b49817 100644
--- a/sysdeps/unix/sysv/linux/powerpc/htm.h
+++ b/sysdeps/unix/sysv/linux/powerpc/htm.h
@@ -128,9 +128,9 @@
 
 # ifdef __TM_FENCE__
    /* New GCC behavior.  */
-#  define __libc_tbegin(R)  __builtin_tbegin (R);
-#  define __libc_tend(R)    __builtin_tend (R);
-#  define __libc_tabort(R)  __builtin_tabort (R);
+#  define __libc_tbegin(R)  __builtin_tbegin (R)
+#  define __libc_tend(R)    __builtin_tend (R)
+#  define __libc_tabort(R)  __builtin_tabort (R)
 # else
    /* Workaround an old GCC behavior. Earlier releases of GCC 4.9 and 5.0,
       didn't use to treat __builtin_tbegin, __builtin_tend and
-- 
2.6.2




1.1                  
src/patchsets/glibc/2.22/00_all_0044-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0044-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0044-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch?rev=1.1&content-type=text/plain

Index: 00_all_0044-S390-Do-not-use-direct-socket-syscalls-if-build-on-k.patch
===================================================================
>From 1fd66a522e9262d7ff36b015090f3989f93ba468 Mon Sep 17 00:00:00 2001
From: Stefan Liebler <[email protected]>
Date: Thu, 3 Mar 2016 08:17:09 +0100
Subject: [PATCH] S390: Do not use direct socket syscalls if build on kernels
 >= 4.3. [BZ #19682]

Beginning with Linux 4.3, the kernel headers contain direct
system call numbers __NR_socket etc. on s390x. On older kernels,
the socket-multiplexer syscall __NR_socketcall was used.

To enable these new syscalls, the patch
"S390: Call direct system calls for socket operations."
(https://sourceware.org/git/?p=glibc.git;a=commit;h=016495b818cb61df7d0d10e6db54074271b3e3a5)
was applied upstream.

If glibc 2.23 is configured with --enable-kernel=4.3 and newer,
the direct socket syscalls are used.
For older kernels, the socket-multiplexer syscall is used instead.

In glibc 2.22 and earlier, this patch is not applied.
If you build glibc on a kernel < 4.3, the socket-multiplexer
syscall is used. But if you build glibc on kernel >= 4.3, the
direct socket-syscalls are used. If you install this glibc on a
kernel < 4.3, all socket operations will fail.
See "Bug 19682 - s390x: Incorrect syscall definitions cause
breakage with Linux 4.3 headers"
(https://sourceware.org/bugzilla/show_bug.cgi?id=19682)
The configure switch --enable-kernel does not influence this
behaviour on older glibc-releases.

The solution is to remove the direct socket-syscalls in
sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
(this patch) on older glibc-releases as it was done by the
upstream patch, too. These entries were never used on s390x,
but the c-files in sysdeps/unix/sysv/linux/.
After this removal, the behaviour of the socket functions are
not changed compared to the original glibc release version
and the socket-multiplexer-syscall is always used.

(cherry picked from commit 425c48c217ef93c2c4f81f9f3bb2fdba096877a2)
---
 sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list 
b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
index 5b8c102..9f03d26 100644
--- a/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list
@@ -12,22 +12,3 @@ shmget               -       shmget          i:iii   
__shmget        shmget
 semop          -       semop           i:ipi   __semop         semop
 semget         -       semget          i:iii   __semget        semget
 semctl         -       semctl          i:iiii  __semctl        semctl
-
-# proper socket implementations:
-accept         -       accept          Ci:iBN  __libc_accept   __accept accept
-bind           -       bind            i:ipi   __bind          bind
-connect                -       connect         Ci:ipi  __libc_connect  
__connect connect
-getpeername    -       getpeername     i:ipp   __getpeername   getpeername
-getsockname    -       getsockname     i:ipp   __getsockname   getsockname
-getsockopt     -       getsockopt      i:iiiBN __getsockopt    getsockopt
-listen         -       listen          i:ii    __listen        listen
-recv           -       recv            Ci:ibni __libc_recv     __recv recv
-recvfrom       -       recvfrom        Ci:ibniBN       __libc_recvfrom 
__recvfrom recvfrom
-recvmsg                -       recvmsg         Ci:ipi  __libc_recvmsg  
__recvmsg recvmsg
-send           -       send            Ci:ibni __libc_send     __send send
-sendmsg                -       sendmsg         Ci:ipi  __libc_sendmsg  
__sendmsg sendmsg
-sendto         -       sendto          Ci:ibnibn       __libc_sendto   
__sendto sendto
-setsockopt     -       setsockopt      i:iiibn __setsockopt    setsockopt
-shutdown       -       shutdown        i:ii    __shutdown      shutdown
-socket         -       socket          i:iii   __socket        socket
-socketpair     -       socketpair      i:iiif  __socketpair    socketpair
-- 
2.6.2




1.1                  src/patchsets/glibc/2.22/00_all_0045-sln-use-stat64.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0045-sln-use-stat64.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo/src/patchsets/glibc/2.22/00_all_0045-sln-use-stat64.patch?rev=1.1&content-type=text/plain

Index: 00_all_0045-sln-use-stat64.patch
===================================================================
>From 3f749c2e7b8226eb8c6f16fb180987dc7efe35ba Mon Sep 17 00:00:00 2001
From: Hongjiu Zhang <[email protected]>
Date: Sun, 6 Mar 2016 20:18:21 -0500
Subject: [PATCH] sln: use stat64

When using sln on some filesystems which return 64-bit inodes,
the stat call might fail during install like so:
        .../elf/sln .../elf/symlink.list
        /lib32/libc.so.6: invalid destination: Value too large for defined data 
type
        /lib32/ld-linux.so.2: invalid destination: Value too large for defined 
data type
        Makefile:104: recipe for target 'install-symbolic-link' failed

Switch to using stat64 all the time to avoid this.

URL: https://bugs.gentoo.org/576396
(cherry picked from commit f5e753c8c3a18a1e3c715dd11bf4dc341b5c481f)
(cherry picked from commit d6778fc4b0039b2116f88218212618ca357fee2f)
---
 ChangeLog | 5 +++++
 elf/sln.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 95cc5a2..7663053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-03-07  Hongjiu Zhang  <[email protected]>
+
+       * elf/sln.c (makesymlink): Change struct stat to stat64, and lstat
+       to lstat64.
+
 2015-08-05  Mike Frysinger  <[email protected]>
 
        * nptl/allocatestack.c (allocate_stack): Move stacktop decl down to
diff --git a/elf/sln.c b/elf/sln.c
index 1a7d24e..c6601fd 100644
--- a/elf/sln.c
+++ b/elf/sln.c
@@ -167,11 +167,11 @@ makesymlink (src, dest)
      const char *src;
      const char *dest;
 {
-  struct stat stats;
+  struct stat64 stats;
   const char *error;
 
   /* Destination must not be a directory. */
-  if (lstat (dest, &stats) == 0)
+  if (lstat64 (dest, &stats) == 0)
     {
       if (S_ISDIR (stats.st_mode))
        {
-- 
2.6.2





Reply via email to