Browse Source

glibc package update to 222 with all patches enabled and optimizations

Signed-off-by: basebuilder_pel7ppc64bebuilder0 <basebuilder@powerel.org>
master
basebuilder_pel7ppc64bebuilder0 7 years ago
parent
commit
209fe0988b
  1. 6
      SOURCES/glibc-aa64-commonpagesize-64k.patch
  2. 16
      SOURCES/glibc-aa64-setcontext.patch
  3. 50
      SOURCES/glibc-aarch64-add-ptr_mangle-support.patch
  4. 4
      SOURCES/glibc-aarch64-fpu-optional-trapping-exceptions.patch
  5. 12
      SOURCES/glibc-aarch64-ifunc.patch
  6. 85
      SOURCES/glibc-aarch64-syscall-rewrite.patch
  7. 13
      SOURCES/glibc-arm-hardfloat-3.patch
  8. 38
      SOURCES/glibc-fedora-elf-ORIGIN.patch
  9. 8
      SOURCES/glibc-fedora-elf-rh737223.patch
  10. 52
      SOURCES/glibc-fedora-gai-canonical.patch
  11. 2
      SOURCES/glibc-fedora-getrlimit-PLT.patch
  12. 2
      SOURCES/glibc-fedora-ldd.patch
  13. 2
      SOURCES/glibc-fedora-linux-tcsetattr.patch
  14. 12
      SOURCES/glibc-fedora-localedef.patch
  15. 12
      SOURCES/glibc-fedora-locarchive.patch
  16. 2
      SOURCES/glibc-fedora-nptl-linklibc.patch
  17. 2
      SOURCES/glibc-fedora-nscd.patch
  18. 48
      SOURCES/glibc-fedora-regcomp-sw11561.patch
  19. 28
      SOURCES/glibc-manual-update.patch
  20. 14
      SOURCES/glibc-ppc64le-01.patch
  21. 376
      SOURCES/glibc-ppc64le-03.patch
  22. 224
      SOURCES/glibc-ppc64le-04.patch
  23. 80
      SOURCES/glibc-ppc64le-05.patch
  24. 192
      SOURCES/glibc-ppc64le-06.patch
  25. 146
      SOURCES/glibc-ppc64le-07.patch
  26. 468
      SOURCES/glibc-ppc64le-08.patch
  27. 154
      SOURCES/glibc-ppc64le-09.patch
  28. 8
      SOURCES/glibc-ppc64le-11.patch
  29. 1
      SOURCES/glibc-ppc64le-12.patch
  30. 10
      SOURCES/glibc-ppc64le-13.patch
  31. 204
      SOURCES/glibc-ppc64le-17.patch
  32. 34
      SOURCES/glibc-ppc64le-18.patch
  33. 24
      SOURCES/glibc-ppc64le-19.patch
  34. 2
      SOURCES/glibc-ppc64le-20.patch
  35. 82
      SOURCES/glibc-ppc64le-21.patch
  36. 4
      SOURCES/glibc-ppc64le-22.patch
  37. 36
      SOURCES/glibc-ppc64le-23.patch
  38. 20
      SOURCES/glibc-ppc64le-24.patch
  39. 196
      SOURCES/glibc-ppc64le-25.patch
  40. 180
      SOURCES/glibc-ppc64le-26.patch
  41. 320
      SOURCES/glibc-ppc64le-27.patch
  42. 64
      SOURCES/glibc-ppc64le-28.patch
  43. 422
      SOURCES/glibc-ppc64le-29.patch
  44. 1990
      SOURCES/glibc-ppc64le-30.patch
  45. 206
      SOURCES/glibc-ppc64le-31.patch
  46. 180
      SOURCES/glibc-ppc64le-32.patch
  47. 416
      SOURCES/glibc-ppc64le-33.patch
  48. 8
      SOURCES/glibc-ppc64le-35.patch
  49. 10
      SOURCES/glibc-ppc64le-36.patch
  50. 90
      SOURCES/glibc-ppc64le-38.patch
  51. 126
      SOURCES/glibc-ppc64le-39.patch
  52. 16
      SOURCES/glibc-ppc64le-40.patch
  53. 366
      SOURCES/glibc-ppc64le-41.patch
  54. 154
      SOURCES/glibc-ppc64le-42.patch
  55. 12
      SOURCES/glibc-ppc64le-44.patch
  56. 2
      SOURCES/glibc-rh1000923.patch
  57. 4
      SOURCES/glibc-rh1008298.patch
  58. 12
      SOURCES/glibc-rh1025612.patch
  59. 20
      SOURCES/glibc-rh1027101.patch
  60. 2
      SOURCES/glibc-rh1027348-1.patch
  61. 20
      SOURCES/glibc-rh1027348-3.patch
  62. 4
      SOURCES/glibc-rh1027348-4.patch
  63. 52
      SOURCES/glibc-rh1027348.patch
  64. 24
      SOURCES/glibc-rh1032435.patch
  65. 12
      SOURCES/glibc-rh1039970.patch
  66. 12
      SOURCES/glibc-rh1046199.patch
  67. 2
      SOURCES/glibc-rh1047983.patch
  68. 24
      SOURCES/glibc-rh1048036.patch
  69. 108
      SOURCES/glibc-rh1048123.patch
  70. 36
      SOURCES/glibc-rh1063681.patch
  71. 2
      SOURCES/glibc-rh1064063.patch
  72. 10
      SOURCES/glibc-rh1064066.patch
  73. 1
      SOURCES/glibc-rh1064945.patch
  74. 10
      SOURCES/glibc-rh1073667.patch
  75. 17
      SOURCES/glibc-rh1074410-2.patch
  76. 107
      SOURCES/glibc-rh1074410.patch
  77. 1
      SOURCES/glibc-rh1077389-p1.patch
  78. 1
      SOURCES/glibc-rh1077389-p2.patch
  79. 22
      SOURCES/glibc-rh1078225.patch
  80. 24
      SOURCES/glibc-rh1080766.patch
  81. 28
      SOURCES/glibc-rh1083644.patch
  82. 82
      SOURCES/glibc-rh1083646.patch
  83. 12
      SOURCES/glibc-rh1083647.patch
  84. 12
      SOURCES/glibc-rh1084089.patch
  85. 40
      SOURCES/glibc-rh1084395.patch
  86. 12
      SOURCES/glibc-rh1085313.patch
  87. 12
      SOURCES/glibc-rh1098042.patch
  88. 60
      SOURCES/glibc-rh1098047.patch
  89. 21
      SOURCES/glibc-rh1103856.patch
  90. 8
      SOURCES/glibc-rh1103874.patch
  91. 34
      SOURCES/glibc-rh1120490.patch
  92. 46
      SOURCES/glibc-rh1132518-mpx.patch
  93. 1
      SOURCES/glibc-rh1133812-1.patch
  94. 28
      SOURCES/glibc-rh1133812-2.patch
  95. 302
      SOURCES/glibc-rh1133812-3.patch
  96. 19
      SOURCES/glibc-rh1138520.patch
  97. 12
      SOURCES/glibc-rh1140250.patch
  98. 200
      SOURCES/glibc-rh1140272-avx512.patch
  99. 102
      SOURCES/glibc-rh1140474.patch
  100. 16
      SOURCES/glibc-rh1144133.patch
  101. Some files were not shown because too many files have changed in this diff Show More

6
SOURCES/glibc-aa64-commonpagesize-64k.patch

@ -3,9 +3,9 @@
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
case "$machine" in case "$machine" in
aarch64*) aarch64*)
# Parameters to allow auto-detection of -z relro. # Parameters to allow auto-detection of -z relro.
- libc_commonpagesize=0x1000 - libc_commonpagesize=0x1000
+ libc_commonpagesize=0x10000 + libc_commonpagesize=0x10000
libc_relro_required=yes libc_relro_required=yes
;; ;;
esac esac

16
SOURCES/glibc-aa64-setcontext.patch

@ -21,15 +21,15 @@ index aff2e32..70b2e32 100644
This file is part of the GNU C Library. This file is part of the GNU C Library.
@@ -53,6 +53,9 @@ ENTRY(__getcontext) @@ -53,6 +53,9 @@ ENTRY(__getcontext)
mov x2, sp mov x2, sp
str x2, [x0, oSP] str x2, [x0, oSP]
+ /* Initialize the pstate. */ + /* Initialize the pstate. */
+ str xzr, [x0, oPSTATE] + str xzr, [x0, oPSTATE]
+ +
/* Figure out where to place the first context extension /* Figure out where to place the first context extension
block. */ block. */
add x2, x0, #oEXTENSION add x2, x0, #oEXTENSION
diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S diff --git glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S
index a98f67f..f45a655 100644 index a98f67f..f45a655 100644
--- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/setcontext.S
@ -108,7 +108,7 @@ index a98f67f..f45a655 100644
+ mov x2, #0 + mov x2, #0
+ mov x3, #_NSIG8 + mov x3, #_NSIG8
+ mov x8, SYS_ify (rt_sigprocmask) + mov x8, SYS_ify (rt_sigprocmask)
svc 0 svc 0
- -
- /* Ooops we failed. Recover the stack */ - /* Ooops we failed. Recover the stack */
- -
@ -200,8 +200,8 @@ index a98f67f..f45a655 100644
-ENTRY(__startcontext) -ENTRY(__startcontext)
+ENTRY (__startcontext) +ENTRY (__startcontext)
mov x0, x19 mov x0, x19
cbnz x0, __setcontext cbnz x0, __setcontext
-1: b HIDDEN_JUMPTARGET(_exit) -1: b HIDDEN_JUMPTARGET(_exit)
-END(__startcontext) -END(__startcontext)
+1: b HIDDEN_JUMPTARGET (_exit) +1: b HIDDEN_JUMPTARGET (_exit)

50
SOURCES/glibc-aarch64-add-ptr_mangle-support.patch

@ -9,23 +9,23 @@ index 250f2af..2d38bbf 100644
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/__longjmp.S --- glibc-2.17-c758a686/ports/sysdeps/aarch64/__longjmp.S
+++ glibc-2.17-c758a686/ports/sysdeps/aarch64/__longjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/__longjmp.S
@@ -50,8 +50,12 @@ ENTRY (__longjmp) @@ -50,8 +50,12 @@ ENTRY (__longjmp)
ldp x23, x24, [x0, #JB_X23<<3] ldp x23, x24, [x0, #JB_X23<<3]
ldp x25, x26, [x0, #JB_X25<<3] ldp x25, x26, [x0, #JB_X25<<3]
ldp x27, x28, [x0, #JB_X27<<3] ldp x27, x28, [x0, #JB_X27<<3]
+#ifdef PTR_DEMANGLE +#ifdef PTR_DEMANGLE
+ ldp x29, x4, [x0, #JB_X29<<3] + ldp x29, x4, [x0, #JB_X29<<3]
+ PTR_DEMANGLE (x30, x4, x3, x2) + PTR_DEMANGLE (x30, x4, x3, x2)
+#else +#else
ldp x29, x30, [x0, #JB_X29<<3] ldp x29, x30, [x0, #JB_X29<<3]
- -
+#endif +#endif
ldp d8, d9, [x0, #JB_D8<<3] ldp d8, d9, [x0, #JB_D8<<3]
ldp d10, d11, [x0, #JB_D10<<3] ldp d10, d11, [x0, #JB_D10<<3]
ldp d12, d13, [x0, #JB_D12<<3] ldp d12, d13, [x0, #JB_D12<<3]
@@ -87,8 +91,12 @@ ENTRY (__longjmp) @@ -87,8 +91,12 @@ ENTRY (__longjmp)
cfi_same_value(d13) cfi_same_value(d13)
cfi_same_value(d14) cfi_same_value(d14)
cfi_same_value(d15) cfi_same_value(d15)
- -
- ldr x5, [x0, #JB_SP<<3] - ldr x5, [x0, #JB_SP<<3]
+#ifdef PTR_DEMANGLE +#ifdef PTR_DEMANGLE
@ -34,9 +34,9 @@ index 250f2af..2d38bbf 100644
+#else +#else
+ ldr x5, [x0, #JB_SP<<3] + ldr x5, [x0, #JB_SP<<3]
+#endif +#endif
mov sp, x5 mov sp, x5
cmp x1, #0 cmp x1, #0
mov x0, #1 mov x0, #1
diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h
index 84c2ccc..bcf2afa 100644 index 84c2ccc..bcf2afa 100644
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h --- glibc-2.17-c758a686/ports/sysdeps/aarch64/jmpbuf-offsets.h
@ -91,31 +91,31 @@ index cb94e01..5822abd 100644
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S --- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
+++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
@@ -39,13 +39,25 @@ ENTRY (__sigsetjmp) @@ -39,13 +39,25 @@ ENTRY (__sigsetjmp)
stp x23, x24, [x0, #JB_X23<<3] stp x23, x24, [x0, #JB_X23<<3]
stp x25, x26, [x0, #JB_X25<<3] stp x25, x26, [x0, #JB_X25<<3]
stp x27, x28, [x0, #JB_X27<<3] stp x27, x28, [x0, #JB_X27<<3]
+ +
+#ifdef PTR_MANGLE +#ifdef PTR_MANGLE
+ PTR_MANGLE (x4, x30, x3, x2) + PTR_MANGLE (x4, x30, x3, x2)
+ stp x29, x4, [x0, #JB_X29<<3] + stp x29, x4, [x0, #JB_X29<<3]
+#else +#else
stp x29, x30, [x0, #JB_X29<<3] stp x29, x30, [x0, #JB_X29<<3]
+#endif +#endif
stp d8, d9, [x0, #JB_D8<<3] stp d8, d9, [x0, #JB_D8<<3]
stp d10, d11, [x0, #JB_D10<<3] stp d10, d11, [x0, #JB_D10<<3]
stp d12, d13, [x0, #JB_D12<<3] stp d12, d13, [x0, #JB_D12<<3]
stp d14, d15, [x0, #JB_D14<<3] stp d14, d15, [x0, #JB_D14<<3]
+#ifdef PTR_MANGLE +#ifdef PTR_MANGLE
+ mov x4, sp + mov x4, sp
+ PTR_MANGLE (x5, x4, x3, x2) + PTR_MANGLE (x5, x4, x3, x2)
+ str x5, [x0, #JB_SP<<3] + str x5, [x0, #JB_SP<<3]
+#else +#else
mov x2, sp mov x2, sp
str x2, [x0, #JB_SP<<3] str x2, [x0, #JB_SP<<3]
+#endif +#endif
#if defined NOT_IN_libc && defined IS_IN_rtld #if defined NOT_IN_libc && defined IS_IN_rtld
/* In ld.so we never save the signal mask */ /* In ld.so we never save the signal mask */
mov w0, #0 mov w0, #0
diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h diff --git glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h
index 0dd597a..7169ba7 100644 index 0dd597a..7169ba7 100644
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h --- glibc-2.17-c758a686/ports/sysdeps/aarch64/sysdep.h

4
SOURCES/glibc-aarch64-fpu-optional-trapping-exceptions.patch

@ -95,7 +95,7 @@ Date: Thu Apr 17 09:39:27 2014 +0100
+ } + }
+ +
+ printf ("Test: after feenableexcept (%s) processes will abort\n", + printf ("Test: after feenableexcept (%s) processes will abort\n",
flag_name); flag_name);
printf (" when feraiseexcept (%s) is called.\n", flag_name); printf (" when feraiseexcept (%s) is called.\n", flag_name);
pid = fork (); pid = fork ();
@@ -470,7 +472,6 @@ feenable_test (const char *flag_name, int fe_exc) @@ -470,7 +472,6 @@ feenable_test (const char *flag_name, int fe_exc)
@ -107,7 +107,7 @@ Date: Thu Apr 17 09:39:27 2014 +0100
/* First disable all exceptions. */ /* First disable all exceptions. */
@@ -488,8 +489,12 @@ feenable_test (const char *flag_name, int fe_exc) @@ -488,8 +489,12 @@ feenable_test (const char *flag_name, int fe_exc)
flag_name, excepts); flag_name, excepts);
++count_errors; ++count_errors;
} }
- -

12
SOURCES/glibc-aarch64-ifunc.patch

@ -188,8 +188,8 @@ index b1878a7..1db5a5b 100644
/* Return nonzero iff ELF header is compatible with the running host. */ /* Return nonzero iff ELF header is compatible with the running host. */
static inline int __attribute__ ((unused)) static inline int __attribute__ ((unused))
@@ -336,6 +337,12 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, @@ -336,6 +337,12 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
} }
break; break;
+ case R_AARCH64_IRELATIVE: + case R_AARCH64_IRELATIVE:
+ value = map->l_addr + reloc->r_addend; + value = map->l_addr + reloc->r_addend;
@ -197,12 +197,12 @@ index b1878a7..1db5a5b 100644
+ *reloc_addr = value; + *reloc_addr = value;
+ break; + break;
+ +
default: default:
_dl_reloc_bad_type (map, r_type, 0); _dl_reloc_bad_type (map, r_type, 0);
break; break;
@@ -379,6 +386,13 @@ elf_machine_lazy_rel (struct link_map *map, @@ -379,6 +386,13 @@ elf_machine_lazy_rel (struct link_map *map,
td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)]) td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
+ map->l_addr); + map->l_addr);
} }
+ else if (__glibc_unlikely (r_type == R_AARCH64_IRELATIVE)) + else if (__glibc_unlikely (r_type == R_AARCH64_IRELATIVE))
+ { + {

85
SOURCES/glibc-aarch64-syscall-rewrite.patch

@ -41,7 +41,7 @@ index 8be1464..d5c31f3 100644
+ mov x11, x2 + mov x11, x2
+ mov x12, x3 + mov x12, x3
+ +
/* Sanity check args. */ /* Sanity check args. */
- cbz x0, 1f - cbz x0, 1f
- cbz x1, 1f - cbz x1, 1f
- /* Insert the args onto the new stack. */ - /* Insert the args onto the new stack. */
@ -50,14 +50,14 @@ index 8be1464..d5c31f3 100644
+ cbz x10, .Lsyscall_error + cbz x10, .Lsyscall_error
+ cbz x1, .Lsyscall_error + cbz x1, .Lsyscall_error
/* Do the system call. */ /* Do the system call. */
+ /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ + /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */
mov x0, x2 /* flags */ mov x0, x2 /* flags */
- -
/* New sp is already in x1. */ /* New sp is already in x1. */
mov x2, x4 /* ptid */ mov x2, x4 /* ptid */
mov x3, x5 /* tls */ mov x3, x5 /* tls */
mov x4, x6 /* ctid */ mov x4, x6 /* ctid */
-#ifdef RESET_PID -#ifdef RESET_PID
- /* We rely on the kernel preserving the argument regsiters across a - /* We rely on the kernel preserving the argument regsiters across a
@ -66,16 +66,16 @@ index 8be1464..d5c31f3 100644
- mov x5, x0 - mov x5, x0
-#endif -#endif
- -
mov x8, #SYS_ify(clone) mov x8, #SYS_ify(clone)
- /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ - /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */
svc 0x0 svc 0x0
- cfi_endproc - cfi_endproc
cmp x0, #0 cmp x0, #0
- beq 2f - beq 2f
- blt C_SYMBOL_NAME(__syscall_error) - blt C_SYMBOL_NAME(__syscall_error)
+ beq thread_start + beq thread_start
+ blt .Lsyscall_error + blt .Lsyscall_error
RET RET
-1: mov x0, #-EINVAL -1: mov x0, #-EINVAL
- b syscall_error - b syscall_error
+PSEUDO_END (__clone) +PSEUDO_END (__clone)
@ -84,23 +84,23 @@ index 8be1464..d5c31f3 100644
+ .align 4 + .align 4
+ .type thread_start, %function + .type thread_start, %function
+thread_start: +thread_start:
cfi_startproc cfi_startproc
cfi_undefined (x30) cfi_undefined (x30)
mov x29, 0 mov x29, 0
+ +
#ifdef RESET_PID #ifdef RESET_PID
- tbnz x5, #CLONE_THREAD_BIT, 3f - tbnz x5, #CLONE_THREAD_BIT, 3f
+ tbnz x11, #CLONE_THREAD_BIT, 3f + tbnz x11, #CLONE_THREAD_BIT, 3f
mov x0, #-1 mov x0, #-1
- tbnz x5, #CLONE_VM_BIT, 2f - tbnz x5, #CLONE_VM_BIT, 2f
+ tbnz x11, #CLONE_VM_BIT, 2f + tbnz x11, #CLONE_VM_BIT, 2f
mov x8, #SYS_ify(getpid) mov x8, #SYS_ify(getpid)
svc 0x0 svc 0x0
2: 2:
@@ -86,18 +83,16 @@ ENTRY(__clone) @@ -86,18 +83,16 @@ ENTRY(__clone)
sub x1, x1, #PTHREAD_SIZEOF sub x1, x1, #PTHREAD_SIZEOF
str w0, [x1, #PTHREAD_PID_OFFSET] str w0, [x1, #PTHREAD_PID_OFFSET]
str w0, [x1, #PTHREAD_TID_OFFSET] str w0, [x1, #PTHREAD_TID_OFFSET]
- -
3: 3:
#endif #endif
@ -113,9 +113,9 @@ index 8be1464..d5c31f3 100644
+ mov x0, x12 + mov x0, x12
+ blr x10 + blr x10
/* We are done, pass the return value through x0. */ /* We are done, pass the return value through x0. */
b HIDDEN_JUMPTARGET(_exit) b HIDDEN_JUMPTARGET(_exit)
cfi_endproc cfi_endproc
- cfi_startproc - cfi_startproc
-PSEUDO_END (__clone) -PSEUDO_END (__clone)
+ .size thread_start, .-thread_start + .size thread_start, .-thread_start
@ -127,7 +127,7 @@ index f01fb84..be6c026 100644
+++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/ioctl.S
@@ -20,13 +20,12 @@ @@ -20,13 +20,12 @@
.text .text
ENTRY(__ioctl) ENTRY(__ioctl)
- movz x8, #__NR_ioctl - movz x8, #__NR_ioctl
- sxtw x0, w0 - sxtw x0, w0
@ -139,7 +139,7 @@ index f01fb84..be6c026 100644
+ svc #0x0 + svc #0x0
+ cmn x0, #4095 + cmn x0, #4095
+ b.cs .Lsyscall_error + b.cs .Lsyscall_error
ret ret
- -
- PSEUDO_END (__ioctl) - PSEUDO_END (__ioctl)
+PSEUDO_END (__ioctl) +PSEUDO_END (__ioctl)
@ -347,7 +347,7 @@ index e0e5cc0..a3b9284 100644
/* There is no __local_multiple_threads for librt, so use the TCB. */ /* There is no __local_multiple_threads for librt, so use the TCB. */
@@ -173,20 +112,10 @@ extern int __local_multiple_threads attribute_hidden; @@ -173,20 +112,10 @@ extern int __local_multiple_threads attribute_hidden;
__builtin_expect (THREAD_GETMEM (THREAD_SELF, \ __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
header.multiple_threads) == 0, 1) header.multiple_threads) == 0, 1)
# else # else
-# define SINGLE_THREAD_P \ -# define SINGLE_THREAD_P \
- stp x0, x30, [sp, -16]!; \ - stp x0, x30, [sp, -16]!; \
@ -375,12 +375,12 @@ index 574fdf1..fac6416 100644
--- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S
+++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/syscall.S
@@ -37,8 +37,6 @@ ENTRY (syscall) @@ -37,8 +37,6 @@ ENTRY (syscall)
mov x6, x7 mov x6, x7
svc 0x0 svc 0x0
cmn x0, #4095 cmn x0, #4095
- b.cs 1f - b.cs 1f
+ b.cs .Lsyscall_error + b.cs .Lsyscall_error
RET RET
-1: -1:
- b SYSCALL_ERROR - b SYSCALL_ERROR
PSEUDO_END (syscall) PSEUDO_END (syscall)
@ -441,13 +441,13 @@ index 713bf7d..9961c03 100644
# define SYSCALL_ERROR_HANDLER \ # define SYSCALL_ERROR_HANDLER \
-__local_syscall_error: \ -__local_syscall_error: \
+.Lsyscall_error: \ +.Lsyscall_error: \
adrp x1, C_SYMBOL_NAME(rtld_errno); \ adrp x1, C_SYMBOL_NAME(rtld_errno); \
- add x1, x1, #:lo12:C_SYMBOL_NAME(rtld_errno); \ - add x1, x1, #:lo12:C_SYMBOL_NAME(rtld_errno); \
neg w0, w0; \ neg w0, w0; \
- str w0, [x1]; \ - str w0, [x1]; \
+ str w0, [x1, :lo12:C_SYMBOL_NAME(rtld_errno)]; \ + str w0, [x1, :lo12:C_SYMBOL_NAME(rtld_errno)]; \
mov x0, -1; \ mov x0, -1; \
RET; RET;
# else # else
# define SYSCALL_ERROR_HANDLER \ # define SYSCALL_ERROR_HANDLER \
@ -466,14 +466,14 @@ index 713bf7d..9961c03 100644
+ neg w2, w0; \ + neg w2, w0; \
+ ldr x1, [x1, :gottprel_lo12:errno]; \ + ldr x1, [x1, :gottprel_lo12:errno]; \
+ mrs x3, tpidr_el0; \ + mrs x3, tpidr_el0; \
mov x0, -1; \ mov x0, -1; \
- ldr x19, [sp,16]; \ - ldr x19, [sp,16]; \
- ldp x29, x30, [sp], 32; \ - ldp x29, x30, [sp], 32; \
- cfi_adjust_cfa_offset (-32); \ - cfi_adjust_cfa_offset (-32); \
- cfi_restore (x29); \ - cfi_restore (x29); \
- cfi_restore (x30); \ - cfi_restore (x30); \
+ str w2, [x1, x3]; \ + str w2, [x1, x3]; \
RET; RET;
# endif # endif
# else # else
-# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */ -# define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
@ -486,9 +486,9 @@ index 713bf7d..9961c03 100644
/* Linux takes system call args in registers: /* Linux takes system call args in registers:
- syscall number in the SVC instruction - syscall number in the SVC instruction
+ syscall number x8 + syscall number x8
arg 1 x0 arg 1 x0
arg 2 x1 arg 2 x1
arg 3 x2 arg 3 x2
@@ -177,28 +149,8 @@ __local_syscall_error: \ @@ -177,28 +149,8 @@ __local_syscall_error: \
# undef DO_CALL # undef DO_CALL
@ -524,12 +524,12 @@ index f2dc49b..3fb68b9 100644
--- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S
+++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/vfork.S
@@ -38,10 +38,8 @@ ENTRY (__vfork) @@ -38,10 +38,8 @@ ENTRY (__vfork)
RESTORE_PID RESTORE_PID
#endif #endif
cmn x0, #4095 cmn x0, #4095
- b.cs 1f - b.cs 1f
+ b.cs .Lsyscall_error + b.cs .Lsyscall_error
RET RET
-1: -1:
- b SYSCALL_ERROR - b SYSCALL_ERROR
@ -537,3 +537,4 @@ index f2dc49b..3fb68b9 100644
libc_hidden_def (__vfork) libc_hidden_def (__vfork)
-- --
1.8.3.1 1.8.3.1


13
SOURCES/glibc-arm-hardfloat-3.patch

@ -4,9 +4,9 @@ diff -Nru glibc-2.17-c758a686/elf/dl-load.c glibc-2.17-c758a686/elf/dl-load.c
--- glibc-2.17-c758a686/elf/dl-load.c 2012-06-06 13:07:41.727524312 -0600 --- glibc-2.17-c758a686/elf/dl-load.c 2012-06-06 13:07:41.727524312 -0600
+++ glibc-2.17-c758a686/elf/dl-load.c 2012-06-06 13:11:19.308681002 -0600 +++ glibc-2.17-c758a686/elf/dl-load.c 2012-06-06 13:11:19.308681002 -0600
@@ -2093,10 +2093,14 @@ _dl_map_object (struct link_map *loader, @@ -2093,10 +2093,14 @@ _dl_map_object (struct link_map *loader,
soname = ((const char *) D_PTR (l, l_info[DT_STRTAB]) soname = ((const char *) D_PTR (l, l_info[DT_STRTAB])
+ l->l_info[DT_SONAME]->d_un.d_val); + l->l_info[DT_SONAME]->d_un.d_val);
if (strcmp (name, soname) != 0) if (strcmp (name, soname) != 0)
- continue; - continue;
+#ifdef __arm__ +#ifdef __arm__
+ if (strcmp (name, "ld-linux.so.3") + if (strcmp (name, "ld-linux.so.3")
@ -14,8 +14,9 @@ diff -Nru glibc-2.17-c758a686/elf/dl-load.c glibc-2.17-c758a686/elf/dl-load.c
+#endif +#endif
+ continue; + continue;
/* We have a match on a new name -- cache it. */ /* We have a match on a new name -- cache it. */
- add_name_to_object (l, soname); - add_name_to_object (l, soname);
+ add_name_to_object (l, name); + add_name_to_object (l, name);
l->l_soname_added = 1; l->l_soname_added = 1;
} }

38
SOURCES/glibc-fedora-elf-ORIGIN.patch

@ -28,7 +28,7 @@ index 18a83d2..6e16a9a 100644
size_t len; size_t len;
bool is_curly = false; bool is_curly = false;
@@ -279,12 +278,6 @@ is_dst (const char *start, const char *name, const char *str, @@ -279,12 +278,6 @@ is_dst (const char *start, const char *name, const char *str,
&& (!is_path || name[len] != ':')) && (!is_path || name[len] != ':'))
return 0; return 0;
- if (__builtin_expect (secure, 0) - if (__builtin_expect (secure, 0)
@ -54,17 +54,17 @@ index 18a83d2..6e16a9a 100644
+ if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0 + if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0
+ || (len = is_dst (start, name, "PLATFORM", is_path)) != 0 + || (len = is_dst (start, name, "PLATFORM", is_path)) != 0
+ || (len = is_dst (start, name, "LIB", is_path)) != 0) + || (len = is_dst (start, name, "LIB", is_path)) != 0)
++cnt; ++cnt;
name = strchr (name + len, '$'); name = strchr (name + len, '$');
@@ -338,9 +328,16 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, @@ -338,9 +328,16 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
size_t len; size_t len;
++name; ++name;
- if ((len = is_dst (start, name, "ORIGIN", is_path, - if ((len = is_dst (start, name, "ORIGIN", is_path,
- INTUSE(__libc_enable_secure))) != 0) - INTUSE(__libc_enable_secure))) != 0)
+ if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0) + if ((len = is_dst (start, name, "ORIGIN", is_path)) != 0)
{ {
+ /* For SUID/GUID programs $ORIGIN must always appear + /* For SUID/GUID programs $ORIGIN must always appear
+ first in a path element. */ + first in a path element. */
+ if (__builtin_expect (INTUSE(__libc_enable_secure), 0) + if (__builtin_expect (INTUSE(__libc_enable_secure), 0)
@ -74,25 +74,25 @@ index 18a83d2..6e16a9a 100644
+ repl = (const char *) -1; + repl = (const char *) -1;
+ else + else
#ifndef SHARED #ifndef SHARED
if (l == NULL) if (l == NULL)
repl = _dl_get_origin (); repl = _dl_get_origin ();
@@ -351,9 +348,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, @@ -351,9 +348,9 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
check_for_trusted = (INTUSE(__libc_enable_secure) check_for_trusted = (INTUSE(__libc_enable_secure)
&& l->l_type == lt_executable); && l->l_type == lt_executable);
} }
- else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0) - else if ((len = is_dst (start, name, "PLATFORM", is_path, 0)) != 0)
+ else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0) + else if ((len = is_dst (start, name, "PLATFORM", is_path)) != 0)
repl = GLRO(dl_platform); repl = GLRO(dl_platform);
- else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0) - else if ((len = is_dst (start, name, "LIB", is_path, 0)) != 0)
+ else if ((len = is_dst (start, name, "LIB", is_path)) != 0) + else if ((len = is_dst (start, name, "LIB", is_path)) != 0)
repl = DL_DST_LIB; repl = DL_DST_LIB;
if (repl != NULL && repl != (const char *) -1) if (repl != NULL && repl != (const char *) -1)
@@ -373,6 +370,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result, @@ -373,6 +370,7 @@ _dl_dst_substitute (struct link_map *l, const char *name, char *result,
element, but keep an empty element at the end. */ element, but keep an empty element at the end. */
if (wp == result && is_path && *name == ':' && name[1] != '\0') if (wp == result && is_path && *name == ':' && name[1] != '\0')
++name; ++name;
+ check_for_trusted = false; + check_for_trusted = false;
} }
else else
/* No DST we recognize. */ /* No DST we recognize. */

8
SOURCES/glibc-fedora-elf-rh737223.patch

@ -3,13 +3,13 @@ diff -Nru glibc-2.17-c758a686/elf/setup-vdso.h glibc-2.17-c758a686/elf/setup-vds
--- glibc-2.17-c758a686/elf/setup-vdso.h 2012-10-10 21:34:38.000000000 -0600 --- glibc-2.17-c758a686/elf/setup-vdso.h 2012-10-10 21:34:38.000000000 -0600
+++ glibc-2.17-c758a686/elf/setup-vdso.h 2012-10-11 09:43:14.152958832 -0600 +++ glibc-2.17-c758a686/elf/setup-vdso.h 2012-10-11 09:43:14.152958832 -0600
@@ -93,7 +93,9 @@ setup_vdso (struct link_map *main_map __ @@ -93,7 +93,9 @@ setup_vdso (struct link_map *main_map __
char *copy = malloc (len); char *copy = malloc (len);
if (copy == NULL) if (copy == NULL)
_dl_fatal_printf ("out of memory\n"); _dl_fatal_printf ("out of memory\n");
- l->l_libname->name = l->l_name = memcpy (copy, dsoname, len); - l->l_libname->name = l->l_name = memcpy (copy, dsoname, len);
+ l->l_libname->name = memcpy (copy, dsoname, len); + l->l_libname->name = memcpy (copy, dsoname, len);
+ if (GLRO(dl_debug_mask)) + if (GLRO(dl_debug_mask))
+ l->l_name = copy; + l->l_name = copy;
} }
/* Add the vDSO to the object list. */ /* Add the vDSO to the object list. */

52
SOURCES/glibc-fedora-gai-canonical.patch

@ -11,23 +11,23 @@ Date: Tue Oct 15 10:21:13 2013 +0200
+++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
@@ -565,8 +565,8 @@ gaih_inet (const char *name, const struct gaih_service *service, @@ -565,8 +565,8 @@ gaih_inet (const char *name, const struct gaih_service *service,
/* If we do not have to look for IPv6 addresses, use /* If we do not have to look for IPv6 addresses, use
the simple, old functions, which do not support the simple, old functions, which do not support
- IPv6 scope ids. */ - IPv6 scope ids. */
- if (req->ai_family == AF_INET) - if (req->ai_family == AF_INET)
+ IPv6 scope ids, nor retrieving the canonical name. */ + IPv6 scope ids, nor retrieving the canonical name. */
+ if (req->ai_family == AF_INET && (req->ai_flags & AI_CANONNAME) == 0) + if (req->ai_family == AF_INET && (req->ai_flags & AI_CANONNAME) == 0)
{ {
/* Allocate additional room for struct host_data. */ /* Allocate additional room for struct host_data. */
size_t tmpbuflen = (512 + MAX_NR_ALIASES * sizeof(char*) size_t tmpbuflen = (512 + MAX_NR_ALIASES * sizeof(char*)
@@ -1107,70 +1107,10 @@ gaih_inet (const char *name, const struct gaih_service *service, @@ -1107,70 +1107,10 @@ gaih_inet (const char *name, const struct gaih_service *service,
/* Only the first entry gets the canonical name. */ /* Only the first entry gets the canonical name. */
if (at2 == at && (req->ai_flags & AI_CANONNAME) != 0) if (at2 == at && (req->ai_flags & AI_CANONNAME) != 0)
{ {
- char *tmpbuf2 = NULL; - char *tmpbuf2 = NULL;
- bool malloc_tmpbuf2 = false; - bool malloc_tmpbuf2 = false;
- -
if (canon == NULL) if (canon == NULL)
- { - {
- struct hostent *h = NULL; - struct hostent *h = NULL;
- int herrno; - int herrno;
@ -93,32 +93,32 @@ Date: Tue Oct 15 10:21:13 2013 +0200
+ canon = orig_name; + canon = orig_name;
#ifdef HAVE_LIBIDN #ifdef HAVE_LIBIDN
if (req->ai_flags & AI_CANONIDN) if (req->ai_flags & AI_CANONIDN)
@@ -1185,9 +1125,6 @@ gaih_inet (const char *name, const struct gaih_service *service, @@ -1185,9 +1125,6 @@ gaih_inet (const char *name, const struct gaih_service *service,
int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags); int rc = __idna_to_unicode_lzlz (canon, &out, idn_flags);
if (rc != IDNA_SUCCESS) if (rc != IDNA_SUCCESS)
{ {
- if (malloc_tmpbuf2) - if (malloc_tmpbuf2)
- free (tmpbuf2); - free (tmpbuf2);
- -
if (rc == IDNA_MALLOC_ERROR) if (rc == IDNA_MALLOC_ERROR)
result = -EAI_MEMORY; result = -EAI_MEMORY;
else if (rc == IDNA_DLOPEN_ERROR) else if (rc == IDNA_DLOPEN_ERROR)
@@ -1217,17 +1154,11 @@ gaih_inet (const char *name, const struct gaih_service *service, @@ -1217,17 +1154,11 @@ gaih_inet (const char *name, const struct gaih_service *service,
canon = strdup (canon); canon = strdup (canon);
if (canon == NULL) if (canon == NULL)
{ {
- if (malloc_tmpbuf2) - if (malloc_tmpbuf2)
- free (tmpbuf2); - free (tmpbuf2);
- -
result = -EAI_MEMORY; result = -EAI_MEMORY;
goto free_and_return; goto free_and_return;
} }
} }
} }
- -
- if (malloc_tmpbuf2) - if (malloc_tmpbuf2)
- free (tmpbuf2); - free (tmpbuf2);
} }
family = at2->family; family = at2->family;

2
SOURCES/glibc-fedora-getrlimit-PLT.patch

@ -11,7 +11,7 @@ Date: Sat Dec 6 23:40:48 2014 +0000
@@ -14,5 +14,6 @@ extern int __getrusage (enum __rusage_who __who, struct rusage *__usage) @@ -14,5 +14,6 @@ extern int __getrusage (enum __rusage_who __who, struct rusage *__usage)
extern int __setrlimit (enum __rlimit_resource __resource, extern int __setrlimit (enum __rlimit_resource __resource,
const struct rlimit *__rlimits); const struct rlimit *__rlimits);
+libc_hidden_proto (__getrlimit) +libc_hidden_proto (__getrlimit)
#endif #endif
#endif #endif

2
SOURCES/glibc-fedora-ldd.patch

@ -28,7 +28,7 @@ Date: Wed Aug 16 15:59:55 2017 +0200
# This can be a non-ELF binary or no binary at all. # This can be a non-ELF binary or no binary at all.
nonelf "$file" || { nonelf "$file" || {
@@ -185,7 +173,7 @@ warning: you do not have execution permission for" "\`$file'" >&2 @@ -185,7 +173,7 @@ warning: you do not have execution permission for" "\`$file'" >&2
result=1 result=1
} }
;; ;;
- 2) - 2)

2
SOURCES/glibc-fedora-linux-tcsetattr.patch

@ -11,7 +11,7 @@ diff -Nru glibc-2.17-c758a686/sysdeps/unix/sysv/linux/tcsetattr.c glibc-2.17-c75
{ {
@@ -79,6 +80,35 @@ tcsetattr (fd, optional_actions, termios @@ -79,6 +80,35 @@ tcsetattr (fd, optional_actions, termios
memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0], memcpy (&k_termios.c_cc[0], &termios_p->c_cc[0],
__KERNEL_NCCS * sizeof (cc_t)); __KERNEL_NCCS * sizeof (cc_t));
- return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios); - return INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);
+ retval = INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios); + retval = INLINE_SYSCALL (ioctl, 3, fd, cmd, &k_termios);

12
SOURCES/glibc-fedora-localedef.patch

@ -2,10 +2,10 @@ diff -Nru glibc-2.17-c758a686/localedata/Makefile glibc-2.17-c758a686/localedata
--- glibc-2.17-c758a686/localedata/Makefile 2012-06-05 07:42:49.000000000 -0600 --- glibc-2.17-c758a686/localedata/Makefile 2012-06-05 07:42:49.000000000 -0600
+++ glibc-2.17-c758a686/localedata/Makefile 2012-06-07 12:15:21.776318827 -0600 +++ glibc-2.17-c758a686/localedata/Makefile 2012-06-07 12:15:21.776318827 -0600
@@ -211,6 +211,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-lo @@ -211,6 +211,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-lo
echo -n '...'; \ echo -n '...'; \
input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \ input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
$(LOCALEDEF) --alias-file=../intl/locale.alias \ $(LOCALEDEF) --alias-file=../intl/locale.alias \
+ --no-archive \ + --no-archive \
-i locales/$$input -c -f charmaps/$$charset \ -i locales/$$input -c -f charmaps/$$charset \
$(addprefix --prefix=,$(install_root)) $$locale; \ $(addprefix --prefix=,$(install_root)) $$locale; \
echo ' done'; \ echo ' done'; \

12
SOURCES/glibc-fedora-locarchive.patch

@ -5,8 +5,8 @@ diff -Nru glibc-2.17-c758a686/ChangeLog.17 glibc-2.17-c758a686/ChangeLog.17
--- glibc-2.17-c758a686/ChangeLog.17 2012-06-05 07:42:49.000000000 -0600 --- glibc-2.17-c758a686/ChangeLog.17 2012-06-05 07:42:49.000000000 -0600
+++ glibc-2.17-c758a686/ChangeLog.17 2012-06-07 12:15:21.564319619 -0600 +++ glibc-2.17-c758a686/ChangeLog.17 2012-06-07 12:15:21.564319619 -0600
@@ -11818,6 +11829,10 @@ d2009-10-30 Ulrich Drepper <drepper@re @@ -11818,6 +11829,10 @@ d2009-10-30 Ulrich Drepper <drepper@re
[BZ #4368] [BZ #4368]
* stdlib/stdlib.h: Remove obsolete part of comment for realpath. * stdlib/stdlib.h: Remove obsolete part of comment for realpath.


+2007-04-16 Jakub Jelinek <jakub@redhat.com> +2007-04-16 Jakub Jelinek <jakub@redhat.com>
+ +
@ -14,14 +14,14 @@ diff -Nru glibc-2.17-c758a686/ChangeLog.17 glibc-2.17-c758a686/ChangeLog.17
+ +
2007-04-16 Ulrich Drepper <drepper@redhat.com> 2007-04-16 Ulrich Drepper <drepper@redhat.com>
[BZ #4364] [BZ #4364]
diff -Nru glibc-2.17-c758a686/locale/programs/locarchive.c glibc-2.17-c758a686/locale/programs/locarchive.c diff -Nru glibc-2.17-c758a686/locale/programs/locarchive.c glibc-2.17-c758a686/locale/programs/locarchive.c
--- glibc-2.17-c758a686/locale/programs/locarchive.c 2012-06-05 07:42:49.000000000 -0600 --- glibc-2.17-c758a686/locale/programs/locarchive.c 2012-06-05 07:42:49.000000000 -0600
+++ glibc-2.17-c758a686/locale/programs/locarchive.c 2012-06-07 12:15:21.585319540 -0600 +++ glibc-2.17-c758a686/locale/programs/locarchive.c 2012-06-07 12:15:21.585319540 -0600
@@ -252,9 +252,9 @@ oldlocrecentcmp (const void *a, const vo @@ -252,9 +252,9 @@ oldlocrecentcmp (const void *a, const vo
/* forward decls for below */ /* forward decls for below */
static uint32_t add_locale (struct locarhandle *ah, const char *name, static uint32_t add_locale (struct locarhandle *ah, const char *name,
locale_data_t data, bool replace); locale_data_t data, bool replace);
-static void add_alias (struct locarhandle *ah, const char *alias, -static void add_alias (struct locarhandle *ah, const char *alias,
- bool replace, const char *oldname, - bool replace, const char *oldname,
- uint32_t *locrec_offset_p); - uint32_t *locrec_offset_p);
@ -38,7 +38,7 @@ diff -Nru glibc-2.17-c758a686/locale/programs/locarchive.c glibc-2.17-c758a686/l
-static struct namehashent * -static struct namehashent *
+struct namehashent * +struct namehashent *
insert_name (struct locarhandle *ah, insert_name (struct locarhandle *ah,
const char *name, size_t name_len, bool replace) const char *name, size_t name_len, bool replace)
{ {
@@ -693,7 +693,7 @@ insert_name (struct locarhandle *ah, @@ -693,7 +693,7 @@ insert_name (struct locarhandle *ah,
return &namehashtab[idx]; return &namehashtab[idx];
@ -47,5 +47,5 @@ diff -Nru glibc-2.17-c758a686/locale/programs/locarchive.c glibc-2.17-c758a686/l
-static void -static void
+void +void
add_alias (struct locarhandle *ah, const char *alias, bool replace, add_alias (struct locarhandle *ah, const char *alias, bool replace,
const char *oldname, uint32_t *locrec_offset_p) const char *oldname, uint32_t *locrec_offset_p)
{ {

2
SOURCES/glibc-fedora-nptl-linklibc.patch

@ -3,7 +3,7 @@ diff -Nru glibc-2.17-c758a686/nptl/Makefile glibc-2.17-c758a686/nptl/Makefile
+++ glibc-2.17-c758a686/nptl/Makefile 2012-06-07 12:15:21.816318678 -0600 +++ glibc-2.17-c758a686/nptl/Makefile 2012-06-07 12:15:21.816318678 -0600
@@ -529,15 +529,19 @@ $(addprefix $(objpfx), \ @@ -529,15 +529,19 @@ $(addprefix $(objpfx), \
$(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \ $(tests) $(xtests) $(test-srcs))): $(objpfx)libpthread.so \
$(objpfx)libpthread_nonshared.a $(objpfx)libpthread_nonshared.a
$(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so $(objpfx)tst-unload: $(common-objpfx)dlfcn/libdl.so
-# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so, -# $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
+# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so, +# $(objpfx)linklibc.so is used instead of $(common-objpfx)libc.so,

2
SOURCES/glibc-fedora-nscd.patch

@ -8,5 +8,5 @@ diff -Nru glibc-2.17-c758a686/nscd/nscd.conf glibc-2.17-c758a686/nscd/nscd.conf
-# server-user nobody -# server-user nobody
+ server-user nscd + server-user nscd
# stat-user somebody # stat-user somebody
debug-level 0 debug-level 0
# reload-count 5 # reload-count 5

48
SOURCES/glibc-fedora-regcomp-sw11561.patch

@ -90,25 +90,25 @@ elements compare against the byte sequence of it, not its name.
+ lookup_collation_sequence_value (bracket_elem_t *br_elem) + lookup_collation_sequence_value (bracket_elem_t *br_elem)
{ {
if (br_elem->type == SB_CHAR) if (br_elem->type == SB_CHAR)
{ {
@@ -2843,7 +2831,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, @@ -2843,7 +2831,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
int32_t elem, idx; int32_t elem, idx;
elem = seek_collating_symbol_entry (br_elem->opr.name, elem = seek_collating_symbol_entry (br_elem->opr.name,
sym_name_len); sym_name_len);
- if (symb_table[2 * elem] != 0) - if (symb_table[2 * elem] != 0)
+ if (elem != -1) + if (elem != -1)
{ {
/* We found the entry. */ /* We found the entry. */
idx = symb_table[2 * elem + 1]; idx = symb_table[2 * elem + 1];
@@ -2861,7 +2849,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, @@ -2861,7 +2849,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
/* Return the collation sequence value. */ /* Return the collation sequence value. */
return *(unsigned int *) (extra + idx); return *(unsigned int *) (extra + idx);
} }
- else if (symb_table[2 * elem] == 0 && sym_name_len == 1) - else if (symb_table[2 * elem] == 0 && sym_name_len == 1)
+ else if (sym_name_len == 1) + else if (sym_name_len == 1)
{ {
/* No valid character. Match it as a single byte /* No valid character. Match it as a single byte
character. */ character. */
@@ -2883,11 +2871,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token, @@ -2883,11 +2871,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
auto inline reg_errcode_t auto inline reg_errcode_t
@ -138,18 +138,18 @@ elements compare against the byte sequence of it, not its name.
int32_t elem, idx; int32_t elem, idx;
size_t name_len = strlen ((const char *) name); size_t name_len = strlen ((const char *) name);
if (nrules != 0) if (nrules != 0)
{ {
elem = seek_collating_symbol_entry (name, name_len); elem = seek_collating_symbol_entry (name, name_len);
- if (symb_table[2 * elem] != 0) - if (symb_table[2 * elem] != 0)
+ if (elem != -1) + if (elem != -1)
{ {
/* We found the entry. */ /* We found the entry. */
idx = symb_table[2 * elem + 1]; idx = symb_table[2 * elem + 1];
/* Skip the name of collating element name. */ /* Skip the name of collating element name. */
idx += 1 + extra[idx]; idx += 1 + extra[idx];
} }
- else if (symb_table[2 * elem] == 0 && name_len == 1) - else if (symb_table[2 * elem] == 0 && name_len == 1)
+ else if (name_len == 1) + else if (name_len == 1)
{ {
/* No valid character, treat it as a normal /* No valid character, treat it as a normal
character. */ character. */

28
SOURCES/glibc-manual-update.patch

@ -6558,26 +6558,26 @@ diff -urN glibc-2.17-c758a686/manual/Makefile glibc-2.17-c758a686/manual/Makefil
pdf: $(objpfx)libc.pdf pdf: $(objpfx)libc.pdf
@@ -42,8 +37,8 @@ @@ -42,8 +37,8 @@
intro errno memory ctype string charset locale \ intro errno memory ctype string charset locale \
message search pattern io stdio llio filesys \ message search pattern io stdio llio filesys \
pipe socket terminal syslog math arith time \ pipe socket terminal syslog math arith time \
- resource setjmp signal startup process job nss \ - resource setjmp signal startup process job nss \
- users sysinfo conf crypt debug probes) - users sysinfo conf crypt debug probes)
+ resource setjmp signal startup process ipc job \ + resource setjmp signal startup process ipc job \
+ nss users sysinfo conf crypt debug threads probes) + nss users sysinfo conf crypt debug threads probes)
add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi)) add-chapters = $(wildcard $(foreach d, $(add-ons), ../$d/$d.texi))
appendices = lang.texi header.texi install.texi maint.texi platform.texi \ appendices = lang.texi header.texi install.texi maint.texi platform.texi \
contrib.texi contrib.texi
@@ -89,6 +84,7 @@ @@ -89,6 +84,7 @@
$(objpfx)summary.texi: $(objpfx)stamp-summary ; $(objpfx)summary.texi: $(objpfx)stamp-summary ;
$(objpfx)stamp-summary: summary.awk $(filter-out $(objpfx)summary.texi, \ $(objpfx)stamp-summary: summary.awk $(filter-out $(objpfx)summary.texi, \
$(texis-path)) $(texis-path))
+ -$(SHELL) ./check-safety.sh $(filter-out $(objpfx)%, $(texis-path)) + -$(SHELL) ./check-safety.sh $(filter-out $(objpfx)%, $(texis-path))
$(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' \ $(AWK) -f $^ | sort -t' ' -df -k 1,1 | tr '\014' '\012' \
> $(objpfx)summary-tmp > $(objpfx)summary-tmp
$(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi $(move-if-change) $(objpfx)summary-tmp $(objpfx)summary.texi
@@ -145,8 +141,7 @@ @@ -145,8 +141,7 @@
mv -f $@.new $@ mv -f $@.new $@
$(objpfx)%.info: %.texinfo $(objpfx)%.info: %.texinfo
- LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=`basename $@` $< - LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=`basename $@` $<
@ -6585,15 +6585,15 @@ diff -urN glibc-2.17-c758a686/manual/Makefile glibc-2.17-c758a686/manual/Makefil
+ LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $< + LANGUAGE=C LC_ALL=C $(MAKEINFO) -P $(objpfx) --output=$@ $<
$(objpfx)%.dvi: %.texinfo $(objpfx)%.dvi: %.texinfo
cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \ cd $(objpfx);$(TEXI2DVI) -I $(shell cd $(<D) && pwd) --output=$@ \
@@ -159,19 +154,19 @@ @@ -159,19 +154,19 @@
# Distribution. # Distribution.
minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \ minimal-dist = summary.awk texis.awk tsort.awk libc-texinfo.sh libc.texinfo \
- libm-err.texi stamp-libm-err \ - libm-err.texi stamp-libm-err \
+ libm-err.texi stamp-libm-err check-safety.sh \ + libm-err.texi stamp-libm-err check-safety.sh \
$(filter-out summary.texi, $(nonexamples)) \ $(filter-out summary.texi, $(nonexamples)) \
$(patsubst %.c.texi,examples/%.c, $(examples)) $(patsubst %.c.texi,examples/%.c, $(examples))
indices = cp fn pg tp vr ky indices = cp fn pg tp vr ky
-generated-dirs := libc -generated-dirs := libc
@ -16662,8 +16662,8 @@ diff -urN glibc-2.17-c758a686/manual/texinfo.tex glibc-2.17-c758a686/manual/texi
% %
\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
@@ -6297,13 +6434,11 @@ @@ -6297,13 +6434,11 @@
% side, and for 6pt waste from % side, and for 6pt waste from
% each corner char, and rule thickness % each corner char, and rule thickness
\normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
- % Flag to tell @lisp, etc., not to narrow margin. - % Flag to tell @lisp, etc., not to narrow margin.
- \let\nonarrowing = t% - \let\nonarrowing = t%

14
SOURCES/glibc-ppc64le-01.patch

@ -13,8 +13,8 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules
--- glibc-2.17-c758a686/Makerules 2014-06-02 15:29:42.000000000 +0000 --- glibc-2.17-c758a686/Makerules 2014-06-02 15:29:42.000000000 +0000
+++ glibc-2.17-c758a686/Makerules 2014-06-02 15:25:21.000000000 +0000 +++ glibc-2.17-c758a686/Makerules 2014-06-02 15:25:21.000000000 +0000
@@ -1152,6 +1152,14 @@ @@ -1152,6 +1152,14 @@
LC_ALL=C $(OBJDUMP) --dynamic-syms $< > $@T LC_ALL=C $(OBJDUMP) --dynamic-syms $< > $@T
mv -f $@T $@ mv -f $@T $@
+# A sysdeps/.../Makefile can set abilist-pattern to something like +# A sysdeps/.../Makefile can set abilist-pattern to something like
+# %-foo.abilist to look for libc-foo.abilist instead of libc.abilist. +# %-foo.abilist to look for libc-foo.abilist instead of libc.abilist.
@ -39,14 +39,14 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules
+ $(check-abi-pattern) + $(check-abi-pattern)
+endif +endif
check-abi-%: $(common-objpfx)config.make %.abilist $(objpfx)%.symlist check-abi-%: $(common-objpfx)config.make %.abilist $(objpfx)%.symlist
$(check-abi) $(check-abi)
check-abi-%: $(common-objpfx)config.make %.abilist $(common-objpfx)%.symlist check-abi-%: $(common-objpfx)config.make %.abilist $(common-objpfx)%.symlist
$(check-abi) $(check-abi)
+define check-abi-pattern +define check-abi-pattern
+ diff -p -U 0 $(filter $(abilist-pattern),$^) $(filter %.symlist,$^) + diff -p -U 0 $(filter $(abilist-pattern),$^) $(filter %.symlist,$^)
+endef +endef
define check-abi define check-abi
diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^) diff -p -U 0 $(filter %.abilist,$^) $(filter %.symlist,$^)
endef endef
+ifdef abilist-pattern +ifdef abilist-pattern
@ -56,9 +56,9 @@ diff -urN glibc-2.17-c758a686/Makerules glibc-2.17-c758a686/Makerules
+ $(update-abi-pattern) + $(update-abi-pattern)
+endif +endif
update-abi-%: $(objpfx)%.symlist %.abilist update-abi-%: $(objpfx)%.symlist %.abilist
$(update-abi) $(update-abi)
update-abi-%: $(common-objpfx)%.symlist %.abilist update-abi-%: $(common-objpfx)%.symlist %.abilist
$(update-abi) $(update-abi)
+define update-abi-pattern +define update-abi-pattern
+@if cmp -s $^ 2> /dev/null; \ +@if cmp -s $^ 2> /dev/null; \
+ then \ + then \

376
SOURCES/glibc-ppc64le-03.patch

@ -92,35 +92,35 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -859,21 +874,21 @@ @@ -859,21 +874,21 @@
exit ;; exit ;;
*:GNU:*:*) *:GNU:*:*)
# the GNU system # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;; exit ;;
*:GNU/*:*:*) *:GNU/*:*:*)
# other systems with GNU libc and userland # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;; exit ;;
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
exit ;; exit ;;
aarch64:Linux:*:*) aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
aarch64_be:Linux:*:*) aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
alpha:Linux:*:*) alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -886,59 +901,54 @@ @@ -886,59 +901,54 @@
EV68*) UNAME_MACHINE=alphaev68 ;; EV68*) UNAME_MACHINE=alphaev68 ;;
esac esac
objdump --private-headers /bin/sh | grep -q ld.so.1 objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
@ -128,46 +128,46 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c
+ exit ;; + exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*) + arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
arm*:Linux:*:*) arm*:Linux:*:*)
eval $set_cc_for_build eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__ | grep -q __ARM_EABI__
then then
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP | grep -q __ARM_PCS_VFP
then then
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi - echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi fi
fi fi
exit ;; exit ;;
avr32*:Linux:*:*) avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
cris:Linux:*:*) cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu - echo ${UNAME_MACHINE}-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;; exit ;;
crisv32:Linux:*:*) crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu - echo ${UNAME_MACHINE}-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;; exit ;;
frv:Linux:*:*) frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
hexagon:Linux:*:*) hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
i*86:Linux:*:*) i*86:Linux:*:*)
- LIBC=gnu - LIBC=gnu
- eval $set_cc_for_build - eval $set_cc_for_build
@ -179,58 +179,58 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;; exit ;;
ia64:Linux:*:*) ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
m32r*:Linux:*:*) m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
m68*:Linux:*:*) m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
mips:Linux:*:* | mips64:Linux:*:*) mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build eval $set_cc_for_build
@@ -957,54 +967,63 @@ @@ -957,54 +967,63 @@
#endif #endif
EOF EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;; ;;
+ or1k:Linux:*:*) + or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;; + exit ;;
or32:Linux:*:*) or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
padre:Linux:*:*) padre:Linux:*:*)
- echo sparc-unknown-linux-gnu - echo sparc-unknown-linux-gnu
+ echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-${LIBC}
exit ;; exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*) parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu - echo hppa64-unknown-linux-gnu
+ echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-${LIBC}
exit ;; exit ;;
parisc:Linux:*:* | hppa:Linux:*:*) parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level # Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;;
esac esac
exit ;; exit ;;
ppc64:Linux:*:*) ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu - echo powerpc64-unknown-linux-gnu
+ echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-${LIBC}
exit ;; exit ;;
ppc:Linux:*:*) ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu - echo powerpc-unknown-linux-gnu
+ echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-${LIBC}
@ -240,45 +240,45 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c
+ exit ;; + exit ;;
+ ppcle:Linux:*:*) + ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-${LIBC}
exit ;; exit ;;
s390:Linux:*:* | s390x:Linux:*:*) s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux - echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;; exit ;;
sh64*:Linux:*:*) sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
sh*:Linux:*:*) sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*) sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
tile*:Linux:*:*) tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
vax:Linux:*:*) vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu - echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;; exit ;;
x86_64:Linux:*:*) x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
xtensa*:Linux:*:*) xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu - echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
i*86:DYNIX/ptx:4*:*) i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1237,19 +1256,31 @@ @@ -1237,19 +1256,31 @@
exit ;; exit ;;
*:Darwin:*:*) *:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in - case $UNAME_PROCESSOR in
- i386) - i386)
- eval $set_cc_for_build - eval $set_cc_for_build
@ -317,8 +317,8 @@ diff -urN glibc-2.17-c758a686/scripts/config.guess glibc-2.17-c758a686/scripts/c
+ # that Apple uses in portable devices. + # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64 + UNAME_PROCESSOR=x86_64
+ fi + fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;; exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*) *:procnto*:*:* | *:QNX:[0123456789]*:*)
diff -urN glibc-2.17-c758a686/scripts/config.sub glibc-2.17-c758a686/scripts/config.sub diff -urN glibc-2.17-c758a686/scripts/config.sub glibc-2.17-c758a686/scripts/config.sub
--- glibc-2.17-c758a686/scripts/config.sub 2014-05-26 15:59:45.000000000 -0500 --- glibc-2.17-c758a686/scripts/config.sub 2014-05-26 15:59:45.000000000 -0500
@ -387,197 +387,197 @@ diff -urN glibc-2.17-c758a686/scripts/config.sub glibc-2.17-c758a686/scripts/con
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -156,7 +149,7 @@ @@ -156,7 +149,7 @@
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze) - -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*) + -apple | -axis | -knuth | -cray | -microblaze*)
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
@@ -259,10 +252,12 @@ @@ -259,10 +252,12 @@
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \ | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | be32 | be64 \ - | be32 | be64 \
+ | arc | arceb \ + | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \ + | avr | avr32 \
+ | be32 | be64 \ + | be32 | be64 \
| bfin \ | bfin \
- | c4x | clipper \ - | c4x | clipper \
+ | c4x | c8051 | clipper \ + | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \ | d10v | d30v | dlx | dsp16xx \
| epiphany \ | epiphany \
| fido | fr30 | frv \ | fido | fr30 | frv \
@@ -270,10 +265,11 @@ @@ -270,10 +265,11 @@
| hexagon \ | hexagon \
| i370 | i860 | i960 | ia64 \ | i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \ | ip2k | iq2000 \
+ | k1om \ + | k1om \
| le32 | le64 \ | le32 | le64 \
| lm32 \ | lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \ | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \ - | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \ | mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \ | mips16 \
| mips64 | mips64el \ | mips64 | mips64el \
@@ -291,16 +287,17 @@ @@ -291,16 +287,17 @@
| mipsisa64r2 | mipsisa64r2el \ | mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \ + | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \ | mipstx39 | mipstx39el \
| mn10200 | mn10300 \ | mn10200 | mn10300 \
| moxie \ | moxie \
| mt \ | mt \
| msp430 \ | msp430 \
| nds32 | nds32le | nds32be \ | nds32 | nds32le | nds32be \
- | nios | nios2 \ - | nios | nios2 \
+ | nios | nios2 | nios2eb | nios2el \ + | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 \ | open8 \
- | or32 \ - | or32 \
+ | or1k | or32 \ + | or1k | or32 \
| pdp10 | pdp11 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \ | pyramid \
@@ -328,7 +325,7 @@ @@ -328,7 +325,7 @@
c6x) c6x)
basic_machine=tic6x-unknown basic_machine=tic6x-unknown
;; ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
;; ;;
@@ -370,13 +367,13 @@ @@ -370,13 +367,13 @@
| aarch64-* | aarch64_be-* \ | aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \ | avr-* | avr32-* \
| be32-* | be64-* \ | be32-* | be64-* \
| bfin-* | bs2000-* \ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \ - | clipper-* | craynv-* | cydra-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \ | d10v-* | d30v-* | dlx-* \
| elxsi-* \ | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -385,11 +382,13 @@ @@ -385,11 +382,13 @@
| hexagon-* \ | hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \ | i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \ | ip2k-* | iq2000-* \
+ | k1om-* \ + | k1om-* \
| le32-* | le64-* \ | le32-* | le64-* \
| lm32-* \ | lm32-* \
| m32c-* | m32r-* | m32rle-* \ | m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \ + | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \ | mips16-* \
| mips64-* | mips64el-* \ | mips64-* | mips64el-* \
@@ -407,12 +406,13 @@ @@ -407,12 +406,13 @@
| mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \ + | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \ | mipstx39-* | mipstx39el-* \
| mmix-* \ | mmix-* \
| mt-* \ | mt-* \
| msp430-* \ | msp430-* \
| nds32-* | nds32le-* | nds32be-* \ | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \ - | nios-* | nios2-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \ | none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \ | open8-* \
| orion-* \ | orion-* \
@@ -788,7 +788,7 @@ @@ -788,7 +788,7 @@
basic_machine=ns32k-utek basic_machine=ns32k-utek
os=-sysv os=-sysv
;; ;;
- microblaze) - microblaze)
+ microblaze*) + microblaze*)
basic_machine=microblaze-xilinx basic_machine=microblaze-xilinx
;; ;;
mingw64) mingw64)
@@ -796,7 +796,7 @@ @@ -796,7 +796,7 @@
os=-mingw64 os=-mingw64
;; ;;
mingw32) mingw32)
- basic_machine=i386-pc - basic_machine=i386-pc
+ basic_machine=i686-pc + basic_machine=i686-pc
os=-mingw32 os=-mingw32
;; ;;
mingw32ce) mingw32ce)
@@ -832,7 +832,7 @@ @@ -832,7 +832,7 @@
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;; ;;
msys) msys)
- basic_machine=i386-pc - basic_machine=i386-pc
+ basic_machine=i686-pc + basic_machine=i686-pc
os=-msys os=-msys
;; ;;
mvs) mvs)
@@ -1023,7 +1023,11 @@ @@ -1023,7 +1023,11 @@
basic_machine=i586-unknown basic_machine=i586-unknown
os=-pw32 os=-pw32
;; ;;
- rdos) - rdos)
+ rdos | rdos64) + rdos | rdos64)
+ basic_machine=x86_64-pc + basic_machine=x86_64-pc
+ os=-rdos + os=-rdos
+ ;; + ;;
+ rdos32) + rdos32)
basic_machine=i386-pc basic_machine=i386-pc
os=-rdos os=-rdos
;; ;;
@@ -1350,7 +1354,7 @@ @@ -1350,7 +1354,7 @@
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \ - | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \ + | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \ | -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1496,9 +1500,6 @@ @@ -1496,9 +1500,6 @@
-aros*) -aros*)
os=-aros os=-aros
;; ;;
- -kaos*) - -kaos*)
- os=-kaos - os=-kaos
- ;; - ;;
-zvmoe) -zvmoe)
os=-zvmoe os=-zvmoe
;; ;;
@@ -1547,6 +1548,9 @@ @@ -1547,6 +1548,9 @@
c4x-* | tic4x-*) c4x-* | tic4x-*)
os=-coff os=-coff
;; ;;
+ c8051-*) + c8051-*)
+ os=-elf + os=-elf
+ ;; + ;;
hexagon-*) hexagon-*)
os=-elf os=-elf
;; ;;
@@ -1590,6 +1594,9 @@ @@ -1590,6 +1594,9 @@
mips*-*) mips*-*)
os=-elf os=-elf
;; ;;
+ or1k-*) + or1k-*)
+ os=-elf + os=-elf
+ ;; + ;;
or32-*) or32-*)
os=-coff os=-coff
;; ;;
diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/install-sh diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/install-sh
--- glibc-2.17-c758a686/scripts/install-sh 2014-05-26 15:59:45.000000000 -0500 --- glibc-2.17-c758a686/scripts/install-sh 2014-05-26 15:59:45.000000000 -0500
+++ glibc-2.17-c758a686/scripts/install-sh 2014-05-26 16:00:34.000000000 -0500 +++ glibc-2.17-c758a686/scripts/install-sh 2014-05-26 16:00:34.000000000 -0500
@ -1098,11 +1098,11 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins
+ # Otherwise, rely on $mkdir_umask. + # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then + if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode + mkdir_mode=-m$mode
else else
- dstfile=`basename $dst $transformbasename | - dstfile=`basename $dst $transformbasename |
- sed $transformarg`$transformbasename - sed $transformarg`$transformbasename
+ mkdir_mode= + mkdir_mode=
fi fi
-# don't allow the sed command to completely eliminate the filename -# don't allow the sed command to completely eliminate the filename
+ posix_mkdir=false + posix_mkdir=false
@ -1185,7 +1185,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins
+ prefix=$prefix$d + prefix=$prefix$d
+ if test -d "$prefix"; then + if test -d "$prefix"; then
+ prefixes= + prefixes=
else else
- true - true
+ if $posix_mkdir; then + if $posix_mkdir; then
+ (umask=$mkdir_umask && + (umask=$mkdir_umask &&
@ -1199,7 +1199,7 @@ diff -urN glibc-2.17-c758a686/scripts/install-sh glibc-2.17-c758a686/scripts/ins
+ esac + esac
+ prefixes="$prefixes '$qprefix'" + prefixes="$prefixes '$qprefix'"
+ fi + fi
fi fi
+ prefix=$prefix/ + prefix=$prefix/
+ done + done

224
SOURCES/glibc-ppc64le-04.patch

@ -57,8 +57,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7
- ex2_u.ieee.exponent += n_i >> unsafe; - ex2_u.ieee.exponent += n_i >> unsafe;
+ ex2_u.d[0].ieee.exponent += n_i >> unsafe; + ex2_u.d[0].ieee.exponent += n_i >> unsafe;
/* Fortunately, there are no subnormal lowpart doubles in /* Fortunately, there are no subnormal lowpart doubles in
__expl_table, only normal values and zeros. __expl_table, only normal values and zeros.
But after scaling it can be subnormal. */ But after scaling it can be subnormal. */
- exponent2 = ex2_u.ieee.exponent2 + (n_i >> unsafe); - exponent2 = ex2_u.ieee.exponent2 + (n_i >> unsafe);
- if (ex2_u.ieee.exponent2 == 0) - if (ex2_u.ieee.exponent2 == 0)
- /* assert ((ex2_u.ieee.mantissa2|ex2_u.ieee.mantissa3) == 0) */; - /* assert ((ex2_u.ieee.mantissa2|ex2_u.ieee.mantissa3) == 0) */;
@ -69,26 +69,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7
- ex2_u.ieee.exponent2 = exponent2; - ex2_u.ieee.exponent2 = exponent2;
+ ex2_u.d[1].ieee.exponent = exponent2; + ex2_u.d[1].ieee.exponent = exponent2;
else if (exponent2 <= -54) else if (exponent2 <= -54)
{ {
- ex2_u.ieee.exponent2 = 0; - ex2_u.ieee.exponent2 = 0;
- ex2_u.ieee.mantissa2 = 0; - ex2_u.ieee.mantissa2 = 0;
- ex2_u.ieee.mantissa3 = 0; - ex2_u.ieee.mantissa3 = 0;
+ ex2_u.d[1].ieee.exponent = 0; + ex2_u.d[1].ieee.exponent = 0;
+ ex2_u.d[1].ieee.mantissa0 = 0; + ex2_u.d[1].ieee.mantissa0 = 0;
+ ex2_u.d[1].ieee.mantissa1 = 0; + ex2_u.d[1].ieee.mantissa1 = 0;
} }
else else
{ {
static const double static const double
two54 = 1.80143985094819840000e+16, /* 4350000000000000 */ two54 = 1.80143985094819840000e+16, /* 4350000000000000 */
twom54 = 5.55111512312578270212e-17; /* 3C90000000000000 */ twom54 = 5.55111512312578270212e-17; /* 3C90000000000000 */
- ex2_u.dd[1] *= two54; - ex2_u.dd[1] *= two54;
- ex2_u.ieee.exponent2 += n_i >> unsafe; - ex2_u.ieee.exponent2 += n_i >> unsafe;
- ex2_u.dd[1] *= twom54; - ex2_u.dd[1] *= twom54;
+ ex2_u.d[1].d *= two54; + ex2_u.d[1].d *= two54;
+ ex2_u.d[1].ieee.exponent += n_i >> unsafe; + ex2_u.d[1].ieee.exponent += n_i >> unsafe;
+ ex2_u.d[1].d *= twom54; + ex2_u.d[1].d *= twom54;
} }
/* Compute scale = 2^n_1. */ /* Compute scale = 2^n_1. */
- scale_u.d = 1.0L; - scale_u.d = 1.0L;
@ -97,7 +97,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7
+ scale_u.d[0].ieee.exponent += n_i - (n_i >> unsafe); + scale_u.d[0].ieee.exponent += n_i - (n_i >> unsafe);
/* Approximate e^x2 - 1, using a seventh-degree polynomial, /* Approximate e^x2 - 1, using a seventh-degree polynomial,
with maximum error in [-2^-16-2^-53,2^-16+2^-53] with maximum error in [-2^-16-2^-53,2^-16+2^-53]
@@ -204,7 +204,7 @@ @@ -204,7 +204,7 @@
/* Return result. */ /* Return result. */
fesetenv (&oldenv); fesetenv (&oldenv);
@ -106,10 +106,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_expl.c glibc-2.17-c7
+ result = x22 * ex2_u.ld + ex2_u.ld; + result = x22 * ex2_u.ld + ex2_u.ld;
/* Now we can test whether the result is ultimate or if we are unsure. /* Now we can test whether the result is ultimate or if we are unsure.
In the later case we should probably call a mpn based routine to give In the later case we should probably call a mpn based routine to give
@@ -238,7 +238,7 @@ @@ -238,7 +238,7 @@
if (!unsafe) if (!unsafe)
return result; return result;
else else
- return result * scale_u.d; - return result * scale_u.d;
+ return result * scale_u.ld; + return result * scale_u.ld;
@ -179,11 +179,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17-
lo |= 1LL << 52; lo |= 1LL << 52;
/* The lower double is normalized separately from the upper. We may /* The lower double is normalized separately from the upper. We may
need to adjust the lower manitissa to reflect this. */ need to adjust the lower manitissa to reflect this. */
- ediff = u.ieee.exponent - u.ieee.exponent2; - ediff = u.ieee.exponent - u.ieee.exponent2;
+ ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent;
if (ediff > 53) if (ediff > 53)
lo = lo >> (ediff-53); lo = lo >> (ediff-53);
} }
@@ -59,8 +59,8 @@ @@ -59,8 +59,8 @@
difference between the long double and the rounded high double difference between the long double and the rounded high double
@ -198,13 +198,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17-
if (hi == 0LL) if (hi == 0LL)
@@ -92,7 +92,7 @@ @@ -92,7 +92,7 @@
#define NUM_LEADING_ZEROS (BITS_PER_MP_LIMB \ #define NUM_LEADING_ZEROS (BITS_PER_MP_LIMB \
- (LDBL_MANT_DIG - ((N - 1) * BITS_PER_MP_LIMB))) - (LDBL_MANT_DIG - ((N - 1) * BITS_PER_MP_LIMB)))
- if (u.ieee.exponent == 0) - if (u.ieee.exponent == 0)
+ if (u.d[0].ieee.exponent == 0) + if (u.d[0].ieee.exponent == 0)
{ {
/* A biased exponent of zero is a special case. /* A biased exponent of zero is a special case.
Either it is a zero or it is a denormal number. */ Either it is a zero or it is a denormal number. */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-26 21:08:01.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-26 21:08:01.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-26 21:08:10.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-26 21:08:10.000000000 -0500
@ -231,11 +231,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
lo |= (1ULL << 52); lo |= (1ULL << 52);
lo = lo << 7; /* pre-shift lo to match ieee854. */ lo = lo << 7; /* pre-shift lo to match ieee854. */
/* The lower double is normalized separately from the upper. We /* The lower double is normalized separately from the upper. We
may need to adjust the lower manitissa to reflect this. */ may need to adjust the lower manitissa to reflect this. */
- ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2; - ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2;
+ ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent;
if (ediff > 53) if (ediff > 53)
lo = lo >> (ediff-53); lo = lo >> (ediff-53);
hi |= (1ULL << 52); hi |= (1ULL << 52);
} }
@ -263,34 +263,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
lo = (lo64 >> 7)& ((1ULL << 53) - 1); lo = (lo64 >> 7)& ((1ULL << 53) - 1);
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
if (hidden2) if (hidden2)
{ {
hi++; hi++;
- u.ieee.negative2 = !sign; - u.ieee.negative2 = !sign;
+ u.d[1].ieee.negative = !sign; + u.d[1].ieee.negative = !sign;
lo = (1ULL << 53) - lo; lo = (1ULL << 53) - lo;
} }
/* The hidden bit of the lo mantissa is zero so we need to /* The hidden bit of the lo mantissa is zero so we need to
@@ -94,32 +94,32 @@ @@ -94,32 +94,32 @@
lzcount = lzcount - 11; lzcount = lzcount - 11;
if (lzcount > 0) if (lzcount > 0)
{ {
- int expnt2 = u.ieee.exponent2 - lzcount; - int expnt2 = u.ieee.exponent2 - lzcount;
+ int expnt2 = u.d[1].ieee.exponent - lzcount; + int expnt2 = u.d[1].ieee.exponent - lzcount;
if (expnt2 >= 1) if (expnt2 >= 1)
{ {
/* Not denormal. Normalize and set low exponent. */ /* Not denormal. Normalize and set low exponent. */
lo = lo << lzcount; lo = lo << lzcount;
- u.ieee.exponent2 = expnt2; - u.ieee.exponent2 = expnt2;
+ u.d[1].ieee.exponent = expnt2; + u.d[1].ieee.exponent = expnt2;
} }
else else
{ {
/* Is denormal. */ /* Is denormal. */
lo = lo << (lzcount + expnt2); lo = lo << (lzcount + expnt2);
- u.ieee.exponent2 = 0; - u.ieee.exponent2 = 0;
+ u.d[1].ieee.exponent = 0; + u.d[1].ieee.exponent = 0;
} }
} }
} }
else else
{ {
@ -360,44 +360,44 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-
/* The low order 53 bits (52 + hidden) go into the lower double */ /* The low order 53 bits (52 + hidden) go into the lower double */
@@ -74,15 +74,15 @@ @@ -74,15 +74,15 @@
else else
lzcount = lzcount + 42; lzcount = lzcount + 42;
- if (lzcount > u.ieee.exponent) - if (lzcount > u.ieee.exponent)
+ if (lzcount > u.d[0].ieee.exponent) + if (lzcount > u.d[0].ieee.exponent)
{ {
- lzcount = u.ieee.exponent; - lzcount = u.ieee.exponent;
- u.ieee.exponent = 0; - u.ieee.exponent = 0;
+ lzcount = u.d[0].ieee.exponent; + lzcount = u.d[0].ieee.exponent;
+ u.d[0].ieee.exponent = 0; + u.d[0].ieee.exponent = 0;
exponent2 -= lzcount; exponent2 -= lzcount;
} }
else else
{ {
- u.ieee.exponent -= (lzcount - 1); - u.ieee.exponent -= (lzcount - 1);
+ u.d[0].ieee.exponent -= (lzcount - 1); + u.d[0].ieee.exponent -= (lzcount - 1);
exponent2 -= (lzcount - 1); exponent2 -= (lzcount - 1);
} }
@@ -112,9 +112,9 @@ @@ -112,9 +112,9 @@
{ {
if ((hi & (1LL << 53)) != 0) if ((hi & (1LL << 53)) != 0)
hi -= 1LL << 52; hi -= 1LL << 52;
- u.ieee.exponent++; - u.ieee.exponent++;
+ u.d[0].ieee.exponent++; + u.d[0].ieee.exponent++;
} }
- u.ieee.negative2 = !sign; - u.ieee.negative2 = !sign;
+ u.d[1].ieee.negative = !sign; + u.d[1].ieee.negative = !sign;
lo = (1LL << 53) - lo; lo = (1LL << 53) - lo;
} }
@@ -135,17 +135,17 @@ @@ -135,17 +135,17 @@
exponent2 = exponent2 - lzcount; exponent2 = exponent2 - lzcount;
} }
if (exponent2 > 0) if (exponent2 > 0)
- u.ieee.exponent2 = exponent2; - u.ieee.exponent2 = exponent2;
+ u.d[1].ieee.exponent = exponent2; + u.d[1].ieee.exponent = exponent2;
else else
lo >>= 1 - exponent2; lo >>= 1 - exponent2;
} }
else else
- u.ieee.negative2 = 0; - u.ieee.negative2 = 0;
@ -426,81 +426,81 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2
- eldbl.d = fpnum.ldbl.d; \ - eldbl.d = fpnum.ldbl.d; \
+ union ibm_extended_long_double u; \ + union ibm_extended_long_double u; \
+ u.ld = fpnum.ldbl.d; \ + u.ld = fpnum.ldbl.d; \
\ \
assert (sizeof (long double) == 16); \ assert (sizeof (long double) == 16); \
\ \
- lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3; \ - lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3; \
- hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1; \ - hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1; \
+ lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; \ + lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; \
+ hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; \ + hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; \
lo <<= 7; /* pre-shift lo to match ieee854. */ \ lo <<= 7; /* pre-shift lo to match ieee854. */ \
/* If the lower double is not a denomal or zero then set the hidden \ /* If the lower double is not a denomal or zero then set the hidden \
53rd bit. */ \ 53rd bit. */ \
- if (eldbl.ieee.exponent2 != 0) \ - if (eldbl.ieee.exponent2 != 0) \
+ if (u.d[1].ieee.exponent != 0) \ + if (u.d[1].ieee.exponent != 0) \
lo |= (1ULL << (52 + 7)); \ lo |= (1ULL << (52 + 7)); \
else \ else \
lo <<= 1; \ lo <<= 1; \
/* The lower double is normalized separately from the upper. We \ /* The lower double is normalized separately from the upper. We \
may need to adjust the lower manitissa to reflect this. */ \ may need to adjust the lower manitissa to reflect this. */ \
- ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2; \ - ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2; \
+ ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; \ + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; \
if (ediff > 53 + 63) \ if (ediff > 53 + 63) \
lo = 0; \ lo = 0; \
else if (ediff > 53) \ else if (ediff > 53) \
lo = lo >> (ediff - 53); \ lo = lo >> (ediff - 53); \
- else if (eldbl.ieee.exponent2 == 0 && ediff < 53) \ - else if (eldbl.ieee.exponent2 == 0 && ediff < 53) \
+ else if (u.d[1].ieee.exponent == 0 && ediff < 53) \ + else if (u.d[1].ieee.exponent == 0 && ediff < 53) \
lo = lo << (53 - ediff); \ lo = lo << (53 - ediff); \
- if (eldbl.ieee.negative != eldbl.ieee.negative2 \ - if (eldbl.ieee.negative != eldbl.ieee.negative2 \
- && (eldbl.ieee.exponent2 != 0 || lo != 0L)) \ - && (eldbl.ieee.exponent2 != 0 || lo != 0L)) \
+ if (u.d[0].ieee.negative != u.d[1].ieee.negative \ + if (u.d[0].ieee.negative != u.d[1].ieee.negative \
+ && (u.d[1].ieee.exponent != 0 || lo != 0L)) \ + && (u.d[1].ieee.exponent != 0 || lo != 0L)) \
{ \ { \
lo = (1ULL << 60) - lo; \ lo = (1ULL << 60) - lo; \
if (hi == 0L) \ if (hi == 0L) \
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
/* we have a borrow from the hidden bit, so shift left 1. */ \ /* we have a borrow from the hidden bit, so shift left 1. */ \
hi = 0xffffffffffffeLL | (lo >> 59); \ hi = 0xffffffffffffeLL | (lo >> 59); \
lo = 0xfffffffffffffffLL & (lo << 1); \ lo = 0xfffffffffffffffLL & (lo << 1); \
- eldbl.ieee.exponent--; \ - eldbl.ieee.exponent--; \
+ u.d[0].ieee.exponent--; \ + u.d[0].ieee.exponent--; \
} \ } \
else \ else \
hi--; \ hi--; \
@@ -110,9 +110,9 @@ @@ -110,9 +110,9 @@
*--wnumstr = L'0'; \ *--wnumstr = L'0'; \
} \ } \
\ \
- leading = eldbl.ieee.exponent == 0 ? '0' : '1'; \ - leading = eldbl.ieee.exponent == 0 ? '0' : '1'; \
+ leading = u.d[0].ieee.exponent == 0 ? '0' : '1'; \ + leading = u.d[0].ieee.exponent == 0 ? '0' : '1'; \
\ \
- exponent = eldbl.ieee.exponent; \ - exponent = eldbl.ieee.exponent; \
+ exponent = u.d[0].ieee.exponent; \ + exponent = u.d[0].ieee.exponent; \
\ \
if (exponent == 0) \ if (exponent == 0) \
{ \ { \
@@ -122,18 +122,18 @@ @@ -122,18 +122,18 @@
{ \ { \
/* This is a denormalized number. */ \ /* This is a denormalized number. */ \
expnegative = 1; \ expnegative = 1; \
- exponent = IBM_EXTENDED_LONG_DOUBLE_BIAS - 1; \ - exponent = IBM_EXTENDED_LONG_DOUBLE_BIAS - 1; \
+ exponent = IEEE754_DOUBLE_BIAS - 1; \ + exponent = IEEE754_DOUBLE_BIAS - 1; \
} \ } \
} \ } \
- else if (exponent >= IBM_EXTENDED_LONG_DOUBLE_BIAS) \ - else if (exponent >= IBM_EXTENDED_LONG_DOUBLE_BIAS) \
+ else if (exponent >= IEEE754_DOUBLE_BIAS) \ + else if (exponent >= IEEE754_DOUBLE_BIAS) \
{ \ { \
expnegative = 0; \ expnegative = 0; \
- exponent -= IBM_EXTENDED_LONG_DOUBLE_BIAS; \ - exponent -= IBM_EXTENDED_LONG_DOUBLE_BIAS; \
+ exponent -= IEEE754_DOUBLE_BIAS; \ + exponent -= IEEE754_DOUBLE_BIAS; \
} \ } \
else \ else \
{ \ { \
expnegative = 1; \ expnegative = 1; \
- exponent = -(exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS); \ - exponent = -(exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS); \
+ exponent = -(exponent - IEEE754_DOUBLE_BIAS); \ + exponent = -(exponent - IEEE754_DOUBLE_BIAS); \
} \ } \
} while (0) } while (0)
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c
@ -520,11 +520,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2
+ double high = u.d[0].d; + double high = u.d[0].d;
feholdexcept (&env); feholdexcept (&env);
if (high > 0.0) if (high > 0.0)
{ {
@@ -51,11 +51,11 @@ @@ -51,11 +51,11 @@
high += TWO52; high += TWO52;
if (high == 0.0) high = -0.0; if (high == 0.0) high = -0.0;
} }
- u.dd[0] = high; - u.dd[0] = high;
- u.dd[1] = 0.0; - u.dd[1] = 0.0;
+ u.d[0].d = high; + u.d[0].d = high;
@ -542,22 +542,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2
feholdexcept (&env); feholdexcept (&env);
- if (u.dd[0] > 0.0) - if (u.dd[0] > 0.0)
+ if (u.d[0].d > 0.0) + if (u.d[0].d > 0.0)
{ {
- if (u.dd[1] > 0.0) - if (u.dd[1] > 0.0)
+ if (u.d[1].d > 0.0) + if (u.d[1].d > 0.0)
{ {
/* If the high/low doubles are the same sign then simply /* If the high/low doubles are the same sign then simply
round the low double. */ round the low double. */
- high = u.dd[0]; - high = u.dd[0];
- low = u.dd[1]; - low = u.dd[1];
+ high = u.d[0].d; + high = u.d[0].d;
+ low = u.d[1].d; + low = u.d[1].d;
} }
- else if (u.dd[1] < 0.0) - else if (u.dd[1] < 0.0)
+ else if (u.d[1].d < 0.0) + else if (u.d[1].d < 0.0)
{ {
/* Else the high double is pre rounded and we need to /* Else the high double is pre rounded and we need to
adjust for that. */ adjust for that. */
- tau = __nextafter (u.dd[0], 0.0); - tau = __nextafter (u.dd[0], 0.0);
- tau = (u.dd[0] - tau) * 2.0; - tau = (u.dd[0] - tau) * 2.0;
@ -567,28 +567,28 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2
+ tau = (u.d[0].d - tau) * 2.0; + tau = (u.d[0].d - tau) * 2.0;
+ high = u.d[0].d - tau; + high = u.d[0].d - tau;
+ low = u.d[1].d + tau; + low = u.d[1].d + tau;
} }
low += TWO52; low += TWO52;
low -= TWO52; low -= TWO52;
} }
- else if (u.dd[0] < 0.0) - else if (u.dd[0] < 0.0)
+ else if (u.d[0].d < 0.0) + else if (u.d[0].d < 0.0)
{ {
- if (u.dd[1] < 0.0) - if (u.dd[1] < 0.0)
+ if (u.d[1].d < 0.0) + if (u.d[1].d < 0.0)
{ {
/* If the high/low doubles are the same sign then simply /* If the high/low doubles are the same sign then simply
round the low double. */ round the low double. */
- high = u.dd[0]; - high = u.dd[0];
- low = u.dd[1]; - low = u.dd[1];
+ high = u.d[0].d; + high = u.d[0].d;
+ low = u.d[1].d; + low = u.d[1].d;
} }
- else if (u.dd[1] > 0.0) - else if (u.dd[1] > 0.0)
+ else if (u.d[1].d > 0.0) + else if (u.d[1].d > 0.0)
{ {
/* Else the high double is pre rounded and we need to /* Else the high double is pre rounded and we need to
adjust for that. */ adjust for that. */
- tau = __nextafter (u.dd[0], 0.0); - tau = __nextafter (u.dd[0], 0.0);
- tau = (u.dd[0] - tau) * 2.0; - tau = (u.dd[0] - tau) * 2.0;
- high = u.dd[0] - tau; - high = u.dd[0] - tau;
@ -597,10 +597,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nearbyintl.c glibc-2
+ tau = (u.d[0].d - tau) * 2.0; + tau = (u.d[0].d - tau) * 2.0;
+ high = u.d[0].d - tau; + high = u.d[0].d - tau;
+ low = u.d[1].d + tau; + low = u.d[1].d + tau;
} }
low = TWO52 - low; low = TWO52 - low;
low = -(low - TWO52); low = -(low - TWO52);
} }
- u.dd[0] = high + low; - u.dd[0] = high + low;
- u.dd[1] = high - u.dd[0] + low; - u.dd[1] = high - u.dd[0] + low;
+ u.d[0].d = high + low; + u.d[0].d = high + low;

80
SOURCES/glibc-ppc64le-05.patch

@ -125,9 +125,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/ldbl2mpn.c glibc-2.17-
lo = (1ULL << 53) - lo; lo = (1ULL << 53) - lo;
- if (hi == 0LL) - if (hi == 0LL)
+ if (hi == 0) + if (hi == 0)
{ {
/* we have a borrow from the hidden bit, so shift left 1. */ /* we have a borrow from the hidden bit, so shift left 1. */
hi = 0x0ffffffffffffeLL | (lo >> 51); hi = 0x0ffffffffffffeLL | (lo >> 51);
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 19:13:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 19:13:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 19:51:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h 2014-05-27 19:51:13.000000000 -0500
@ -192,7 +192,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
+ double is denormal ie. has an exponent of zero). */ + double is denormal ie. has an exponent of zero). */
+ ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent - 53; + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent - 53;
+ if (ediff > 0) + if (ediff > 0)
{ {
- /* we have a borrow from the hidden bit, so shift left 1. */ - /* we have a borrow from the hidden bit, so shift left 1. */
- hi = (hi << 1) | (lo >> 59); - hi = (hi << 1) | (lo >> 59);
- lo = 0xfffffffffffffffLL & (lo << 1); - lo = 0xfffffffffffffffLL & (lo << 1);
@ -217,7 +217,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
+ lo = (((uint64_t) 1 << 60) - 1) & (lo << 1); + lo = (((uint64_t) 1 << 60) - 1) & (lo << 1);
+ *exp = *exp - 1; + *exp = *exp - 1;
+ } + }
} }
} }
+ else + else
+ /* If the larger magnitude double is denormal then the smaller + /* If the larger magnitude double is denormal then the smaller
@ -266,21 +266,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
+ /* hidden bit of low double controls rounding of the high double. + /* hidden bit of low double controls rounding of the high double.
+ If hidden is '1' and either the explicit mantissa is non-zero + If hidden is '1' and either the explicit mantissa is non-zero
+ or hi is odd, then round up hi and adjust lo (2nd mantissa) + or hi is odd, then round up hi and adjust lo (2nd mantissa)
plus change the sign of the low double to compensate. */ plus change the sign of the low double to compensate. */
- if (hidden2) - if (hidden2)
+ if ((lo & ((uint64_t) 1 << 52)) != 0 + if ((lo & ((uint64_t) 1 << 52)) != 0
+ && ((hi & 1) != 0 || (lo & (((uint64_t) 1 << 52) - 1)) != 0)) + && ((hi & 1) != 0 || (lo & (((uint64_t) 1 << 52) - 1)) != 0))
{ {
hi++; hi++;
+ if ((hi & ((uint64_t) 1 << 53)) != 0) + if ((hi & ((uint64_t) 1 << 53)) != 0)
+ { + {
+ hi = hi >> 1; + hi = hi >> 1;
+ u.d[0].ieee.exponent++; + u.d[0].ieee.exponent++;
+ } + }
u.d[1].ieee.negative = !sign; u.d[1].ieee.negative = !sign;
- lo = (1ULL << 53) - lo; - lo = (1ULL << 53) - lo;
+ lo = ((uint64_t) 1 << 53) - lo; + lo = ((uint64_t) 1 << 53) - lo;
} }
- /* The hidden bit of the lo mantissa is zero so we need to - /* The hidden bit of the lo mantissa is zero so we need to
- normalize the it for the low double. Shift it left until the - normalize the it for the low double. Shift it left until the
- hidden bit is '1' then adjust the 2nd exponent accordingly. */ - hidden bit is '1' then adjust the 2nd exponent accordingly. */
@ -288,11 +288,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
+ the hidden bit is '1' and adjust the exponent accordingly. */ + the hidden bit is '1' and adjust the exponent accordingly. */
if (sizeof (lo) == sizeof (long)) if (sizeof (lo) == sizeof (long))
lzcount = __builtin_clzl (lo); lzcount = __builtin_clzl (lo);
@@ -91,34 +132,30 @@ @@ -91,34 +132,30 @@
lzcount = __builtin_clzl ((long) (lo >> 32)); lzcount = __builtin_clzl ((long) (lo >> 32));
else else
lzcount = __builtin_clzl ((long) lo) + 32; lzcount = __builtin_clzl ((long) lo) + 32;
- lzcount = lzcount - 11; - lzcount = lzcount - 11;
- if (lzcount > 0) - if (lzcount > 0)
+ lzcount = lzcount - (64 - 53); + lzcount = lzcount - (64 - 53);
@ -303,7 +303,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
+ /* Not denormal. */ + /* Not denormal. */
+ u.d[1].ieee.exponent = expnt2; + u.d[1].ieee.exponent = expnt2;
+ else + else
{ {
- int expnt2 = u.d[1].ieee.exponent - lzcount; - int expnt2 = u.d[1].ieee.exponent - lzcount;
- if (expnt2 >= 1) - if (expnt2 >= 1)
- { - {
@ -315,14 +315,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h glibc-2.17
+ as if it was 1, hence the extra shift. */ + as if it was 1, hence the extra shift. */
+ if (expnt2 > -53) + if (expnt2 > -53)
+ lo >>= 1 - expnt2; + lo >>= 1 - expnt2;
else else
- { - {
- /* Is denormal. */ - /* Is denormal. */
- lo = lo << (lzcount + expnt2); - lo = lo << (lzcount + expnt2);
- u.d[1].ieee.exponent = 0; - u.d[1].ieee.exponent = 0;
- } - }
+ lo = 0; + lo = 0;
} }
} }
else else
- { - {
@ -374,7 +374,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c 2014-05-27 19:14:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c 2014-05-27 19:14:45.000000000 -0500
@@ -70,9 +70,9 @@ @@ -70,9 +70,9 @@
else else
lzcount = __builtin_clzl ((long) val) + 32; lzcount = __builtin_clzl ((long) val) + 32;
if (hi) if (hi)
- lzcount = lzcount - 11; - lzcount = lzcount - 11;
+ lzcount = lzcount - (64 - 53); + lzcount = lzcount - (64 - 53);
@ -383,9 +383,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-
+ lzcount = lzcount + 53 - (64 - 53); + lzcount = lzcount + 53 - (64 - 53);
if (lzcount > u.d[0].ieee.exponent) if (lzcount > u.d[0].ieee.exponent)
{ {
@@ -98,29 +98,27 @@ @@ -98,29 +98,27 @@
} }
} }
- if (lo != 0L) - if (lo != 0L)
@ -395,24 +395,24 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-
- If hidden2 is '1' and either the explicit mantissa is non-zero - If hidden2 is '1' and either the explicit mantissa is non-zero
+ /* hidden bit of low double controls rounding of the high double. + /* hidden bit of low double controls rounding of the high double.
+ If hidden is '1' and either the explicit mantissa is non-zero + If hidden is '1' and either the explicit mantissa is non-zero
or hi is odd, then round up hi and adjust lo (2nd mantissa) or hi is odd, then round up hi and adjust lo (2nd mantissa)
plus change the sign of the low double to compensate. */ plus change the sign of the low double to compensate. */
if ((lo & (1LL << 52)) != 0 if ((lo & (1LL << 52)) != 0
- && ((hi & 1) != 0 || (lo & ((1LL << 52) - 1)))) - && ((hi & 1) != 0 || (lo & ((1LL << 52) - 1))))
+ && ((hi & 1) != 0 || (lo & ((1LL << 52) - 1)) != 0)) + && ((hi & 1) != 0 || (lo & ((1LL << 52) - 1)) != 0))
{ {
hi++; hi++;
- if ((hi & ((1LL << 52) - 1)) == 0) - if ((hi & ((1LL << 52) - 1)) == 0)
+ if ((hi & (1LL << 53)) != 0) + if ((hi & (1LL << 53)) != 0)
{ {
- if ((hi & (1LL << 53)) != 0) - if ((hi & (1LL << 53)) != 0)
- hi -= 1LL << 52; - hi -= 1LL << 52;
+ hi >>= 1; + hi >>= 1;
u.d[0].ieee.exponent++; u.d[0].ieee.exponent++;
} }
u.d[1].ieee.negative = !sign; u.d[1].ieee.negative = !sign;
lo = (1LL << 53) - lo; lo = (1LL << 53) - lo;
} }
- /* The hidden bit of the lo mantissa is zero so we need to normalize - /* The hidden bit of the lo mantissa is zero so we need to normalize
- it for the low double. Shift it left until the hidden bit is '1' - it for the low double. Shift it left until the hidden bit is '1'
@ -421,11 +421,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-
+ the hidden bit is '1' and adjust the exponent accordingly. */ + the hidden bit is '1' and adjust the exponent accordingly. */
if (sizeof (lo) == sizeof (long)) if (sizeof (lo) == sizeof (long))
lzcount = __builtin_clzl (lo); lzcount = __builtin_clzl (lo);
@@ -128,24 +126,24 @@ @@ -128,24 +126,24 @@
lzcount = __builtin_clzl ((long) (lo >> 32)); lzcount = __builtin_clzl ((long) (lo >> 32));
else else
lzcount = __builtin_clzl ((long) lo) + 32; lzcount = __builtin_clzl ((long) lo) + 32;
- lzcount = lzcount - 11; - lzcount = lzcount - 11;
- if (lzcount > 0) - if (lzcount > 0)
- { - {
@ -437,10 +437,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c glibc-2.17-
+ exponent2 -= lzcount; + exponent2 -= lzcount;
+ +
if (exponent2 > 0) if (exponent2 > 0)
u.d[1].ieee.exponent = exponent2; u.d[1].ieee.exponent = exponent2;
- else - else
+ else if (exponent2 > -53) + else if (exponent2 > -53)
lo >>= 1 - exponent2; lo >>= 1 - exponent2;
+ else + else
+ lo = 0; + lo = 0;
} }
@ -462,14 +462,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:13:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:13:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:14:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:14:45.000000000 -0500
@@ -43,15 +43,15 @@ @@ -43,15 +43,15 @@
lo <<= 1; \ lo <<= 1; \
/* The lower double is normalized separately from the upper. We \ /* The lower double is normalized separately from the upper. We \
may need to adjust the lower manitissa to reflect this. */ \ may need to adjust the lower manitissa to reflect this. */ \
- ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; \ - ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent; \
- if (ediff > 53 + 63) \ - if (ediff > 53 + 63) \
+ ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent - 53; \ + ediff = u.d[0].ieee.exponent - u.d[1].ieee.exponent - 53; \
+ if (ediff > 63) \ + if (ediff > 63) \
lo = 0; \ lo = 0; \
- else if (ediff > 53) \ - else if (ediff > 53) \
- lo = lo >> (ediff - 53); \ - lo = lo >> (ediff - 53); \
- else if (u.d[1].ieee.exponent == 0 && ediff < 53) \ - else if (u.d[1].ieee.exponent == 0 && ediff < 53) \
@ -481,6 +481,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2
if (u.d[0].ieee.negative != u.d[1].ieee.negative \ if (u.d[0].ieee.negative != u.d[1].ieee.negative \
- && (u.d[1].ieee.exponent != 0 || lo != 0L)) \ - && (u.d[1].ieee.exponent != 0 || lo != 0L)) \
+ && lo != 0) \ + && lo != 0) \
{ \ { \
lo = (1ULL << 60) - lo; \ lo = (1ULL << 60) - lo; \
if (hi == 0L) \ if (hi == 0L) \

192
SOURCES/glibc-ppc64le-06.patch

@ -47,27 +47,27 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("fpclassify (LDBL_MIN) failed: %d\n", fpclassify (ld)); - printf ("fpclassify (LDBL_MIN) failed: %d\n", fpclassify (ld));
+ printf ("fpclassify (LDBL_MIN) failed: %d (%La)\n", + printf ("fpclassify (LDBL_MIN) failed: %d (%La)\n",
+ fpclassify (v1), v1); + fpclassify (v1), v1);
result = 1; result = 1;
} }
- ld = nextafterl (ld, LDBL_MIN / 2.0); - ld = nextafterl (ld, LDBL_MIN / 2.0);
- if (fpclassify (ld) != FP_SUBNORMAL) - if (fpclassify (ld) != FP_SUBNORMAL)
+ v2 = nextafterl (v1, LDBL_MIN / 2.0); + v2 = nextafterl (v1, LDBL_MIN / 2.0);
+ if (fpclassify (v2) != FP_SUBNORMAL) + if (fpclassify (v2) != FP_SUBNORMAL)
{ {
printf ("fpclassify (LDBL_MIN-epsilon) failed: %d (%La)\n", printf ("fpclassify (LDBL_MIN-epsilon) failed: %d (%La)\n",
- fpclassify (ld), ld); - fpclassify (ld), ld);
+ fpclassify (v2), v2); + fpclassify (v2), v2);
result = 1; result = 1;
} }
- v2.d = ld = nextafterl (ld, LDBL_MIN); - v2.d = ld = nextafterl (ld, LDBL_MIN);
- if (fpclassify (ld) != FP_NORMAL) - if (fpclassify (ld) != FP_NORMAL)
+ v2 = nextafterl (v2, LDBL_MIN); + v2 = nextafterl (v2, LDBL_MIN);
+ if (fpclassify (v2) != FP_NORMAL) + if (fpclassify (v2) != FP_NORMAL)
{ {
printf ("fpclassify (LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n", printf ("fpclassify (LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n",
- fpclassify (ld), ld); - fpclassify (ld), ld);
+ fpclassify (v2), v2); + fpclassify (v2), v2);
result = 1; result = 1;
} }
- if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - if (v1.ieee.mantissa0 != v2.ieee.mantissa0)
@ -94,7 +94,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("LDBL_MIN: negative differs: %d vs %d\n", - printf ("LDBL_MIN: negative differs: %d vs %d\n",
- v1.ieee.negative, v2.ieee.negative); - v1.ieee.negative, v2.ieee.negative);
+ printf ("LDBL_MIN-epsilon+epsilon != LDBL_MIN: %La vs %La\n", v2, v1); + printf ("LDBL_MIN-epsilon+epsilon != LDBL_MIN: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- v1.d = ld = -LDBL_MIN; - v1.d = ld = -LDBL_MIN;
@ -105,27 +105,27 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("fpclassify (-LDBL_MIN) failed: %d\n", fpclassify (ld)); - printf ("fpclassify (-LDBL_MIN) failed: %d\n", fpclassify (ld));
+ printf ("fpclassify (-LDBL_MIN) failed: %d (%La)\n", + printf ("fpclassify (-LDBL_MIN) failed: %d (%La)\n",
+ fpclassify (v1), v1); + fpclassify (v1), v1);
result = 1; result = 1;
} }
- ld = nextafterl (ld, -LDBL_MIN / 2.0); - ld = nextafterl (ld, -LDBL_MIN / 2.0);
- if (fpclassify (ld) != FP_SUBNORMAL) - if (fpclassify (ld) != FP_SUBNORMAL)
+ v2 = nextafterl (v1, -LDBL_MIN / 2.0); + v2 = nextafterl (v1, -LDBL_MIN / 2.0);
+ if (fpclassify (v2) != FP_SUBNORMAL) + if (fpclassify (v2) != FP_SUBNORMAL)
{ {
printf ("fpclassify (-LDBL_MIN-epsilon) failed: %d (%La)\n", printf ("fpclassify (-LDBL_MIN-epsilon) failed: %d (%La)\n",
- fpclassify (ld), ld); - fpclassify (ld), ld);
+ fpclassify (v2), v2); + fpclassify (v2), v2);
result = 1; result = 1;
} }
- v2.d = ld = nextafterl (ld, -LDBL_MIN); - v2.d = ld = nextafterl (ld, -LDBL_MIN);
- if (fpclassify (ld) != FP_NORMAL) - if (fpclassify (ld) != FP_NORMAL)
+ v2 = nextafterl (v2, -LDBL_MIN); + v2 = nextafterl (v2, -LDBL_MIN);
+ if (fpclassify (v2) != FP_NORMAL) + if (fpclassify (v2) != FP_NORMAL)
{ {
printf ("fpclassify (-LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n", printf ("fpclassify (-LDBL_MIN-epsilon+epsilon) failed: %d (%La)\n",
- fpclassify (ld), ld); - fpclassify (ld), ld);
+ fpclassify (v2), v2); + fpclassify (v2), v2);
result = 1; result = 1;
} }
- if (v1.ieee.mantissa0 != v2.ieee.mantissa0) - if (v1.ieee.mantissa0 != v2.ieee.mantissa0)
@ -152,7 +152,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("-LDBL_MIN: negative differs: %d vs %d\n", - printf ("-LDBL_MIN: negative differs: %d vs %d\n",
- v1.ieee.negative, v2.ieee.negative); - v1.ieee.negative, v2.ieee.negative);
+ printf ("-LDBL_MIN-epsilon+epsilon != -LDBL_MIN: %La vs %La\n", v2, v1); + printf ("-LDBL_MIN-epsilon+epsilon != -LDBL_MIN: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- ld = LDBL_MAX; - ld = LDBL_MAX;
@ -163,7 +163,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("fpclassify (LDBL_MAX) failed: %d\n", fpclassify (ld)); - printf ("fpclassify (LDBL_MAX) failed: %d\n", fpclassify (ld));
+ printf ("fpclassify (LDBL_MAX) failed: %d (%La)\n", + printf ("fpclassify (LDBL_MAX) failed: %d (%La)\n",
+ fpclassify (v1), v1); + fpclassify (v1), v1);
result = 1; result = 1;
} }
- ld = nextafterl (ld, INFINITY); - ld = nextafterl (ld, INFINITY);
- if (fpclassify (ld) != FP_INFINITE) - if (fpclassify (ld) != FP_INFINITE)
@ -173,7 +173,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("fpclassify (LDBL_MAX+epsilon) failed: %d\n", fpclassify (ld)); - printf ("fpclassify (LDBL_MAX+epsilon) failed: %d\n", fpclassify (ld));
+ printf ("fpclassify (LDBL_MAX+epsilon) failed: %d (%La)\n", + printf ("fpclassify (LDBL_MAX+epsilon) failed: %d (%La)\n",
+ fpclassify (v2), v2); + fpclassify (v2), v2);
result = 1; result = 1;
} }
- ld = -LDBL_MAX; - ld = -LDBL_MAX;
@ -184,7 +184,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("fpclassify (-LDBL_MAX) failed: %d\n", fpclassify (ld)); - printf ("fpclassify (-LDBL_MAX) failed: %d\n", fpclassify (ld));
+ printf ("fpclassify (-LDBL_MAX) failed: %d (%La)\n", + printf ("fpclassify (-LDBL_MAX) failed: %d (%La)\n",
+ fpclassify (v1), v1); + fpclassify (v1), v1);
result = 1; result = 1;
} }
- ld = nextafterl (ld, -INFINITY); - ld = nextafterl (ld, -INFINITY);
- if (fpclassify (ld) != FP_INFINITE) - if (fpclassify (ld) != FP_INFINITE)
@ -195,7 +195,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- fpclassify (ld)); - fpclassify (ld));
+ printf ("fpclassify (-LDBL_MAX-epsilon) failed: %d (%La)\n", + printf ("fpclassify (-LDBL_MAX-epsilon) failed: %d (%La)\n",
+ fpclassify (v2), v2); + fpclassify (v2), v2);
result = 1; result = 1;
} }
- v1.d = ld = 0.0625; - v1.d = ld = 0.0625;
@ -229,7 +229,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("0.0625L down: negative differs: %d vs %d\n", - printf ("0.0625L down: negative differs: %d vs %d\n",
- v1.ieee.negative, v2.ieee.negative); - v1.ieee.negative, v2.ieee.negative);
+ printf ("0.0625L-epsilon+epsilon != 0.0625L: %La vs %La\n", v2, v1); + printf ("0.0625L-epsilon+epsilon != 0.0625L: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- v1.d = ld = 0.0625; - v1.d = ld = 0.0625;
@ -263,7 +263,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("0.0625L up: negative differs: %d vs %d\n", - printf ("0.0625L up: negative differs: %d vs %d\n",
- v1.ieee.negative, v2.ieee.negative); - v1.ieee.negative, v2.ieee.negative);
+ printf ("0.0625L+epsilon-epsilon != 0.0625L: %La vs %La\n", v2, v1); + printf ("0.0625L+epsilon-epsilon != 0.0625L: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- v1.d = ld = -0.0625; - v1.d = ld = -0.0625;
@ -297,7 +297,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("-0.0625L up: negative differs: %d vs %d\n", - printf ("-0.0625L up: negative differs: %d vs %d\n",
- v1.ieee.negative, v2.ieee.negative); - v1.ieee.negative, v2.ieee.negative);
+ printf ("-0.0625L+epsilon-epsilon != -0.0625L: %La vs %La\n", v2, v1); + printf ("-0.0625L+epsilon-epsilon != -0.0625L: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- v1.d = ld = -0.0625; - v1.d = ld = -0.0625;
@ -331,7 +331,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("-0.0625L down: negative differs: %d vs %d\n", - printf ("-0.0625L down: negative differs: %d vs %d\n",
- v1.ieee.negative, v2.ieee.negative); - v1.ieee.negative, v2.ieee.negative);
+ printf ("-0.0625L-epsilon+epsilon != -0.0625L: %La vs %La\n", v2, v1); + printf ("-0.0625L-epsilon+epsilon != -0.0625L: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- v1.d = ld = 0.0; - v1.d = ld = 0.0;
@ -359,7 +359,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("0.0L up: exponent differs: %4x vs %4x\n", - printf ("0.0L up: exponent differs: %4x vs %4x\n",
- v1.ieee.exponent, v2.ieee.exponent); - v1.ieee.exponent, v2.ieee.exponent);
+ printf ("0.0+epsilon-epsilon != 0.0L: %La vs %La\n", v2, v1); + printf ("0.0+epsilon-epsilon != 0.0L: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- if (0 != v2.ieee.negative) - if (0 != v2.ieee.negative)
+ if (signbit (v2)) + if (signbit (v2))
@ -367,7 +367,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("0.0L up: negative differs: 0 vs %d\n", - printf ("0.0L up: negative differs: 0 vs %d\n",
- v2.ieee.negative); - v2.ieee.negative);
+ printf ("0.0+epsilon-epsilon is negative\n"); + printf ("0.0+epsilon-epsilon is negative\n");
result = 1; result = 1;
} }
- v1.d = ld = 0.0; - v1.d = ld = 0.0;
@ -395,7 +395,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("0.0L down: exponent differs: %4x vs %4x\n", - printf ("0.0L down: exponent differs: %4x vs %4x\n",
- v1.ieee.exponent, v2.ieee.exponent); - v1.ieee.exponent, v2.ieee.exponent);
+ printf ("0.0-epsilon+epsilon != 0.0L: %La vs %La\n", v2, v1); + printf ("0.0-epsilon+epsilon != 0.0L: %La vs %La\n", v2, v1);
result = 1; result = 1;
} }
- if (1 != v2.ieee.negative) - if (1 != v2.ieee.negative)
+ if (!signbit (v2)) + if (!signbit (v2))
@ -403,7 +403,7 @@ diff -urN glibc-2.17-c758a686/math/test-misc.c glibc-2.17-c758a686/math/test-mis
- printf ("0.0L down: negative differs: 1 vs %d\n", - printf ("0.0L down: negative differs: 1 vs %d\n",
- v2.ieee.negative); - v2.ieee.negative);
+ printf ("0.0-epsilon+epsilon is positive\n"); + printf ("0.0-epsilon+epsilon is positive\n");
result = 1; result = 1;
} }
diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c
@ -411,42 +411,42 @@ diff -urN glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c glibc-2.17-c
+++ glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/ports/sysdeps/ia64/fpu/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500
@@ -25,9 +25,11 @@ @@ -25,9 +25,11 @@
/* The "strange" 80 bit format on ia64 has an explicit \ /* The "strange" 80 bit format on ia64 has an explicit \
leading digit in the 64 bit mantissa. */ \ leading digit in the 64 bit mantissa. */ \
unsigned long long int num; \ unsigned long long int num; \
+ union ieee854_long_double u; \ + union ieee854_long_double u; \
+ u.d = fpnum.ldbl; \ + u.d = fpnum.ldbl; \
\ \
- num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \
- | fpnum.ldbl.ieee.mantissa1); \ - | fpnum.ldbl.ieee.mantissa1); \
+ num = (((unsigned long long int) u.ieee.mantissa0) << 32 \ + num = (((unsigned long long int) u.ieee.mantissa0) << 32 \
+ | u.ieee.mantissa1); \ + | u.ieee.mantissa1); \
\ \
zero_mantissa = num == 0; \ zero_mantissa = num == 0; \
\ \
@@ -49,8 +51,8 @@ @@ -49,8 +51,8 @@
\ \
/* We have 3 bits from the mantissa in the leading nibble. \ /* We have 3 bits from the mantissa in the leading nibble. \
Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \
- exponent = fpnum.ldbl.ieee.exponent; \ - exponent = fpnum.ldbl.ieee.exponent; \
- \ - \
+ exponent = u.ieee.exponent; \ + exponent = u.ieee.exponent; \
+ \ + \
if (exponent == 0) \ if (exponent == 0) \
{ \ { \
if (zero_mantissa) \ if (zero_mantissa) \
diff -urN glibc-2.17-c758a686/stdio-common/printf_fp.c glibc-2.17-c758a686/stdio-common/printf_fp.c diff -urN glibc-2.17-c758a686/stdio-common/printf_fp.c glibc-2.17-c758a686/stdio-common/printf_fp.c
--- glibc-2.17-c758a686/stdio-common/printf_fp.c 2014-05-27 19:53:22.000000000 -0500 --- glibc-2.17-c758a686/stdio-common/printf_fp.c 2014-05-27 19:53:22.000000000 -0500
+++ glibc-2.17-c758a686/stdio-common/printf_fp.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/stdio-common/printf_fp.c 2014-05-27 19:53:45.000000000 -0500
@@ -335,8 +335,7 @@ @@ -335,8 +335,7 @@
int res; int res;
if (__isnanl (fpnum.ldbl)) if (__isnanl (fpnum.ldbl))
{ {
- union ieee854_long_double u = { .d = fpnum.ldbl }; - union ieee854_long_double u = { .d = fpnum.ldbl };
- is_neg = u.ieee.negative != 0; - is_neg = u.ieee.negative != 0;
+ is_neg = signbit (fpnum.ldbl); + is_neg = signbit (fpnum.ldbl);
if (isupper (info->spec)) if (isupper (info->spec))
{ {
special = "NAN"; special = "NAN";
diff -urN glibc-2.17-c758a686/stdio-common/printf_fphex.c glibc-2.17-c758a686/stdio-common/printf_fphex.c diff -urN glibc-2.17-c758a686/stdio-common/printf_fphex.c glibc-2.17-c758a686/stdio-common/printf_fphex.c
--- glibc-2.17-c758a686/stdio-common/printf_fphex.c 2014-05-27 19:53:22.000000000 -0500 --- glibc-2.17-c758a686/stdio-common/printf_fphex.c 2014-05-27 19:53:22.000000000 -0500
+++ glibc-2.17-c758a686/stdio-common/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/stdio-common/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500
@ -469,30 +469,30 @@ diff -urN glibc-2.17-c758a686/stdio-common/printf_fphex.c glibc-2.17-c758a686/st
/* Check for special values: not a number or infinity. */ /* Check for special values: not a number or infinity. */
- if (__isnanl (fpnum.ldbl.d)) - if (__isnanl (fpnum.ldbl.d))
+ if (__isnanl (fpnum.ldbl)) + if (__isnanl (fpnum.ldbl))
{ {
- negative = fpnum.ldbl.ieee.negative != 0; - negative = fpnum.ldbl.ieee.negative != 0;
if (isupper (info->spec)) if (isupper (info->spec))
{ {
special = "NAN"; special = "NAN";
@@ -181,8 +180,7 @@ @@ -181,8 +180,7 @@
} }
else else
{ {
- int res = __isinfl (fpnum.ldbl.d); - int res = __isinfl (fpnum.ldbl.d);
- if (res) - if (res)
+ if (__isinfl (fpnum.ldbl)) + if (__isinfl (fpnum.ldbl))
{ {
if (isupper (info->spec)) if (isupper (info->spec))
{ {
@@ -194,11 +192,9 @@ @@ -194,11 +192,9 @@
special = "inf"; special = "inf";
wspecial = L"inf"; wspecial = L"inf";
} }
- negative = res < 0; - negative = res < 0;
} }
- else - else
- negative = signbit (fpnum.ldbl.d); - negative = signbit (fpnum.ldbl.d);
} }
+ negative = signbit (fpnum.ldbl); + negative = signbit (fpnum.ldbl);
} }
else else
@ -519,39 +519,39 @@ diff -urN glibc-2.17-c758a686/stdio-common/printf_size.c glibc-2.17-c758a686/std
/* Check for special values: not a number or infinity. */ /* Check for special values: not a number or infinity. */
- if (__isnanl (fpnum.ldbl.d)) - if (__isnanl (fpnum.ldbl.d))
+ if (__isnanl (fpnum.ldbl)) + if (__isnanl (fpnum.ldbl))
{ {
special = "nan"; special = "nan";
wspecial = L"nan"; wspecial = L"nan";
// fpnum_sign = 0; Already zero // fpnum_sign = 0; Already zero
} }
- else if ((res = __isinfl (fpnum.ldbl.d))) - else if ((res = __isinfl (fpnum.ldbl.d)))
+ else if ((res = __isinfl (fpnum.ldbl))) + else if ((res = __isinfl (fpnum.ldbl)))
{ {
fpnum_sign = res; fpnum_sign = res;
special = "inf"; special = "inf";
wspecial = L"inf"; wspecial = L"inf";
} }
else else
- while (fpnum.ldbl.d >= divisor && tag[1] != '\0') - while (fpnum.ldbl.d >= divisor && tag[1] != '\0')
+ while (fpnum.ldbl >= divisor && tag[1] != '\0') + while (fpnum.ldbl >= divisor && tag[1] != '\0')
{ {
- fpnum.ldbl.d /= divisor; - fpnum.ldbl.d /= divisor;
+ fpnum.ldbl /= divisor; + fpnum.ldbl /= divisor;
++tag; ++tag;
} }
} }
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500
@@ -24,13 +24,15 @@ @@ -24,13 +24,15 @@
digits we use only the implicit digits for the number before \ digits we use only the implicit digits for the number before \
the decimal point. */ \ the decimal point. */ \
unsigned long long int num0, num1; \ unsigned long long int num0, num1; \
+ union ieee854_long_double u; \ + union ieee854_long_double u; \
+ u.d = fpnum.ldbl; \ + u.d = fpnum.ldbl; \
\ \
assert (sizeof (long double) == 16); \ assert (sizeof (long double) == 16); \
\ \
- num0 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - num0 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \
- | fpnum.ldbl.ieee.mantissa1); \ - | fpnum.ldbl.ieee.mantissa1); \
- num1 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa2) << 32 \ - num1 = (((unsigned long long int) fpnum.ldbl.ieee.mantissa2) << 32 \
@ -560,21 +560,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128/printf_fphex.c glibc-2.17
+ | u.ieee.mantissa1); \ + | u.ieee.mantissa1); \
+ num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \ + num1 = (((unsigned long long int) u.ieee.mantissa2) << 32 \
+ | u.ieee.mantissa3); \ + | u.ieee.mantissa3); \
\ \
zero_mantissa = (num0|num1) == 0; \ zero_mantissa = (num0|num1) == 0; \
\ \
@@ -75,9 +77,9 @@ @@ -75,9 +77,9 @@
*--wnumstr = L'0'; \ *--wnumstr = L'0'; \
} \ } \
\ \
- leading = fpnum.ldbl.ieee.exponent == 0 ? '0' : '1'; \ - leading = fpnum.ldbl.ieee.exponent == 0 ? '0' : '1'; \
+ leading = u.ieee.exponent == 0 ? '0' : '1'; \ + leading = u.ieee.exponent == 0 ? '0' : '1'; \
\ \
- exponent = fpnum.ldbl.ieee.exponent; \ - exponent = fpnum.ldbl.ieee.exponent; \
+ exponent = u.ieee.exponent; \ + exponent = u.ieee.exponent; \
\ \
if (exponent == 0) \ if (exponent == 0) \
{ \ { \
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500
@ -584,69 +584,69 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/printf_fphex.c glibc-2
union ibm_extended_long_double u; \ union ibm_extended_long_double u; \
- u.ld = fpnum.ldbl.d; \ - u.ld = fpnum.ldbl.d; \
+ u.ld = fpnum.ldbl; \ + u.ld = fpnum.ldbl; \
\ \
assert (sizeof (long double) == 16); \ assert (sizeof (long double) == 16); \
\ \
lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; \ lo = ((long long)u.d[1].ieee.mantissa0 << 32) | u.d[1].ieee.mantissa1; \
hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; \ hi = ((long long)u.d[0].ieee.mantissa0 << 32) | u.d[0].ieee.mantissa1; \
lo <<= 7; /* pre-shift lo to match ieee854. */ \ lo <<= 7; /* pre-shift lo to match ieee854. */ \
- /* If the lower double is not a denomal or zero then set the hidden \ - /* If the lower double is not a denomal or zero then set the hidden \
+ /* If the lower double is not a denormal or zero then set the hidden \ + /* If the lower double is not a denormal or zero then set the hidden \
53rd bit. */ \ 53rd bit. */ \
if (u.d[1].ieee.exponent != 0) \ if (u.d[1].ieee.exponent != 0) \
lo |= (1ULL << (52 + 7)); \ lo |= (1ULL << (52 + 7)); \
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-96/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500
@@ -25,11 +25,13 @@ @@ -25,11 +25,13 @@
/* The "strange" 80 bit format on ix86 and m68k has an explicit \ /* The "strange" 80 bit format on ix86 and m68k has an explicit \
leading digit in the 64 bit mantissa. */ \ leading digit in the 64 bit mantissa. */ \
unsigned long long int num; \ unsigned long long int num; \
+ union ieee854_long_double u; \ + union ieee854_long_double u; \
+ u.d = fpnum.ldbl; \ + u.d = fpnum.ldbl; \
\ \
assert (sizeof (long double) == 12); \ assert (sizeof (long double) == 12); \
\ \
- num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \
- | fpnum.ldbl.ieee.mantissa1); \ - | fpnum.ldbl.ieee.mantissa1); \
+ num = (((unsigned long long int) u.ieee.mantissa0) << 32 \ + num = (((unsigned long long int) u.ieee.mantissa0) << 32 \
+ | u.ieee.mantissa1); \ + | u.ieee.mantissa1); \
\ \
zero_mantissa = num == 0; \ zero_mantissa = num == 0; \
\ \
@@ -62,7 +64,7 @@ @@ -62,7 +64,7 @@
\ \
/* We have 3 bits from the mantissa in the leading nibble. \ /* We have 3 bits from the mantissa in the leading nibble. \
Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \
- exponent = fpnum.ldbl.ieee.exponent; \ - exponent = fpnum.ldbl.ieee.exponent; \
+ exponent = u.ieee.exponent; \ + exponent = u.ieee.exponent; \
\ \
if (exponent == 0) \ if (exponent == 0) \
{ \ { \
diff -urN glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c diff -urN glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c
--- glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c 2014-05-27 19:53:20.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/x86_64/fpu/printf_fphex.c 2014-05-27 19:53:45.000000000 -0500
@@ -25,10 +25,11 @@ @@ -25,10 +25,11 @@
/* The "strange" 80 bit format on ix86 and m68k has an explicit \ /* The "strange" 80 bit format on ix86 and m68k has an explicit \
leading digit in the 64 bit mantissa. */ \ leading digit in the 64 bit mantissa. */ \
unsigned long long int num; \ unsigned long long int num; \
+ union ieee854_long_double u; \ + union ieee854_long_double u; \
+ u.d = fpnum.ldbl; \ + u.d = fpnum.ldbl; \
\ \
- \ - \
- num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \ - num = (((unsigned long long int) fpnum.ldbl.ieee.mantissa0) << 32 \
- | fpnum.ldbl.ieee.mantissa1); \ - | fpnum.ldbl.ieee.mantissa1); \
+ num = (((unsigned long long int) u.ieee.mantissa0) << 32 \ + num = (((unsigned long long int) u.ieee.mantissa0) << 32 \
+ | u.ieee.mantissa1); \ + | u.ieee.mantissa1); \
\ \
zero_mantissa = num == 0; \ zero_mantissa = num == 0; \
\ \
@@ -61,7 +62,7 @@ @@ -61,7 +62,7 @@
\ \
/* We have 3 bits from the mantissa in the leading nibble. \ /* We have 3 bits from the mantissa in the leading nibble. \
Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \ Therefore we are here using `IEEE854_LONG_DOUBLE_BIAS + 3'. */ \
- exponent = fpnum.ldbl.ieee.exponent; \ - exponent = fpnum.ldbl.ieee.exponent; \
+ exponent = u.ieee.exponent; \ + exponent = u.ieee.exponent; \
\ \
if (exponent == 0) \ if (exponent == 0) \
{ \ { \

146
SOURCES/glibc-ppc64le-07.patch

@ -47,8 +47,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c glibc-2.17-
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c 2014-05-27 19:59:00.000000000 -0500
@@ -36,8 +36,12 @@ @@ -36,8 +36,12 @@
{ {
long double t; long double t;
int64_t hx; int64_t hx;
- u_int64_t lx; - u_int64_t lx;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ uint64_t lx; + uint64_t lx;
@ -57,9 +57,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acoshl.c glibc-2.17-
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
if(hx<0x3ff0000000000000LL) { /* x < 1 */ if(hx<0x3ff0000000000000LL) { /* x < 1 */
return (x-x)/(x-x); return (x-x)/(x-x);
} else if(hx >=0x41b0000000000000LL) { /* x > 2**28 */ } else if(hx >=0x41b0000000000000LL) { /* x > 2**28 */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c 2014-05-27 19:59:00.000000000 -0500
@ -77,9 +77,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c
+ if (a == 1.0L) + if (a == 1.0L)
{ {
if (x > 0.0L) if (x > 0.0L)
return 0.0; /* acos(1) = 0 */ return 0.0; /* acos(1) = 0 */
else else
return (2.0 * pio2_hi) + (2.0 * pio2_lo); /* acos(-1)= pi */ return (2.0 * pio2_hi) + (2.0 * pio2_lo); /* acos(-1)= pi */
} }
- else if (u.value > 1.0L) - else if (u.value > 1.0L)
+ else if (a > 1.0L) + else if (a > 1.0L)
@ -91,23 +91,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c
{ {
- if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */ - if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */
+ if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */ + if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */
return pio2_hi + pio2_lo; return pio2_hi + pio2_lo;
- if (u.value < 0.4375L) - if (u.value < 0.4375L)
+ if (a < 0.4375L) + if (a < 0.4375L)
{ {
/* Arcsine of x. */ /* Arcsine of x. */
z = x * x; z = x * x;
@@ -199,7 +198,7 @@ @@ -199,7 +198,7 @@
return z; return z;
} }
/* .4375 <= |x| < .5 */ /* .4375 <= |x| < .5 */
- t = u.value - 0.4375L; - t = u.value - 0.4375L;
+ t = a - 0.4375L; + t = a - 0.4375L;
p = ((((((((((P10 * t p = ((((((((((P10 * t
+ P9) * t + P9) * t
+ P8) * t + P8) * t
@@ -230,9 +229,9 @@ @@ -230,9 +229,9 @@
r = acosr4375 + r; r = acosr4375 + r;
return r; return r;
} }
- else if (u.value < 0.625L) - else if (u.value < 0.625L)
@ -116,8 +116,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c
- t = u.value - 0.5625L; - t = u.value - 0.5625L;
+ t = a - 0.5625L; + t = a - 0.5625L;
p = ((((((((((rS10 * t p = ((((((((((rS10 * t
+ rS9) * t + rS9) * t
+ rS8) * t + rS8) * t
@@ -264,7 +263,9 @@ @@ -264,7 +263,9 @@
} }
else else
@ -128,11 +128,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_acosl.c glibc-2.17-c
+ z = (one - a) * 0.5; + z = (one - a) * 0.5;
s = __ieee754_sqrtl (z); s = __ieee754_sqrtl (z);
/* Compute an extended precision square root from /* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s). the Newton iteration s -> 0.5 * (s + z / s).
@@ -273,12 +274,11 @@ @@ -273,12 +274,11 @@
Express s = f1 + f2 where f1 * f1 is exactly representable. Express s = f1 + f2 where f1 * f1 is exactly representable.
w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s . w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s .
s + w has extended precision. */ s + w has extended precision. */
- u.value = s; - u.value = s;
- u.parts32.w2 = 0; - u.parts32.w2 = 0;
- u.parts32.w3 = 0; - u.parts32.w3 = 0;
@ -173,12 +173,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c
{ {
- if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */ - if (u.value < 6.938893903907228e-18L) /* |x| < 2**-57 */
+ if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */ + if (a < 6.938893903907228e-18L) /* |x| < 2**-57 */
{ {
if (huge + x > one) if (huge + x > one)
return x; /* return x with inexact if x!=0 */ return x; /* return x with inexact if x!=0 */
@@ -155,9 +154,9 @@ @@ -155,9 +154,9 @@
flag = 1; flag = 1;
} }
} }
- else if (u.value < 0.625L) - else if (u.value < 0.625L)
+ else if (a < 0.625L) + else if (a < 0.625L)
@ -186,8 +186,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_asinl.c glibc-2.17-c
- t = u.value - 0.5625; - t = u.value - 0.5625;
+ t = a - 0.5625; + t = a - 0.5625;
p = ((((((((((rS10 * t p = ((((((((((rS10 * t
+ rS9) * t + rS9) * t
+ rS8) * t + rS8) * t
@@ -190,7 +189,7 @@ @@ -190,7 +189,7 @@
else else
{ {
@ -222,31 +222,31 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c glibc-2.17-
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atanhl.c 2014-05-27 19:59:00.000000000 -0500
@@ -40,8 +40,10 @@ @@ -40,8 +40,10 @@
{ {
long double t; long double t;
int64_t hx,ix; int64_t hx,ix;
- u_int64_t lx __attribute__ ((unused)); - u_int64_t lx __attribute__ ((unused));
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ double xhi; + double xhi;
+ +
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
ix = hx&0x7fffffffffffffffLL; ix = hx&0x7fffffffffffffffLL;
if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */ if (ix >= 0x3ff0000000000000LL) { /* |x|>=1 */
if (ix > 0x3ff0000000000000LL) if (ix > 0x3ff0000000000000LL)
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_coshl.c 2014-05-27 19:59:00.000000000 -0500
@@ -41,9 +41,11 @@ @@ -41,9 +41,11 @@
{ {
long double t,w; long double t,w;
int64_t ix; int64_t ix;
+ double xhi; + double xhi;
/* High word of |x|. */ /* High word of |x|. */
- GET_LDOUBLE_MSW64(ix,x); - GET_LDOUBLE_MSW64(ix,x);
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (ix, xhi); + EXTRACT_WORDS64 (ix, xhi);
ix &= 0x7fffffffffffffffLL; ix &= 0x7fffffffffffffffLL;
/* x is INF or NaN */ /* x is INF or NaN */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log2l.c
@ -291,15 +291,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c glibc-2.17-c
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sinhl.c 2014-05-27 19:59:00.000000000 -0500
@@ -38,9 +38,11 @@ @@ -38,9 +38,11 @@
{ {
long double t,w,h; long double t,w,h;
int64_t ix,jx; int64_t ix,jx;
+ double xhi; + double xhi;
/* High word of |x|. */ /* High word of |x|. */
- GET_LDOUBLE_MSW64(jx,x); - GET_LDOUBLE_MSW64(jx,x);
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (jx, xhi); + EXTRACT_WORDS64 (jx, xhi);
ix = jx&0x7fffffffffffffffLL; ix = jx&0x7fffffffffffffffLL;
/* x is INF or NaN */ /* x is INF or NaN */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c
@ -320,8 +320,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_cosl.c glibc-2.17-c7
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */ tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */ if (tix < 0x3fc30000) /* |x| < 0.1484375 */
@@ -136,7 +139,8 @@ @@ -136,7 +139,8 @@
case 2: index = (hix - 0x3fc30000) >> 14; break; case 2: index = (hix - 0x3fc30000) >> 14; break;
} }
*/ */
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); - SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32); + INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32);
@ -349,14 +349,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sincosl.c glibc-2.17
if (tix < 0x3fc30000) /* |x| < 0.1484375 */ if (tix < 0x3fc30000) /* |x| < 0.1484375 */
{ {
@@ -164,7 +167,8 @@ @@ -164,7 +167,8 @@
case 2: index = (hix - 0x3fc30000) >> 14; break; case 2: index = (hix - 0x3fc30000) >> 14; break;
} }
*/ */
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); - SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32); + INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32);
+ h = hhi; + h = hhi;
if (iy) if (iy)
l = y - (h - x); l = y - (h - x);
else else
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c 2014-05-27 19:58:07.000000000 -0500
@ -374,30 +374,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_sinl.c glibc-2.17-c7
tix &= ~0x80000000; /* tix = |x|'s high 32 bits */ tix &= ~0x80000000; /* tix = |x|'s high 32 bits */
if (tix < 0x3fc30000) /* |x| < 0.1484375 */ if (tix < 0x3fc30000) /* |x| < 0.1484375 */
@@ -132,7 +135,8 @@ @@ -132,7 +135,8 @@
case 2: index = (hix - 0x3fc30000) >> 14; break; case 2: index = (hix - 0x3fc30000) >> 14; break;
} }
*/ */
- SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0); - SET_LDOUBLE_WORDS64(h, ((u_int64_t)hix) << 32, 0);
+ INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32); + INSERT_WORDS64 (hhi, ((uint64_t)hix) << 32);
+ h = hhi; + h = hhi;
if (iy) if (iy)
l = (ix < 0 ? -y : y) - (h - x); l = (ix < 0 ? -y : y) - (h - x);
else else
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_asinhl.c 2014-05-27 19:59:00.000000000 -0500
@@ -38,7 +38,10 @@ @@ -38,7 +38,10 @@
{ {
long double t,w; long double t,w;
int64_t hx,ix; int64_t hx,ix;
- GET_LDOUBLE_MSW64(hx,x); - GET_LDOUBLE_MSW64(hx,x);
+ double xhi; + double xhi;
+ +
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
ix = hx&0x7fffffffffffffffLL; ix = hx&0x7fffffffffffffffLL;
if(ix>=0x7ff0000000000000LL) return x+x; /* x is inf or NaN */ if(ix>=0x7ff0000000000000LL) return x+x; /* x is inf or NaN */
if(ix< 0x3e20000000000000LL) { /* |x|<2**-29 */ if(ix< 0x3e20000000000000LL) { /* |x|<2**-29 */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c 2014-05-27 19:59:00.000000000 -0500
@ -428,7 +428,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_atanl.c glibc-2.17-c
/* NaN. */ /* NaN. */
- if ((k & 0xfffff) | s.parts32.w1 ) - if ((k & 0xfffff) | s.parts32.w1 )
+ if (((k - 0x7ff00000) | lx) != 0) + if (((k - 0x7ff00000) | lx) != 0)
return (x + x); return (x + x);
/* Infinity. */ /* Infinity. */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c
@ -436,8 +436,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c glibc-2.17-c7
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c 2014-05-27 19:59:00.000000000 -0500
@@ -53,9 +53,11 @@ @@ -53,9 +53,11 @@
{ {
long double y[2],z=0.0L; long double y[2],z=0.0L;
int64_t n, ix; int64_t n, ix;
+ double xhi; + double xhi;
/* High word of x. */ /* High word of x. */
@ -446,27 +446,27 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_cosl.c glibc-2.17-c7
+ EXTRACT_WORDS64 (ix, xhi); + EXTRACT_WORDS64 (ix, xhi);
/* |x| ~< pi/4 */ /* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL; ix &= 0x7fffffffffffffffLL;
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fabsl.c 2014-05-27 19:59:00.000000000 -0500
@@ -29,10 +29,16 @@ @@ -29,10 +29,16 @@
long double __fabsl(long double x) long double __fabsl(long double x)
{ {
u_int64_t hx, lx; u_int64_t hx, lx;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ double xhi, xlo; + double xhi, xlo;
+ +
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
lx = lx ^ ( hx & 0x8000000000000000LL ); lx = lx ^ ( hx & 0x8000000000000000LL );
hx = hx & 0x7fffffffffffffffLL; hx = hx & 0x7fffffffffffffffLL;
- SET_LDOUBLE_WORDS64(x,hx,lx); - SET_LDOUBLE_WORDS64(x,hx,lx);
+ INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xhi, hx);
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x; return x;
} }
long_double_symbol (libm, __fabsl, fabsl); long_double_symbol (libm, __fabsl, fabsl);
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_finitel.c
@ -507,13 +507,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_fpclassifyl.c glibc-
/* +/-NaN or +/-Inf */ /* +/-NaN or +/-Inf */
if (hx & 0x000fffffffffffffULL) { if (hx & 0x000fffffffffffffULL) {
@@ -65,6 +67,7 @@ @@ -65,6 +67,7 @@
retval = FP_NORMAL; retval = FP_NORMAL;
} else { } else {
if ((hx & 0x7ff0000000000000ULL) == 0x0360000000000000ULL) { if ((hx & 0x7ff0000000000000ULL) == 0x0360000000000000ULL) {
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
if ((lx & 0x7fffffffffffffff) /* lower is non-zero */ if ((lx & 0x7fffffffffffffff) /* lower is non-zero */
&& ((lx^hx) & 0x8000000000000000ULL)) { /* and sign differs */ && ((lx^hx) & 0x8000000000000000ULL)) { /* and sign differs */
/* +/- denormal */ /* +/- denormal */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c 2014-05-27 19:59:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isnanl.c 2014-05-27 19:59:00.000000000 -0500
@ -590,8 +590,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c glibc-2.17-c7
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c 2014-05-27 19:59:19.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c 2014-05-27 19:59:19.000000000 -0500
@@ -53,9 +53,11 @@ @@ -53,9 +53,11 @@
{ {
long double y[2],z=0.0L; long double y[2],z=0.0L;
int64_t n, ix; int64_t n, ix;
+ double xhi; + double xhi;
/* High word of x. */ /* High word of x. */
@ -600,14 +600,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_sinl.c glibc-2.17-c7
+ EXTRACT_WORDS64 (ix, xhi); + EXTRACT_WORDS64 (ix, xhi);
/* |x| ~< pi/4 */ /* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL; ix &= 0x7fffffffffffffffLL;
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c 2014-05-27 19:59:19.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c 2014-05-27 19:59:19.000000000 -0500
@@ -53,9 +53,11 @@ @@ -53,9 +53,11 @@
{ {
long double y[2],z=0.0L; long double y[2],z=0.0L;
int64_t n, ix; int64_t n, ix;
+ double xhi; + double xhi;
/* High word of x. */ /* High word of x. */
@ -616,7 +616,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanl.c glibc-2.17-c7
+ EXTRACT_WORDS64 (ix, xhi); + EXTRACT_WORDS64 (ix, xhi);
/* |x| ~< pi/4 */ /* |x| ~< pi/4 */
ix &= 0x7fffffffffffffffLL; ix &= 0x7fffffffffffffffLL;
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c 2014-05-27 19:58:07.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c 2014-05-27 19:58:07.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c 2014-05-27 19:59:19.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_logbl.c 2014-05-27 19:59:19.000000000 -0500

468
SOURCES/glibc-ppc64le-08.patch

@ -52,8 +52,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c glibc-2.17-
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c 2014-05-27 23:05:55.000000000 -0500
@@ -56,11 +56,15 @@ @@ -56,11 +56,15 @@
{ {
long double z; long double z;
int64_t k,m,hx,hy,ix,iy; int64_t k,m,hx,hy,ix,iy;
- u_int64_t lx,ly; - u_int64_t lx,ly;
+ uint64_t lx; + uint64_t lx;
+ double xhi, xlo, yhi; + double xhi, xlo, yhi;
@ -62,31 +62,31 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_atan2l.c glibc-2.17-
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
ix = hx&0x7fffffffffffffffLL; ix = hx&0x7fffffffffffffffLL;
- GET_LDOUBLE_WORDS64(hy,ly,y); - GET_LDOUBLE_WORDS64(hy,ly,y);
+ yhi = ldbl_high (y); + yhi = ldbl_high (y);
+ EXTRACT_WORDS64 (hy, yhi); + EXTRACT_WORDS64 (hy, yhi);
iy = hy&0x7fffffffffffffffLL; iy = hy&0x7fffffffffffffffLL;
if(((ix)>0x7ff0000000000000LL)|| if(((ix)>0x7ff0000000000000LL)||
((iy)>0x7ff0000000000000LL)) /* x or y is NaN */ ((iy)>0x7ff0000000000000LL)) /* x or y is NaN */
@@ -70,7 +74,7 @@ @@ -70,7 +74,7 @@
m = ((hy>>63)&1)|((hx>>62)&2); /* 2*sign(x)+sign(y) */ m = ((hy>>63)&1)|((hx>>62)&2); /* 2*sign(x)+sign(y) */
/* when y = 0 */ /* when y = 0 */
- if((iy|(ly&0x7fffffffffffffffLL))==0) { - if((iy|(ly&0x7fffffffffffffffLL))==0) {
+ if(iy==0) { + if(iy==0) {
switch(m) { switch(m) {
case 0: case 0:
case 1: return y; /* atan(+-0,+anything)=+-0 */ case 1: return y; /* atan(+-0,+anything)=+-0 */
@@ -79,7 +83,7 @@ @@ -79,7 +83,7 @@
} }
} }
/* when x = 0 */ /* when x = 0 */
- if((ix|(lx&0x7fffffffffffffff))==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; - if((ix|(lx&0x7fffffffffffffff))==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
+ if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; + if(ix==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny;
/* when x is INF */ /* when x is INF */
if(ix==0x7ff0000000000000LL) { if(ix==0x7ff0000000000000LL) {
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_gammal_r.c 2014-05-27 23:05:55.000000000 -0500
@ -115,34 +115,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_ilogbl.c glibc-2.17-
{ {
- int64_t hx,lx; - int64_t hx,lx;
+ int64_t hx; + int64_t hx;
int ix; int ix;
+ double xhi; + double xhi;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
hx &= 0x7fffffffffffffffLL; hx &= 0x7fffffffffffffffLL;
if(hx <= 0x0010000000000000LL) { if(hx <= 0x0010000000000000LL) {
- if((hx|(lx&0x7fffffffffffffffLL))==0) - if((hx|(lx&0x7fffffffffffffffLL))==0)
+ if(hx==0) + if(hx==0)
return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */ return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */
else /* subnormal x */ else /* subnormal x */
- if(hx==0) { - if(hx==0) {
- for (ix = -1043; lx>0; lx<<=1) ix -=1; - for (ix = -1043; lx>0; lx<<=1) ix -=1;
- } else { - } else {
- for (ix = -1022, hx<<=11; hx>0; hx<<=1) ix -=1; - for (ix = -1022, hx<<=11; hx>0; hx<<=1) ix -=1;
- } - }
+ for (ix = -1022, hx<<=11; hx>0; hx<<=1) ix -=1; + for (ix = -1022, hx<<=11; hx>0; hx<<=1) ix -=1;
return ix; return ix;
} }
else if (hx<0x7ff0000000000000LL) return (hx>>52)-0x3ff; else if (hx<0x7ff0000000000000LL) return (hx>>52)-0x3ff;
else if (FP_ILOGBNAN != INT_MAX) { else if (FP_ILOGBNAN != INT_MAX) {
/* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */ /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */
- if (((hx^0x7ff0000000000000LL)|lx) == 0) - if (((hx^0x7ff0000000000000LL)|lx) == 0)
+ if (hx==0x7ff0000000000000LL) + if (hx==0x7ff0000000000000LL)
return INT_MAX; return INT_MAX;
} }
return FP_ILOGBNAN; return FP_ILOGBNAN;
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c 2014-05-27 23:05:55.000000000 -0500
@ -175,7 +175,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c75
- if ((u.parts32.w0 & 0xfffff) | u.parts32.w1 - if ((u.parts32.w0 & 0xfffff) | u.parts32.w1
- | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3) - | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3)
+ if (((ix - 0x7ff00000) | lx) != 0) + if (((ix - 0x7ff00000) | lx) != 0)
return x + x; return x + x;
} }
@@ -298,21 +297,20 @@ @@ -298,21 +297,20 @@
@ -202,7 +202,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c75
- if ((u.parts32.w0 & 0xfffff) | u.parts32.w1 - if ((u.parts32.w0 & 0xfffff) | u.parts32.w1
- | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3) - | (u.parts32.w2 & 0x7fffffff) | u.parts32.w3)
+ if (((ix - 0x7ff00000) | lx) != 0) + if (((ix - 0x7ff00000) | lx) != 0)
return x + x; return x + x;
} }
if (x <= 0.0L) if (x <= 0.0L)
@@ -377,14 +375,16 @@ @@ -377,14 +375,16 @@
@ -215,16 +215,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_jnl.c glibc-2.17-c75
+ GET_HIGH_WORD (se, xhi); + GET_HIGH_WORD (se, xhi);
+ se &= 0xfff00000; + se &= 0xfff00000;
for (i = 1; i < n && se != 0xfff00000; i++) for (i = 1; i < n && se != 0xfff00000; i++)
{ {
temp = b; temp = b;
b = ((long double) (i + i) / x) * b - a; b = ((long double) (i + i) / x) * b - a;
- u.value = b; - u.value = b;
- se = u.parts32.w0 & 0xfff00000; - se = u.parts32.w0 & 0xfff00000;
+ xhi = ldbl_high (b); + xhi = ldbl_high (b);
+ GET_HIGH_WORD (se, xhi); + GET_HIGH_WORD (se, xhi);
+ se &= 0xfff00000; + se &= 0xfff00000;
a = temp; a = temp;
} }
} }
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_log10l.c 2014-05-27 23:05:51.000000000 -0500
@ -285,35 +285,35 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_logl.c glibc-2.17-c7
} }
else else
@@ -233,10 +235,8 @@ @@ -233,10 +235,8 @@
k = (m - 0xff000) >> 13; k = (m - 0xff000) >> 13;
/* t is the argument 0.5 + (k+26)/128 /* t is the argument 0.5 + (k+26)/128
of the nearest item to u in the lookup table. */ of the nearest item to u in the lookup table. */
- t.parts32.w0 = 0x3ff00000 + (k << 13); - t.parts32.w0 = 0x3ff00000 + (k << 13);
- t.parts32.w1 = 0; - t.parts32.w1 = 0;
- t.parts32.w2 = 0; - t.parts32.w2 = 0;
- t.parts32.w3 = 0; - t.parts32.w3 = 0;
+ INSERT_WORDS (xhi, 0x3ff00000 + (k << 13), 0); + INSERT_WORDS (xhi, 0x3ff00000 + (k << 13), 0);
+ t = xhi; + t = xhi;
w0 += 0x100000; w0 += 0x100000;
e -= 1; e -= 1;
k += 64; k += 64;
@@ -244,17 +244,15 @@ @@ -244,17 +244,15 @@
else else
{ {
k = (m - 0xfe000) >> 14; k = (m - 0xfe000) >> 14;
- t.parts32.w0 = 0x3fe00000 + (k << 14); - t.parts32.w0 = 0x3fe00000 + (k << 14);
- t.parts32.w1 = 0; - t.parts32.w1 = 0;
- t.parts32.w2 = 0; - t.parts32.w2 = 0;
- t.parts32.w3 = 0; - t.parts32.w3 = 0;
+ INSERT_WORDS (xhi, 0x3fe00000 + (k << 14), 0); + INSERT_WORDS (xhi, 0x3fe00000 + (k << 14), 0);
+ t = xhi; + t = xhi;
} }
- u.value = __scalbnl (u.value, ((int) ((w0 - u.parts32.w0) * 2)) >> 21); - u.value = __scalbnl (u.value, ((int) ((w0 - u.parts32.w0) * 2)) >> 21);
+ x = __scalbnl (x, ((int) ((w0 - hx) * 2)) >> 21); + x = __scalbnl (x, ((int) ((w0 - hx) * 2)) >> 21);
/* log(u) = log( t u/t ) = log(t) + log(u/t) /* log(u) = log( t u/t ) = log(t) + log(u/t)
log(t) is tabulated in the lookup table. log(t) is tabulated in the lookup table.
Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t. Express log(u/t) = log(1+z), where z = u/t - 1 = (u-t)/t.
cf. Cody & Waite. */ cf. Cody & Waite. */
- z = (u.value - t.value) / t.value; - z = (u.value - t.value) / t.value;
+ z = (x - t) / t; + z = (x - t) / t;
} }
@ -390,11 +390,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7
+ +
+ GET_HIGH_WORD (low_ye, ylo); + GET_HIGH_WORD (low_ye, ylo);
+ if ((low_ye & 0x7fffffff) >= 0x43400000) /* Low part >= 2^53 */ + if ((low_ye & 0x7fffffff) >= 0x43400000) /* Low part >= 2^53 */
yisint = 2; /* even integer y */ yisint = 2; /* even integer y */
else if (iy >= 0x3ff00000) /* 1.0 */ else if (iy >= 0x3ff00000) /* 1.0 */
{ {
@@ -207,42 +205,43 @@ @@ -207,42 +205,43 @@
} }
} }
+ ax = fabsl (x); + ax = fabsl (x);
@ -405,18 +405,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7
{ {
- if (iy == 0x7ff00000 && q.parts32.w1 == 0) /* y is +-inf */ - if (iy == 0x7ff00000 && q.parts32.w1 == 0) /* y is +-inf */
+ if (iy == 0x7ff00000) /* y is +-inf */ + if (iy == 0x7ff00000) /* y is +-inf */
{ {
- if (((ix - 0x3ff00000) | p.parts32.w1 - if (((ix - 0x3ff00000) | p.parts32.w1
- | (p.parts32.w2 & 0x7fffffff) | p.parts32.w3) == 0) - | (p.parts32.w2 & 0x7fffffff) | p.parts32.w3) == 0)
- return y - y; /* inf**+-1 is NaN */ - return y - y; /* inf**+-1 is NaN */
- else if (ix > 0x3ff00000 || fabsl (x) > 1.0L) - else if (ix > 0x3ff00000 || fabsl (x) > 1.0L)
+ if (ax > one) + if (ax > one)
/* (|x|>1)**+-inf = inf,0 */ /* (|x|>1)**+-inf = inf,0 */
return (hy >= 0) ? y : zero; return (hy >= 0) ? y : zero;
else else
/* (|x|<1)**-,+inf = inf,0 */ /* (|x|<1)**-,+inf = inf,0 */
return (hy < 0) ? -y : zero; return (hy < 0) ? -y : zero;
} }
- if (iy == 0x3ff00000) - if (iy == 0x3ff00000)
- { /* y is +-1 */ - { /* y is +-1 */
- if (hy < 0) - if (hy < 0)
@ -446,7 +446,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7
+ if (hx >= 0) /* x >= +0 */ + if (hx >= 0) /* x >= +0 */
+ return __ieee754_sqrtl (x); + return __ieee754_sqrtl (x);
+ } + }
} }
} }
- ax = fabsl (x); - ax = fabsl (x);
@ -456,9 +456,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7
{ {
- if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) - if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000)
+ if (ix == 0x7ff00000 || ix == 0 || (ix == 0x3ff00000 && xlo == 0.0)) + if (ix == 0x7ff00000 || ix == 0 || (ix == 0x3ff00000 && xlo == 0.0))
{ {
z = ax; /*x is +-0,+-inf,+-1 */ z = ax; /*x is +-0,+-inf,+-1 */
if (hy < 0) if (hy < 0)
@@ -294,8 +293,8 @@ @@ -294,8 +293,8 @@
{ {
ax *= two113; ax *= two113;
@ -559,9 +559,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7
- if (((j - 0x40d00000) | o.parts32.w1 - if (((j - 0x40d00000) | o.parts32.w1
- | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) - | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0)
+ if (((j - 0x40d00000) | lj) != 0) + if (((j - 0x40d00000) | lj) != 0)
return s * huge * huge; /* overflow */ return s * huge * huge; /* overflow */
else else
{ {
@@ -399,8 +377,7 @@ @@ -399,8 +377,7 @@
else if ((j & 0x7fffffff) >= 0x40d01b90) /* z <= -16495 */ else if ((j & 0x7fffffff) >= 0x40d01b90) /* z <= -16495 */
{ {
@ -569,9 +569,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_powl.c glibc-2.17-c7
- if (((j - 0xc0d01bc0) | o.parts32.w1 - if (((j - 0xc0d01bc0) | o.parts32.w1
- | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0) - | (o.parts32.w2 & 0x7fffffff) | o.parts32.w3) != 0)
+ if (((j - 0xc0d01bc0) | lj) != 0) + if (((j - 0xc0d01bc0) | lj) != 0)
return s * tiny * tiny; /* underflow */ return s * tiny * tiny; /* underflow */
else else
{ {
@@ -419,10 +396,7 @@ @@ -419,10 +396,7 @@
p_h -= t; p_h -= t;
} }
@ -610,21 +610,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/k_tanl.c glibc-2.17-c7
+ if ((int) x == 0) /* generate inexact */ + if ((int) x == 0) /* generate inexact */
+ { + {
+ if ((ix | lx | (iy + 1)) == 0) + if ((ix | lx | (iy + 1)) == 0)
return one / fabs (x); return one / fabs (x);
else else
return (iy == 1) ? x : -one / x; return (iy == 1) ? x : -one / x;
@@ -103,7 +103,7 @@ @@ -103,7 +103,7 @@
} }
if (ix >= 0x3fe59420) /* |x| >= 0.6743316650390625 */ if (ix >= 0x3fe59420) /* |x| >= 0.6743316650390625 */
{ {
- if ((u.parts32.w0 & 0x80000000) != 0) - if ((u.parts32.w0 & 0x80000000) != 0)
+ if ((hx & 0x80000000) != 0) + if ((hx & 0x80000000) != 0)
{ {
x = -x; x = -x;
y = -y; y = -y;
@@ -139,15 +139,13 @@ @@ -139,15 +139,13 @@
{ /* if allow error up to 2 ulp, { /* if allow error up to 2 ulp,
simply return -1.0/(x+r) here */ simply return -1.0/(x+r) here */
/* compute -1.0/(x+r) accurately */ /* compute -1.0/(x+r) accurately */
- u1.value = w; - u1.value = w;
- u1.parts32.w2 = 0; - u1.parts32.w2 = 0;
@ -670,9 +670,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_expm1l.c glibc-2.17-
/* Infinity. */ /* Infinity. */
- if (((ix & 0xfffff) | u.parts32.w1 | (u.parts32.w2&0x7fffffff) | u.parts32.w3) == 0) - if (((ix & 0xfffff) | u.parts32.w1 | (u.parts32.w2&0x7fffffff) | u.parts32.w3) == 0)
+ if (((ix - 0x7ff00000) | lx) == 0) + if (((ix - 0x7ff00000) | lx) == 0)
{ {
if (sign) if (sign)
return -1.0L; return -1.0L;
@@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@
} }
@ -691,44 +691,44 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_frexpl.c glibc-2.17-
{ {
- u_int64_t hx, lx, ix, ixl; - u_int64_t hx, lx, ix, ixl;
+ uint64_t hx, lx, ix, ixl; + uint64_t hx, lx, ix, ixl;
int64_t explo; int64_t explo;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ double xhi, xlo; + double xhi, xlo;
+ +
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
ixl = 0x7fffffffffffffffULL&lx; ixl = 0x7fffffffffffffffULL&lx;
ix = 0x7fffffffffffffffULL&hx; ix = 0x7fffffffffffffffULL&hx;
*eptr = 0; *eptr = 0;
- if(ix>=0x7ff0000000000000ULL||((ix|ixl)==0)) return x; /* 0,inf,nan */ - if(ix>=0x7ff0000000000000ULL||((ix|ixl)==0)) return x; /* 0,inf,nan */
+ if(ix>=0x7ff0000000000000ULL||ix==0) return x; /* 0,inf,nan */ + if(ix>=0x7ff0000000000000ULL||ix==0) return x; /* 0,inf,nan */
if (ix<0x0010000000000000ULL) { /* subnormal */ if (ix<0x0010000000000000ULL) { /* subnormal */
x *= two107; x *= two107;
- GET_LDOUBLE_MSW64(hx,x); - GET_LDOUBLE_MSW64(hx,x);
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
ix = hx&0x7fffffffffffffffULL; ix = hx&0x7fffffffffffffffULL;
*eptr = -107; *eptr = -107;
} }
@@ -54,7 +59,7 @@ @@ -54,7 +59,7 @@
if (ixl != 0ULL) { if (ixl != 0ULL) {
explo = (ixl>>52) - (ix>>52) + 0x3fe; explo = (ixl>>52) - (ix>>52) + 0x3fe;
if ((ixl&0x7ff0000000000000ULL) == 0LL) { if ((ixl&0x7ff0000000000000ULL) == 0LL) {
- /* the lower double is a denomal so we need to correct its - /* the lower double is a denomal so we need to correct its
+ /* the lower double is a denormal so we need to correct its + /* the lower double is a denormal so we need to correct its
mantissa and perhaps its exponent. */ mantissa and perhaps its exponent. */
int cnt; int cnt;
@@ -73,7 +78,9 @@ @@ -73,7 +78,9 @@
lx = 0ULL; lx = 0ULL;
hx = (hx&0x800fffffffffffffULL) | 0x3fe0000000000000ULL; hx = (hx&0x800fffffffffffffULL) | 0x3fe0000000000000ULL;
- SET_LDOUBLE_WORDS64(x,hx,lx); - SET_LDOUBLE_WORDS64(x,hx,lx);
+ INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xhi, hx);
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x; return x;
} }
#ifdef IS_IN_libm #ifdef IS_IN_libm
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_isinf_nsl.c
@ -828,67 +828,67 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c glibc-2.17-c
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_modfl.c 2014-05-27 23:05:55.000000000 -0500
@@ -37,43 +37,54 @@ @@ -37,43 +37,54 @@
{ {
int64_t i0,i1,j0; int64_t i0,i1,j0;
u_int64_t i; u_int64_t i;
- GET_LDOUBLE_WORDS64(i0,i1,x); - GET_LDOUBLE_WORDS64(i0,i1,x);
+ double xhi, xlo; + double xhi, xlo;
+ +
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (i0, xhi); + EXTRACT_WORDS64 (i0, xhi);
+ EXTRACT_WORDS64 (i1, xlo); + EXTRACT_WORDS64 (i1, xlo);
i1 &= 0x000fffffffffffffLL; i1 &= 0x000fffffffffffffLL;
j0 = ((i0>>52)&0x7ff)-0x3ff; /* exponent of x */ j0 = ((i0>>52)&0x7ff)-0x3ff; /* exponent of x */
if(j0<52) { /* integer part in high x */ if(j0<52) { /* integer part in high x */
if(j0<0) { /* |x|<1 */ if(j0<0) { /* |x|<1 */
/* *iptr = +-0 */ /* *iptr = +-0 */
- SET_LDOUBLE_WORDS64(*iptr,i0&0x8000000000000000ULL,0); - SET_LDOUBLE_WORDS64(*iptr,i0&0x8000000000000000ULL,0);
+ INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL);
+ *iptr = xhi; + *iptr = xhi;
return x; return x;
} else { } else {
i = (0x000fffffffffffffLL)>>j0; i = (0x000fffffffffffffLL)>>j0;
if(((i0&i)|(i1&0x7fffffffffffffffLL))==0) { /* x is integral */ if(((i0&i)|(i1&0x7fffffffffffffffLL))==0) { /* x is integral */
*iptr = x; *iptr = x;
/* return +-0 */ /* return +-0 */
- SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); - SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0);
+ INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL);
+ x = xhi; + x = xhi;
return x; return x;
} else { } else {
- SET_LDOUBLE_WORDS64(*iptr,i0&(~i),0); - SET_LDOUBLE_WORDS64(*iptr,i0&(~i),0);
+ INSERT_WORDS64 (xhi, i0&(~i)); + INSERT_WORDS64 (xhi, i0&(~i));
+ *iptr = xhi; + *iptr = xhi;
return x - *iptr; return x - *iptr;
} }
} }
} else if (j0>103) { /* no fraction part */ } else if (j0>103) { /* no fraction part */
*iptr = x*one; *iptr = x*one;
/* We must handle NaNs separately. */ /* We must handle NaNs separately. */
- if (j0 == 0x400 && ((i0 & 0x000fffffffffffffLL) | i1)) - if (j0 == 0x400 && ((i0 & 0x000fffffffffffffLL) | i1))
+ if ((i0 & 0x7fffffffffffffffLL) > 0x7ff0000000000000LL) + if ((i0 & 0x7fffffffffffffffLL) > 0x7ff0000000000000LL)
return x*one; return x*one;
/* return +-0 */ /* return +-0 */
- SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); - SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0);
+ INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL);
+ x = xhi; + x = xhi;
return x; return x;
} else { /* fraction part in low x */ } else { /* fraction part in low x */
i = -1ULL>>(j0-52); i = -1ULL>>(j0-52);
if((i1&i)==0) { /* x is integral */ if((i1&i)==0) { /* x is integral */
*iptr = x; *iptr = x;
/* return +-0 */ /* return +-0 */
- SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0); - SET_LDOUBLE_WORDS64(x,i0&0x8000000000000000ULL,0);
+ INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL); + INSERT_WORDS64 (xhi, i0&0x8000000000000000ULL);
+ x = xhi; + x = xhi;
return x; return x;
} else { } else {
- SET_LDOUBLE_WORDS64(*iptr,i0,i1&(~i)); - SET_LDOUBLE_WORDS64(*iptr,i0,i1&(~i));
+ INSERT_WORDS64 (xhi, i0); + INSERT_WORDS64 (xhi, i0);
+ INSERT_WORDS64 (xlo, i1&(~i)); + INSERT_WORDS64 (xlo, i1&(~i));
+ *iptr = ldbl_pack (xhi, xlo); + *iptr = ldbl_pack (xhi, xlo);
return x - *iptr; return x - *iptr;
} }
} }
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c 2014-05-27 23:05:55.000000000 -0500
@ -910,9 +910,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
+ yhi = ldbl_high (y); + yhi = ldbl_high (y);
+ EXTRACT_WORDS64 (hy, yhi); + EXTRACT_WORDS64 (hy, yhi);
ihx = hx&0x7fffffffffffffffLL; /* |hx| */ ihx = hx&0x7fffffffffffffffLL; /* |hx| */
- ilx = lx&0x7fffffffffffffffLL; /* |lx| */ - ilx = lx&0x7fffffffffffffffLL; /* |lx| */
ihy = hy&0x7fffffffffffffffLL; /* |hy| */ ihy = hy&0x7fffffffffffffffLL; /* |hy| */
- if((((ihx&0x7ff0000000000000LL)==0x7ff0000000000000LL)&& - if((((ihx&0x7ff0000000000000LL)==0x7ff0000000000000LL)&&
- ((ihx&0x000fffffffffffffLL)!=0)) || /* x is nan */ - ((ihx&0x000fffffffffffffLL)!=0)) || /* x is nan */
@ -920,138 +920,138 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c glibc-2
- ((ihy&0x000fffffffffffffLL)!=0))) /* y is nan */ - ((ihy&0x000fffffffffffffLL)!=0))) /* y is nan */
+ if((ihx>0x7ff0000000000000LL) || /* x is nan */ + if((ihx>0x7ff0000000000000LL) || /* x is nan */
+ (ihy>0x7ff0000000000000LL)) /* y is nan */ + (ihy>0x7ff0000000000000LL)) /* y is nan */
return x+y; /* signal the nan */ return x+y; /* signal the nan */
if(x==y) if(x==y)
return y; /* x=y, return y */ return y; /* x=y, return y */
- if(ihx == 0 && ilx == 0) { /* x == 0 */ - if(ihx == 0 && ilx == 0) { /* x == 0 */
- long double u; - long double u;
+ if(ihx == 0) { /* x == 0 */ + if(ihx == 0) { /* x == 0 */
+ long double u; /* return +-minsubnormal */ + long double u; /* return +-minsubnormal */
hy = (hy & 0x8000000000000000ULL) | 1; hy = (hy & 0x8000000000000000ULL) | 1;
- SET_LDOUBLE_WORDS64(x,hy,0ULL);/* return +-minsubnormal */ - SET_LDOUBLE_WORDS64(x,hy,0ULL);/* return +-minsubnormal */
+ INSERT_WORDS64 (yhi, hy); + INSERT_WORDS64 (yhi, hy);
+ x = yhi; + x = yhi;
u = math_opt_barrier (x); u = math_opt_barrier (x);
u = u * u; u = u * u;
math_force_eval (u); /* raise underflow flag */ math_force_eval (u); /* raise underflow flag */
@@ -59,10 +60,16 @@ @@ -59,10 +60,16 @@
long double u; long double u;
if(x > y) { /* x > y, x -= ulp */ if(x > y) { /* x > y, x -= ulp */
+ /* This isn't the largest magnitude correctly rounded + /* This isn't the largest magnitude correctly rounded
+ long double as you can see from the lowest mantissa + long double as you can see from the lowest mantissa
+ bit being zero. It is however the largest magnitude + bit being zero. It is however the largest magnitude
+ long double with a 106 bit mantissa, and nextafterl + long double with a 106 bit mantissa, and nextafterl
+ is insane with variable precision. So to make + is insane with variable precision. So to make
+ nextafterl sane we assume 106 bit precision. */ + nextafterl sane we assume 106 bit precision. */
if((hx==0xffefffffffffffffLL)&&(lx==0xfc8ffffffffffffeLL)) if((hx==0xffefffffffffffffLL)&&(lx==0xfc8ffffffffffffeLL))
return x+x; /* overflow, return -inf */ return x+x; /* overflow, return -inf */
if (hx >= 0x7ff0000000000000LL) { if (hx >= 0x7ff0000000000000LL) {
- SET_LDOUBLE_WORDS64(u,0x7fefffffffffffffLL,0x7c8ffffffffffffeLL); - SET_LDOUBLE_WORDS64(u,0x7fefffffffffffffLL,0x7c8ffffffffffffeLL);
+ u = 0x1.fffffffffffff7ffffffffffff8p+1023L; + u = 0x1.fffffffffffff7ffffffffffff8p+1023L;
return u; return u;
} }
if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */
@@ -77,16 +84,19 @@ @@ -77,16 +84,19 @@
return x; return x;
} }
if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */
- SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL); - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL);
+ INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); + INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52));
+ u = yhi; + u = yhi;
u *= 0x1.0000000000000p-105L; u *= 0x1.0000000000000p-105L;
- } else - } else
- SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL); - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL);
+ } else { + } else {
+ INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); + INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52));
+ u = yhi; + u = yhi;
+ } + }
return x - u; return x - u;
} else { /* x < y, x += ulp */ } else { /* x < y, x += ulp */
if((hx==0x7fefffffffffffffLL)&&(lx==0x7c8ffffffffffffeLL)) if((hx==0x7fefffffffffffffLL)&&(lx==0x7c8ffffffffffffeLL))
return x+x; /* overflow, return +inf */ return x+x; /* overflow, return +inf */
- if ((u_int64_t) hx >= 0xfff0000000000000ULL) { - if ((u_int64_t) hx >= 0xfff0000000000000ULL) {
- SET_LDOUBLE_WORDS64(u,0xffefffffffffffffLL,0xfc8ffffffffffffeLL); - SET_LDOUBLE_WORDS64(u,0xffefffffffffffffLL,0xfc8ffffffffffffeLL);
+ if ((uint64_t) hx >= 0xfff0000000000000ULL) { + if ((uint64_t) hx >= 0xfff0000000000000ULL) {
+ u = -0x1.fffffffffffff7ffffffffffff8p+1023L; + u = -0x1.fffffffffffff7ffffffffffff8p+1023L;
return u; return u;
} }
if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */ if(ihx <= 0x0360000000000000LL) { /* x <= LDBL_MIN */
@@ -103,10 +113,13 @@ @@ -103,10 +113,13 @@
return x; return x;
} }
if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */ if (ihx < 0x06a0000000000000LL) { /* ulp will denormal */
- SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL); - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL),0ULL);
+ INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52)); + INSERT_WORDS64 (yhi, hx & (0x7ffLL<<52));
+ u = yhi; + u = yhi;
u *= 0x1.0000000000000p-105L; u *= 0x1.0000000000000p-105L;
- } else - } else
- SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL); - SET_LDOUBLE_WORDS64(u,(hx&0x7ff0000000000000LL)-0x0690000000000000LL,0ULL);
+ } else { + } else {
+ INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52)); + INSERT_WORDS64 (yhi, (hx & (0x7ffLL<<52))-(0x069LL<<52));
+ u = yhi; + u = yhi;
+ } + }
return x + u; return x + u;
} }
} }
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c 2014-05-27 23:10:26.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttoward.c 2014-05-27 23:10:26.000000000 -0500
@@ -34,23 +34,23 @@ @@ -34,23 +34,23 @@
{ {
int32_t hx,ix; int32_t hx,ix;
int64_t hy,iy; int64_t hy,iy;
- u_int32_t lx; - u_int32_t lx;
- u_int64_t ly,uly; - u_int64_t ly,uly;
+ uint32_t lx; + uint32_t lx;
+ double yhi; + double yhi;
+ +
EXTRACT_WORDS(hx,lx,x); EXTRACT_WORDS(hx,lx,x);
- GET_LDOUBLE_WORDS64(hy,ly,y); - GET_LDOUBLE_WORDS64(hy,ly,y);
+ yhi = ldbl_high (y); + yhi = ldbl_high (y);
+ EXTRACT_WORDS64(hy,yhi); + EXTRACT_WORDS64(hy,yhi);
ix = hx&0x7fffffff; /* |x| */ ix = hx&0x7fffffff; /* |x| */
iy = hy&0x7fffffffffffffffLL; /* |y| */ iy = hy&0x7fffffffffffffffLL; /* |y| */
- uly = ly&0x7fffffffffffffffLL; /* |y| */ - uly = ly&0x7fffffffffffffffLL; /* |y| */
if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */ if(((ix>=0x7ff00000)&&((ix-0x7ff00000)|lx)!=0) || /* x is nan */
- ((iy>=0x7ff0000000000000LL)&&((iy-0x7ff0000000000000LL)|uly)!=0)) - ((iy>=0x7ff0000000000000LL)&&((iy-0x7ff0000000000000LL)|uly)!=0))
- /* y is nan */ - /* y is nan */
+ iy>0x7ff0000000000000LL) /* y is nan */ + iy>0x7ff0000000000000LL) /* y is nan */
return x+y; return x+y;
if((long double) x==y) return y; /* x=y, return y */ if((long double) x==y) return y; /* x=y, return y */
if((ix|lx)==0) { /* x == 0 */ if((ix|lx)==0) { /* x == 0 */
double u; double u;
- INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */ - INSERT_WORDS(x,(u_int32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
+ INSERT_WORDS(x,(uint32_t)((hy>>32)&0x80000000),1);/* return +-minsub */ + INSERT_WORDS(x,(uint32_t)((hy>>32)&0x80000000),1);/* return +-minsub */
u = math_opt_barrier (x); u = math_opt_barrier (x);
u = u * u; u = u * u;
math_force_eval (u); /* raise underflow flag */ math_force_eval (u); /* raise underflow flag */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_nexttowardf.c 2014-05-27 23:05:55.000000000 -0500
@@ -27,16 +27,16 @@ @@ -27,16 +27,16 @@
{ {
int32_t hx,ix; int32_t hx,ix;
int64_t hy,iy; int64_t hy,iy;
- u_int64_t ly, uly; - u_int64_t ly, uly;
+ double yhi; + double yhi;
GET_FLOAT_WORD(hx,x); GET_FLOAT_WORD(hx,x);
- GET_LDOUBLE_WORDS64(hy,ly,y); - GET_LDOUBLE_WORDS64(hy,ly,y);
+ yhi = ldbl_high (y); + yhi = ldbl_high (y);
+ EXTRACT_WORDS64 (hy, yhi); + EXTRACT_WORDS64 (hy, yhi);
ix = hx&0x7fffffff; /* |x| */ ix = hx&0x7fffffff; /* |x| */
iy = hy&0x7fffffffffffffffLL; /* |y| */ iy = hy&0x7fffffffffffffffLL; /* |y| */
- uly = ly&0x7fffffffffffffffLL; /* |y| */ - uly = ly&0x7fffffffffffffffLL; /* |y| */
if((ix>0x7f800000) || /* x is nan */ if((ix>0x7f800000) || /* x is nan */
- ((iy>=0x7ff0000000000000LL)&&((iy-0x7ff0000000000000LL)|uly)!=0)) - ((iy>=0x7ff0000000000000LL)&&((iy-0x7ff0000000000000LL)|uly)!=0))
+ (iy>0x7ff0000000000000LL)) + (iy>0x7ff0000000000000LL))
/* y is nan */ /* y is nan */
return x+y; return x+y;
if((long double) x==y) return y; /* x=y, return y */ if((long double) x==y) return y; /* x=y, return y */
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c 2014-05-27 23:05:55.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_remquol.c 2014-05-27 23:05:55.000000000 -0500
@ -1090,53 +1090,53 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c glibc-2.1
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c 2014-05-27 23:15:30.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalblnl.c 2014-05-27 23:15:30.000000000 -0500
@@ -41,11 +41,15 @@ @@ -41,11 +41,15 @@
{ {
int64_t k,l,hx,lx; int64_t k,l,hx,lx;
union { int64_t i; double d; } u; union { int64_t i; double d; } u;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ double xhi, xlo; + double xhi, xlo;
+ +
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
k = (hx>>52)&0x7ff; /* extract exponent */ k = (hx>>52)&0x7ff; /* extract exponent */
l = (lx>>52)&0x7ff; l = (lx>>52)&0x7ff;
if (k==0) { /* 0 or subnormal x */ if (k==0) { /* 0 or subnormal x */
- if (((hx|lx)&0x7fffffffffffffffULL)==0) return x; /* +-0 */ - if (((hx|lx)&0x7fffffffffffffffULL)==0) return x; /* +-0 */
+ if ((hx&0x7fffffffffffffffULL)==0) return x; /* +-0 */ + if ((hx&0x7fffffffffffffffULL)==0) return x; /* +-0 */
u.i = hx; u.i = hx;
u.d *= two54; u.d *= two54;
hx = u.i; hx = u.i;
@@ -61,7 +65,9 @@ @@ -61,7 +65,9 @@
if (k > 0) { /* normal result */ if (k > 0) { /* normal result */
hx = (hx&0x800fffffffffffffULL)|(k<<52); hx = (hx&0x800fffffffffffffULL)|(k<<52);
if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */ if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */
- SET_LDOUBLE_WORDS64(x,hx,lx); - SET_LDOUBLE_WORDS64(x,hx,lx);
+ INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xhi, hx);
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x; return x;
} }
if (l == 0) { /* low part subnormal */ if (l == 0) { /* low part subnormal */
@@ -81,14 +87,19 @@ @@ -81,14 +87,19 @@
u.d *= twom54; u.d *= twom54;
lx = u.i; lx = u.i;
} }
- SET_LDOUBLE_WORDS64(x,hx,lx); - SET_LDOUBLE_WORDS64(x,hx,lx);
+ INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xhi, hx);
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x; return x;
} }
if (k <= -54) if (k <= -54)
return tiny*__copysignl(tiny,x); /*underflow*/ return tiny*__copysignl(tiny,x); /*underflow*/
k += 54; /* subnormal result */ k += 54; /* subnormal result */
lx &= 0x8000000000000000ULL; lx &= 0x8000000000000000ULL;
- SET_LDOUBLE_WORDS64(x,(hx&0x800fffffffffffffULL)|(k<<52),lx); - SET_LDOUBLE_WORDS64(x,(hx&0x800fffffffffffffULL)|(k<<52),lx);
+ hx &= 0x800fffffffffffffULL; + hx &= 0x800fffffffffffffULL;
+ INSERT_WORDS64 (xhi, hx|(k<<52)); + INSERT_WORDS64 (xhi, hx|(k<<52));
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x*twolm54; return x*twolm54;
} }
long_double_symbol (libm, __scalblnl, scalblnl); long_double_symbol (libm, __scalblnl, scalblnl);
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c
@ -1144,53 +1144,53 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c glibc-2.17
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c 2014-05-27 23:16:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_scalbnl.c 2014-05-27 23:16:25.000000000 -0500
@@ -41,11 +41,15 @@ @@ -41,11 +41,15 @@
{ {
int64_t k,l,hx,lx; int64_t k,l,hx,lx;
union { int64_t i; double d; } u; union { int64_t i; double d; } u;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
+ double xhi, xlo; + double xhi, xlo;
+ +
+ ldbl_unpack (x, &xhi, &xlo); + ldbl_unpack (x, &xhi, &xlo);
+ EXTRACT_WORDS64 (hx, xhi); + EXTRACT_WORDS64 (hx, xhi);
+ EXTRACT_WORDS64 (lx, xlo); + EXTRACT_WORDS64 (lx, xlo);
k = (hx>>52)&0x7ff; /* extract exponent */ k = (hx>>52)&0x7ff; /* extract exponent */
l = (lx>>52)&0x7ff; l = (lx>>52)&0x7ff;
if (k==0) { /* 0 or subnormal x */ if (k==0) { /* 0 or subnormal x */
- if (((hx|lx)&0x7fffffffffffffffULL)==0) return x; /* +-0 */ - if (((hx|lx)&0x7fffffffffffffffULL)==0) return x; /* +-0 */
+ if ((hx&0x7fffffffffffffffULL)==0) return x; /* +-0 */ + if ((hx&0x7fffffffffffffffULL)==0) return x; /* +-0 */
u.i = hx; u.i = hx;
u.d *= two54; u.d *= two54;
hx = u.i; hx = u.i;
@@ -61,7 +65,9 @@ @@ -61,7 +65,9 @@
if (k > 0) { /* normal result */ if (k > 0) { /* normal result */
hx = (hx&0x800fffffffffffffULL)|(k<<52); hx = (hx&0x800fffffffffffffULL)|(k<<52);
if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */ if ((lx & 0x7fffffffffffffffULL) == 0) { /* low part +-0 */
- SET_LDOUBLE_WORDS64(x,hx,lx); - SET_LDOUBLE_WORDS64(x,hx,lx);
+ INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xhi, hx);
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x; return x;
} }
if (l == 0) { /* low part subnormal */ if (l == 0) { /* low part subnormal */
@@ -81,14 +87,19 @@ @@ -81,14 +87,19 @@
u.d *= twom54; u.d *= twom54;
lx = u.i; lx = u.i;
} }
- SET_LDOUBLE_WORDS64(x,hx,lx); - SET_LDOUBLE_WORDS64(x,hx,lx);
+ INSERT_WORDS64 (xhi, hx); + INSERT_WORDS64 (xhi, hx);
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x; return x;
} }
if (k <= -54) if (k <= -54)
return tiny*__copysignl(tiny,x); /*underflow*/ return tiny*__copysignl(tiny,x); /*underflow*/
k += 54; /* subnormal result */ k += 54; /* subnormal result */
lx &= 0x8000000000000000ULL; lx &= 0x8000000000000000ULL;
- SET_LDOUBLE_WORDS64(x,(hx&0x800fffffffffffffULL)|(k<<52),lx); - SET_LDOUBLE_WORDS64(x,(hx&0x800fffffffffffffULL)|(k<<52),lx);
+ hx &= 0x800fffffffffffffULL; + hx &= 0x800fffffffffffffULL;
+ INSERT_WORDS64 (xhi, hx|(k<<52)); + INSERT_WORDS64 (xhi, hx|(k<<52));
+ INSERT_WORDS64 (xlo, lx); + INSERT_WORDS64 (xlo, lx);
+ x = ldbl_pack (xhi, xlo); + x = ldbl_pack (xhi, xlo);
return x*twolm54; return x*twolm54;
} }
#ifdef IS_IN_libm #ifdef IS_IN_libm
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c
@ -1199,7 +1199,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c glibc-2.17-c
@@ -47,10 +47,12 @@ @@ -47,10 +47,12 @@
long double __tanhl(long double x) long double __tanhl(long double x)
{ {
long double t,z; long double t,z;
- int64_t jx,ix,lx; - int64_t jx,ix,lx;
+ int64_t jx,ix; + int64_t jx,ix;
+ double xhi; + double xhi;
@ -1208,18 +1208,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_tanhl.c glibc-2.17-c
- GET_LDOUBLE_WORDS64(jx,lx,x); - GET_LDOUBLE_WORDS64(jx,lx,x);
+ xhi = ldbl_high (x); + xhi = ldbl_high (x);
+ EXTRACT_WORDS64 (jx, xhi); + EXTRACT_WORDS64 (jx, xhi);
ix = jx&0x7fffffffffffffffLL; ix = jx&0x7fffffffffffffffLL;
/* x is INF or NaN */ /* x is INF or NaN */
@@ -61,7 +63,7 @@ @@ -61,7 +63,7 @@
/* |x| < 22 */ /* |x| < 22 */
if (ix < 0x4036000000000000LL) { /* |x|<22 */ if (ix < 0x4036000000000000LL) { /* |x|<22 */
- if ((ix | (lx&0x7fffffffffffffffLL)) == 0) - if ((ix | (lx&0x7fffffffffffffffLL)) == 0)
+ if (ix == 0) + if (ix == 0)
return x; /* x == +-0 */ return x; /* x == +-0 */
if (ix<0x3c60000000000000LL) /* |x|<2**-57 */ if (ix<0x3c60000000000000LL) /* |x|<2**-57 */
return x*(one+x); /* tanh(small) = small */ return x*(one+x); /* tanh(small) = small */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps 2014-05-27 23:05:51.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps 2014-05-27 23:05:51.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps 2014-05-27 23:08:26.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/fpu/libm-test-ulps 2014-05-27 23:08:26.000000000 -0500

154
SOURCES/glibc-ppc64le-09.patch

@ -115,7 +115,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c
+ ldbl_unpack (y, &yhi, &ylo); + ldbl_unpack (y, &yhi, &ylo);
+ EXTRACT_WORDS64 (hy, yhi); + EXTRACT_WORDS64 (hy, yhi);
+ EXTRACT_WORDS64 (ly, ylo); + EXTRACT_WORDS64 (ly, ylo);
sx = hx&0x8000000000000000ULL; /* sign of x */ sx = hx&0x8000000000000000ULL; /* sign of x */
- hx ^=sx; /* |x| */ - hx ^=sx; /* |x| */
- hy &= 0x7fffffffffffffffLL; /* |y| */ - hy &= 0x7fffffffffffffffLL; /* |y| */
+ hx ^= sx; /* |x| */ + hx ^= sx; /* |x| */
@ -125,9 +125,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c
/* purge off exception values */ /* purge off exception values */
- if(__builtin_expect((hy|(ly&0x7fffffffffffffff))==0 || - if(__builtin_expect((hy|(ly&0x7fffffffffffffff))==0 ||
+ if(__builtin_expect(hy==0 || + if(__builtin_expect(hy==0 ||
(hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */ (hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */
(hy>0x7ff0000000000000LL),0)) /* or y is NaN */ (hy>0x7ff0000000000000LL),0)) /* or y is NaN */
return (x*y)/(x*y); return (x*y)/(x*y);
- if(__builtin_expect(hx<=hy,0)) { - if(__builtin_expect(hx<=hy,0)) {
- if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */ - if((hx<hy)||(lx<ly)) return x; /* |x|<|y| return x */
- if(lx==ly) - if(lx==ly)
@ -159,7 +159,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c
+ /* If |x| == |y| return x*0. */ + /* If |x| == |y| return x*0. */
+ if ((lx ^ sx) == (ly ^ sy)) + if ((lx ^ sx) == (ly ^ sy))
+ return Zero[(uint64_t) sx >> 63]; + return Zero[(uint64_t) sx >> 63];
} }
- /* determine ix = ilogb(x) */ - /* determine ix = ilogb(x) */
- if(__builtin_expect(hx<0x0010000000000000LL,0)) { /* subnormal x */ - if(__builtin_expect(hx<0x0010000000000000LL,0)) { /* subnormal x */
@ -235,25 +235,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c glibc-2.17-c
+ } + }
/* fix point fmod */ /* fix point fmod */
n = ix - iy; n = ix - iy;
@@ -104,7 +111,7 @@ @@ -104,7 +111,7 @@
hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1; hz=hx-hy;lz=lx-ly; if(lx<ly) hz -= 1;
if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;} if(hz<0){hx = hx+hx+(lx>>63); lx = lx+lx;}
else { else {
- if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */ - if((hz|(lz&0x7fffffffffffffff))==0) /* return sign(x)*0 */
+ if((hz|lz)==0) /* return sign(x)*0 */ + if((hz|lz)==0) /* return sign(x)*0 */
return Zero[(u_int64_t)sx>>63]; return Zero[(u_int64_t)sx>>63];
hx = hz+hz+(lz>>63); lx = lz+lz; hx = hz+hz+(lz>>63); lx = lz+lz;
} }
@@ -113,7 +120,7 @@ @@ -113,7 +120,7 @@
if(hz>=0) {hx=hz;lx=lz;} if(hz>=0) {hx=hz;lx=lz;}
/* convert back to floating value and restore the sign */ /* convert back to floating value and restore the sign */
- if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */ - if((hx|(lx&0x7fffffffffffffff))==0) /* return sign(x)*0 */
+ if((hx|lx)==0) /* return sign(x)*0 */ + if((hx|lx)==0) /* return sign(x)*0 */
return Zero[(u_int64_t)sx>>63]; return Zero[(u_int64_t)sx>>63];
while(hx<0x0001000000000000LL) { /* normalize x */ while(hx<0x0001000000000000LL) { /* normalize x */
hx = hx+hx+(lx>>63); lx = lx+lx; hx = hx+hx+(lx>>63); lx = lx+lx;
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c 2014-05-27 20:02:27.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c 2014-05-27 20:02:27.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c 2014-05-27 20:04:08.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c 2014-05-27 20:04:08.000000000 -0500
@ -269,7 +269,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
{ {
- long double a,b,t1,t2,y1,y2,w,kld; - long double a,b,t1,t2,y1,y2,w,kld;
+ long double a,b,a1,a2,b1,b2,w,kld; + long double a,b,a1,a2,b1,b2,w,kld;
int64_t j,k,ha,hb; int64_t j,k,ha,hb;
+ double xhi, yhi, hi, lo; + double xhi, yhi, hi, lo;
- GET_LDOUBLE_MSW64(ha,x); - GET_LDOUBLE_MSW64(ha,x);
@ -277,31 +277,31 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
+ EXTRACT_WORDS64 (ha, xhi); + EXTRACT_WORDS64 (ha, xhi);
+ yhi = ldbl_high (y); + yhi = ldbl_high (y);
+ EXTRACT_WORDS64 (hb, yhi); + EXTRACT_WORDS64 (hb, yhi);
ha &= 0x7fffffffffffffffLL; ha &= 0x7fffffffffffffffLL;
- GET_LDOUBLE_MSW64(hb,y); - GET_LDOUBLE_MSW64(hb,y);
hb &= 0x7fffffffffffffffLL; hb &= 0x7fffffffffffffffLL;
if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;} if(hb > ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;}
a = fabsl(a); /* a <- |a| */ a = fabsl(a); /* a <- |a| */
b = fabsl(b); /* b <- |b| */ b = fabsl(b); /* b <- |b| */
- if((ha-hb)>0x780000000000000LL) {return a+b;} /* x/y > 2**120 */ - if((ha-hb)>0x780000000000000LL) {return a+b;} /* x/y > 2**120 */
+ if((ha-hb)>0x0780000000000000LL) {return a+b;} /* x/y > 2**120 */ + if((ha-hb)>0x0780000000000000LL) {return a+b;} /* x/y > 2**120 */
k=0; k=0;
kld = 1.0L; kld = 1.0L;
if(ha > 0x5f30000000000000LL) { /* a>2**500 */ if(ha > 0x5f30000000000000LL) { /* a>2**500 */
if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */ if(ha >= 0x7ff0000000000000LL) { /* Inf or NaN */
- u_int64_t low; - u_int64_t low;
w = a+b; /* for sNaN */ w = a+b; /* for sNaN */
- GET_LDOUBLE_LSW64(low,a); - GET_LDOUBLE_LSW64(low,a);
- if(((ha&0xfffffffffffffLL)|(low&0x7fffffffffffffffLL))==0) - if(((ha&0xfffffffffffffLL)|(low&0x7fffffffffffffffLL))==0)
+ if(ha == 0x7ff0000000000000LL) + if(ha == 0x7ff0000000000000LL)
w = a; w = a;
- GET_LDOUBLE_LSW64(low,b); - GET_LDOUBLE_LSW64(low,b);
- if(((hb^0x7ff0000000000000LL)|(low&0x7fffffffffffffffLL))==0) - if(((hb^0x7ff0000000000000LL)|(low&0x7fffffffffffffffLL))==0)
+ if(hb == 0x7ff0000000000000LL) + if(hb == 0x7ff0000000000000LL)
w = b; w = b;
return w; return w;
} }
/* scale a and b by 2**-600 */ /* scale a and b by 2**-600 */
- ha -= 0x2580000000000000LL; hb -= 0x2580000000000000LL; k += 600; - ha -= 0x2580000000000000LL; hb -= 0x2580000000000000LL; k += 600;
- a /= two600; - a /= two600;
- b /= two600; - b /= two600;
@ -311,10 +311,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
+ b *= 0x1p-600L; + b *= 0x1p-600L;
+ k = 600; + k = 600;
+ kld = 0x1p+600L; + kld = 0x1p+600L;
} }
- if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */ - if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */
+ else if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */ + else if(hb < 0x23d0000000000000LL) { /* b < 2**-450 */
if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */ if(hb <= 0x000fffffffffffffLL) { /* subnormal b or 0 */
- u_int64_t low; - u_int64_t low;
- GET_LDOUBLE_LSW64(low,b); - GET_LDOUBLE_LSW64(low,b);
- if((hb|(low&0x7fffffffffffffffLL))==0) return a; - if((hb|(low&0x7fffffffffffffffLL))==0) return a;
@ -328,7 +328,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
+ b *= 0x1p+1022L; + b *= 0x1p+1022L;
+ k = -1022; + k = -1022;
+ kld = 0x1p-1022L; + kld = 0x1p-1022L;
} else { /* scale a and b by 2^600 */ } else { /* scale a and b by 2^600 */
- ha += 0x2580000000000000LL; /* a *= 2^600 */ - ha += 0x2580000000000000LL; /* a *= 2^600 */
- hb += 0x2580000000000000LL; /* b *= 2^600 */ - hb += 0x2580000000000000LL; /* b *= 2^600 */
- k -= 600; - k -= 600;
@ -339,11 +339,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
+ b *= 0x1p+600L; + b *= 0x1p+600L;
+ k = -600; + k = -600;
+ kld = 0x1p-600L; + kld = 0x1p-600L;
} }
} }
/* medium size a and b */ /* medium size a and b */
w = a-b; w = a-b;
if (w>b) { if (w>b) {
- SET_LDOUBLE_WORDS64(t1,ha,0); - SET_LDOUBLE_WORDS64(t1,ha,0);
- t2 = a-t1; - t2 = a-t1;
- w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1))); - w = __ieee754_sqrtl(t1*t1-(b*(-b)-t2*(a+t1)));
@ -357,8 +357,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
+ = a1*a1 + a1*a2 + a2*a + b*b + = a1*a1 + a1*a2 + a2*a + b*b
+ = a1*a1 + a2*(a+a1) + b*b */ + = a1*a1 + a2*(a+a1) + b*b */
+ w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1))); + w = __ieee754_sqrtl(a1*a1-(b*(-b)-a2*(a+a1)));
} else { } else {
a = a+a; a = a+a;
- SET_LDOUBLE_WORDS64(y1,hb,0); - SET_LDOUBLE_WORDS64(y1,hb,0);
- y2 = b - y1; - y2 = b - y1;
- SET_LDOUBLE_WORDS64(t1,ha+0x0010000000000000LL,0); - SET_LDOUBLE_WORDS64(t1,ha+0x0010000000000000LL,0);
@ -379,16 +379,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_hypotl.c glibc-2.17-
+ = w*w + a1*(b1+b2) + a2*b + = w*w + a1*(b1+b2) + a2*b
+ = w*w + a1*b1 + a1*b2 + a2*b */ + = w*w + a1*b1 + a1*b2 + a2*b */
+ w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b))); + w = __ieee754_sqrtl(a1*b1-(w*(-w)-(a1*b2+a2*b)));
} }
if(k!=0) if(k!=0)
return w*kld; return w*kld;
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c
--- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c 2014-05-27 20:02:27.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c 2014-05-27 20:02:27.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c 2014-05-27 20:04:08.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c 2014-05-27 20:04:08.000000000 -0500
@@ -33,18 +33,22 @@ @@ -33,18 +33,22 @@
int64_t hx,hp; int64_t hx,hp;
u_int64_t sx,lx,lp; u_int64_t sx,lx,lp;
long double p_half; long double p_half;
+ double xhi, xlo, phi, plo; + double xhi, xlo, phi, plo;
- GET_LDOUBLE_WORDS64(hx,lx,x); - GET_LDOUBLE_WORDS64(hx,lx,x);
@ -399,29 +399,29 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_remainderl.c glibc-2
+ ldbl_unpack (p, &phi, &plo); + ldbl_unpack (p, &phi, &plo);
+ EXTRACT_WORDS64 (hp, phi); + EXTRACT_WORDS64 (hp, phi);
+ EXTRACT_WORDS64 (lp, plo); + EXTRACT_WORDS64 (lp, plo);
sx = hx&0x8000000000000000ULL; sx = hx&0x8000000000000000ULL;
hp &= 0x7fffffffffffffffLL; hp &= 0x7fffffffffffffffLL;
hx &= 0x7fffffffffffffffLL; hx &= 0x7fffffffffffffffLL;
/* purge off exception values */ /* purge off exception values */
- if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */ - if((hp|(lp&0x7fffffffffffffff))==0) return (x*p)/(x*p); /* p = 0 */
+ if(hp==0) return (x*p)/(x*p); /* p = 0 */ + if(hp==0) return (x*p)/(x*p); /* p = 0 */
if((hx>=0x7ff0000000000000LL)|| /* x not finite */ if((hx>=0x7ff0000000000000LL)|| /* x not finite */
- ((hp>=0x7ff0000000000000LL)&& /* p is NaN */ - ((hp>=0x7ff0000000000000LL)&& /* p is NaN */
- (((hp-0x7ff0000000000000LL)|lp)!=0))) - (((hp-0x7ff0000000000000LL)|lp)!=0)))
+ (hp>0x7ff0000000000000LL)) /* p is NaN */ + (hp>0x7ff0000000000000LL)) /* p is NaN */
return (x*p)/(x*p); return (x*p)/(x*p);
@@ -64,8 +68,8 @@ @@ -64,8 +68,8 @@
if(x>=p_half) x -= p; if(x>=p_half) x -= p;
} }
} }
- GET_LDOUBLE_MSW64(hx,x); - GET_LDOUBLE_MSW64(hx,x);
- SET_LDOUBLE_MSW64(x,hx^sx); - SET_LDOUBLE_MSW64(x,hx^sx);
+ if (sx) + if (sx)
+ x = -x; + x = -x;
return x; return x;
} }
strong_alias (__ieee754_remainderl, __remainderl_finite) strong_alias (__ieee754_remainderl, __remainderl_finite)
diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c
@ -452,16 +452,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7
@@ -778,7 +778,7 @@ @@ -778,7 +778,7 @@
if (ix >= 0x4039A0DE) if (ix >= 0x4039A0DE)
{ {
/* __erfcl (x) underflows if x > 25.6283 */ /* __erfcl (x) underflows if x > 25.6283 */
- if (sign) - if (sign)
+ if ((hx & 0x80000000) == 0) + if ((hx & 0x80000000) == 0)
return one-tiny; return one-tiny;
else else
return tiny-one; return tiny-one;
@@ -789,8 +789,9 @@ @@ -789,8 +789,9 @@
return (one - y); return (one - y);
} }
} }
- u.parts32.w0 = ix; - u.parts32.w0 = ix;
- a = u.value; - a = u.value;
@ -516,14 +516,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7
+ x = -x; + x = -x;
i = 8.0 * x; i = 8.0 * x;
switch (i) switch (i)
{ {
@@ -891,7 +893,7 @@ @@ -891,7 +893,7 @@
y += C20a; y += C20a;
break; break;
} }
- if (sign & 0x80000000) - if (sign & 0x80000000)
+ if (hx & 0x80000000) + if (hx & 0x80000000)
y = 2.0L - y; y = 2.0L - y;
return y; return y;
} }
@@ -899,10 +901,11 @@ @@ -899,10 +901,11 @@
@ -532,7 +532,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7
/* x < -9 */ /* x < -9 */
- if ((ix >= 0x40220000) && (sign & 0x80000000)) - if ((ix >= 0x40220000) && (sign & 0x80000000))
+ if (hx >= 0xc0220000) + if (hx >= 0xc0220000)
return two - tiny; return two - tiny;
- x = fabsl (x); - x = fabsl (x);
+ if ((hx & 0x80000000) != 0) + if ((hx & 0x80000000) != 0)
@ -541,9 +541,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7
i = 8.0 / x; i = 8.0 / x;
switch (i) switch (i)
@@ -933,21 +936,17 @@ @@ -933,21 +936,17 @@
p = neval (z, RNr8, NRNr8) / deval (z, RDr8, NRDr8); p = neval (z, RNr8, NRNr8) / deval (z, RDr8, NRDr8);
break; break;
} }
- u.value = x; - u.value = x;
- u.parts32.w3 = 0; - u.parts32.w3 = 0;
- u.parts32.w2 = 0; - u.parts32.w2 = 0;
@ -551,17 +551,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/s_erfl.c glibc-2.17-c7
- z = u.value; - z = u.value;
+ z = (float) x; + z = (float) x;
r = __ieee754_expl (-z * z - 0.5625) * r = __ieee754_expl (-z * z - 0.5625) *
__ieee754_expl ((z - x) * (z + x) + p); __ieee754_expl ((z - x) * (z + x) + p);
- if ((sign & 0x80000000) == 0) - if ((sign & 0x80000000) == 0)
+ if ((hx & 0x80000000) == 0) + if ((hx & 0x80000000) == 0)
return r / x; return r / x;
else else
return two - r / x; return two - r / x;
} }
else else
{ {
- if ((sign & 0x80000000) == 0) - if ((sign & 0x80000000) == 0)
+ if ((hx & 0x80000000) == 0) + if ((hx & 0x80000000) == 0)
return tiny * tiny; return tiny * tiny;
else else
return two - tiny; return two - tiny;

8
SOURCES/glibc-ppc64le-11.patch

@ -62,7 +62,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c
+ n = (int64_t) ((l - k) * 2) >> 53; + n = (int64_t) ((l - k) * 2) >> 53;
+ m = (a.i[1] >> 52) & 0x7ff; + m = (a.i[1] >> 52) & 0x7ff;
if (m == 0) { if (m == 0) {
a.d[1] *= two54; a.d[1] *= two54;
- m = ((a.i[2] >> 20) & 0x7ff) - 54; - m = ((a.i[2] >> 20) & 0x7ff) - 54;
+ m = ((a.i[1] >> 52) & 0x7ff) - 54; + m = ((a.i[1] >> 52) & 0x7ff) - 54;
} }
@ -77,10 +77,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c
+ else if (m <= -54) { + else if (m <= -54) {
+ a.i[1] &= INT64_C(0x8000000000000000); + a.i[1] &= INT64_C(0x8000000000000000);
} else { } else {
m += 54; m += 54;
- a.i[2] = (a.i[2] & 0x800fffff) | (m << 20); - a.i[2] = (a.i[2] & 0x800fffff) | (m << 20);
+ a.i[1] = (a.i[1] & INT64_C(0x800fffffffffffff)) | (m << 52); + a.i[1] = (a.i[1] & INT64_C(0x800fffffffffffff)) | (m << 52);
a.d[1] *= twom54; a.d[1] *= twom54;
} }
} }
a.i[0] = l; a.i[0] = l;
@ -101,7 +101,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/ieee754/ldbl-128ibm/e_sqrtl.c glibc-2.17-c
- if (a.i[0] == 0xfff00000 && a.i[1] == 0) - if (a.i[0] == 0xfff00000 && a.i[1] == 0)
+ if (k>=INT64_C(0x7ff0000000000000)) { + if (k>=INT64_C(0x7ff0000000000000)) {
+ if (a.i[0] == INT64_C(0xfff0000000000000)) + if (a.i[0] == INT64_C(0xfff0000000000000))
return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */ return (big1-big1)/(big-big); /* sqrt (-Inf) = NaN. */
return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */ return x; /* sqrt (NaN) = NaN, sqrt (+Inf) = +Inf. */
} }
if (x == 0) return x; if (x == 0) return x;

1
SOURCES/glibc-ppc64le-12.patch

@ -72,3 +72,4 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/bits/mathinline.h glibc-2.17-c
+ return lrint ((double) __x); + return lrint ((double) __x);
} }
# endif # endif

10
SOURCES/glibc-ppc64le-13.patch

@ -33,7 +33,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrt.c glibc-2.17-c758a686/s
- if ((u.l[1] & FE_INVALID) == 0) - if ((u.l[1] & FE_INVALID) == 0)
+ if ((u.l & FE_INVALID) == 0) + if ((u.l & FE_INVALID) == 0)
#endif #endif
feraiseexcept (FE_INVALID); feraiseexcept (FE_INVALID);
x = a_nan.value; x = a_nan.value;
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c 2014-05-27 22:31:42.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c 2014-05-27 22:31:42.000000000 -0500
@ -45,7 +45,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/e_sqrtf.c glibc-2.17-c758a686/
- if ((u.l[1] & FE_INVALID) == 0) - if ((u.l[1] & FE_INVALID) == 0)
+ if ((u.l & FE_INVALID) == 0) + if ((u.l & FE_INVALID) == 0)
#endif #endif
feraiseexcept (FE_INVALID); feraiseexcept (FE_INVALID);
x = a_nan.value; x = a_nan.value;
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c
--- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c 2014-05-27 22:31:42.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/fpu/fclrexcpt.c 2014-05-27 22:31:42.000000000 -0500
@ -244,12 +244,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fraiseexcpt.c glibc-2.17-c758a
/* Store the new status word (along with the rest of the environment), /* Store the new status word (along with the rest of the environment),
triggering any appropriate exceptions. */ triggering any appropriate exceptions. */
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
don't have FE_INVALID_SOFTWARE implemented. Detect this don't have FE_INVALID_SOFTWARE implemented. Detect this
case and raise FE_INVALID_SNAN instead. */ case and raise FE_INVALID_SNAN instead. */
u.fenv = fegetenv_register (); u.fenv = fegetenv_register ();
- if ((u.l[1] & FE_INVALID) == 0) - if ((u.l[1] & FE_INVALID) == 0)
+ if ((u.l & FE_INVALID) == 0) + if ((u.l & FE_INVALID) == 0)
set_fpscr_bit (FPSCR_VXSNAN); set_fpscr_bit (FPSCR_VXSNAN);
} }
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c diff -urN glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c glibc-2.17-c758a686/sysdeps/powerpc/fpu/fsetexcptflg.c

204
SOURCES/glibc-ppc64le-17.patch

@ -32,259 +32,259 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S glibc-2
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysign.S 2014-05-27 22:45:46.000000000 -0500
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
stwu r1,-16(r1) stwu r1,-16(r1)
cfi_adjust_cfa_offset (16) cfi_adjust_cfa_offset (16)
stfd fp2,8(r1) stfd fp2,8(r1)
- lwz r3,8(r1) - lwz r3,8(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
cmpwi r3,0 cmpwi r3,0
addi r1,r1,16 addi r1,r1,16
cfi_adjust_cfa_offset (-16) cfi_adjust_cfa_offset (-16)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_copysignl.S 2014-05-27 22:45:46.000000000 -0500
@@ -30,7 +30,7 @@ @@ -30,7 +30,7 @@
fmr fp0,fp1 fmr fp0,fp1
fabs fp1,fp1 fabs fp1,fp1
fcmpu cr7,fp0,fp1 fcmpu cr7,fp0,fp1
- lwz r3,8(r1) - lwz r3,8(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
cmpwi cr6,r3,0 cmpwi cr6,r3,0
addi r1,r1,16 addi r1,r1,16
cfi_adjust_cfa_offset (-16) cfi_adjust_cfa_offset (-16)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lrint.S 2014-05-27 22:45:46.000000000 -0500
@@ -24,10 +24,10 @@ @@ -24,10 +24,10 @@
stwu r1,-16(r1) stwu r1,-16(r1)
fctiw fp13,fp1 fctiw fp13,fp1
stfd fp13,8(r1) stfd fp13,8(r1)
- nop /* Insure the following load is in a different dispatch group */ - nop /* Insure the following load is in a different dispatch group */
+ nop /* Ensure the following load is in a different dispatch group */ + nop /* Ensure the following load is in a different dispatch group */
nop /* to avoid pipe stall on POWER4&5. */ nop /* to avoid pipe stall on POWER4&5. */
nop nop
- lwz r3,12(r1) - lwz r3,12(r1)
+ lwz r3,8+LOWORD(r1) + lwz r3,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__lrint) END (__lrint)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
nop /* Ensure the following load is in a different dispatch */ nop /* Ensure the following load is in a different dispatch */
nop /* group to avoid pipe stall on POWER4&5. */ nop /* group to avoid pipe stall on POWER4&5. */
nop nop
- lwz r3,12(r1) /* Load return as integer. */ - lwz r3,12(r1) /* Load return as integer. */
+ lwz r3,8+LOWORD(r1) /* Load return as integer. */ + lwz r3,8+LOWORD(r1) /* Load return as integer. */
.Lout: .Lout:
addi r1,r1,16 addi r1,r1,16
blr blr
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:48:09.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrint.S 2014-05-27 22:48:09.000000000 -0500
@@ -29,8 +29,8 @@ @@ -29,8 +29,8 @@
nop /* Insure the following load is in a different dispatch group */ nop /* Insure the following load is in a different dispatch group */
nop /* to avoid pipe stall on POWER4&5. */ nop /* to avoid pipe stall on POWER4&5. */
nop nop
- lwz r3,8(r1) - lwz r3,8(r1)
- lwz r4,12(r1) - lwz r4,12(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__llrint) END (__llrint)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:48:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llrintf.S 2014-05-27 22:48:44.000000000 -0500
@@ -28,8 +28,8 @@ @@ -28,8 +28,8 @@
nop /* Insure the following load is in a different dispatch group */ nop /* Insure the following load is in a different dispatch group */
nop /* to avoid pipe stall on POWER4&5. */ nop /* to avoid pipe stall on POWER4&5. */
nop nop
- lwz r3,8(r1) - lwz r3,8(r1)
- lwz r4,12(r1) - lwz r4,12(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__llrintf) END (__llrintf)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500
@@ -27,8 +27,8 @@ @@ -27,8 +27,8 @@
ori r1,r1,0 ori r1,r1,0
stfd fp1,24(r1) /* copy FPR to GPR */ stfd fp1,24(r1) /* copy FPR to GPR */
ori r1,r1,0 ori r1,r1,0
- lwz r4,24(r1) - lwz r4,24(r1)
- lwz r5,28(r1) - lwz r5,28(r1)
+ lwz r4,24+HIWORD(r1) + lwz r4,24+HIWORD(r1)
+ lwz r5,24+LOWORD(r1) + lwz r5,24+LOWORD(r1)
lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
clrlwi r4,r4,1 /* x = fabs(x) */ clrlwi r4,r4,1 /* x = fabs(x) */
cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500
@@ -39,8 +39,8 @@ @@ -39,8 +39,8 @@
nop /* Ensure the following load is in a different dispatch */ nop /* Ensure the following load is in a different dispatch */
nop /* group to avoid pipe stall on POWER4&5. */ nop /* group to avoid pipe stall on POWER4&5. */
nop nop
- lwz r4,12(r1) - lwz r4,12(r1)
- lwz r3,8(r1) - lwz r3,8(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__llround) END (__llround)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power5+/fpu/s_lround.S 2014-05-27 22:45:46.000000000 -0500
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
nop /* Ensure the following load is in a different dispatch */ nop /* Ensure the following load is in a different dispatch */
nop /* group to avoid pipe stall on POWER4&5. */ nop /* group to avoid pipe stall on POWER4&5. */
nop nop
- lwz r3,12(r1) - lwz r3,12(r1)
+ lwz r3,8+LOWORD(r1) + lwz r3,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__lround) END (__lround)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500
@@ -27,8 +27,8 @@ @@ -27,8 +27,8 @@
ori r1,r1,0 ori r1,r1,0
stfd fp1,24(r1) /* copy FPR to GPR */ stfd fp1,24(r1) /* copy FPR to GPR */
ori r1,r1,0 ori r1,r1,0
- lwz r4,24(r1) - lwz r4,24(r1)
- lwz r5,28(r1) - lwz r5,28(r1)
+ lwz r4,24+HIWORD(r1) + lwz r4,24+HIWORD(r1)
+ lwz r5,24+LOWORD(r1) + lwz r5,24+LOWORD(r1)
lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */ lis r0,0x7ff0 /* const long r0 0x7ff00000 00000000 */
clrlwi r4,r4,1 /* x = fabs(x) */ clrlwi r4,r4,1 /* x = fabs(x) */
cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */ cmpw cr7,r4,r0 /* if (fabs(x) =< inf) */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:46:52.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrint.S 2014-05-27 22:46:52.000000000 -0500
@@ -29,8 +29,8 @@ @@ -29,8 +29,8 @@
/* Insure the following load is in a different dispatch group by /* Insure the following load is in a different dispatch group by
inserting "group ending nop". */ inserting "group ending nop". */
ori r1,r1,0 ori r1,r1,0
- lwz r3,8(r1) - lwz r3,8(r1)
- lwz r4,12(r1) - lwz r4,12(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__llrint) END (__llrint)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:47:29.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llrintf.S 2014-05-27 22:47:29.000000000 -0500
@@ -28,8 +28,8 @@ @@ -28,8 +28,8 @@
/* Insure the following load is in a different dispatch group by /* Insure the following load is in a different dispatch group by
inserting "group ending nop". */ inserting "group ending nop". */
ori r1,r1,0 ori r1,r1,0
- lwz r3,8(r1) - lwz r3,8(r1)
- lwz r4,12(r1) - lwz r4,12(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__llrintf) END (__llrintf)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/fpu/s_llround.S 2014-05-27 22:45:46.000000000 -0500
@@ -39,8 +39,8 @@ @@ -39,8 +39,8 @@
/* Insure the following load is in a different dispatch group by /* Insure the following load is in a different dispatch group by
inserting "group ending nop". */ inserting "group ending nop". */
ori r1,r1,0 ori r1,r1,0
- lwz r4,12(r1) - lwz r4,12(r1)
- lwz r3,8(r1) - lwz r3,8(r1)
+ lwz r3,8+HIWORD(r1) + lwz r3,8+HIWORD(r1)
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
addi r1,r1,16 addi r1,r1,16
blr blr
END (__llround) END (__llround)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500
@@ -54,9 +54,8 @@ @@ -54,9 +54,8 @@
stfd fp1,8(r1) /* Transfer FP to GPR's. */ stfd fp1,8(r1) /* Transfer FP to GPR's. */
ori 2,2,0 /* Force a new dispatch group. */ ori 2,2,0 /* Force a new dispatch group. */
- lhz r0,8(r1) /* Fetch the upper portion of the high word of - lhz r0,8(r1) /* Fetch the upper portion of the high word of
- the FP value (where the exponent and sign bits - the FP value (where the exponent and sign bits
- are). */ - are). */
+ lhz r0,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + lhz r0,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
+ (biased exponent and sign bit). */ + (biased exponent and sign bit). */
clrlwi r0,r0,17 /* r0 = abs(r0). */ clrlwi r0,r0,17 /* r0 = abs(r0). */
addi r1,r1,16 /* Reset the stack pointer. */ addi r1,r1,16 /* Reset the stack pointer. */
cmpwi cr7,r0,0x7ff0 /* r4 == 0x7ff0?. */ cmpwi cr7,r0,0x7ff0 /* r4 == 0x7ff0?. */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500
@@ -48,14 +48,13 @@ @@ -48,14 +48,13 @@
li r3,0 li r3,0
bflr 29 /* If not INF, return. */ bflr 29 /* If not INF, return. */
- /* Either we have -INF/+INF or a denormal. */ - /* Either we have -INF/+INF or a denormal. */
+ /* Either we have +INF or -INF. */ + /* Either we have +INF or -INF. */
stwu r1,-16(r1) /* Allocate stack space. */ stwu r1,-16(r1) /* Allocate stack space. */
stfd fp1,8(r1) /* Transfer FP to GPR's. */ stfd fp1,8(r1) /* Transfer FP to GPR's. */
ori 2,2,0 /* Force a new dispatch group. */ ori 2,2,0 /* Force a new dispatch group. */
- lhz r4,8(r1) /* Fetch the upper portion of the high word of - lhz r4,8(r1) /* Fetch the upper portion of the high word of
- the FP value (where the exponent and sign bits - the FP value (where the exponent and sign bits
- are). */ - are). */
+ lhz r4,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + lhz r4,8+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
+ (biased exponent and sign bit). */ + (biased exponent and sign bit). */
addi r1,r1,16 /* Reset the stack pointer. */ addi r1,r1,16 /* Reset the stack pointer. */
cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */
li r3,1 li r3,1
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/fpu/s_isnan.S 2014-05-27 22:45:46.000000000 -0500
@@ -53,8 +53,8 @@ @@ -53,8 +53,8 @@
stwu r1,-16(r1) /* Allocate stack space. */ stwu r1,-16(r1) /* Allocate stack space. */
stfd fp1,8(r1) /* Transfer FP to GPR's. */ stfd fp1,8(r1) /* Transfer FP to GPR's. */
ori 2,2,0 /* Force a new dispatch group. */ ori 2,2,0 /* Force a new dispatch group. */
- lwz r4,8(r1) /* Load the upper half of the FP value. */ - lwz r4,8(r1) /* Load the upper half of the FP value. */
- lwz r5,12(r1) /* Load the lower half of the FP value. */ - lwz r5,12(r1) /* Load the lower half of the FP value. */
+ lwz r4,8+HIWORD(r1) /* Load the upper half of the FP value. */ + lwz r4,8+HIWORD(r1) /* Load the upper half of the FP value. */
+ lwz r5,8+LOWORD(r1) /* Load the lower half of the FP value. */ + lwz r5,8+LOWORD(r1) /* Load the lower half of the FP value. */
addi r1,r1,16 /* Reset the stack pointer. */ addi r1,r1,16 /* Reset the stack pointer. */
lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */ lis r0,0x7ff0 /* Load the upper portion for an INF/NaN. */
clrlwi r4,r4,1 /* r4 = abs(r4). */ clrlwi r4,r4,1 /* r4 = abs(r4). */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_finite.S 2014-05-27 22:45:46.000000000 -0500
@@ -39,10 +39,8 @@ @@ -39,10 +39,8 @@
stfd fp1,-16(r1) /* Transfer FP to GPR's. */ stfd fp1,-16(r1) /* Transfer FP to GPR's. */
ori 2,2,0 /* Force a new dispatch group. */ ori 2,2,0 /* Force a new dispatch group. */
- -
- lhz r4,-16(r1) /* Fetch the upper portion of the high word of - lhz r4,-16(r1) /* Fetch the upper portion of the high word of
- the FP value (where the exponent and sign bits - the FP value (where the exponent and sign bits
- are). */ - are). */
+ lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
+ (biased exponent and sign bit). */ + (biased exponent and sign bit). */
clrlwi r4,r4,17 /* r4 = abs(r4). */ clrlwi r4,r4,17 /* r4 = abs(r4). */
cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */
bltlr cr7 /* LT means finite, other non-finite. */ bltlr cr7 /* LT means finite, other non-finite. */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/fpu/s_isinf.S 2014-05-27 22:45:46.000000000 -0500
@@ -38,9 +38,8 @@ @@ -38,9 +38,8 @@
stfd fp1,-16(r1) /* Transfer FP to GPR's. */ stfd fp1,-16(r1) /* Transfer FP to GPR's. */
ori 2,2,0 /* Force a new dispatch group. */ ori 2,2,0 /* Force a new dispatch group. */
- lhz r4,-16(r1) /* Fetch the upper portion of the high word of - lhz r4,-16(r1) /* Fetch the upper portion of the high word of
- the FP value (where the exponent and sign bits - the FP value (where the exponent and sign bits
- are). */ - are). */
+ lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value + lhz r4,-16+HISHORT(r1) /* Fetch the upper 16 bits of the FP value
+ (biased exponent and sign bit). */ + (biased exponent and sign bit). */
cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */ cmpwi cr7,r4,0x7ff0 /* r4 == 0x7ff0? */
li r3,1 li r3,1
beqlr cr7 /* EQ means INF, otherwise -INF. */ beqlr cr7 /* EQ means INF, otherwise -INF. */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h diff -urN glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h
--- glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/sysdep.h 2014-05-27 22:45:46.000000000 -0500

34
SOURCES/glibc-ppc64le-18.patch

@ -18,20 +18,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/s_roundf.S glibc-2.1
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
#include <sysdep.h> #include <sysdep.h>
.section .rodata.cst8,"aM",@progbits,8 .section .rodata.cst8,"aM",@progbits,8
- .align 2 - .align 2
+ .align 3 + .align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
.long 0x4b000000 .long 0x4b000000
.LC1: /* 0.5 */ .LC1: /* 0.5 */
@@ -60,7 +60,6 @@ @@ -60,7 +60,6 @@
#ifdef SHARED #ifdef SHARED
lfs fp10,.LC1-.LC0(r9) lfs fp10,.LC1-.LC0(r9)
#else #else
- lis r9,.LC1@ha - lis r9,.LC1@ha
lfs fp10,.LC1@l(r9) lfs fp10,.LC1@l(r9)
#endif #endif
ble- cr6,.L4 ble- cr6,.L4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 2014-05-27 22:50:13.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 2014-05-27 22:50:13.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 2014-05-27 22:50:13.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S 2014-05-27 22:50:13.000000000 -0500
@ -49,33 +49,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S g
+ .LC0: .long (52+127)<<23 /* 0x1p+52 */ + .LC0: .long (52+127)<<23 /* 0x1p+52 */
+ .long (-1+127)<<23 /* 0.5 */ + .long (-1+127)<<23 /* 0.5 */
.section ".text" .section ".text"
@@ -57,12 +55,12 @@ @@ -57,12 +55,12 @@
addi r9,r9,.LC0-got_label@l addi r9,r9,.LC0-got_label@l
mtlr r11 mtlr r11
cfi_same_value (lr) cfi_same_value (lr)
- lfd fp9,0(r9) - lfd fp9,0(r9)
- lfs fp10,8(r9) - lfs fp10,8(r9)
+ lfs fp9,0(r9) + lfs fp9,0(r9)
+ lfs fp10,4(r9) + lfs fp10,4(r9)
#else #else
lis r9,.LC0@ha lis r9,.LC0@ha
- lfd fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */ - lfd fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */
- lfs fp10,.LC0@l+8(r9) /* Load 0.5 into fpr10. */ - lfs fp10,.LC0@l+8(r9) /* Load 0.5 into fpr10. */
+ lfs fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */ + lfs fp9,.LC0@l(r9) /* Load 2^52 into fpr9. */
+ lfs fp10,.LC0@l+4(r9) /* Load 0.5 into fpr10. */ + lfs fp10,.LC0@l+4(r9) /* Load 0.5 into fpr10. */
#endif #endif
fabs fp2,fp1 /* Get the absolute value of x. */ fabs fp2,fp1 /* Get the absolute value of x. */
fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */ fsub fp12,fp10,fp10 /* Compute 0.0 into fpr12. */
@@ -80,8 +78,8 @@ @@ -80,8 +78,8 @@
nop nop
nop nop
nop nop
- lwz r4,12(r1) /* Load return as integer. */ - lwz r4,12(r1) /* Load return as integer. */
- lwz r3,8(r1) - lwz r3,8(r1)
+ lwz r3,8+HIWORD(r1) /* Load return as integer. */ + lwz r3,8+HIWORD(r1) /* Load return as integer. */
+ lwz r4,8+LOWORD(r1) + lwz r4,8+LOWORD(r1)
.Lout: .Lout:
addi r1,r1,16 addi r1,r1,16
blr blr

24
SOURCES/glibc-ppc64le-19.patch

@ -21,13 +21,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_ceilf.S glibc-2.17
@@ -19,8 +19,10 @@ @@ -19,8 +19,10 @@
#include <sysdep.h> #include <sysdep.h>
.section ".toc","aw" .section ".toc","aw"
+ .p2align 3 + .p2align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000 - .tc FD_4b000000_0[TC],0x4b00000000000000
+ .long 0x4b000000 + .long 0x4b000000
+ .long 0x0 + .long 0x0
.section ".text" .section ".text"
EALIGN (__ceilf, 4, 0) EALIGN (__ceilf, 4, 0)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S
@ -36,13 +36,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_floorf.S glibc-2.1
@@ -19,8 +19,10 @@ @@ -19,8 +19,10 @@
#include <sysdep.h> #include <sysdep.h>
.section ".toc","aw" .section ".toc","aw"
+ .p2align 3 + .p2align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000 - .tc FD_4b000000_0[TC],0x4b00000000000000
+ .long 0x4b000000 + .long 0x4b000000
+ .long 0x0 + .long 0x0
.section ".text" .section ".text"
EALIGN (__floorf, 4, 0) EALIGN (__floorf, 4, 0)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S
@ -51,13 +51,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_nearbyintf.S glibc
@@ -26,8 +26,10 @@ @@ -26,8 +26,10 @@
/* float [fp1] nearbyintf(float [fp1]) */ /* float [fp1] nearbyintf(float [fp1]) */
.section ".toc","aw" .section ".toc","aw"
+ .p2align 3 + .p2align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000 - .tc FD_4b000000_0[TC],0x4b00000000000000
+ .long 0x4b000000 + .long 0x4b000000
+ .long 0x0 + .long 0x0
.section ".text" .section ".text"
EALIGN (__nearbyintf, 4, 0) EALIGN (__nearbyintf, 4, 0)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S
@ -66,13 +66,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_rintf.S glibc-2.17
@@ -19,8 +19,10 @@ @@ -19,8 +19,10 @@
#include <sysdep.h> #include <sysdep.h>
.section ".toc","aw" .section ".toc","aw"
+ .p2align 3 + .p2align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000 - .tc FD_4b000000_0[TC],0x4b00000000000000
+ .long 0x4b000000 + .long 0x4b000000
+ .long 0x0 + .long 0x0
.section ".text" .section ".text"
EALIGN (__rintf, 4, 0) EALIGN (__rintf, 4, 0)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S
@ -81,7 +81,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S glibc-2.1
@@ -19,10 +19,12 @@ @@ -19,10 +19,12 @@
#include <sysdep.h> #include <sysdep.h>
.section ".toc","aw" .section ".toc","aw"
+ .p2align 3 + .p2align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000 - .tc FD_4b000000_0[TC],0x4b00000000000000
@ -90,7 +90,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_roundf.S glibc-2.1
- .tc FD_3f000000_0[TC],0x3f00000000000000 - .tc FD_3f000000_0[TC],0x3f00000000000000
+ .long 0x3f000000 + .long 0x3f000000
+ +
.section ".text" .section ".text"
/* float [fp1] roundf (float x [fp1]) /* float [fp1] roundf (float x [fp1])
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S
@ -99,12 +99,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_truncf.S glibc-2.1
@@ -19,8 +19,10 @@ @@ -19,8 +19,10 @@
#include <sysdep.h> #include <sysdep.h>
.section ".toc","aw" .section ".toc","aw"
+ .p2align 3 + .p2align 3
.LC0: /* 2**23 */ .LC0: /* 2**23 */
- .tc FD_4b000000_0[TC],0x4b00000000000000 - .tc FD_4b000000_0[TC],0x4b00000000000000
+ .long 0x4b000000 + .long 0x4b000000
+ .long 0x0 + .long 0x0
.section ".text" .section ".text"
/* float [fp1] truncf (float x [fp1]) /* float [fp1] truncf (float x [fp1])

2
SOURCES/glibc-ppc64le-20.patch

@ -39,3 +39,5 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/hp-timing.h glibc
+ : : "cr0"); \ + : : "cr0"); \
+ Var = ((hp_timing_t) hi << 32) | lo; \ + Var = ((hp_timing_t) hi << 32) | lo; \
} while (0) } while (0)

82
SOURCES/glibc-ppc64le-21.patch

@ -49,14 +49,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S g
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S 2014-05-27 22:55:27.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S 2014-05-27 22:55:27.000000000 -0500
@@ -46,16 +46,16 @@ @@ -46,16 +46,16 @@
# endif # endif
mtlr r6 mtlr r6
cfi_same_value (lr) cfi_same_value (lr)
- lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5) - lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5)
+ lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r5) + lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r5)
# else # else
lwz r5,_dl_hwcap@got(r5) lwz r5,_dl_hwcap@got(r5)
mtlr r6 mtlr r6
cfi_same_value (lr) cfi_same_value (lr)
- lwz r5,4(r5) - lwz r5,4(r5)
+ lwz r5,LOWORD(r5) + lwz r5,LOWORD(r5)
# endif # endif
@ -66,19 +66,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/__longjmp-common.S g
+ lis r5,(_dl_hwcap+LOWORD)@ha + lis r5,(_dl_hwcap+LOWORD)@ha
+ lwz r5,(_dl_hwcap+LOWORD)@l(r5) + lwz r5,(_dl_hwcap+LOWORD)@l(r5)
# endif # endif
andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
beq L(no_vmx) beq L(no_vmx)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S 2014-05-27 22:55:23.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S 2014-05-27 22:55:23.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S 2014-05-27 22:55:27.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S 2014-05-27 22:55:27.000000000 -0500
@@ -97,14 +97,14 @@ @@ -97,14 +97,14 @@
# else # else
lwz r5,_rtld_global_ro@got(r5) lwz r5,_rtld_global_ro@got(r5)
# endif # endif
- lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5) - lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r5)
+ lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r5) + lwz r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r5)
# else # else
lwz r5,_dl_hwcap@got(r5) lwz r5,_dl_hwcap@got(r5)
- lwz r5,4(r5) - lwz r5,4(r5)
+ lwz r5,LOWORD(r5) + lwz r5,LOWORD(r5)
# endif # endif
@ -88,14 +88,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glib
+ lis r6,(_dl_hwcap+LOWORD)@ha + lis r6,(_dl_hwcap+LOWORD)@ha
+ lwz r5,(_dl_hwcap+LOWORD)@l(r6) + lwz r5,(_dl_hwcap+LOWORD)@l(r6)
# endif # endif
andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16)
beq L(no_vmx) beq L(no_vmx)
@@ -114,44 +114,43 @@ @@ -114,44 +114,43 @@
stw r0,((JB_VRSAVE)*4)(3) stw r0,((JB_VRSAVE)*4)(3)
addi r6,r5,16 addi r6,r5,16
beq+ L(aligned_save_vmx) beq+ L(aligned_save_vmx)
+ +
lvsr v0,0,r5 lvsr v0,0,r5
- vspltisb v1,-1 /* set v1 to all 1's */ - vspltisb v1,-1 /* set v1 to all 1's */
- vspltisb v2,0 /* set v2 to all 0's */ - vspltisb v2,0 /* set v2 to all 0's */
- vperm v3,v2,v1,v0 /* v3 contains shift mask with num all 1 bytes on left = misalignment */ - vperm v3,v2,v1,v0 /* v3 contains shift mask with num all 1 bytes on left = misalignment */
@ -168,52 +168,52 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S glib
+ vperm v2,v2,v2,v1 + vperm v2,v2,v2,v1
+ save_misaligned_vmx(v2,v31,v0,v3,r5,r6) + save_misaligned_vmx(v2,v31,v0,v3,r5,r6)
+ +
b L(no_vmx) b L(no_vmx)
L(aligned_save_vmx): L(aligned_save_vmx):
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-27 22:55:23.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-27 22:55:23.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-27 22:55:27.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-27 22:55:27.000000000 -0500
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
beq L(no_vmx) beq L(no_vmx)
la r5,((JB_VRS)*8)(3) la r5,((JB_VRS)*8)(3)
andi. r6,r5,0xf andi. r6,r5,0xf
- lwz r0,((JB_VRSAVE)*8)(3) - lwz r0,((JB_VRSAVE)*8)(3)
+ lwz r0,((JB_VRSAVE)*8)(3) /* 32-bit VRSAVE. */ + lwz r0,((JB_VRSAVE)*8)(3) /* 32-bit VRSAVE. */
mtspr VRSAVE,r0 mtspr VRSAVE,r0
beq+ L(aligned_restore_vmx) beq+ L(aligned_restore_vmx)
addi r6,r5,16 addi r6,r5,16
@@ -156,7 +156,7 @@ @@ -156,7 +156,7 @@
lfd fp21,((JB_FPRS+7)*8)(r3) lfd fp21,((JB_FPRS+7)*8)(r3)
ld r22,((JB_GPRS+8)*8)(r3) ld r22,((JB_GPRS+8)*8)(r3)
lfd fp22,((JB_FPRS+8)*8)(r3) lfd fp22,((JB_FPRS+8)*8)(r3)
- ld r0,(JB_CR*8)(r3) - ld r0,(JB_CR*8)(r3)
+ lwz r0,((JB_CR*8)+4)(r3) /* 32-bit CR. */ + lwz r0,((JB_CR*8)+4)(r3) /* 32-bit CR. */
ld r23,((JB_GPRS+9)*8)(r3) ld r23,((JB_GPRS+9)*8)(r3)
lfd fp23,((JB_FPRS+9)*8)(r3) lfd fp23,((JB_FPRS+9)*8)(r3)
ld r24,((JB_GPRS+10)*8)(r3) ld r24,((JB_GPRS+10)*8)(r3)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-27 22:55:23.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-27 22:55:23.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-27 22:55:27.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S 2014-05-27 22:55:27.000000000 -0500
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
mfcr r0 mfcr r0
std r16,((JB_GPRS+2)*8)(3) std r16,((JB_GPRS+2)*8)(3)
stfd fp16,((JB_FPRS+2)*8)(3) stfd fp16,((JB_FPRS+2)*8)(3)
- std r0,(JB_CR*8)(3) - std r0,(JB_CR*8)(3)
+ stw r0,((JB_CR*8)+4)(3) /* 32-bit CR. */ + stw r0,((JB_CR*8)+4)(3) /* 32-bit CR. */
std r17,((JB_GPRS+3)*8)(3) std r17,((JB_GPRS+3)*8)(3)
stfd fp17,((JB_FPRS+3)*8)(3) stfd fp17,((JB_FPRS+3)*8)(3)
std r18,((JB_GPRS+4)*8)(3) std r18,((JB_GPRS+4)*8)(3)
@@ -142,50 +142,46 @@ @@ -142,50 +142,46 @@
la r5,((JB_VRS)*8)(3) la r5,((JB_VRS)*8)(3)
andi. r6,r5,0xf andi. r6,r5,0xf
mfspr r0,VRSAVE mfspr r0,VRSAVE
- stw r0,((JB_VRSAVE)*8)(3) - stw r0,((JB_VRSAVE)*8)(3)
+ stw r0,((JB_VRSAVE)*8)(3) /* 32-bit VRSAVE. */ + stw r0,((JB_VRSAVE)*8)(3) /* 32-bit VRSAVE. */
addi r6,r5,16 addi r6,r5,16
beq+ L(aligned_save_vmx) beq+ L(aligned_save_vmx)
+ +
lvsr v0,0,r5 lvsr v0,0,r5
- vspltisb v1,-1 /* set v1 to all 1's */ - vspltisb v1,-1 /* set v1 to all 1's */
- vspltisb v2,0 /* set v2 to all 0's */ - vspltisb v2,0 /* set v2 to all 0's */
- vperm v3,v2,v1,v0 /* v3 contains shift mask with num all 1 bytes - vperm v3,v2,v1,v0 /* v3 contains shift mask with num all 1 bytes
@ -289,6 +289,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.
+ vperm v2,v2,v2,v1 + vperm v2,v2,v2,v1
+ save_misaligned_vmx(v2,v31,v0,v3,r5,r6) + save_misaligned_vmx(v2,v31,v0,v3,r5,r6)
+ +
b L(no_vmx) b L(no_vmx)
L(aligned_save_vmx): L(aligned_save_vmx):

4
SOURCES/glibc-ppc64le-22.patch

@ -95,7 +95,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-_setjmp.S glibc-2.17
+compat_symbol (libc, __novmx_setjmp, _setjmp, GLIBC_2_0); +compat_symbol (libc, __novmx_setjmp, _setjmp, GLIBC_2_0);
ENTRY (BP_SYM (__novmx_setjmp)) ENTRY (BP_SYM (__novmx_setjmp))
li r4,0 /* Set second argument to 0. */ li r4,0 /* Set second argument to 0. */
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
libc_hidden_def (__novmx_setjmp) libc_hidden_def (__novmx_setjmp)
# endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */ # endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4) */
@ -109,7 +109,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S glibc-2.17-
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S 2014-05-27 23:22:10.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S 2014-05-27 23:22:10.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S 2014-05-27 23:22:12.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/bsd-setjmp.S 2014-05-27 23:22:12.000000000 -0500
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
b __novmx__sigsetjmp@local b __novmx__sigsetjmp@local
END (__novmxsetjmp) END (__novmxsetjmp)
strong_alias (__novmxsetjmp, __novmx__setjmp) strong_alias (__novmxsetjmp, __novmx__setjmp)
-symbol_version (__novmxsetjmp, setjmp, GLIBC_2.0) -symbol_version (__novmxsetjmp, setjmp, GLIBC_2.0)

36
SOURCES/glibc-ppc64le-23.patch

@ -17,13 +17,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getconte
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S 2014-05-27 23:25:38.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext-common.S 2014-05-27 23:25:38.000000000 -0500
@@ -151,15 +151,15 @@ @@ -151,15 +151,15 @@
# ifdef SHARED # ifdef SHARED
lwz r7,_rtld_global_ro@got(r7) lwz r7,_rtld_global_ro@got(r7)
mtlr r8 mtlr r8
- lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
+ lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
# else # else
lwz r7,_dl_hwcap@got(r7) lwz r7,_dl_hwcap@got(r7)
mtlr r8 mtlr r8
- lwz r7,4(r7) - lwz r7,4(r7)
+ lwz r7,LOWORD(r7) + lwz r7,LOWORD(r7)
# endif # endif
@ -33,20 +33,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/getconte
+ lis r7,(_dl_hwcap+LOWORD)@ha + lis r7,(_dl_hwcap+LOWORD)@ha
+ lwz r7,(_dl_hwcap+LOWORD)@l(r7) + lwz r7,(_dl_hwcap+LOWORD)@l(r7)
# endif # endif
andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S 2014-05-27 23:25:35.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S 2014-05-27 23:25:35.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S 2014-05-27 23:25:38.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/setcontext-common.S 2014-05-27 23:25:38.000000000 -0500
@@ -79,15 +79,15 @@ @@ -79,15 +79,15 @@
# ifdef SHARED # ifdef SHARED
lwz r7,_rtld_global_ro@got(r7) lwz r7,_rtld_global_ro@got(r7)
mtlr r8 mtlr r8
- lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
+ lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
# else # else
lwz r7,_dl_hwcap@got(r7) lwz r7,_dl_hwcap@got(r7)
mtlr r8 mtlr r8
- lwz r7,4(r7) - lwz r7,4(r7)
+ lwz r7,LOWORD(r7) + lwz r7,LOWORD(r7)
# endif # endif
@ -63,13 +63,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcont
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S 2014-05-27 23:25:38.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcontext-common.S 2014-05-27 23:25:38.000000000 -0500
@@ -152,15 +152,15 @@ @@ -152,15 +152,15 @@
# ifdef SHARED # ifdef SHARED
lwz r7,_rtld_global_ro@got(r7) lwz r7,_rtld_global_ro@got(r7)
mtlr r8 mtlr r8
- lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
+ lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
# else # else
lwz r7,_dl_hwcap@got(r7) lwz r7,_dl_hwcap@got(r7)
mtlr r8 mtlr r8
- lwz r7,4(r7) - lwz r7,4(r7)
+ lwz r7,LOWORD(r7) + lwz r7,LOWORD(r7)
# endif # endif
@ -82,13 +82,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcont
# ifdef __CONTEXT_ENABLE_VRS # ifdef __CONTEXT_ENABLE_VRS
@@ -308,14 +308,14 @@ @@ -308,14 +308,14 @@
mtlr r8 mtlr r8
# ifdef SHARED # ifdef SHARED
lwz r7,_rtld_global_ro@got(r7) lwz r7,_rtld_global_ro@got(r7)
- lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7) - lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+4(r7)
+ lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7) + lwz r7,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET+LOWORD(r7)
# else # else
lwz r7,_dl_hwcap@got(r7) lwz r7,_dl_hwcap@got(r7)
- lwz r7,4(r7) - lwz r7,4(r7)
+ lwz r7,LOWORD(r7) + lwz r7,LOWORD(r7)
# endif # endif
@ -98,5 +98,5 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/swapcont
+ lis r7,(_dl_hwcap+LOWORD)@ha + lis r7,(_dl_hwcap+LOWORD)@ha
+ lwz r7,(_dl_hwcap+LOWORD)@l(r7) + lwz r7,(_dl_hwcap+LOWORD)@l(r7)
# endif # endif
andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16) andis. r7,r7,(PPC_FEATURE_HAS_ALTIVEC >> 16)
la r10,(_UC_VREGS)(r31) la r10,(_UC_VREGS)(r31)

20
SOURCES/glibc-ppc64le-24.patch

@ -17,26 +17,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecont
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 2014-05-28 12:25:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc32/makecontext.S 2014-05-28 12:25:51.000000000 -0500
@@ -47,7 +47,9 @@ @@ -47,7 +47,9 @@
#ifdef PIC #ifdef PIC
mflr r0 mflr r0
cfi_register(lr,r0) cfi_register(lr,r0)
- bl 1f - bl 1f
+ /* Use this conditional form of branch and link to avoid destroying + /* Use this conditional form of branch and link to avoid destroying
+ the cpu link stack used to predict blr return addresses. */ + the cpu link stack used to predict blr return addresses. */
+ bcl 20,31,1f + bcl 20,31,1f
1: mflr r6 1: mflr r6
addi r6,r6,L(exitcode)-1b addi r6,r6,L(exitcode)-1b
mtlr r0 mtlr r0
@@ -136,7 +138,9 @@ @@ -136,7 +138,9 @@
#ifdef PIC #ifdef PIC
mflr r0 mflr r0
cfi_register(lr,r0) cfi_register(lr,r0)
- bl 1f - bl 1f
+ /* Use this conditional form of branch and link to avoid destroying + /* Use this conditional form of branch and link to avoid destroying
+ the cpu link stack used to predict blr return addresses. */ + the cpu link stack used to predict blr return addresses. */
+ bcl 20,31,1f + bcl 20,31,1f
1: mflr r6 1: mflr r6
addi r6,r6,L(novec_exitcode)-1b addi r6,r6,L(novec_exitcode)-1b
mtlr r0 mtlr r0
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-28 12:25:49.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-28 12:25:49.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-28 12:25:51.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecontext.S 2014-05-28 12:25:51.000000000 -0500
@ -51,5 +51,5 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecont
+ the cpu link stack used to predict blr return addresses. */ + the cpu link stack used to predict blr return addresses. */
+ bcl 20,31,L(gotexitcodeaddr); + bcl 20,31,L(gotexitcodeaddr);
/* This is the helper code which gets called if a function which /* This is the helper code which gets called if a function which
is registered with 'makecontext' returns. In this case we is registered with 'makecontext' returns. In this case we

196
SOURCES/glibc-ppc64le-25.patch

@ -34,30 +34,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S glibc-2.
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S 2014-05-28 12:28:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S 2014-05-28 12:28:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S 2014-05-28 12:28:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S 2014-05-28 12:28:45.000000000 -0500
@@ -31,7 +31,11 @@ @@ -31,7 +31,11 @@
li r0,0 /* Word with null chars to use with cmpb. */ li r0,0 /* Word with null chars to use with cmpb. */
li r5,-1 /* MASK = 0xffffffffffffffff. */ li r5,-1 /* MASK = 0xffffffffffffffff. */
lwz r12,0(r4) /* Load word from memory. */ lwz r12,0(r4) /* Load word from memory. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ slw r5,r5,r6 + slw r5,r5,r6
+#else +#else
srw r5,r5,r6 /* MASK = MASK >> padding. */ srw r5,r5,r6 /* MASK = MASK >> padding. */
+#endif +#endif
orc r9,r12,r5 /* Mask bits that are not part of the string. */ orc r9,r12,r5 /* Mask bits that are not part of the string. */
cmpb r10,r9,r0 /* Check for null bytes in WORD1. */ cmpb r10,r9,r0 /* Check for null bytes in WORD1. */
cmpwi cr7,r10,0 /* If r10 == 0, no null's have been found. */ cmpwi cr7,r10,0 /* If r10 == 0, no null's have been found. */
@@ -49,9 +53,6 @@ @@ -49,9 +53,6 @@
cmpb r10,r12,r0 cmpb r10,r12,r0
cmpwi cr7,r10,0 cmpwi cr7,r10,0
bne cr7,L(done) bne cr7,L(done)
- b L(loop) /* We branch here (rather than falling through) - b L(loop) /* We branch here (rather than falling through)
- to skip the nops due to heavy alignment - to skip the nops due to heavy alignment
- of the loop below. */ - of the loop below. */
/* Main loop to look for the end of the string. Since it's a /* Main loop to look for the end of the string. Since it's a
small loop (< 8 instructions), align it to 32-bytes. */ small loop (< 8 instructions), align it to 32-bytes. */
@@ -88,9 +89,15 @@ @@ -88,9 +89,15 @@
0xff in the same position as the null byte in the original 0xff in the same position as the null byte in the original
word from the string. Use that to calculate the length. */ word from the string. Use that to calculate the length. */
L(done): L(done):
- cntlzw r0,r10 /* Count leading zeroes before the match. */ - cntlzw r0,r10 /* Count leading zeroes before the match. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -67,11 +67,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strlen.S glibc-2.
+#else +#else
+ cntlzw r0,r10 /* Count leading zeros before the match. */ + cntlzw r0,r10 /* Count leading zeros before the match. */
+#endif +#endif
subf r5,r3,r4 subf r5,r3,r4
- srwi r0,r0,3 /* Convert leading zeroes to bytes. */ - srwi r0,r0,3 /* Convert leading zeroes to bytes. */
+ srwi r0,r0,3 /* Convert leading zeros to bytes. */ + srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r5,r0 /* Compute final length. */ add r3,r5,r0 /* Compute final length. */
blr blr
END (BP_SYM (strlen)) END (BP_SYM (strlen))
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S 2014-05-28 12:28:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S 2014-05-28 12:28:44.000000000 -0500
@ -110,12 +110,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758
+#define rTMP2 r11 +#define rTMP2 r11
+#define rTMP3 r12 +#define rTMP3 r12
CHECK_BOUNDS_LOW (rRTN, rTMP1, rTMP2) CHECK_BOUNDS_LOW (rRTN, rTMP1, rTMP2)
@@ -96,15 +101,20 @@ @@ -96,15 +101,20 @@
lwz rWORD1, 0(rSTR) lwz rWORD1, 0(rSTR)
li rMASK, -1 li rMASK, -1
addi r7F7F, r7F7F, 0x7f7f addi r7F7F, r7F7F, 0x7f7f
-/* That's the setup done, now do the first pair of words. -/* That's the setup done, now do the first pair of words.
- We make an exception and use method (2) on the first two words, to reduce - We make an exception and use method (2) on the first two words, to reduce
- overhead. */ - overhead. */
@ -126,51 +126,51 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ slw rMASK, rMASK, rPADN + slw rMASK, rMASK, rPADN
+#else +#else
srw rMASK, rMASK, rPADN srw rMASK, rMASK, rPADN
+#endif +#endif
and rTMP1, r7F7F, rWORD1 and rTMP1, r7F7F, rWORD1
or rTMP2, r7F7F, rWORD1 or rTMP2, r7F7F, rWORD1
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor rTMP1, rTMP2, rTMP1 - nor rTMP1, rTMP2, rTMP1
- and. rWORD1, rTMP1, rMASK - and. rWORD1, rTMP1, rMASK
+ nor rTMP3, rTMP2, rTMP1 + nor rTMP3, rTMP2, rTMP1
+ and. rTMP3, rTMP3, rMASK + and. rTMP3, rTMP3, rMASK
mtcrf 0x01, rRTN mtcrf 0x01, rRTN
bne L(done0) bne L(done0)
lis rFEFE, -0x101 lis rFEFE, -0x101
@@ -113,11 +123,12 @@ @@ -113,11 +123,12 @@
bt 29, L(loop) bt 29, L(loop)
/* Handle second word of pair. */ /* Handle second word of pair. */
+/* Perhaps use method (1) here for little-endian, saving one instruction? */ +/* Perhaps use method (1) here for little-endian, saving one instruction? */
lwzu rWORD1, 4(rSTR) lwzu rWORD1, 4(rSTR)
and rTMP1, r7F7F, rWORD1 and rTMP1, r7F7F, rWORD1
or rTMP2, r7F7F, rWORD1 or rTMP2, r7F7F, rWORD1
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor. rWORD1, rTMP2, rTMP1 - nor. rWORD1, rTMP2, rTMP1
+ nor. rTMP3, rTMP2, rTMP1 + nor. rTMP3, rTMP2, rTMP1
bne L(done0) bne L(done0)
/* The loop. */ /* The loop. */
@@ -131,29 +142,53 @@ @@ -131,29 +142,53 @@
add rTMP3, rFEFE, rWORD2 add rTMP3, rFEFE, rWORD2
nor rTMP4, r7F7F, rWORD2 nor rTMP4, r7F7F, rWORD2
bne L(done1) bne L(done1)
- and. rTMP1, rTMP3, rTMP4 - and. rTMP1, rTMP3, rTMP4
+ and. rTMP3, rTMP3, rTMP4 + and. rTMP3, rTMP3, rTMP4
beq L(loop) beq L(loop)
+#ifndef __LITTLE_ENDIAN__ +#ifndef __LITTLE_ENDIAN__
and rTMP1, r7F7F, rWORD2 and rTMP1, r7F7F, rWORD2
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- andc rWORD1, rTMP4, rTMP1 - andc rWORD1, rTMP4, rTMP1
+ andc rTMP3, rTMP4, rTMP1 + andc rTMP3, rTMP4, rTMP1
b L(done0) b L(done0)
L(done1): L(done1):
and rTMP1, r7F7F, rWORD1 and rTMP1, r7F7F, rWORD1
subi rSTR, rSTR, 4 subi rSTR, rSTR, 4
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- andc rWORD1, rTMP2, rTMP1 - andc rWORD1, rTMP2, rTMP1
+ andc rTMP3, rTMP2, rTMP1 + andc rTMP3, rTMP2, rTMP1
@ -182,11 +182,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strlen.S glibc-2.17-c758
L(done0): L(done0):
- cntlzw rTMP3, rWORD1 - cntlzw rTMP3, rWORD1
+ cntlzw rTMP3, rTMP3 + cntlzw rTMP3, rTMP3
subf rTMP1, rRTN, rSTR subf rTMP1, rRTN, rSTR
srwi rTMP3, rTMP3, 3 srwi rTMP3, rTMP3, 3
add rRTN, rTMP1, rTMP3 add rRTN, rTMP1, rTMP3
/* GKM FIXME: check high bound. */ /* GKM FIXME: check high bound. */
blr blr
+#else +#else
+ +
+L(done0): +L(done0):
@ -216,30 +216,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S glibc-2.
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S 2014-05-28 12:28:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S 2014-05-28 12:28:44.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S 2014-05-28 12:28:45.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S 2014-05-28 12:28:45.000000000 -0500
@@ -32,7 +32,11 @@ @@ -32,7 +32,11 @@
with cmpb. */ with cmpb. */
li r5,-1 /* MASK = 0xffffffffffffffff. */ li r5,-1 /* MASK = 0xffffffffffffffff. */
ld r12,0(r4) /* Load doubleword from memory. */ ld r12,0(r4) /* Load doubleword from memory. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ sld r5,r5,r6 + sld r5,r5,r6
+#else +#else
srd r5,r5,r6 /* MASK = MASK >> padding. */ srd r5,r5,r6 /* MASK = MASK >> padding. */
+#endif +#endif
orc r9,r12,r5 /* Mask bits that are not part of the string. */ orc r9,r12,r5 /* Mask bits that are not part of the string. */
cmpb r10,r9,r0 /* Check for null bytes in DWORD1. */ cmpb r10,r9,r0 /* Check for null bytes in DWORD1. */
cmpdi cr7,r10,0 /* If r10 == 0, no null's have been found. */ cmpdi cr7,r10,0 /* If r10 == 0, no null's have been found. */
@@ -50,9 +54,6 @@ @@ -50,9 +54,6 @@
cmpb r10,r12,r0 cmpb r10,r12,r0
cmpdi cr7,r10,0 cmpdi cr7,r10,0
bne cr7,L(done) bne cr7,L(done)
- b L(loop) /* We branch here (rather than falling through) - b L(loop) /* We branch here (rather than falling through)
- to skip the nops due to heavy alignment - to skip the nops due to heavy alignment
- of the loop below. */ - of the loop below. */
/* Main loop to look for the end of the string. Since it's a /* Main loop to look for the end of the string. Since it's a
small loop (< 8 instructions), align it to 32-bytes. */ small loop (< 8 instructions), align it to 32-bytes. */
@@ -89,9 +90,15 @@ @@ -89,9 +90,15 @@
0xff in the same position as the null byte in the original 0xff in the same position as the null byte in the original
doubleword from the string. Use that to calculate the length. */ doubleword from the string. Use that to calculate the length. */
L(done): L(done):
- cntlzd r0,r10 /* Count leading zeroes before the match. */ - cntlzd r0,r10 /* Count leading zeroes before the match. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -249,11 +249,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strlen.S glibc-2.
+#else +#else
+ cntlzd r0,r10 /* Count leading zeros before the match. */ + cntlzd r0,r10 /* Count leading zeros before the match. */
+#endif +#endif
subf r5,r3,r4 subf r5,r3,r4
- srdi r0,r0,3 /* Convert leading zeroes to bytes. */ - srdi r0,r0,3 /* Convert leading zeroes to bytes. */
+ srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */ + srdi r0,r0,3 /* Convert leading/trailing zeros to bytes. */
add r3,r5,r0 /* Compute final length. */ add r3,r5,r0 /* Compute final length. */
blr blr
END (BP_SYM (strlen)) END (BP_SYM (strlen))
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S 2014-05-28 12:28:44.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S 2014-05-28 12:28:44.000000000 -0500
@ -283,7 +283,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758
0 and 3 through 12 (so long as we don't call any procedures) without 0 and 3 through 12 (so long as we don't call any procedures) without
@@ -80,7 +85,7 @@ @@ -80,7 +85,7 @@
ENTRY (BP_SYM (strlen)) ENTRY (BP_SYM (strlen))
CALL_MCOUNT 1 CALL_MCOUNT 1
-#define rTMP1 r0 -#define rTMP1 r0
+#define rTMP4 r0 +#define rTMP4 r0
@ -304,9 +304,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758
/* Note: The Bounded pointer support in this code is broken. This code /* Note: The Bounded pointer support in this code is broken. This code
was inherited from PPC32 and that support was never completed. was inherited from PPC32 and that support was never completed.
@@ -109,30 +114,36 @@ @@ -109,30 +114,36 @@
addi r7F7F, r7F7F, 0x7f7f addi r7F7F, r7F7F, 0x7f7f
li rMASK, -1 li rMASK, -1
insrdi r7F7F, r7F7F, 32, 0 insrdi r7F7F, r7F7F, 32, 0
-/* That's the setup done, now do the first pair of doublewords. -/* That's the setup done, now do the first pair of doublewords.
- We make an exception and use method (2) on the first two doublewords, - We make an exception and use method (2) on the first two doublewords,
- to reduce overhead. */ - to reduce overhead. */
@ -320,54 +320,54 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758
+#else +#else
+ srd rMASK, rMASK, rPADN + srd rMASK, rMASK, rPADN
+#endif +#endif
and rTMP1, r7F7F, rWORD1 and rTMP1, r7F7F, rWORD1
or rTMP2, r7F7F, rWORD1 or rTMP2, r7F7F, rWORD1
lis rFEFE, -0x101 lis rFEFE, -0x101
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
addi rFEFE, rFEFE, -0x101 addi rFEFE, rFEFE, -0x101
- nor rTMP1, rTMP2, rTMP1 - nor rTMP1, rTMP2, rTMP1
- and. rWORD1, rTMP1, rMASK - and. rWORD1, rTMP1, rMASK
+ nor rTMP3, rTMP2, rTMP1 + nor rTMP3, rTMP2, rTMP1
+ and. rTMP3, rTMP3, rMASK + and. rTMP3, rTMP3, rMASK
mtcrf 0x01, rRTN mtcrf 0x01, rRTN
bne L(done0) bne L(done0)
- sldi rTMP1, rFEFE, 32 - sldi rTMP1, rFEFE, 32
- add rFEFE, rFEFE, rTMP1 - add rFEFE, rFEFE, rTMP1
+ sldi rTMP1, rFEFE, 32 + sldi rTMP1, rFEFE, 32
+ add rFEFE, rFEFE, rTMP1 + add rFEFE, rFEFE, rTMP1
/* Are we now aligned to a doubleword boundary? */ /* Are we now aligned to a doubleword boundary? */
bt 28, L(loop) bt 28, L(loop)
/* Handle second doubleword of pair. */ /* Handle second doubleword of pair. */
+/* Perhaps use method (1) here for little-endian, saving one instruction? */ +/* Perhaps use method (1) here for little-endian, saving one instruction? */
ldu rWORD1, 8(rSTR) ldu rWORD1, 8(rSTR)
and rTMP1, r7F7F, rWORD1 and rTMP1, r7F7F, rWORD1
or rTMP2, r7F7F, rWORD1 or rTMP2, r7F7F, rWORD1
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor. rWORD1, rTMP2, rTMP1 - nor. rWORD1, rTMP2, rTMP1
+ nor. rTMP3, rTMP2, rTMP1 + nor. rTMP3, rTMP2, rTMP1
bne L(done0) bne L(done0)
/* The loop. */ /* The loop. */
@@ -146,29 +157,53 @@ @@ -146,29 +157,53 @@
add rTMP3, rFEFE, rWORD2 add rTMP3, rFEFE, rWORD2
nor rTMP4, r7F7F, rWORD2 nor rTMP4, r7F7F, rWORD2
bne L(done1) bne L(done1)
- and. rTMP1, rTMP3, rTMP4 - and. rTMP1, rTMP3, rTMP4
+ and. rTMP3, rTMP3, rTMP4 + and. rTMP3, rTMP3, rTMP4
beq L(loop) beq L(loop)
+#ifndef __LITTLE_ENDIAN__ +#ifndef __LITTLE_ENDIAN__
and rTMP1, r7F7F, rWORD2 and rTMP1, r7F7F, rWORD2
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- andc rWORD1, rTMP4, rTMP1 - andc rWORD1, rTMP4, rTMP1
+ andc rTMP3, rTMP4, rTMP1 + andc rTMP3, rTMP4, rTMP1
b L(done0) b L(done0)
L(done1): L(done1):
and rTMP1, r7F7F, rWORD1 and rTMP1, r7F7F, rWORD1
subi rSTR, rSTR, 8 subi rSTR, rSTR, 8
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- andc rWORD1, rTMP2, rTMP1 - andc rWORD1, rTMP2, rTMP1
+ andc rTMP3, rTMP2, rTMP1 + andc rTMP3, rTMP2, rTMP1
@ -379,11 +379,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strlen.S glibc-2.17-c758
L(done0): L(done0):
- cntlzd rTMP3, rWORD1 - cntlzd rTMP3, rWORD1
+ cntlzd rTMP3, rTMP3 + cntlzd rTMP3, rTMP3
subf rTMP1, rRTN, rSTR subf rTMP1, rRTN, rSTR
srdi rTMP3, rTMP3, 3 srdi rTMP3, rTMP3, 3
add rRTN, rTMP1, rTMP3 add rRTN, rTMP1, rTMP3
/* GKM FIXME: check high bound. */ /* GKM FIXME: check high bound. */
blr blr
+#else +#else
+ +
+L(done0): +L(done0):

180
SOURCES/glibc-ppc64le-26.patch

@ -21,11 +21,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S 2014-05-28 12:40:17.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S 2014-05-28 12:40:17.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S 2014-05-28 12:44:52.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S 2014-05-28 12:44:52.000000000 -0500
@@ -30,51 +30,47 @@ @@ -30,51 +30,47 @@
add r7,r3,r4 /* Calculate the last acceptable address. */ add r7,r3,r4 /* Calculate the last acceptable address. */
cmplwi r4,16 cmplwi r4,16
li r0,0 /* Word with null chars. */ li r0,0 /* Word with null chars. */
+ addi r7,r7,-1 + addi r7,r7,-1
ble L(small_range) ble L(small_range)
- cmplw cr7,r3,r7 /* Is the address equal or less than r3? If - cmplw cr7,r3,r7 /* Is the address equal or less than r3? If
- it's equal or less, it means size is either 0 - it's equal or less, it means size is either 0
@ -34,18 +34,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
- -
- li r7,-1 /* Make r11 the biggest if r4 <= 0. */ - li r7,-1 /* Make r11 the biggest if r4 <= 0. */
-L(proceed): -L(proceed):
rlwinm r6,r3,3,27,28 /* Calculate padding. */ rlwinm r6,r3,3,27,28 /* Calculate padding. */
lwz r12,0(r8) /* Load word from memory. */ lwz r12,0(r8) /* Load word from memory. */
cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srw r10,r10,r6 + srw r10,r10,r6
+ slw r10,r10,r6 + slw r10,r10,r6
+#else +#else
slw r10,r10,r6 slw r10,r10,r6
srw r10,r10,r6 srw r10,r10,r6
+#endif +#endif
cmplwi cr7,r10,0 /* If r10 == 0, no null's have been found. */ cmplwi cr7,r10,0 /* If r10 == 0, no null's have been found. */
bne cr7,L(done) bne cr7,L(done)
- /* Are we done already? */ - /* Are we done already? */
- addi r9,r8,4 - addi r9,r8,4
@ -53,18 +53,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
- bge cr6,L(end_max) - bge cr6,L(end_max)
- -
+ clrrwi r7,r7,2 /* Address of last word. */ + clrrwi r7,r7,2 /* Address of last word. */
mtcrf 0x01,r8 mtcrf 0x01,r8
/* Are we now aligned to a doubleword boundary? If so, skip to /* Are we now aligned to a doubleword boundary? If so, skip to
the main loop. Otherwise, go through the alignment code. */ the main loop. Otherwise, go through the alignment code. */
bt 29,L(loop_setup) bt 29,L(loop_setup)
- /* Handle DWORD2 of pair. */ - /* Handle DWORD2 of pair. */
+ /* Handle WORD2 of pair. */ + /* Handle WORD2 of pair. */
lwzu r12,4(r8) lwzu r12,4(r8)
cmpb r10,r12,r0 cmpb r10,r12,r0
cmplwi cr7,r10,0 cmplwi cr7,r10,0
bne cr7,L(done) bne cr7,L(done)
- /* Are we done already? */ - /* Are we done already? */
- addi r9,r8,4 - addi r9,r8,4
@ -80,19 +80,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
+ be at r8 + 4 + 8 * cnt - 4. Solving for cnt gives + be at r8 + 4 + 8 * cnt - 4. Solving for cnt gives
+ cnt = (r7 - r8) / 8 */ + cnt = (r7 - r8) / 8 */
+ sub r5,r7,r8 + sub r5,r7,r8
srwi r6,r5,3 /* Number of loop iterations. */ srwi r6,r5,3 /* Number of loop iterations. */
mtctr r6 /* Setup the counter. */ mtctr r6 /* Setup the counter. */
- b L(loop) - b L(loop)
- /* Main loop to look for the null byte backwards in the string. Since - /* Main loop to look for the null byte backwards in the string. Since
+ +
+ /* Main loop to look for the null byte in the string. Since + /* Main loop to look for the null byte in the string. Since
it's a small loop (< 8 instructions), align it to 32-bytes. */ it's a small loop (< 8 instructions), align it to 32-bytes. */
.p2align 5 .p2align 5
L(loop): L(loop):
@@ -90,15 +86,18 @@ @@ -90,15 +86,18 @@
cmplwi cr7,r5,0 cmplwi cr7,r5,0
bne cr7,L(found) bne cr7,L(found)
bdnz L(loop) bdnz L(loop)
- /* We're here because the counter reached 0, and that means we - /* We're here because the counter reached 0, and that means we
- didn't have any matches for null in the whole range. Just return - didn't have any matches for null in the whole range. Just return
- the original size. */ - the original size. */
@ -112,12 +112,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
L(end_max): L(end_max):
- sub r3,r7,r3 - sub r3,r7,r3
+ mr r3,r4 + mr r3,r4
blr blr
/* OK, one (or both) of the words contains a null byte. Check /* OK, one (or both) of the words contains a null byte. Check
@@ -123,49 +122,56 @@ @@ -123,49 +122,56 @@
We need to make sure the null char is *before* the end of the We need to make sure the null char is *before* the end of the
range. */ range. */
L(done): L(done):
- cntlzw r0,r10 /* Count leading zeroes before the match. */ - cntlzw r0,r10 /* Count leading zeroes before the match. */
- srwi r0,r0,3 /* Convert leading zeroes to bytes. */ - srwi r0,r0,3 /* Convert leading zeroes to bytes. */
@ -144,30 +144,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
+ cmplw r3,r4 + cmplw r3,r4
+ blelr + blelr
+ mr r3,r4 + mr r3,r4
blr blr
-/* Deals with size <= 32. */ -/* Deals with size <= 32. */
+/* Deals with size <= 16. */ +/* Deals with size <= 16. */
.align 4 .align 4
L(small_range): L(small_range):
cmplwi r4,0 cmplwi r4,0
- beq L(zero) - beq L(zero)
+ beq L(end_max) + beq L(end_max)
+ +
+ clrrwi r7,r7,2 /* Address of last word. */ + clrrwi r7,r7,2 /* Address of last word. */
rlwinm r6,r3,3,27,28 /* Calculate padding. */ rlwinm r6,r3,3,27,28 /* Calculate padding. */
lwz r12,0(r8) /* Load word from memory. */ lwz r12,0(r8) /* Load word from memory. */
cmpb r10,r12,r0 /* Check for null bytes in WORD1. */ cmpb r10,r12,r0 /* Check for null bytes in WORD1. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srw r10,r10,r6 + srw r10,r10,r6
+ slw r10,r10,r6 + slw r10,r10,r6
+#else +#else
slw r10,r10,r6 slw r10,r10,r6
srw r10,r10,r6 srw r10,r10,r6
+#endif +#endif
cmplwi cr7,r10,0 cmplwi cr7,r10,0
bne cr7,L(done) bne cr7,L(done)
- addi r9,r8,4 - addi r9,r8,4
- cmplw r9,r7 - cmplw r9,r7
@ -176,13 +176,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strnlen.S glibc-2
+ cmplw r8,r7 + cmplw r8,r7
+ beq L(end_max) + beq L(end_max)
.p2align 5 .p2align 5
L(loop_small): L(loop_small):
lwzu r12,4(r8) lwzu r12,4(r8)
cmpb r10,r12,r0 cmpb r10,r12,r0
- addi r9,r8,4 - addi r9,r8,4
cmplwi cr6,r10,0 cmplwi cr6,r10,0
bne cr6,L(done) bne cr6,L(done)
- cmplw r9,r7 - cmplw r9,r7
- bge L(end_max) - bge L(end_max)
- b L(loop_small) - b L(loop_small)
@ -199,17 +199,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S 2014-05-28 13:24:41.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S 2014-05-28 13:24:41.000000000 -0500
@@ -26,33 +26,29 @@ @@ -26,33 +26,29 @@
ENTRY (BP_SYM (__strnlen)) ENTRY (BP_SYM (__strnlen))
CALL_MCOUNT 2 CALL_MCOUNT 2
dcbt 0,r3 dcbt 0,r3
- clrrdi r8,r3,3 - clrrdi r8,r3,3
+ clrrdi r8,r3,3 + clrrdi r8,r3,3
add r7,r3,r4 /* Calculate the last acceptable address. */ add r7,r3,r4 /* Calculate the last acceptable address. */
cmpldi r4,32 cmpldi r4,32
li r0,0 /* Doubleword with null chars. */ li r0,0 /* Doubleword with null chars. */
+ addi r7,r7,-1 + addi r7,r7,-1
+ +
/* If we have less than 33 bytes to search, skip to a faster code. */ /* If we have less than 33 bytes to search, skip to a faster code. */
ble L(small_range) ble L(small_range)
- cmpld cr7,r3,r7 /* Is the address equal or less than r3? If - cmpld cr7,r3,r7 /* Is the address equal or less than r3? If
- it's equal or less, it means size is either 0 - it's equal or less, it means size is either 0
@ -218,18 +218,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
- -
- li r7,-1 /* Make r11 the biggest if r4 <= 0. */ - li r7,-1 /* Make r11 the biggest if r4 <= 0. */
-L(proceed): -L(proceed):
rlwinm r6,r3,3,26,28 /* Calculate padding. */ rlwinm r6,r3,3,26,28 /* Calculate padding. */
ld r12,0(r8) /* Load doubleword from memory. */ ld r12,0(r8) /* Load doubleword from memory. */
cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6 + srd r10,r10,r6
+ sld r10,r10,r6 + sld r10,r10,r6
+#else +#else
sld r10,r10,r6 sld r10,r10,r6
srd r10,r10,r6 srd r10,r10,r6
+#endif +#endif
cmpldi cr7,r10,0 /* If r10 == 0, no null's have been found. */ cmpldi cr7,r10,0 /* If r10 == 0, no null's have been found. */
bne cr7,L(done) bne cr7,L(done)
- /* Are we done already? */ - /* Are we done already? */
- addi r9,r8,8 - addi r9,r8,8
@ -237,12 +237,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
- bge cr6,L(end_max) - bge cr6,L(end_max)
- -
+ clrrdi r7,r7,3 /* Address of last doubleword. */ + clrrdi r7,r7,3 /* Address of last doubleword. */
mtcrf 0x01,r8 mtcrf 0x01,r8
/* Are we now aligned to a quadword boundary? If so, skip to /* Are we now aligned to a quadword boundary? If so, skip to
the main loop. Otherwise, go through the alignment code. */ the main loop. Otherwise, go through the alignment code. */
@@ -65,17 +61,18 @@ @@ -65,17 +61,18 @@
cmpldi cr7,r10,0 cmpldi cr7,r10,0
bne cr7,L(done) bne cr7,L(done)
- /* Are we done already? */ - /* Are we done already? */
- addi r9,r8,8 - addi r9,r8,8
@ -258,19 +258,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
+ be at r8 + 8 + 16 * cnt - 8. Solving for cnt gives + be at r8 + 8 + 16 * cnt - 8. Solving for cnt gives
+ cnt = (r7 - r8) / 16 */ + cnt = (r7 - r8) / 16 */
+ sub r5,r7,r8 + sub r5,r7,r8
srdi r6,r5,4 /* Number of loop iterations. */ srdi r6,r5,4 /* Number of loop iterations. */
mtctr r6 /* Setup the counter. */ mtctr r6 /* Setup the counter. */
- b L(loop) - b L(loop)
- /* Main loop to look for the null byte backwards in the string. Since - /* Main loop to look for the null byte backwards in the string. Since
+ +
+ /* Main loop to look for the null byte in the string. Since + /* Main loop to look for the null byte in the string. Since
it's a small loop (< 8 instructions), align it to 32-bytes. */ it's a small loop (< 8 instructions), align it to 32-bytes. */
.p2align 5 .p2align 5
L(loop): L(loop):
@@ -91,15 +88,18 @@ @@ -91,15 +88,18 @@
cmpldi cr7,r5,0 cmpldi cr7,r5,0
bne cr7,L(found) bne cr7,L(found)
bdnz L(loop) bdnz L(loop)
- /* We're here because the counter reached 0, and that means we - /* We're here because the counter reached 0, and that means we
- didn't have any matches for null in the whole range. Just return - didn't have any matches for null in the whole range. Just return
- the original size. */ - the original size. */
@ -290,13 +290,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
L(end_max): L(end_max):
- sub r3,r7,r3 - sub r3,r7,r3
+ mr r3,r4 + mr r3,r4
blr blr
/* OK, one (or both) of the doublewords contains a null byte. Check /* OK, one (or both) of the doublewords contains a null byte. Check
@@ -121,52 +121,59 @@ @@ -121,52 +121,59 @@
/* r10 has the output of the cmpb instruction, that is, it contains /* r10 has the output of the cmpb instruction, that is, it contains
0xff in the same position as the null byte in the original 0xff in the same position as the null byte in the original
doubleword from the string. Use that to calculate the length. doubleword from the string. Use that to calculate the length.
- We need to make sure the null char is *before* the start of the - We need to make sure the null char is *before* the start of the
- range (since we're going backwards). */ - range (since we're going backwards). */
+ We need to make sure the null char is *before* the end of the + We need to make sure the null char is *before* the end of the
@ -327,30 +327,30 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
+ cmpld r3,r4 + cmpld r3,r4
+ blelr + blelr
+ mr r3,r4 + mr r3,r4
blr blr
/* Deals with size <= 32. */ /* Deals with size <= 32. */
.align 4 .align 4
L(small_range): L(small_range):
cmpldi r4,0 cmpldi r4,0
- beq L(zero) - beq L(zero)
+ beq L(end_max) + beq L(end_max)
+ +
+ clrrdi r7,r7,3 /* Address of last doubleword. */ + clrrdi r7,r7,3 /* Address of last doubleword. */
rlwinm r6,r3,3,26,28 /* Calculate padding. */ rlwinm r6,r3,3,26,28 /* Calculate padding. */
- ld r12,0(r8) /* Load word from memory. */ - ld r12,0(r8) /* Load word from memory. */
+ ld r12,0(r8) /* Load doubleword from memory. */ + ld r12,0(r8) /* Load doubleword from memory. */
cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */ cmpb r10,r12,r0 /* Check for null bytes in DWORD1. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6 + srd r10,r10,r6
+ sld r10,r10,r6 + sld r10,r10,r6
+#else +#else
sld r10,r10,r6 sld r10,r10,r6
srd r10,r10,r6 srd r10,r10,r6
+#endif +#endif
cmpldi cr7,r10,0 cmpldi cr7,r10,0
bne cr7,L(done) bne cr7,L(done)
- addi r9,r8,8 - addi r9,r8,8
- cmpld r9,r7 - cmpld r9,r7
@ -359,13 +359,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strnlen.S glibc-2
+ cmpld r8,r7 + cmpld r8,r7
+ beq L(end_max) + beq L(end_max)
.p2align 5 .p2align 5
L(loop_small): L(loop_small):
ldu r12,8(r8) ldu r12,8(r8)
cmpb r10,r12,r0 cmpb r10,r12,r0
- addi r9,r8,8 - addi r9,r8,8
cmpldi cr6,r10,0 cmpldi cr6,r10,0
bne cr6,L(done) bne cr6,L(done)
- cmpld r9,r7 - cmpld r9,r7
- bge L(end_max) - bge L(end_max)
- b L(loop_small) - b L(loop_small)

320
SOURCES/glibc-ppc64le-27.patch

@ -41,8 +41,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2
#define rBITDIF r11 /* bits that differ in s1 & s2 words */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */
+#define rTMP r12 +#define rTMP r12
dcbt 0,rSTR1 dcbt 0,rSTR1
or rTMP, rSTR2, rSTR1 or rTMP, rSTR2, rSTR1
@@ -80,12 +81,45 @@ @@ -80,12 +81,45 @@
we don't compare two strings as different because of gunk beyond we don't compare two strings as different because of gunk beyond
the end of the strings... */ the end of the strings... */
@ -82,32 +82,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2
+ +
+#else +#else
L(endstring): L(endstring):
and rTMP, r7F7F, rWORD1 and rTMP, r7F7F, rWORD1
beq cr1, L(equal) beq cr1, L(equal)
add rTMP, rTMP, r7F7F add rTMP, rTMP, r7F7F
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
- -
andc rNEG, rNEG, rTMP andc rNEG, rNEG, rTMP
blt- L(highbit) blt- L(highbit)
cntlzw rBITDIF, rBITDIF cntlzw rBITDIF, rBITDIF
@@ -93,28 +127,20 @@ @@ -93,28 +127,20 @@
addi rNEG, rNEG, 7 addi rNEG, rNEG, 7
cmpw cr1, rNEG, rBITDIF cmpw cr1, rNEG, rBITDIF
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
- blt- cr1, L(equal) - blt- cr1, L(equal)
- srawi rRTN, rRTN, 31 - srawi rRTN, rRTN, 31
- ori rRTN, rRTN, 1 - ori rRTN, rRTN, 1
- blr - blr
+ bgelr+ cr1 + bgelr+ cr1
L(equal): L(equal):
li rRTN, 0 li rRTN, 0
blr blr
L(different): L(different):
- lwzu rWORD1, -4(rSTR1) - lwzu rWORD1, -4(rSTR1)
+ lwz rWORD1, -4(rSTR1) + lwz rWORD1, -4(rSTR1)
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
- blt- L(highbit) - blt- L(highbit)
- srawi rRTN, rRTN, 31 - srawi rRTN, rRTN, 31
- ori rRTN, rRTN, 1 - ori rRTN, rRTN, 1
@ -118,12 +118,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/strncmp.S glibc-2
- srwi rWORD1, rWORD1, 24 - srwi rWORD1, rWORD1, 24
- sub rRTN, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2
+ ori rRTN, rWORD2, 1 + ori rRTN, rWORD2, 1
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S 2014-05-28 13:27:02.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S 2014-05-28 13:27:02.000000000 -0500
@ -142,8 +142,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2
#define rBITDIF r11 /* bits that differ in s1 & s2 words */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */
+#define rTMP r12 +#define rTMP r12
dcbt 0,rSTR1 dcbt 0,rSTR1
nop nop
@@ -83,13 +84,45 @@ @@ -83,13 +84,45 @@
/* OK. We've hit the end of the string. We need to be careful that /* OK. We've hit the end of the string. We need to be careful that
we don't compare two strings as different because of gunk beyond we don't compare two strings as different because of gunk beyond
@ -183,32 +183,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2
+#else +#else
L(endstring): L(endstring):
and rTMP,r7F7F,rWORD1 and rTMP,r7F7F,rWORD1
beq cr1,L(equal) beq cr1,L(equal)
add rTMP,rTMP,r7F7F add rTMP,rTMP,r7F7F
xor. rBITDIF,rWORD1,rWORD2 xor. rBITDIF,rWORD1,rWORD2
- -
andc rNEG,rNEG,rTMP andc rNEG,rNEG,rTMP
blt L(highbit) blt L(highbit)
cntlzw rBITDIF,rBITDIF cntlzw rBITDIF,rBITDIF
@@ -97,28 +130,20 @@ @@ -97,28 +130,20 @@
addi rNEG,rNEG,7 addi rNEG,rNEG,7
cmpw cr1,rNEG,rBITDIF cmpw cr1,rNEG,rBITDIF
sub rRTN,rWORD1,rWORD2 sub rRTN,rWORD1,rWORD2
- blt cr1,L(equal) - blt cr1,L(equal)
- srawi rRTN,rRTN,31 - srawi rRTN,rRTN,31
- ori rRTN,rRTN,1 - ori rRTN,rRTN,1
- blr - blr
+ bgelr cr1 + bgelr cr1
L(equal): L(equal):
li rRTN,0 li rRTN,0
blr blr
L(different): L(different):
- lwzu rWORD1,-4(rSTR1) - lwzu rWORD1,-4(rSTR1)
+ lwz rWORD1,-4(rSTR1) + lwz rWORD1,-4(rSTR1)
xor. rBITDIF,rWORD1,rWORD2 xor. rBITDIF,rWORD1,rWORD2
sub rRTN,rWORD1,rWORD2 sub rRTN,rWORD1,rWORD2
- blt L(highbit) - blt L(highbit)
- srawi rRTN,rRTN,31 - srawi rRTN,rRTN,31
- ori rRTN,rRTN,1 - ori rRTN,rRTN,1
@ -219,12 +219,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strncmp.S glibc-2
- srwi rWORD1,rWORD1,24 - srwi rWORD1,rWORD1,24
- sub rRTN,rWORD1,rWORD2 - sub rRTN,rWORD1,rWORD2
+ ori rRTN, rWORD2, 1 + ori rRTN, rWORD2, 1
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S 2014-05-28 13:27:02.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S 2014-05-28 13:27:02.000000000 -0500
@ -243,12 +243,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758
#define rBITDIF r10 /* bits that differ in s1 & s2 words */ #define rBITDIF r10 /* bits that differ in s1 & s2 words */
+#define rTMP r11 +#define rTMP r11
CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1) CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1)
CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2) CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2)
@@ -64,10 +65,45 @@ @@ -64,10 +65,45 @@
and. rTMP, rTMP, rNEG and. rTMP, rTMP, rNEG
cmpw cr1, rWORD1, rWORD2 cmpw cr1, rWORD1, rWORD2
beq+ L(g0) beq+ L(g0)
-L(endstring): -L(endstring):
+ +
/* OK. We've hit the end of the string. We need to be careful that /* OK. We've hit the end of the string. We need to be careful that
@ -289,18 +289,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcmp.S glibc-2.17-c758
+ +
+#else +#else
+L(endstring): +L(endstring):
and rTMP, r7F7F, rWORD1 and rTMP, r7F7F, rWORD1
beq cr1, L(equal) beq cr1, L(equal)
add rTMP, rTMP, r7F7F add rTMP, rTMP, r7F7F
@@ -94,7 +130,7 @@ @@ -94,7 +130,7 @@
ori rRTN, rWORD2, 1 ori rRTN, rWORD2, 1
/* GKM FIXME: check high bounds. */ /* GKM FIXME: check high bounds. */
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S 2014-05-28 13:27:02.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S 2014-05-28 13:27:02.000000000 -0500
@ -319,8 +319,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c75
#define rBITDIF r11 /* bits that differ in s1 & s2 words */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */
+#define rTMP r12 +#define rTMP r12
dcbt 0,rSTR1 dcbt 0,rSTR1
or rTMP, rSTR2, rSTR1 or rTMP, rSTR2, rSTR1
@@ -78,12 +79,45 @@ @@ -78,12 +79,45 @@
we don't compare two strings as different because of gunk beyond we don't compare two strings as different because of gunk beyond
the end of the strings... */ the end of the strings... */
@ -360,32 +360,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c75
+ +
+#else +#else
L(endstring): L(endstring):
and rTMP, r7F7F, rWORD1 and rTMP, r7F7F, rWORD1
beq cr1, L(equal) beq cr1, L(equal)
add rTMP, rTMP, r7F7F add rTMP, rTMP, r7F7F
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
- -
andc rNEG, rNEG, rTMP andc rNEG, rNEG, rTMP
blt- L(highbit) blt- L(highbit)
cntlzw rBITDIF, rBITDIF cntlzw rBITDIF, rBITDIF
@@ -91,28 +125,20 @@ @@ -91,28 +125,20 @@
addi rNEG, rNEG, 7 addi rNEG, rNEG, 7
cmpw cr1, rNEG, rBITDIF cmpw cr1, rNEG, rBITDIF
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
- blt- cr1, L(equal) - blt- cr1, L(equal)
- srawi rRTN, rRTN, 31 - srawi rRTN, rRTN, 31
- ori rRTN, rRTN, 1 - ori rRTN, rRTN, 1
- blr - blr
+ bgelr+ cr1 + bgelr+ cr1
L(equal): L(equal):
li rRTN, 0 li rRTN, 0
blr blr
L(different): L(different):
- lwzu rWORD1, -4(rSTR1) - lwzu rWORD1, -4(rSTR1)
+ lwz rWORD1, -4(rSTR1) + lwz rWORD1, -4(rSTR1)
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
- blt- L(highbit) - blt- L(highbit)
- srawi rRTN, rRTN, 31 - srawi rRTN, rRTN, 31
- ori rRTN, rRTN, 1 - ori rRTN, rRTN, 1
@ -396,18 +396,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strncmp.S glibc-2.17-c75
- srwi rWORD1, rWORD1, 24 - srwi rWORD1, rWORD1, 24
- sub rRTN, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2
+ ori rRTN, rWORD2, 1 + ori rRTN, rWORD2, 1
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S 2014-05-28 13:27:02.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S 2014-05-28 13:27:02.000000000 -0500
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
EALIGN (BP_SYM(strncmp), 4, 0) EALIGN (BP_SYM(strncmp), 4, 0)
CALL_MCOUNT 3 CALL_MCOUNT 3
-#define rTMP r0 -#define rTMP r0
+#define rTMP2 r0 +#define rTMP2 r0
@ -420,8 +420,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2
#define rBITDIF r11 /* bits that differ in s1 & s2 words */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */
+#define rTMP r12 +#define rTMP r12
dcbt 0,rSTR1 dcbt 0,rSTR1
or rTMP, rSTR2, rSTR1 or rTMP, rSTR2, rSTR1
@@ -84,12 +85,59 @@ @@ -84,12 +85,59 @@
we don't compare two strings as different because of gunk beyond we don't compare two strings as different because of gunk beyond
the end of the strings... */ the end of the strings... */
@ -475,53 +475,53 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/strncmp.S glibc-2
+ +
+#else +#else
L(endstring): L(endstring):
and rTMP, r7F7F, rWORD1 and rTMP, r7F7F, rWORD1
beq cr1, L(equal) beq cr1, L(equal)
add rTMP, rTMP, r7F7F add rTMP, rTMP, r7F7F
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
- -
andc rNEG, rNEG, rTMP andc rNEG, rNEG, rTMP
blt- L(highbit) blt- L(highbit)
cntlzd rBITDIF, rBITDIF cntlzd rBITDIF, rBITDIF
@@ -98,7 +146,7 @@ @@ -98,7 +146,7 @@
cmpd cr1, rNEG, rBITDIF cmpd cr1, rNEG, rBITDIF
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
blt- cr1, L(equal) blt- cr1, L(equal)
- sradi rRTN, rRTN, 63 - sradi rRTN, rRTN, 63
+ sradi rRTN, rRTN, 63 /* must return an int. */ + sradi rRTN, rRTN, 63 /* must return an int. */
ori rRTN, rRTN, 1 ori rRTN, rRTN, 1
blr blr
L(equal): L(equal):
@@ -106,7 +154,7 @@ @@ -106,7 +154,7 @@
blr blr
L(different): L(different):
- ldu rWORD1, -8(rSTR1) - ldu rWORD1, -8(rSTR1)
+ ld rWORD1, -8(rSTR1) + ld rWORD1, -8(rSTR1)
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
blt- L(highbit) blt- L(highbit)
@@ -114,11 +162,10 @@ @@ -114,11 +162,10 @@
ori rRTN, rRTN, 1 ori rRTN, rRTN, 1
blr blr
L(highbit): L(highbit):
- srdi rWORD2, rWORD2, 56 - srdi rWORD2, rWORD2, 56
- srdi rWORD1, rWORD1, 56 - srdi rWORD1, rWORD1, 56
- sub rRTN, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2
+ sradi rRTN, rWORD2, 63 + sradi rRTN, rWORD2, 63
+ ori rRTN, rRTN, 1 + ori rRTN, rRTN, 1
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S 2014-05-28 13:27:02.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S 2014-05-28 13:27:02.000000000 -0500
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
EALIGN (BP_SYM(strncmp),5,0) EALIGN (BP_SYM(strncmp),5,0)
CALL_MCOUNT 3 CALL_MCOUNT 3
-#define rTMP r0 -#define rTMP r0
+#define rTMP2 r0 +#define rTMP2 r0
@ -534,8 +534,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2
#define rBITDIF r11 /* bits that differ in s1 & s2 words */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */
+#define rTMP r12 +#define rTMP r12
dcbt 0,rSTR1 dcbt 0,rSTR1
nop nop
@@ -88,12 +89,57 @@ @@ -88,12 +89,57 @@
we don't compare two strings as different because of gunk beyond we don't compare two strings as different because of gunk beyond
the end of the strings... */ the end of the strings... */
@ -587,53 +587,53 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strncmp.S glibc-2
+ +
+#else +#else
L(endstring): L(endstring):
and rTMP,r7F7F,rWORD1 and rTMP,r7F7F,rWORD1
beq cr1,L(equal) beq cr1,L(equal)
add rTMP,rTMP,r7F7F add rTMP,rTMP,r7F7F
xor. rBITDIF,rWORD1,rWORD2 xor. rBITDIF,rWORD1,rWORD2
- -
andc rNEG,rNEG,rTMP andc rNEG,rNEG,rTMP
blt L(highbit) blt L(highbit)
cntlzd rBITDIF,rBITDIF cntlzd rBITDIF,rBITDIF
@@ -102,7 +148,7 @@ @@ -102,7 +148,7 @@
cmpd cr1,rNEG,rBITDIF cmpd cr1,rNEG,rBITDIF
sub rRTN,rWORD1,rWORD2 sub rRTN,rWORD1,rWORD2
blt cr1,L(equal) blt cr1,L(equal)
- sradi rRTN,rRTN,63 - sradi rRTN,rRTN,63
+ sradi rRTN,rRTN,63 /* must return an int. */ + sradi rRTN,rRTN,63 /* must return an int. */
ori rRTN,rRTN,1 ori rRTN,rRTN,1
blr blr
L(equal): L(equal):
@@ -110,7 +156,7 @@ @@ -110,7 +156,7 @@
blr blr
L(different): L(different):
- ldu rWORD1,-8(rSTR1) - ldu rWORD1,-8(rSTR1)
+ ld rWORD1,-8(rSTR1) + ld rWORD1,-8(rSTR1)
xor. rBITDIF,rWORD1,rWORD2 xor. rBITDIF,rWORD1,rWORD2
sub rRTN,rWORD1,rWORD2 sub rRTN,rWORD1,rWORD2
blt L(highbit) blt L(highbit)
@@ -118,11 +164,10 @@ @@ -118,11 +164,10 @@
ori rRTN,rRTN,1 ori rRTN,rRTN,1
blr blr
L(highbit): L(highbit):
- srdi rWORD2,rWORD2,56 - srdi rWORD2,rWORD2,56
- srdi rWORD1,rWORD1,56 - srdi rWORD1,rWORD1,56
- sub rRTN,rWORD1,rWORD2 - sub rRTN,rWORD1,rWORD2
+ sradi rRTN,rWORD2,63 + sradi rRTN,rWORD2,63
+ ori rRTN,rRTN,1 + ori rRTN,rRTN,1
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S 2014-05-28 13:37:15.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S 2014-05-28 13:37:15.000000000 -0500
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
EALIGN (BP_SYM(strcmp), 4, 0) EALIGN (BP_SYM(strcmp), 4, 0)
CALL_MCOUNT 2 CALL_MCOUNT 2
-#define rTMP r0 -#define rTMP r0
+#define rTMP2 r0 +#define rTMP2 r0
@ -646,16 +646,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758
#define rBITDIF r10 /* bits that differ in s1 & s2 words */ #define rBITDIF r10 /* bits that differ in s1 & s2 words */
+#define rTMP r11 +#define rTMP r11
CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1) CHECK_BOUNDS_LOW (rSTR1, rTMP, rHIGH1)
CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2) CHECK_BOUNDS_LOW (rSTR2, rTMP, rHIGH2)
@@ -72,19 +73,66 @@ @@ -72,19 +73,66 @@
ldu rWORD2, 8(rSTR2) ldu rWORD2, 8(rSTR2)
L(g1): add rTMP, rFEFE, rWORD1 L(g1): add rTMP, rFEFE, rWORD1
nor rNEG, r7F7F, rWORD1 nor rNEG, r7F7F, rWORD1
- -
and. rTMP, rTMP, rNEG and. rTMP, rTMP, rNEG
cmpd cr1, rWORD1, rWORD2 cmpd cr1, rWORD1, rWORD2
beq+ L(g0) beq+ L(g0)
-L(endstring): -L(endstring):
+ +
/* OK. We've hit the end of the string. We need to be careful that /* OK. We've hit the end of the string. We need to be careful that
@ -710,45 +710,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcmp.S glibc-2.17-c758
+ +
+#else +#else
+L(endstring): +L(endstring):
and rTMP, r7F7F, rWORD1 and rTMP, r7F7F, rWORD1
beq cr1, L(equal) beq cr1, L(equal)
add rTMP, rTMP, r7F7F add rTMP, rTMP, r7F7F
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
- -
andc rNEG, rNEG, rTMP andc rNEG, rNEG, rTMP
blt- L(highbit) blt- L(highbit)
cntlzd rBITDIF, rBITDIF cntlzd rBITDIF, rBITDIF
@@ -93,7 +141,7 @@ @@ -93,7 +141,7 @@
cmpd cr1, rNEG, rBITDIF cmpd cr1, rNEG, rBITDIF
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
blt- cr1, L(equal) blt- cr1, L(equal)
- sradi rRTN, rRTN, 63 - sradi rRTN, rRTN, 63
+ sradi rRTN, rRTN, 63 /* must return an int. */ + sradi rRTN, rRTN, 63 /* must return an int. */
ori rRTN, rRTN, 1 ori rRTN, rRTN, 1
blr blr
L(equal): L(equal):
@@ -110,12 +158,11 @@ @@ -110,12 +158,11 @@
ori rRTN, rRTN, 1 ori rRTN, rRTN, 1
blr blr
L(highbit): L(highbit):
- srdi rWORD2, rWORD2, 56 - srdi rWORD2, rWORD2, 56
- srdi rWORD1, rWORD1, 56 - srdi rWORD1, rWORD1, 56
- sub rRTN, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2
+ sradi rRTN, rWORD2, 63 + sradi rRTN, rWORD2, 63
+ ori rRTN, rRTN, 1 + ori rRTN, rRTN, 1
/* GKM FIXME: check high bounds. */ /* GKM FIXME: check high bounds. */
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S 2014-05-28 13:26:59.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S 2014-05-28 13:26:59.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S 2014-05-28 13:38:31.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S 2014-05-28 13:38:31.000000000 -0500
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
EALIGN (BP_SYM(strncmp), 4, 0) EALIGN (BP_SYM(strncmp), 4, 0)
CALL_MCOUNT 3 CALL_MCOUNT 3
-#define rTMP r0 -#define rTMP r0
+#define rTMP2 r0 +#define rTMP2 r0
@ -761,8 +761,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c75
#define rBITDIF r11 /* bits that differ in s1 & s2 words */ #define rBITDIF r11 /* bits that differ in s1 & s2 words */
+#define rTMP r12 +#define rTMP r12
dcbt 0,rSTR1 dcbt 0,rSTR1
or rTMP, rSTR2, rSTR1 or rTMP, rSTR2, rSTR1
@@ -81,13 +82,60 @@ @@ -81,13 +82,60 @@
/* OK. We've hit the end of the string. We need to be careful that /* OK. We've hit the end of the string. We need to be careful that
we don't compare two strings as different because of gunk beyond we don't compare two strings as different because of gunk beyond
@ -818,44 +818,44 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strncmp.S glibc-2.17-c75
+ +
+#else +#else
L(endstring): L(endstring):
and rTMP, r7F7F, rWORD1 and rTMP, r7F7F, rWORD1
beq cr1, L(equal) beq cr1, L(equal)
add rTMP, rTMP, r7F7F add rTMP, rTMP, r7F7F
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
- -
andc rNEG, rNEG, rTMP andc rNEG, rNEG, rTMP
blt- L(highbit) blt- L(highbit)
cntlzd rBITDIF, rBITDIF cntlzd rBITDIF, rBITDIF
@@ -96,7 +144,7 @@ @@ -96,7 +144,7 @@
cmpd cr1, rNEG, rBITDIF cmpd cr1, rNEG, rBITDIF
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
blt- cr1, L(equal) blt- cr1, L(equal)
- sradi rRTN, rRTN, 63 - sradi rRTN, rRTN, 63
+ sradi rRTN, rRTN, 63 /* must return an int. */ + sradi rRTN, rRTN, 63 /* must return an int. */
ori rRTN, rRTN, 1 ori rRTN, rRTN, 1
blr blr
L(equal): L(equal):
@@ -104,7 +152,7 @@ @@ -104,7 +152,7 @@
blr blr
L(different): L(different):
- ldu rWORD1, -8(rSTR1) - ldu rWORD1, -8(rSTR1)
+ ld rWORD1, -8(rSTR1) + ld rWORD1, -8(rSTR1)
xor. rBITDIF, rWORD1, rWORD2 xor. rBITDIF, rWORD1, rWORD2
sub rRTN, rWORD1, rWORD2 sub rRTN, rWORD1, rWORD2
blt- L(highbit) blt- L(highbit)
@@ -112,11 +160,10 @@ @@ -112,11 +160,10 @@
ori rRTN, rRTN, 1 ori rRTN, rRTN, 1
blr blr
L(highbit): L(highbit):
- srdi rWORD2, rWORD2, 56 - srdi rWORD2, rWORD2, 56
- srdi rWORD1, rWORD1, 56 - srdi rWORD1, rWORD1, 56
- sub rRTN, rWORD1, rWORD2 - sub rRTN, rWORD1, rWORD2
+ sradi rRTN, rWORD2, 63 + sradi rRTN, rWORD2, 63
+ ori rRTN, rRTN, 1 + ori rRTN, rRTN, 1
blr blr
- -
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte comparison. */ /* Oh well. In this case, we just do a byte-by-byte comparison. */
.align 4 .align 4

64
SOURCES/glibc-ppc64le-28.patch

@ -21,7 +21,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S glibc-2.17-c758
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S 2014-05-28 13:40:01.000000000 -0500
@@ -74,7 +74,22 @@ @@ -74,7 +74,22 @@
mr rALT, rWORD mr rALT, rWORD
/* We've hit the end of the string. Do the rest byte-by-byte. */ /* We've hit the end of the string. Do the rest byte-by-byte. */
-L(g1): rlwinm. rTMP, rALT, 8, 24, 31 -L(g1): rlwinm. rTMP, rALT, 8, 24, 31
+L(g1): +L(g1):
@ -40,23 +40,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/stpcpy.S glibc-2.17-c758
+ blr + blr
+#else +#else
+ rlwinm. rTMP, rALT, 8, 24, 31 + rlwinm. rTMP, rALT, 8, 24, 31
stbu rTMP, 4(rDEST) stbu rTMP, 4(rDEST)
beqlr- beqlr-
rlwinm. rTMP, rALT, 16, 24, 31 rlwinm. rTMP, rALT, 16, 24, 31
@@ -87,6 +102,7 @@ @@ -87,6 +102,7 @@
CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt) CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt)
STORE_RETURN_VALUE (rDEST) STORE_RETURN_VALUE (rDEST)
blr blr
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte copy. */ /* Oh well. In this case, we just do a byte-by-byte copy. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S 2014-05-28 13:40:01.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S 2014-05-28 13:40:01.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S 2014-05-28 13:40:01.000000000 -0500
@@ -78,7 +78,22 @@ @@ -78,7 +78,22 @@
mr rALT, rWORD mr rALT, rWORD
/* We've hit the end of the string. Do the rest byte-by-byte. */ /* We've hit the end of the string. Do the rest byte-by-byte. */
-L(g1): rlwinm. rTMP, rALT, 8, 24, 31 -L(g1): rlwinm. rTMP, rALT, 8, 24, 31
+L(g1): +L(g1):
@ -75,23 +75,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strcpy.S glibc-2.17-c758
+ blr + blr
+#else +#else
+ rlwinm. rTMP, rALT, 8, 24, 31 + rlwinm. rTMP, rALT, 8, 24, 31
stb rTMP, 4(rDEST) stb rTMP, 4(rDEST)
beqlr- beqlr-
rlwinm. rTMP, rALT, 16, 24, 31 rlwinm. rTMP, rALT, 16, 24, 31
@@ -90,6 +105,7 @@ @@ -90,6 +105,7 @@
stb rALT, 7(rDEST) stb rALT, 7(rDEST)
/* GKM FIXME: check high bound. */ /* GKM FIXME: check high bound. */
blr blr
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte copy. */ /* Oh well. In this case, we just do a byte-by-byte copy. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S 2014-05-28 13:40:01.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S 2014-05-28 13:40:01.000000000 -0500
@@ -75,7 +75,22 @@ @@ -75,7 +75,22 @@
mr rALT, rWORD mr rALT, rWORD
/* We've hit the end of the string. Do the rest byte-by-byte. */ /* We've hit the end of the string. Do the rest byte-by-byte. */
-L(g1): rlwinm. rTMP, rALT, 8, 24, 31 -L(g1): rlwinm. rTMP, rALT, 8, 24, 31
+L(g1): +L(g1):
@ -110,22 +110,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/stpcpy.S glibc-2.17-c758
+ blr + blr
+#else +#else
+ rlwinm. rTMP, rALT, 8, 24, 31 + rlwinm. rTMP, rALT, 8, 24, 31
stbu rTMP, 4(rDEST) stbu rTMP, 4(rDEST)
beqlr- beqlr-
rlwinm. rTMP, rALT, 16, 24, 31 rlwinm. rTMP, rALT, 16, 24, 31
@@ -88,6 +103,7 @@ @@ -88,6 +103,7 @@
CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt) CHECK_BOUNDS_HIGH (rDEST, rHIGH, twlgt)
STORE_RETURN_VALUE (rDEST) STORE_RETURN_VALUE (rDEST)
blr blr
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte copy. */ /* Oh well. In this case, we just do a byte-by-byte copy. */
.align 4 .align 4
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S 2014-05-28 13:40:01.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S 2014-05-28 13:40:01.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S 2014-05-28 13:40:01.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S 2014-05-28 13:40:01.000000000 -0500
@@ -90,6 +90,32 @@ @@ -90,6 +90,32 @@
mr rALT, rWORD mr rALT, rWORD
/* We've hit the end of the string. Do the rest byte-by-byte. */ /* We've hit the end of the string. Do the rest byte-by-byte. */
L(g1): L(g1):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -154,14 +154,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strcpy.S glibc-2.17-c758
+ stb rTMP, 15(rDEST) + stb rTMP, 15(rDEST)
+ blr + blr
+#else +#else
extrdi. rTMP, rALT, 8, 0 extrdi. rTMP, rALT, 8, 0
stb rTMP, 8(rDEST) stb rTMP, 8(rDEST)
beqlr- beqlr-
@@ -114,6 +140,7 @@ @@ -114,6 +140,7 @@
stb rALT, 15(rDEST) stb rALT, 15(rDEST)
/* GKM FIXME: check high bound. */ /* GKM FIXME: check high bound. */
blr blr
+#endif +#endif
/* Oh well. In this case, we just do a byte-by-byte copy. */ /* Oh well. In this case, we just do a byte-by-byte copy. */
.align 4 .align 4

422
SOURCES/glibc-ppc64le-29.patch

@ -35,20 +35,20 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S.orig --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S.orig
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
@@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr)) @@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr))
beq cr7,L(null_match) beq cr7,L(null_match)
/* Replicate byte to word. */ /* Replicate byte to word. */
- rlwimi r4,r4,8,16,23 - rlwimi r4,r4,8,16,23
- rlwimi r4,r4,16,0,15 - rlwimi r4,r4,16,0,15
+ insrdi r4,r4,8,48 + insrdi r4,r4,8,48
+ insrdi r4,r4,16,32 + insrdi r4,r4,16,32
/* Now r4 has a word of c bytes and r0 has /* Now r4 has a word of c bytes and r0 has
a word of null bytes. */ a word of null bytes. */
@@ -48,11 +48,17 @@ ENTRY (BP_SYM(strchr)) @@ -48,11 +48,17 @@ ENTRY (BP_SYM(strchr))
/* Move the words left and right to discard the bits that are /* Move the words left and right to discard the bits that are
not part of the string and to bring them back as zeros. */ not part of the string and to bring them back as zeros. */
- -
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srw r10,r10,r6 + srw r10,r10,r6
@ -56,40 +56,40 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
+ slw r10,r10,r6 + slw r10,r10,r6
+ slw r11,r11,r6 + slw r11,r11,r6
+#else +#else
slw r10,r10,r6 slw r10,r10,r6
slw r11,r11,r6 slw r11,r11,r6
srw r10,r10,r6 srw r10,r10,r6
srw r11,r11,r6 srw r11,r11,r6
+#endif +#endif
or r5,r10,r11 /* OR the results to speed things up. */ or r5,r10,r11 /* OR the results to speed things up. */
cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes
have been found. */ have been found. */
@@ -67,7 +73,7 @@ ENTRY (BP_SYM(strchr)) @@ -67,7 +73,7 @@ ENTRY (BP_SYM(strchr))
/* Handle WORD2 of pair. */ /* Handle WORD2 of pair. */
lwzu r12,4(r8) lwzu r12,4(r8)
- cmpb r10,r12,r4 - cmpb r10,r12,r4
+ cmpb r10,r12,r4 + cmpb r10,r12,r4
cmpb r11,r12,r0 cmpb r11,r12,r0
or r5,r10,r11 or r5,r10,r11
cmpwi cr7,r5,0 cmpwi cr7,r5,0
@@ -102,22 +108,31 @@ L(loop): @@ -102,22 +108,31 @@ L(loop):
bne cr6,L(done) bne cr6,L(done)
/* The c/null byte must be in the second word. Adjust the address /* The c/null byte must be in the second word. Adjust the address
- again and move the result of cmpb to r10 so we can calculate the - again and move the result of cmpb to r10 so we can calculate the
- pointer. */ - pointer. */
+ again and move the result of cmpb to r10/r11 so we can calculate + again and move the result of cmpb to r10/r11 so we can calculate
+ the pointer. */ + the pointer. */
mr r10,r6 mr r10,r6
mr r11,r7 mr r11,r7
addi r8,r8,4 addi r8,r8,4
- /* r5 has the output of the cmpb instruction, that is, it contains - /* r5 has the output of the cmpb instruction, that is, it contains
+ /* r10/r11 have the output of the cmpb instructions, that is, + /* r10/r11 have the output of the cmpb instructions, that is,
0xff in the same position as the c/null byte in the original 0xff in the same position as the c/null byte in the original
word from the string. Use that to calculate the pointer. */ word from the string. Use that to calculate the pointer. */
L(done): L(done):
- cntlzw r4,r10 /* Count leading zeroes before c matches. */ - cntlzw r4,r10 /* Count leading zeroes before c matches. */
- cntlzw r0,r11 /* Count leading zeroes before null matches. */ - cntlzw r0,r11 /* Count leading zeroes before null matches. */
@ -105,17 +105,17 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
+#else +#else
+ cntlzw r0,r10 /* Count leading zeros before c matches. */ + cntlzw r0,r10 /* Count leading zeros before c matches. */
+ cmplw cr7,r11,r10 + cmplw cr7,r11,r10
bgt cr7,L(no_match) bgt cr7,L(no_match)
- srwi r0,r4,3 /* Convert leading zeroes to bytes. */ - srwi r0,r4,3 /* Convert leading zeroes to bytes. */
+#endif +#endif
+ srwi r0,r0,3 /* Convert leading zeros to bytes. */ + srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching c byte add r3,r8,r0 /* Return address of the matching c byte
or null in case c was not found. */ or null in case c was not found. */
blr blr
@@ -135,10 +150,14 @@ L(null_match): @@ -135,10 +150,14 @@ L(null_match):
cmpb r5,r12,r0 /* Compare each byte against null bytes. */ cmpb r5,r12,r0 /* Compare each byte against null bytes. */
/* Move the words left and right to discard the bits that are /* Move the words left and right to discard the bits that are
- not part of the string and to bring them back as zeros. */ - not part of the string and to bring them back as zeros. */
- -
+ not part of the string and bring them back as zeros. */ + not part of the string and bring them back as zeros. */
@ -123,80 +123,80 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchr.S
+ srw r5,r5,r6 + srw r5,r5,r6
+ slw r5,r5,r6 + slw r5,r5,r6
+#else +#else
slw r5,r5,r6 slw r5,r5,r6
srw r5,r5,r6 srw r5,r5,r6
+#endif +#endif
cmpwi cr7,r5,0 /* If r10 == 0, no c or null bytes cmpwi cr7,r5,0 /* If r10 == 0, no c or null bytes
have been found. */ have been found. */
bne cr7,L(done_null) bne cr7,L(done_null)
@@ -193,7 +212,13 @@ L(loop_null): @@ -193,7 +212,13 @@ L(loop_null):
0xff in the same position as the null byte in the original 0xff in the same position as the null byte in the original
word from the string. Use that to calculate the pointer. */ word from the string. Use that to calculate the pointer. */
L(done_null): L(done_null):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ addi r0,r5,-1 + addi r0,r5,-1
+ andc r0,r0,r5 + andc r0,r0,r5
+ popcntw r0,r0 + popcntw r0,r0
+#else +#else
cntlzw r0,r5 /* Count leading zeros before the match. */ cntlzw r0,r5 /* Count leading zeros before the match. */
+#endif +#endif
srwi r0,r0,3 /* Convert leading zeros to bytes. */ srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */ add r3,r8,r0 /* Return address of the matching null byte. */
blr blr
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S
=================================================================== ===================================================================
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S.orig --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S.orig
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S
@@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul)) @@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul))
clrrwi r8,r3,2 /* Align the address to word boundary. */ clrrwi r8,r3,2 /* Align the address to word boundary. */
/* Replicate byte to word. */ /* Replicate byte to word. */
- rlwimi r4,r4,8,16,23 - rlwimi r4,r4,8,16,23
- rlwimi r4,r4,16,0,15 - rlwimi r4,r4,16,0,15
+ insrdi r4,r4,8,48 + insrdi r4,r4,8,48
+ insrdi r4,r4,16,32 + insrdi r4,r4,16,32
rlwinm r6,r3,3,27,28 /* Calculate padding. */ rlwinm r6,r3,3,27,28 /* Calculate padding. */
lwz r12,0(r8) /* Load word from memory. */ lwz r12,0(r8) /* Load word from memory. */
@@ -45,10 +45,17 @@ ENTRY (BP_SYM(__strchrnul)) @@ -45,10 +45,17 @@ ENTRY (BP_SYM(__strchrnul))
/* Move the words left and right to discard the bits that are /* Move the words left and right to discard the bits that are
not part of the string and bring them back as zeros. */ not part of the string and bring them back as zeros. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srw r10,r10,r6 + srw r10,r10,r6
+ srw r9,r9,r6 + srw r9,r9,r6
+ slw r10,r10,r6 + slw r10,r10,r6
+ slw r9,r9,r6 + slw r9,r9,r6
+#else +#else
slw r10,r10,r6 slw r10,r10,r6
slw r9,r9,r6 slw r9,r9,r6
srw r10,r10,r6 srw r10,r10,r6
srw r9,r9,r6 srw r9,r9,r6
+#endif +#endif
or r5,r9,r10 /* OR the results to speed things up. */ or r5,r9,r10 /* OR the results to speed things up. */
cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes cmpwi cr7,r5,0 /* If r5 == 0, no c or null bytes
have been found. */ have been found. */
@@ -56,7 +63,7 @@ ENTRY (BP_SYM(__strchrnul)) @@ -56,7 +63,7 @@ ENTRY (BP_SYM(__strchrnul))
mtcrf 0x01,r8 mtcrf 0x01,r8
- /* Are we now aligned to a quadword boundary? If so, skip to - /* Are we now aligned to a quadword boundary? If so, skip to
+ /* Are we now aligned to a doubleword boundary? If so, skip to + /* Are we now aligned to a doubleword boundary? If so, skip to
the main loop. Otherwise, go through the alignment code. */ the main loop. Otherwise, go through the alignment code. */
bt 29,L(loop) bt 29,L(loop)
@@ -78,7 +85,7 @@ L(loop): @@ -78,7 +85,7 @@ L(loop):
single register for speed. This is an attempt single register for speed. This is an attempt
to speed up the null-checking process for bigger strings. */ to speed up the null-checking process for bigger strings. */
lwz r12,4(r8) lwz r12,4(r8)
- lwzu r11,8(r8) - lwzu r11,8(r8)
+ lwzu r11,8(r8) + lwzu r11,8(r8)
cmpb r10,r12,r0 cmpb r10,r12,r0
cmpb r9,r12,r4 cmpb r9,r12,r4
cmpb r6,r11,r0 cmpb r6,r11,r0
@@ -97,9 +104,9 @@ L(loop): @@ -97,9 +104,9 @@ L(loop):
addi r8,r8,-4 addi r8,r8,-4
bne cr6,L(done) bne cr6,L(done)
- /* The c/null byte must be in the second word. Adjust the - /* The c/null byte must be in the second word. Adjust the
- address again and move the result of cmpb to r10 so we can calculate - address again and move the result of cmpb to r10 so we can calculate
@ -204,23 +204,23 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/strchrnul.S
+ /* The c/null byte must be in the second word. Adjust the address + /* The c/null byte must be in the second word. Adjust the address
+ again and move the result of cmpb to r5 so we can calculate the + again and move the result of cmpb to r5 so we can calculate the
+ pointer. */ + pointer. */
mr r5,r10 mr r5,r10
addi r8,r8,4 addi r8,r8,4
@@ -107,7 +114,13 @@ L(loop): @@ -107,7 +114,13 @@ L(loop):
0xff in the same position as the c/null byte in the original 0xff in the same position as the c/null byte in the original
word from the string. Use that to calculate the pointer. */ word from the string. Use that to calculate the pointer. */
L(done): L(done):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ addi r0,r5,-1 + addi r0,r5,-1
+ andc r0,r0,r5 + andc r0,r0,r5
+ popcntw r0,r0 + popcntw r0,r0
+#else +#else
cntlzw r0,r5 /* Count leading zeros before the match. */ cntlzw r0,r5 /* Count leading zeros before the match. */
+#endif +#endif
srwi r0,r0,3 /* Convert leading zeros to bytes. */ srwi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */ add r3,r8,r0 /* Return address of matching c/null byte. */
blr blr
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S
=================================================================== ===================================================================
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S.orig --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S.orig
@ -232,25 +232,25 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S
+#define rTMP4 rIGN +#define rTMP4 rIGN
+#define rTMP5 rMASK +#define rTMP5 rMASK
CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2)
STORE_RETURN_BOUNDS (rTMP1, rTMP2) STORE_RETURN_BOUNDS (rTMP1, rTMP2)
@@ -59,53 +61,74 @@ ENTRY (BP_SYM (strchr)) @@ -59,53 +61,74 @@ ENTRY (BP_SYM (strchr))
addi r7F7F, r7F7F, 0x7f7f addi r7F7F, r7F7F, 0x7f7f
/* Test the first (partial?) word. */ /* Test the first (partial?) word. */
lwz rWORD, 0(rSTR) lwz rWORD, 0(rSTR)
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ slw rMASK, rMASK, rIGN + slw rMASK, rMASK, rIGN
+#else +#else
srw rMASK, rMASK, rIGN srw rMASK, rMASK, rIGN
+#endif +#endif
orc rWORD, rWORD, rMASK orc rWORD, rWORD, rMASK
add rTMP1, rFEFE, rWORD add rTMP1, rFEFE, rWORD
nor rTMP2, r7F7F, rWORD nor rTMP2, r7F7F, rWORD
- and. rTMP1, rTMP1, rTMP2 - and. rTMP1, rTMP1, rTMP2
+ and. rTMP4, rTMP1, rTMP2 + and. rTMP4, rTMP1, rTMP2
xor rTMP3, rCHR, rWORD xor rTMP3, rCHR, rWORD
orc rTMP3, rTMP3, rMASK orc rTMP3, rTMP3, rMASK
b L(loopentry) b L(loopentry)
/* The loop. */ /* The loop. */
@ -264,15 +264,15 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S
- nor rTMP2, r7F7F, rWORD - nor rTMP2, r7F7F, rWORD
+ add rTMP1, rFEFE, rWORD /* x - 0x01010101. */ + add rTMP1, rFEFE, rWORD /* x - 0x01010101. */
+ nor rTMP2, r7F7F, rWORD /* ~(x | 0x7f7f7f7f) == ~x & 0x80808080. */ + nor rTMP2, r7F7F, rWORD /* ~(x | 0x7f7f7f7f) == ~x & 0x80808080. */
bne L(foundit) bne L(foundit)
- and. rTMP1, rTMP1, rTMP2 - and. rTMP1, rTMP1, rTMP2
+ and. rTMP4, rTMP1, rTMP2 /* (x - 0x01010101) & ~x & 0x80808080. */ + and. rTMP4, rTMP1, rTMP2 /* (x - 0x01010101) & ~x & 0x80808080. */
/* Start test for the bytes we're looking for. */ /* Start test for the bytes we're looking for. */
xor rTMP3, rCHR, rWORD xor rTMP3, rCHR, rWORD
L(loopentry): L(loopentry):
add rTMP1, rFEFE, rTMP3 add rTMP1, rFEFE, rTMP3
nor rTMP2, r7F7F, rTMP3 nor rTMP2, r7F7F, rTMP3
beq L(loop) beq L(loop)
+ +
/* There is a zero byte in the word, but may also be a matching byte (either /* There is a zero byte in the word, but may also be a matching byte (either
before or after the zero byte). In fact, we may be looking for a before or after the zero byte). In fact, we may be looking for a
@ -282,9 +282,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S
- and. rTMP1, rTMP1, rTMP2 - and. rTMP1, rTMP1, rTMP2
+ zero byte, in which case we return a match. */ + zero byte, in which case we return a match. */
+ and. rTMP5, rTMP1, rTMP2 + and. rTMP5, rTMP1, rTMP2
li rRTN, 0 li rRTN, 0
STORE_RETURN_VALUE (rSTR) STORE_RETURN_VALUE (rSTR)
beqlr beqlr
-/* It did happen. Decide which one was first... -/* It did happen. Decide which one was first...
- I'm not sure if this is actually faster than a sequence of - I'm not sure if this is actually faster than a sequence of
- rotates, compares, and branches (we use it anyway because it's shorter). */ - rotates, compares, and branches (we use it anyway because it's shorter). */
@ -307,28 +307,28 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S
+/* I think we could reduce this by two instructions by keeping the "nor" +/* I think we could reduce this by two instructions by keeping the "nor"
+ results from the loop for reuse here. See strlen.S tail. Similarly + results from the loop for reuse here. See strlen.S tail. Similarly
+ one instruction could be pruned from L(foundit). */ + one instruction could be pruned from L(foundit). */
and rFEFE, r7F7F, rWORD and rFEFE, r7F7F, rWORD
- or rMASK, r7F7F, rWORD - or rMASK, r7F7F, rWORD
+ or rTMP5, r7F7F, rWORD + or rTMP5, r7F7F, rWORD
and rTMP1, r7F7F, rTMP3 and rTMP1, r7F7F, rTMP3
- or rIGN, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3
+ or rTMP4, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3
add rFEFE, rFEFE, r7F7F add rFEFE, rFEFE, r7F7F
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor rWORD, rMASK, rFEFE - nor rWORD, rMASK, rFEFE
- nor rTMP2, rIGN, rTMP1 - nor rTMP2, rIGN, rTMP1
+ nor rWORD, rTMP5, rFEFE + nor rWORD, rTMP5, rFEFE
+ nor rTMP2, rTMP4, rTMP1 + nor rTMP2, rTMP4, rTMP1
+ cntlzw rCLZB, rTMP2 + cntlzw rCLZB, rTMP2
cmplw rWORD, rTMP2 cmplw rWORD, rTMP2
bgtlr bgtlr
- cntlzw rCLZB, rTMP2 - cntlzw rCLZB, rTMP2
+#endif +#endif
srwi rCLZB, rCLZB, 3 srwi rCLZB, rCLZB, 3
add rRTN, rSTR, rCLZB add rRTN, rSTR, rCLZB
CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge)
@@ -113,13 +136,21 @@ L(missed): @@ -113,13 +136,21 @@ L(missed):
blr blr
L(foundit): L(foundit):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -338,38 +338,38 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/strchr.S
+ subfic rCLZB, rCLZB, 32-7-32 + subfic rCLZB, rCLZB, 32-7-32
+ srawi rCLZB, rCLZB, 3 + srawi rCLZB, rCLZB, 3
+#else +#else
and rTMP1, r7F7F, rTMP3 and rTMP1, r7F7F, rTMP3
- or rIGN, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3
+ or rTMP4, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor rTMP2, rIGN, rTMP1 - nor rTMP2, rIGN, rTMP1
+ nor rTMP2, rTMP4, rTMP1 + nor rTMP2, rTMP4, rTMP1
cntlzw rCLZB, rTMP2 cntlzw rCLZB, rTMP2
subi rSTR, rSTR, 4 subi rSTR, rSTR, 4
srwi rCLZB, rCLZB, 3 srwi rCLZB, rCLZB, 3
+#endif +#endif
add rRTN, rSTR, rCLZB add rRTN, rSTR, rCLZB
CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge) CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, twlge)
STORE_RETURN_VALUE (rSTR) STORE_RETURN_VALUE (rSTR)
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S
=================================================================== ===================================================================
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S.orig --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S.orig
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S
@@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr)) @@ -37,8 +37,8 @@ ENTRY (BP_SYM(strchr))
beq cr7,L(null_match) beq cr7,L(null_match)
/* Replicate byte to doubleword. */ /* Replicate byte to doubleword. */
- rlwimi r4,r4,8,16,23 - rlwimi r4,r4,8,16,23
- rlwimi r4,r4,16,0,15 - rlwimi r4,r4,16,0,15
+ insrdi r4,r4,8,48 + insrdi r4,r4,8,48
+ insrdi r4,r4,16,32 + insrdi r4,r4,16,32
insrdi r4,r4,32,0 insrdi r4,r4,32,0
/* Now r4 has a doubleword of c bytes and r0 has /* Now r4 has a doubleword of c bytes and r0 has
@@ -49,11 +49,17 @@ ENTRY (BP_SYM(strchr)) @@ -49,11 +49,17 @@ ENTRY (BP_SYM(strchr))
/* Move the doublewords left and right to discard the bits that are /* Move the doublewords left and right to discard the bits that are
not part of the string and bring them back as zeros. */ not part of the string and bring them back as zeros. */
- -
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6 + srd r10,r10,r6
@ -377,22 +377,22 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S
+ sld r10,r10,r6 + sld r10,r10,r6
+ sld r11,r11,r6 + sld r11,r11,r6
+#else +#else
sld r10,r10,r6 sld r10,r10,r6
sld r11,r11,r6 sld r11,r11,r6
srd r10,r10,r6 srd r10,r10,r6
srd r11,r11,r6 srd r11,r11,r6
+#endif +#endif
or r5,r10,r11 /* OR the results to speed things up. */ or r5,r10,r11 /* OR the results to speed things up. */
cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes
have been found. */ have been found. */
@@ -110,15 +116,24 @@ L(loop): @@ -110,15 +116,24 @@ L(loop):
mr r11,r7 mr r11,r7
addi r8,r8,8 addi r8,r8,8
- /* r5 has the output of the cmpb instruction, that is, it contains - /* r5 has the output of the cmpb instruction, that is, it contains
+ /* r10/r11 have the output of the cmpb instructions, that is, + /* r10/r11 have the output of the cmpb instructions, that is,
0xff in the same position as the c/null byte in the original 0xff in the same position as the c/null byte in the original
doubleword from the string. Use that to calculate the pointer. */ doubleword from the string. Use that to calculate the pointer. */
L(done): L(done):
- cntlzd r4,r10 /* Count leading zeroes before c matches. */ - cntlzd r4,r10 /* Count leading zeroes before c matches. */
- cntlzd r0,r11 /* Count leading zeroes before null matches. */ - cntlzd r0,r11 /* Count leading zeroes before null matches. */
@ -404,7 +404,7 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S
+ addi r4,r11,-1 + addi r4,r11,-1
+ andc r4,r4,r11 + andc r4,r4,r11
+ cmpld cr7,r3,r4 + cmpld cr7,r3,r4
bgt cr7,L(no_match) bgt cr7,L(no_match)
- srdi r0,r4,3 /* Convert leading zeroes to bytes. */ - srdi r0,r4,3 /* Convert leading zeroes to bytes. */
+#else +#else
+ cntlzd r0,r10 /* Count leading zeros before c matches. */ + cntlzd r0,r10 /* Count leading zeros before c matches. */
@ -412,94 +412,94 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchr.S
+ bgt cr7,L(no_match) + bgt cr7,L(no_match)
+#endif +#endif
+ srdi r0,r0,3 /* Convert leading zeros to bytes. */ + srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching c byte add r3,r8,r0 /* Return address of the matching c byte
or null in case c was not found. */ or null in case c was not found. */
blr blr
@@ -137,9 +152,13 @@ L(null_match): @@ -137,9 +152,13 @@ L(null_match):
/* Move the doublewords left and right to discard the bits that are /* Move the doublewords left and right to discard the bits that are
not part of the string and bring them back as zeros. */ not part of the string and bring them back as zeros. */
- -
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srd r5,r5,r6 + srd r5,r5,r6
+ sld r5,r5,r6 + sld r5,r5,r6
+#else +#else
sld r5,r5,r6 sld r5,r5,r6
srd r5,r5,r6 srd r5,r5,r6
+#endif +#endif
cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes cmpdi cr7,r5,0 /* If r10 == 0, no c or null bytes
have been found. */ have been found. */
bne cr7,L(done_null) bne cr7,L(done_null)
@@ -194,7 +213,13 @@ L(loop_null): @@ -194,7 +213,13 @@ L(loop_null):
0xff in the same position as the null byte in the original 0xff in the same position as the null byte in the original
doubleword from the string. Use that to calculate the pointer. */ doubleword from the string. Use that to calculate the pointer. */
L(done_null): L(done_null):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ addi r0,r5,-1 + addi r0,r5,-1
+ andc r0,r0,r5 + andc r0,r0,r5
+ popcntd r0,r0 + popcntd r0,r0
+#else +#else
cntlzd r0,r5 /* Count leading zeros before the match. */ cntlzd r0,r5 /* Count leading zeros before the match. */
+#endif +#endif
srdi r0,r0,3 /* Convert leading zeros to bytes. */ srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of the matching null byte. */ add r3,r8,r0 /* Return address of the matching null byte. */
blr blr
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S
=================================================================== ===================================================================
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S.orig --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S.orig
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/strchrnul.S
@@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul)) @@ -29,8 +29,8 @@ ENTRY (BP_SYM(__strchrnul))
clrrdi r8,r3,3 /* Align the address to doubleword boundary. */ clrrdi r8,r3,3 /* Align the address to doubleword boundary. */
/* Replicate byte to doubleword. */ /* Replicate byte to doubleword. */
- rlwimi r4,r4,8,16,23 - rlwimi r4,r4,8,16,23
- rlwimi r4,r4,16,0,15 - rlwimi r4,r4,16,0,15
+ insrdi r4,r4,8,48 + insrdi r4,r4,8,48
+ insrdi r4,r4,16,32 + insrdi r4,r4,16,32
insrdi r4,r4,32,0 insrdi r4,r4,32,0
rlwinm r6,r3,3,26,28 /* Calculate padding. */ rlwinm r6,r3,3,26,28 /* Calculate padding. */
@@ -46,10 +46,17 @@ ENTRY (BP_SYM(__strchrnul)) @@ -46,10 +46,17 @@ ENTRY (BP_SYM(__strchrnul))
/* Move the doublewords left and right to discard the bits that are /* Move the doublewords left and right to discard the bits that are
not part of the string and to bring them back as zeros. */ not part of the string and to bring them back as zeros. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ srd r10,r10,r6 + srd r10,r10,r6
+ srd r9,r9,r6 + srd r9,r9,r6
+ sld r10,r10,r6 + sld r10,r10,r6
+ sld r9,r9,r6 + sld r9,r9,r6
+#else +#else
sld r10,r10,r6 sld r10,r10,r6
sld r9,r9,r6 sld r9,r9,r6
srd r10,r10,r6 srd r10,r10,r6
srd r9,r9,r6 srd r9,r9,r6
+#endif +#endif
or r5,r9,r10 /* OR the results to speed things up. */ or r5,r9,r10 /* OR the results to speed things up. */
cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes cmpdi cr7,r5,0 /* If r5 == 0, no c or null bytes
have been found. */ have been found. */
@@ -99,7 +106,7 @@ L(loop): @@ -99,7 +106,7 @@ L(loop):
bne cr6,L(done) bne cr6,L(done)
/* The c/null byte must be in the second doubleword. Adjust the /* The c/null byte must be in the second doubleword. Adjust the
- address again and move the result of cmpb to r10 so we can calculate - address again and move the result of cmpb to r10 so we can calculate
+ address again and move the result of cmpb to r5 so we can calculate + address again and move the result of cmpb to r5 so we can calculate
the pointer. */ the pointer. */
mr r5,r10 mr r5,r10
addi r8,r8,8 addi r8,r8,8
@@ -108,7 +115,13 @@ L(loop): @@ -108,7 +115,13 @@ L(loop):
0xff in the same position as the c/null byte in the original 0xff in the same position as the c/null byte in the original
doubleword from the string. Use that to calculate the pointer. */ doubleword from the string. Use that to calculate the pointer. */
L(done): L(done):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ addi r0,r5,-1 + addi r0,r5,-1
+ andc r0,r0,r5 + andc r0,r0,r5
+ popcntd r0,r0 + popcntd r0,r0
+#else +#else
cntlzd r0,r5 /* Count leading zeros before the match. */ cntlzd r0,r5 /* Count leading zeros before the match. */
+#endif +#endif
srdi r0,r0,3 /* Convert leading zeros to bytes. */ srdi r0,r0,3 /* Convert leading zeros to bytes. */
add r3,r8,r0 /* Return address of matching c/null byte. */ add r3,r8,r0 /* Return address of matching c/null byte. */
blr blr
Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S
=================================================================== ===================================================================
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S.orig --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S.orig
@ -511,35 +511,35 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S
+#define rTMP4 rIGN +#define rTMP4 rIGN
+#define rTMP5 rMASK +#define rTMP5 rMASK
CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2) CHECK_BOUNDS_LOW (rSTR, rTMP1, rTMP2)
STORE_RETURN_BOUNDS (rTMP1, rTMP2) STORE_RETURN_BOUNDS (rTMP1, rTMP2)
dcbt 0,rRTN dcbt 0,rRTN
- rlwimi rCHR, rCHR, 8, 16, 23 - rlwimi rCHR, rCHR, 8, 16, 23
+ insrdi rCHR, rCHR, 8, 48 + insrdi rCHR, rCHR, 8, 48
li rMASK, -1 li rMASK, -1
- rlwimi rCHR, rCHR, 16, 0, 15 - rlwimi rCHR, rCHR, 16, 0, 15
+ insrdi rCHR, rCHR, 16, 32 + insrdi rCHR, rCHR, 16, 32
rlwinm rIGN, rRTN, 3, 26, 28 rlwinm rIGN, rRTN, 3, 26, 28
insrdi rCHR, rCHR, 32, 0 insrdi rCHR, rCHR, 32, 0
lis rFEFE, -0x101 lis rFEFE, -0x101
@@ -70,53 +72,74 @@ ENTRY (BP_SYM (strchr)) @@ -70,53 +72,74 @@ ENTRY (BP_SYM (strchr))
add rFEFE, rFEFE, rTMP1 add rFEFE, rFEFE, rTMP1
/* Test the first (partial?) word. */ /* Test the first (partial?) word. */
ld rWORD, 0(rSTR) ld rWORD, 0(rSTR)
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ sld rMASK, rMASK, rIGN + sld rMASK, rMASK, rIGN
+#else +#else
srd rMASK, rMASK, rIGN srd rMASK, rMASK, rIGN
+#endif +#endif
orc rWORD, rWORD, rMASK orc rWORD, rWORD, rMASK
add rTMP1, rFEFE, rWORD add rTMP1, rFEFE, rWORD
nor rTMP2, r7F7F, rWORD nor rTMP2, r7F7F, rWORD
- and. rTMP1, rTMP1, rTMP2 - and. rTMP1, rTMP1, rTMP2
+ and. rTMP4, rTMP1, rTMP2 + and. rTMP4, rTMP1, rTMP2
xor rTMP3, rCHR, rWORD xor rTMP3, rCHR, rWORD
orc rTMP3, rTMP3, rMASK orc rTMP3, rTMP3, rMASK
b L(loopentry) b L(loopentry)
/* The loop. */ /* The loop. */
@ -553,15 +553,15 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S
- nor rTMP2, r7F7F, rWORD - nor rTMP2, r7F7F, rWORD
+ add rTMP1, rFEFE, rWORD /* x - 0x01010101. */ + add rTMP1, rFEFE, rWORD /* x - 0x01010101. */
+ nor rTMP2, r7F7F, rWORD /* ~(x | 0x7f7f7f7f) == ~x & 0x80808080. */ + nor rTMP2, r7F7F, rWORD /* ~(x | 0x7f7f7f7f) == ~x & 0x80808080. */
bne L(foundit) bne L(foundit)
- and. rTMP1, rTMP1, rTMP2 - and. rTMP1, rTMP1, rTMP2
+ and. rTMP4, rTMP1, rTMP2 /* (x - 0x01010101) & ~x & 0x80808080. */ + and. rTMP4, rTMP1, rTMP2 /* (x - 0x01010101) & ~x & 0x80808080. */
/* Start test for the bytes we're looking for. */ /* Start test for the bytes we're looking for. */
xor rTMP3, rCHR, rWORD xor rTMP3, rCHR, rWORD
L(loopentry): L(loopentry):
add rTMP1, rFEFE, rTMP3 add rTMP1, rFEFE, rTMP3
nor rTMP2, r7F7F, rTMP3 nor rTMP2, r7F7F, rTMP3
beq L(loop) beq L(loop)
+ +
/* There is a zero byte in the word, but may also be a matching byte (either /* There is a zero byte in the word, but may also be a matching byte (either
before or after the zero byte). In fact, we may be looking for a before or after the zero byte). In fact, we may be looking for a
@ -571,9 +571,9 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S
- and. rTMP1, rTMP1, rTMP2 - and. rTMP1, rTMP1, rTMP2
+ zero byte, in which case we return a match. */ + zero byte, in which case we return a match. */
+ and. rTMP5, rTMP1, rTMP2 + and. rTMP5, rTMP1, rTMP2
li rRTN, 0 li rRTN, 0
STORE_RETURN_VALUE (rSTR) STORE_RETURN_VALUE (rSTR)
beqlr beqlr
-/* It did happen. Decide which one was first... -/* It did happen. Decide which one was first...
- I'm not sure if this is actually faster than a sequence of - I'm not sure if this is actually faster than a sequence of
- rotates, compares, and branches (we use it anyway because it's shorter). */ - rotates, compares, and branches (we use it anyway because it's shorter). */
@ -596,28 +596,28 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S
+/* I think we could reduce this by two instructions by keeping the "nor" +/* I think we could reduce this by two instructions by keeping the "nor"
+ results from the loop for reuse here. See strlen.S tail. Similarly + results from the loop for reuse here. See strlen.S tail. Similarly
+ one instruction could be pruned from L(foundit). */ + one instruction could be pruned from L(foundit). */
and rFEFE, r7F7F, rWORD and rFEFE, r7F7F, rWORD
- or rMASK, r7F7F, rWORD - or rMASK, r7F7F, rWORD
+ or rTMP5, r7F7F, rWORD + or rTMP5, r7F7F, rWORD
and rTMP1, r7F7F, rTMP3 and rTMP1, r7F7F, rTMP3
- or rIGN, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3
+ or rTMP4, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3
add rFEFE, rFEFE, r7F7F add rFEFE, rFEFE, r7F7F
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor rWORD, rMASK, rFEFE - nor rWORD, rMASK, rFEFE
- nor rTMP2, rIGN, rTMP1 - nor rTMP2, rIGN, rTMP1
+ nor rWORD, rTMP5, rFEFE + nor rWORD, rTMP5, rFEFE
+ nor rTMP2, rTMP4, rTMP1 + nor rTMP2, rTMP4, rTMP1
+ cntlzd rCLZB, rTMP2 + cntlzd rCLZB, rTMP2
cmpld rWORD, rTMP2 cmpld rWORD, rTMP2
bgtlr bgtlr
- cntlzd rCLZB, rTMP2 - cntlzd rCLZB, rTMP2
+#endif +#endif
srdi rCLZB, rCLZB, 3 srdi rCLZB, rCLZB, 3
add rRTN, rSTR, rCLZB add rRTN, rSTR, rCLZB
CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge) CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge)
@@ -124,13 +147,21 @@ L(missed): @@ -124,13 +147,21 @@ L(missed):
blr blr
L(foundit): L(foundit):
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -627,16 +627,16 @@ Index: glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/strchr.S
+ subfic rCLZB, rCLZB, 64-7-64 + subfic rCLZB, rCLZB, 64-7-64
+ sradi rCLZB, rCLZB, 3 + sradi rCLZB, rCLZB, 3
+#else +#else
and rTMP1, r7F7F, rTMP3 and rTMP1, r7F7F, rTMP3
- or rIGN, r7F7F, rTMP3 - or rIGN, r7F7F, rTMP3
+ or rTMP4, r7F7F, rTMP3 + or rTMP4, r7F7F, rTMP3
add rTMP1, rTMP1, r7F7F add rTMP1, rTMP1, r7F7F
- nor rTMP2, rIGN, rTMP1 - nor rTMP2, rIGN, rTMP1
+ nor rTMP2, rTMP4, rTMP1 + nor rTMP2, rTMP4, rTMP1
cntlzd rCLZB, rTMP2 cntlzd rCLZB, rTMP2
subi rSTR, rSTR, 8 subi rSTR, rSTR, 8
srdi rCLZB, rCLZB, 3 srdi rCLZB, rCLZB, 3
+#endif +#endif
add rRTN, rSTR, rCLZB add rRTN, rSTR, rCLZB
CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge) CHECK_BOUNDS_HIGH_RTN (rSTR, rTMP2, tdlge)
STORE_RETURN_VALUE (rSTR) STORE_RETURN_VALUE (rSTR)

1990
SOURCES/glibc-ppc64le-30.patch

File diff suppressed because it is too large Load Diff

206
SOURCES/glibc-ppc64le-31.patch

@ -390,39 +390,39 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S glibc-2.
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S 2014-05-29 13:04:56.000000000 -0500
@@ -385,7 +385,7 @@ @@ -385,7 +385,7 @@
beq L(copy_GE_32_unaligned_cont) beq L(copy_GE_32_unaligned_cont)
- /* SRC is not quadword aligned, get it aligned. */ - /* SRC is not quadword aligned, get it aligned. */
+ /* DST is not quadword aligned, get it aligned. */ + /* DST is not quadword aligned, get it aligned. */
mtcrf 0x01,0 mtcrf 0x01,0
subf 31,0,5 subf 31,0,5
@@ -437,13 +437,21 @@ @@ -437,13 +437,21 @@
mr 11,12 mr 11,12
mtcrf 0x01,9 mtcrf 0x01,9
cmplwi cr6,9,1 cmplwi cr6,9,1
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ lvsr 5,0,12 + lvsr 5,0,12
+#else +#else
lvsl 5,0,12 lvsl 5,0,12
+#endif +#endif
lvx 3,0,12 lvx 3,0,12
bf 31,L(setup_unaligned_loop) bf 31,L(setup_unaligned_loop)
/* Copy another 16 bytes to align to 32-bytes due to the loop . */ /* Copy another 16 bytes to align to 32-bytes due to the loop . */
lvx 4,12,6 lvx 4,12,6
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ vperm 6,4,3,5 + vperm 6,4,3,5
+#else +#else
vperm 6,3,4,5 vperm 6,3,4,5
+#endif +#endif
addi 11,12,16 addi 11,12,16
addi 10,3,16 addi 10,3,16
stvx 6,0,3 stvx 6,0,3
@@ -463,11 +471,17 @@ @@ -463,11 +471,17 @@
vector instructions though. */ vector instructions though. */
lvx 4,11,6 /* vr4 = r11+16. */ lvx 4,11,6 /* vr4 = r11+16. */
- vperm 6,3,4,5 /* Merge the correctly-aligned portions - vperm 6,3,4,5 /* Merge the correctly-aligned portions
- of vr3/vr4 into vr6. */ - of vr3/vr4 into vr6. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -430,7 +430,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S glibc-2.
+#else +#else
+ vperm 6,3,4,5 + vperm 6,3,4,5
+#endif +#endif
lvx 3,11,7 /* vr3 = r11+32. */ lvx 3,11,7 /* vr3 = r11+32. */
- vperm 10,4,3,5 /* Merge the correctly-aligned portions - vperm 10,4,3,5 /* Merge the correctly-aligned portions
- of vr3/vr4 into vr10. */ - of vr3/vr4 into vr10. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -438,49 +438,49 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memcpy.S glibc-2.
+#else +#else
+ vperm 10,4,3,5 + vperm 10,4,3,5
+#endif +#endif
addi 11,11,32 addi 11,11,32
stvx 6,0,10 stvx 6,0,10
stvx 10,10,6 stvx 10,10,6
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500
@@ -327,7 +327,7 @@ @@ -327,7 +327,7 @@
beq L(copy_GE_32_unaligned_cont) beq L(copy_GE_32_unaligned_cont)
- /* SRC is not quadword aligned, get it aligned. */ - /* SRC is not quadword aligned, get it aligned. */
+ /* DST is not quadword aligned, get it aligned. */ + /* DST is not quadword aligned, get it aligned. */
mtcrf 0x01,0 mtcrf 0x01,0
subf 31,0,5 subf 31,0,5
@@ -379,13 +379,21 @@ @@ -379,13 +379,21 @@
mr 11,12 mr 11,12
mtcrf 0x01,9 mtcrf 0x01,9
cmplwi cr6,9,1 cmplwi cr6,9,1
- lvsl 5,0,12 - lvsl 5,0,12
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ lvsr 5,0,12 + lvsr 5,0,12
+#else +#else
+ lvsl 5,0,12 + lvsl 5,0,12
+#endif +#endif
lvx 3,0,12 lvx 3,0,12
bf 31,L(setup_unaligned_loop) bf 31,L(setup_unaligned_loop)
/* Copy another 16 bytes to align to 32-bytes due to the loop . */ /* Copy another 16 bytes to align to 32-bytes due to the loop . */
lvx 4,12,6 lvx 4,12,6
- vperm 6,3,4,5 - vperm 6,3,4,5
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ vperm 6,4,3,5 + vperm 6,4,3,5
+#else +#else
+ vperm 6,3,4,5 + vperm 6,3,4,5
+#endif +#endif
addi 11,12,16 addi 11,12,16
addi 10,3,16 addi 10,3,16
stvx 6,0,3 stvx 6,0,3
@@ -405,11 +413,17 @@ @@ -405,11 +413,17 @@
vector instructions though. */ vector instructions though. */
lvx 4,11,6 /* vr4 = r11+16. */ lvx 4,11,6 /* vr4 = r11+16. */
- vperm 6,3,4,5 /* Merge the correctly-aligned portions - vperm 6,3,4,5 /* Merge the correctly-aligned portions
- of vr3/vr4 into vr6. */ - of vr3/vr4 into vr6. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -488,7 +488,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2
+#else +#else
+ vperm 6,3,4,5 + vperm 6,3,4,5
+#endif +#endif
lvx 3,11,7 /* vr3 = r11+32. */ lvx 3,11,7 /* vr3 = r11+32. */
- vperm 10,4,3,5 /* Merge the correctly-aligned portions - vperm 10,4,3,5 /* Merge the correctly-aligned portions
- of vr3/vr4 into vr10. */ - of vr3/vr4 into vr10. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -496,9 +496,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/mempcpy.S glibc-2
+#else +#else
+ vperm 10,4,3,5 + vperm 10,4,3,5
+#endif +#endif
addi 11,11,32 addi 11,11,32
stvx 6,0,10 stvx 6,0,10
stvx 10,10,6 stvx 10,10,6
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S 2014-05-29 13:04:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S 2014-05-29 13:04:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memcpy.S 2014-05-29 13:04:56.000000000 -0500
@ -607,10 +607,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memcpy.S glibc-2.
+ possible when both source and destination are doubleword aligned. + possible when both source and destination are doubleword aligned.
Each case has a optimized unrolled loop. */ Each case has a optimized unrolled loop. */
.machine power4 .machine power4
-EALIGN (BP_SYM (memcpy), 5, 0) -EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0) +EALIGN (memcpy, 5, 0)
CALL_MCOUNT 3 CALL_MCOUNT 3
cmpldi cr1,5,31 cmpldi cr1,5,31
@@ -44,20 +42,20 @@ @@ -44,20 +42,20 @@
@ -1004,10 +1004,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memcpy.S glibc-2.
the source but may take a risk and only require word alignment the source but may take a risk and only require word alignment
for the destination. */ for the destination. */
.machine "power6" .machine "power6"
-EALIGN (BP_SYM (memcpy), 7, 0) -EALIGN (BP_SYM (memcpy), 7, 0)
+EALIGN (memcpy, 7, 0) +EALIGN (memcpy, 7, 0)
CALL_MCOUNT 3 CALL_MCOUNT 3
cmpldi cr1,5,31 cmpldi cr1,5,31
neg 0,3 neg 0,3
@ -2098,19 +2098,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+#define src 4 +#define src 4
+#define cnt 5 +#define cnt 5
+ +
.machine power7 .machine power7
-EALIGN (BP_SYM (memcpy), 5, 0) -EALIGN (BP_SYM (memcpy), 5, 0)
+EALIGN (memcpy, 5, 0) +EALIGN (memcpy, 5, 0)
CALL_MCOUNT 3 CALL_MCOUNT 3
- cmpldi cr1,5,31 - cmpldi cr1,5,31
+ cmpldi cr1,cnt,31 + cmpldi cr1,cnt,31
neg 0,3 neg 0,3
- std 3,-16(1) - std 3,-16(1)
- std 31,-8(1) - std 31,-8(1)
- cfi_offset(31,-8) - cfi_offset(31,-8)
ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move ble cr1, L(copy_LT_32) /* If move < 32 bytes use short move
code. */ code. */
- andi. 11,3,7 /* Check alignment of DST. */ - andi. 11,3,7 /* Check alignment of DST. */
- -
@ -2131,7 +2131,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
- mr 12,4 - mr 12,4
- mr 31,5 - mr 31,5
+ mr dst,3 + mr dst,3
bne cr6,L(copy_GE_32_unaligned) bne cr6,L(copy_GE_32_unaligned)
+ beq L(aligned_copy) + beq L(aligned_copy)
- srdi 9,5,3 /* Number of full quadwords remaining. */ - srdi 9,5,3 /* Number of full quadwords remaining. */
@ -2295,11 +2295,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ lxvd2x 6,0,src + lxvd2x 6,0,src
+ lxvd2x 7,src,6 + lxvd2x 7,src,6
+ mtctr 12 + mtctr 12
b L(aligned_128loop) b L(aligned_128loop)
+ .align 4 + .align 4
L(aligned_128head): L(aligned_128head):
/* for the 2nd + iteration of this loop. */ /* for the 2nd + iteration of this loop. */
- lxvd2x 6,0,11 - lxvd2x 6,0,11
- lxvd2x 7,11,6 - lxvd2x 7,11,6
+ lxvd2x 6,0,src + lxvd2x 6,0,src
@ -2341,7 +2341,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ stxvd2x 8,dst,7 + stxvd2x 8,dst,7
+ stxvd2x 9,dst,8 + stxvd2x 9,dst,8
+ addi dst,dst,64 + addi dst,dst,64
bdnz L(aligned_128head) bdnz L(aligned_128head)
-3: -3:
- /* Check for tail bytes. */ - /* Check for tail bytes. */
@ -2421,7 +2421,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ lbz 8,6(src) + lbz 8,6(src)
+ stb 8,6(dst) + stb 8,6(dst)
+ /* Return original DST pointer. */ + /* Return original DST pointer. */
blr blr
- /* Handle copies of 0~31 bytes. */ - /* Handle copies of 0~31 bytes. */
- .align 4 - .align 4
@ -2435,17 +2435,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ mr dst,3 + mr dst,3
+ cmpldi cr6,cnt,8 + cmpldi cr6,cnt,8
+ mtocrf 0x01,cnt + mtocrf 0x01,cnt
ble cr6,L(copy_LE_8) ble cr6,L(copy_LE_8)
/* At least 9 bytes to go. */ /* At least 9 bytes to go. */
neg 8,4 neg 8,4
- clrrdi 11,4,2 - clrrdi 11,4,2
- andi. 0,8,3 - andi. 0,8,3
- cmpldi cr1,5,16 - cmpldi cr1,5,16
- mr 10,5 - mr 10,5
+ andi. 0,8,3 + andi. 0,8,3
+ cmpldi cr1,cnt,16 + cmpldi cr1,cnt,16
beq L(copy_LT_32_aligned) beq L(copy_LT_32_aligned)
- /* Force 4-bytes alignment for SRC. */ - /* Force 4-bytes alignment for SRC. */
- mtocrf 0x01,0 - mtocrf 0x01,0
@ -2487,10 +2487,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ mtocrf 0x01,cnt + mtocrf 0x01,cnt
L(copy_LT_32_aligned): L(copy_LT_32_aligned):
/* At least 6 bytes to go, and SRC is word-aligned. */ /* At least 6 bytes to go, and SRC is word-aligned. */
blt cr1,8f blt cr1,8f
/* Copy 16 bytes. */ /* Copy 16 bytes. */
- lwz 6,0(12) - lwz 6,0(12)
- lwz 7,4(12) - lwz 7,4(12)
- stw 6,0(3) - stw 6,0(3)
@ -2553,7 +2553,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ .align 4 + .align 4
+/* Copies 2~3 bytes. */ +/* Copies 2~3 bytes. */
+L(tail2): +L(tail2):
bf 30,1f bf 30,1f
- -
- lhz 6,0(12) - lhz 6,0(12)
- sth 6,0(3) - sth 6,0(3)
@ -2566,7 +2566,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ bflr 31 + bflr 31
+ lbz 7,2(src) + lbz 7,2(src)
+ stb 7,2(dst) + stb 7,2(dst)
blr blr
- .align 4 - .align 4
-1: /* Copy 1 byte. */ -1: /* Copy 1 byte. */
@ -2588,7 +2588,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ lbz 6,0(src) + lbz 6,0(src)
+ stb 6,0(dst) + stb 6,0(dst)
+ /* Return original DST pointer. */ + /* Return original DST pointer. */
blr blr
- /* Handles copies of 0~8 bytes. */ - /* Handles copies of 0~8 bytes. */
- .align 4 - .align 4
@ -2599,8 +2599,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
- bne cr6,4f - bne cr6,4f
+ bne cr6,L(tail4) + bne cr6,L(tail4)
/* Though we could've used ld/std here, they are still /* Though we could've used ld/std here, they are still
slow for unaligned cases. */ slow for unaligned cases. */
- lwz 6,0(4) - lwz 6,0(4)
- lwz 7,4(4) - lwz 7,4(4)
@ -2611,7 +2611,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ lwz 7,4(src) + lwz 7,4(src)
+ stw 6,0(dst) + stw 6,0(dst)
+ stw 7,4(dst) + stw 7,4(dst)
blr blr
- .align 4 - .align 4
-4: /* Copies 4~7 bytes. */ -4: /* Copies 4~7 bytes. */
@ -2659,7 +2659,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+#endif +#endif
+ srdi 9,cnt,4 /* Number of full quadwords remaining. */ + srdi 9,cnt,4 /* Number of full quadwords remaining. */
beq L(copy_GE_32_unaligned_cont) beq L(copy_GE_32_unaligned_cont)
- /* SRC is not quadword aligned, get it aligned. */ - /* SRC is not quadword aligned, get it aligned. */
+ /* DST is not quadword aligned, get it aligned. */ + /* DST is not quadword aligned, get it aligned. */
@ -2669,11 +2669,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ mtocrf 0x01,0 + mtocrf 0x01,0
+ subf cnt,0,cnt + subf cnt,0,cnt
/* Vector instructions work best when proper alignment (16-bytes) /* Vector instructions work best when proper alignment (16-bytes)
is present. Move 0~15 bytes as needed to get DST quadword-aligned. */ is present. Move 0~15 bytes as needed to get DST quadword-aligned. */
-1: /* Copy 1 byte. */ -1: /* Copy 1 byte. */
+1: +1:
bf 31,2f bf 31,2f
- -
- lbz 6,0(12) - lbz 6,0(12)
- addi 12,12,1 - addi 12,12,1
@ -2685,7 +2685,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ stb 6,0(dst) + stb 6,0(dst)
+ addi dst,dst,1 + addi dst,dst,1
+2: +2:
bf 30,4f bf 30,4f
- -
- lhz 6,0(12) - lhz 6,0(12)
- addi 12,12,2 - addi 12,12,2
@ -2697,7 +2697,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ sth 6,0(dst) + sth 6,0(dst)
+ addi dst,dst,2 + addi dst,dst,2
+4: +4:
bf 29,8f bf 29,8f
- -
- lwz 6,0(12) - lwz 6,0(12)
- addi 12,12,4 - addi 12,12,4
@ -2709,7 +2709,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ stw 6,0(dst) + stw 6,0(dst)
+ addi dst,dst,4 + addi dst,dst,4
+8: +8:
bf 28,0f bf 28,0f
- -
- ld 6,0(12) - ld 6,0(12)
- addi 12,12,8 - addi 12,12,8
@ -2724,15 +2724,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
- srdi 9,31,4 /* Number of full quadwords remaining. */ - srdi 9,31,4 /* Number of full quadwords remaining. */
+ srdi 9,cnt,4 /* Number of full quadwords remaining. */ + srdi 9,cnt,4 /* Number of full quadwords remaining. */
/* The proper alignment is present, it is OK to copy the bytes now. */ /* The proper alignment is present, it is OK to copy the bytes now. */
L(copy_GE_32_unaligned_cont): L(copy_GE_32_unaligned_cont):
/* Setup two indexes to speed up the indexed vector operations. */ /* Setup two indexes to speed up the indexed vector operations. */
- clrldi 11,31,60 - clrldi 11,31,60
- li 6,16 /* Index for 16-bytes offsets. */ - li 6,16 /* Index for 16-bytes offsets. */
+ clrldi 10,cnt,60 + clrldi 10,cnt,60
+ li 6,16 /* Index for 16-bytes offsets. */ + li 6,16 /* Index for 16-bytes offsets. */
li 7,32 /* Index for 32-bytes offsets. */ li 7,32 /* Index for 32-bytes offsets. */
- cmpldi cr1,11,0 - cmpldi cr1,11,0
- srdi 8,31,5 /* Setup the loop counter. */ - srdi 8,31,5 /* Setup the loop counter. */
- mr 10,3 - mr 10,3
@ -2772,7 +2772,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ addi src,src,16 + addi src,src,16
+ stvx 6,0,dst + stvx 6,0,dst
+ addi dst,dst,16 + addi dst,dst,16
vor 3,4,4 vor 3,4,4
+ clrrdi 0,src,60 + clrrdi 0,src,60
L(setup_unaligned_loop): L(setup_unaligned_loop):
@ -2781,15 +2781,15 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ mtctr 8 + mtctr 8
+ ble cr6,L(end_unaligned_loop) + ble cr6,L(end_unaligned_loop)
/* Copy 32 bytes at a time using vector instructions. */ /* Copy 32 bytes at a time using vector instructions. */
- .align 4 - .align 4
+ .align 4 + .align 4
L(unaligned_loop): L(unaligned_loop):
/* Note: vr6/vr10 may contain data that was already copied, /* Note: vr6/vr10 may contain data that was already copied,
@@ -444,63 +385,56 @@ @@ -444,63 +385,56 @@
some portions again. This is faster than having unaligned some portions again. This is faster than having unaligned
vector instructions though. */ vector instructions though. */
- lvx 4,11,6 /* vr4 = r11+16. */ - lvx 4,11,6 /* vr4 = r11+16. */
- vperm 6,3,4,5 /* Merge the correctly-aligned portions - vperm 6,3,4,5 /* Merge the correctly-aligned portions
@ -2818,7 +2818,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ stvx 6,0,dst + stvx 6,0,dst
+ stvx 10,dst,6 + stvx 10,dst,6
+ addi dst,dst,32 + addi dst,dst,32
bdnz L(unaligned_loop) bdnz L(unaligned_loop)
- .align 4 - .align 4
+ clrrdi 0,src,60 + clrrdi 0,src,60
@ -2826,7 +2826,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ .align 4 + .align 4
L(end_unaligned_loop): L(end_unaligned_loop):
/* Check for tail bytes. */ /* Check for tail bytes. */
- rldicr 0,31,0,59 - rldicr 0,31,0,59
- mtcrf 0x01,31 - mtcrf 0x01,31
- beq cr1,0f - beq cr1,0f
@ -2837,10 +2837,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
- add 12,12,0 - add 12,12,0
+ add src,src,0 + add src,src,0
/* We have 1~15 tail bytes to copy, and DST is quadword aligned. */ /* We have 1~15 tail bytes to copy, and DST is quadword aligned. */
-8: /* Copy 8 bytes. */ -8: /* Copy 8 bytes. */
+ /* Copy 8 bytes. */ + /* Copy 8 bytes. */
bf 28,4f bf 28,4f
- -
- lwz 6,0(12) - lwz 6,0(12)
- lwz 7,4(12) - lwz 7,4(12)
@ -2887,7 +2887,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memcpy.S glibc-2.
+ lbz 8,6(src) + lbz 8,6(src)
+ stb 8,6(dst) + stb 8,6(dst)
+ /* Return original DST pointer. */ + /* Return original DST pointer. */
blr blr
-END_GEN_TB (BP_SYM (memcpy),TB_TOCLESS) -END_GEN_TB (BP_SYM (memcpy),TB_TOCLESS)
+END_GEN_TB (memcpy,TB_TOCLESS) +END_GEN_TB (memcpy,TB_TOCLESS)
@ -2896,33 +2896,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S glibc-2
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S 2014-05-29 13:04:56.000000000 -0500
@@ -367,13 +367,21 @@ @@ -367,13 +367,21 @@
mr 11,12 mr 11,12
mtcrf 0x01,9 mtcrf 0x01,9
cmpldi cr6,9,1 cmpldi cr6,9,1
- lvsl 5,0,12 - lvsl 5,0,12
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ lvsr 5,0,12 + lvsr 5,0,12
+#else +#else
+ lvsl 5,0,12 + lvsl 5,0,12
+#endif +#endif
lvx 3,0,12 lvx 3,0,12
bf 31,L(setup_unaligned_loop) bf 31,L(setup_unaligned_loop)
/* Copy another 16 bytes to align to 32-bytes due to the loop . */ /* Copy another 16 bytes to align to 32-bytes due to the loop . */
lvx 4,12,6 lvx 4,12,6
- vperm 6,3,4,5 - vperm 6,3,4,5
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
+ vperm 6,4,3,5 + vperm 6,4,3,5
+#else +#else
+ vperm 6,3,4,5 + vperm 6,3,4,5
+#endif +#endif
addi 11,12,16 addi 11,12,16
addi 10,3,16 addi 10,3,16
stvx 6,0,3 stvx 6,0,3
@@ -393,11 +401,17 @@ @@ -393,11 +401,17 @@
vector instructions though. */ vector instructions though. */
lvx 4,11,6 /* vr4 = r11+16. */ lvx 4,11,6 /* vr4 = r11+16. */
- vperm 6,3,4,5 /* Merge the correctly-aligned portions - vperm 6,3,4,5 /* Merge the correctly-aligned portions
- of vr3/vr4 into vr6. */ - of vr3/vr4 into vr6. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -2930,7 +2930,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S glibc-2
+#else +#else
+ vperm 6,3,4,5 + vperm 6,3,4,5
+#endif +#endif
lvx 3,11,7 /* vr3 = r11+32. */ lvx 3,11,7 /* vr3 = r11+32. */
- vperm 10,4,3,5 /* Merge the correctly-aligned portions - vperm 10,4,3,5 /* Merge the correctly-aligned portions
- of vr3/vr4 into vr10. */ - of vr3/vr4 into vr10. */
+#ifdef __LITTLE_ENDIAN__ +#ifdef __LITTLE_ENDIAN__
@ -2938,6 +2938,6 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/mempcpy.S glibc-2
+#else +#else
+ vperm 10,4,3,5 + vperm 10,4,3,5
+#endif +#endif
addi 11,11,32 addi 11,11,32
stvx 6,0,10 stvx 6,0,10
stvx 10,10,6 stvx 10,10,6

180
SOURCES/glibc-ppc64le-32.patch

@ -24,55 +24,55 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/memset.S glibc-2.
@@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
/* Align to word boundary. */ /* Align to word boundary. */
cmplwi cr5, rLEN, 31 cmplwi cr5, rLEN, 31
- rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */
+ insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */
beq+ L(aligned) beq+ L(aligned)
mtcrf 0x01, rMEMP0 mtcrf 0x01, rMEMP0
subfic rALIGN, rALIGN, 4 subfic rALIGN, rALIGN, 4
@@ -67,7 +67,7 @@ @@ -67,7 +67,7 @@
/* Handle the case of size < 31. */ /* Handle the case of size < 31. */
L(aligned): L(aligned):
mtcrf 0x01, rLEN mtcrf 0x01, rLEN
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
ble cr5, L(medium) ble cr5, L(medium)
/* Align to 32-byte boundary. */ /* Align to 32-byte boundary. */
andi. rALIGN, rMEMP, 0x1C andi. rALIGN, rMEMP, 0x1C
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S 2014-05-29 13:07:41.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S 2014-05-29 13:07:41.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S 2014-05-29 13:07:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power6/memset.S 2014-05-29 13:07:46.000000000 -0500
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
ble- cr1, L(small) ble- cr1, L(small)
/* Align to word boundary. */ /* Align to word boundary. */
cmplwi cr5, rLEN, 31 cmplwi cr5, rLEN, 31
- rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */
+ insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */
beq+ L(aligned) beq+ L(aligned)
mtcrf 0x01, rMEMP0 mtcrf 0x01, rMEMP0
subfic rALIGN, rALIGN, 4 subfic rALIGN, rALIGN, 4
@@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
/* Handle the case of size < 31. */ /* Handle the case of size < 31. */
L(aligned): L(aligned):
mtcrf 0x01, rLEN mtcrf 0x01, rLEN
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
ble cr5, L(medium) ble cr5, L(medium)
/* Align to 32-byte boundary. */ /* Align to 32-byte boundary. */
andi. rALIGN, rMEMP, 0x1C andi. rALIGN, rMEMP, 0x1C
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S 2014-05-29 13:07:41.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S 2014-05-29 13:07:41.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S 2014-05-29 13:07:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power7/memset.S 2014-05-29 13:07:46.000000000 -0500
@@ -37,8 +37,8 @@ @@ -37,8 +37,8 @@
cfi_offset(31,-8) cfi_offset(31,-8)
/* Replicate byte to word. */ /* Replicate byte to word. */
- rlwimi 4,4,8,16,23 - rlwimi 4,4,8,16,23
- rlwimi 4,4,16,0,15 - rlwimi 4,4,16,0,15
+ insrdi 4,4,8,48 + insrdi 4,4,8,48
+ insrdi 4,4,16,32 + insrdi 4,4,16,32
ble cr6,L(small) /* If length <= 8, use short copy code. */ ble cr6,L(small) /* If length <= 8, use short copy code. */
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S 2014-05-29 13:07:41.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S 2014-05-29 13:07:41.000000000 -0500
@ -80,20 +80,20 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S glibc-2.17-c758
@@ -73,14 +73,14 @@ @@ -73,14 +73,14 @@
/* Align to doubleword boundary. */ /* Align to doubleword boundary. */
cmpldi cr5, rLEN, 31 cmpldi cr5, rLEN, 31
- rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */
+ insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */
beq+ L(aligned2) beq+ L(aligned2)
mtcrf 0x01, rMEMP0 mtcrf 0x01, rMEMP0
subfic rALIGN, rALIGN, 8 subfic rALIGN, rALIGN, 8
cror 28,30,31 /* Detect odd word aligned. */ cror 28,30,31 /* Detect odd word aligned. */
add rMEMP, rMEMP, rALIGN add rMEMP, rMEMP, rALIGN
sub rLEN, rLEN, rALIGN sub rLEN, rLEN, rALIGN
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
bt 29, L(g4) bt 29, L(g4)
/* Process the even word of doubleword. */ /* Process the even word of doubleword. */
bf+ 31, L(g2) bf+ 31, L(g2)
@@ -102,14 +102,14 @@ @@ -102,14 +102,14 @@
/* Handle the case of size < 31. */ /* Handle the case of size < 31. */
@ -101,45 +101,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/memset.S glibc-2.17-c758
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
L(aligned): L(aligned):
mtcrf 0x01, rLEN mtcrf 0x01, rLEN
ble cr5, L(medium) ble cr5, L(medium)
/* Align to 32-byte boundary. */ /* Align to 32-byte boundary. */
andi. rALIGN, rMEMP, 0x18 andi. rALIGN, rMEMP, 0x18
subfic rALIGN, rALIGN, 0x20 subfic rALIGN, rALIGN, 0x20
- insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */
+ insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */
beq L(caligned) beq L(caligned)
mtcrf 0x01, rALIGN mtcrf 0x01, rALIGN
add rMEMP, rMEMP, rALIGN add rMEMP, rMEMP, rALIGN
@@ -230,7 +230,7 @@ @@ -230,7 +230,7 @@
/* Memset of 0-31 bytes. */ /* Memset of 0-31 bytes. */
.align 5 .align 5
L(medium): L(medium):
- insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */
+ insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */
cmpldi cr1, rLEN, 16 cmpldi cr1, rLEN, 16
L(medium_tail2): L(medium_tail2):
add rMEMP, rMEMP, rLEN add rMEMP, rMEMP, rLEN
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S 2014-05-29 13:07:41.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S 2014-05-29 13:07:41.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S 2014-05-29 13:07:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S 2014-05-29 13:07:46.000000000 -0500
@@ -68,14 +68,14 @@ @@ -68,14 +68,14 @@
/* Align to doubleword boundary. */ /* Align to doubleword boundary. */
cmpldi cr5, rLEN, 31 cmpldi cr5, rLEN, 31
- rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */
+ insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */
beq+ L(aligned2) beq+ L(aligned2)
mtcrf 0x01, rMEMP0 mtcrf 0x01, rMEMP0
subfic rALIGN, rALIGN, 8 subfic rALIGN, rALIGN, 8
cror 28,30,31 /* Detect odd word aligned. */ cror 28,30,31 /* Detect odd word aligned. */
add rMEMP, rMEMP, rALIGN add rMEMP, rMEMP, rALIGN
sub rLEN, rLEN, rALIGN sub rLEN, rLEN, rALIGN
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
bt 29, L(g4) bt 29, L(g4)
/* Process the even word of doubleword. */ /* Process the even word of doubleword. */
bf+ 31, L(g2) bf+ 31, L(g2)
@@ -97,14 +97,14 @@ @@ -97,14 +97,14 @@
/* Handle the case of size < 31. */ /* Handle the case of size < 31. */
@ -147,26 +147,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
L(aligned): L(aligned):
mtcrf 0x01, rLEN mtcrf 0x01, rLEN
ble cr5, L(medium) ble cr5, L(medium)
/* Align to 32-byte boundary. */ /* Align to 32-byte boundary. */
andi. rALIGN, rMEMP, 0x18 andi. rALIGN, rMEMP, 0x18
subfic rALIGN, rALIGN, 0x20 subfic rALIGN, rALIGN, 0x20
- insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */
+ insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */
beq L(caligned) beq L(caligned)
mtcrf 0x01, rALIGN mtcrf 0x01, rALIGN
add rMEMP, rMEMP, rALIGN add rMEMP, rMEMP, rALIGN
@@ -164,24 +164,24 @@ @@ -164,24 +164,24 @@
L(getCacheAligned): L(getCacheAligned):
cmpldi cr1,rLEN,32 cmpldi cr1,rLEN,32
andi. rTMP,rMEMP,127 andi. rTMP,rMEMP,127
- blt cr1,L(handletail32) - blt cr1,L(handletail32)
- beq L(cacheAligned) - beq L(cacheAligned)
+ blt cr1,L(handletail32) + blt cr1,L(handletail32)
+ beq L(cacheAligned) + beq L(cacheAligned)
addi rMEMP,rMEMP,32 addi rMEMP,rMEMP,32
addi rLEN,rLEN,-32 addi rLEN,rLEN,-32
- std rCHR,-32(rMEMP) - std rCHR,-32(rMEMP)
- std rCHR,-24(rMEMP) - std rCHR,-24(rMEMP)
- std rCHR,-16(rMEMP) - std rCHR,-16(rMEMP)
@ -180,11 +180,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.
/* Now we are aligned to the cache line and can use dcbz. */ /* Now we are aligned to the cache line and can use dcbz. */
L(cacheAligned): L(cacheAligned):
cmpld cr1,rLEN,rCLS cmpld cr1,rLEN,rCLS
- blt cr1,L(handletail32) - blt cr1,L(handletail32)
+ blt cr1,L(handletail32) + blt cr1,L(handletail32)
dcbz 0,rMEMP dcbz 0,rMEMP
subf rLEN,rCLS,rLEN subf rLEN,rCLS,rLEN
- add rMEMP,rMEMP,rCLS - add rMEMP,rMEMP,rCLS
- b L(cacheAligned) - b L(cacheAligned)
+ add rMEMP,rMEMP,rCLS + add rMEMP,rMEMP,rCLS
@ -194,33 +194,33 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/memset.S glibc-2.
and the remainder (rLEN) is less than the actual cache line size. and the remainder (rLEN) is less than the actual cache line size.
@@ -218,7 +218,7 @@ @@ -218,7 +218,7 @@
/* Memset of 0-31 bytes. */ /* Memset of 0-31 bytes. */
.align 5 .align 5
L(medium): L(medium):
- insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */
+ insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */
cmpldi cr1, rLEN, 16 cmpldi cr1, rLEN, 16
L(medium_tail2): L(medium_tail2):
add rMEMP, rMEMP, rLEN add rMEMP, rMEMP, rLEN
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S 2014-05-29 13:07:41.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S 2014-05-29 13:07:41.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S 2014-05-29 13:07:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S 2014-05-29 13:07:46.000000000 -0500
@@ -65,14 +65,14 @@ @@ -65,14 +65,14 @@
/* Align to doubleword boundary. */ /* Align to doubleword boundary. */
cmpldi cr5, rLEN, 31 cmpldi cr5, rLEN, 31
- rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */ - rlwimi rCHR, rCHR, 8, 16, 23 /* Replicate byte to halfword. */
+ insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */ + insrdi rCHR, rCHR, 8, 48 /* Replicate byte to halfword. */
beq+ L(aligned2) beq+ L(aligned2)
mtcrf 0x01, rMEMP0 mtcrf 0x01, rMEMP0
subfic rALIGN, rALIGN, 8 subfic rALIGN, rALIGN, 8
cror 28,30,31 /* Detect odd word aligned. */ cror 28,30,31 /* Detect odd word aligned. */
add rMEMP, rMEMP, rALIGN add rMEMP, rMEMP, rALIGN
sub rLEN, rLEN, rALIGN sub rLEN, rLEN, rALIGN
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
bt 29, L(g4) bt 29, L(g4)
/* Process the even word of doubleword. */ /* Process the even word of doubleword. */
bf+ 31, L(g2) bf+ 31, L(g2)
@@ -94,14 +94,14 @@ @@ -94,14 +94,14 @@
/* Handle the case of size < 31. */ /* Handle the case of size < 31. */
@ -228,45 +228,45 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/memset.S glibc-2.
- rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */ - rlwimi rCHR, rCHR, 16, 0, 15 /* Replicate halfword to word. */
+ insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */ + insrdi rCHR, rCHR, 16, 32 /* Replicate halfword to word. */
L(aligned): L(aligned):
mtcrf 0x01, rLEN mtcrf 0x01, rLEN
ble cr5, L(medium) ble cr5, L(medium)
/* Align to 32-byte boundary. */ /* Align to 32-byte boundary. */
andi. rALIGN, rMEMP, 0x18 andi. rALIGN, rMEMP, 0x18
subfic rALIGN, rALIGN, 0x20 subfic rALIGN, rALIGN, 0x20
- insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */
+ insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */
beq L(caligned) beq L(caligned)
mtcrf 0x01, rALIGN mtcrf 0x01, rALIGN
add rMEMP, rMEMP, rALIGN add rMEMP, rMEMP, rALIGN
@@ -362,7 +362,7 @@ @@ -362,7 +362,7 @@
/* Memset of 0-31 bytes. */ /* Memset of 0-31 bytes. */
.align 5 .align 5
L(medium): L(medium):
- insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */ - insrdi rCHR,rCHR,32,0 /* Replicate word to double word. */
+ insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */ + insrdi rCHR, rCHR, 32, 0 /* Replicate word to double word. */
cmpldi cr1, rLEN, 16 cmpldi cr1, rLEN, 16
L(medium_tail2): L(medium_tail2):
add rMEMP, rMEMP, rLEN add rMEMP, rMEMP, rLEN
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S 2014-05-29 13:07:41.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S 2014-05-29 13:07:41.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S 2014-05-29 13:07:46.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power7/memset.S 2014-05-29 13:07:46.000000000 -0500
@@ -34,8 +34,8 @@ @@ -34,8 +34,8 @@
mr 10,3 mr 10,3
/* Replicate byte to word. */ /* Replicate byte to word. */
- rlwimi 4,4,8,16,23 - rlwimi 4,4,8,16,23
- rlwimi 4,4,16,0,15 - rlwimi 4,4,16,0,15
+ insrdi 4,4,8,48 + insrdi 4,4,8,48
+ insrdi 4,4,16,32 + insrdi 4,4,16,32
ble cr6,L(small) /* If length <= 8, use short copy code. */ ble cr6,L(small) /* If length <= 8, use short copy code. */
neg 0,3 neg 0,3
@@ -323,7 +323,7 @@ @@ -323,7 +323,7 @@
clrldi 0,0,62 clrldi 0,0,62
beq L(medium_aligned) beq L(medium_aligned)
- /* Force 4-bytes alignment for SRC. */ - /* Force 4-bytes alignment for SRC. */
+ /* Force 4-bytes alignment for DST. */ + /* Force 4-bytes alignment for DST. */
mtocrf 0x01,0 mtocrf 0x01,0
subf 5,0,5 subf 5,0,5
1: /* Copy 1 byte. */ 1: /* Copy 1 byte. */

416
SOURCES/glibc-ppc64le-33.patch

File diff suppressed because it is too large Load Diff

8
SOURCES/glibc-ppc64le-35.patch

@ -40,12 +40,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/makecont
+ the unwind info would be wrong otherwise. */ + the unwind info would be wrong otherwise. */
+ cfi_endproc + cfi_endproc
+ +
/* This is the helper code which gets called if a function which /* This is the helper code which gets called if a function which
is registered with 'makecontext' returns. In this case we is registered with 'makecontext' returns. In this case we
have to install the context listed in the uc_link element of have to install the context listed in the uc_link element of
@@ -157,6 +161,11 @@ @@ -157,6 +161,11 @@
#endif #endif
b L(do_exit) b L(do_exit)
+ /* Re-establish FDE for the rest of the actual makecontext routine. */ + /* Re-establish FDE for the rest of the actual makecontext routine. */
+ cfi_startproc + cfi_startproc

10
SOURCES/glibc-ppc64le-36.patch

@ -88,18 +88,18 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-
case R_PPC64_ADDR30: case R_PPC64_ADDR30:
{ {
Elf64_Addr delta = value - (Elf64_Xword) reloc_addr; Elf64_Addr delta = value - (Elf64_Xword) reloc_addr;
- if (dont_expect ((delta + 0x80000000) >= 0x10000000 - if (dont_expect ((delta + 0x80000000) >= 0x10000000
+ if (dont_expect ((delta + 0x80000000) >= 0x100000000LL + if (dont_expect ((delta + 0x80000000) >= 0x100000000LL
|| (delta & 3) != 0)) || (delta & 3) != 0))
_dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym); _dl_reloc_overflow (map, "R_PPC64_ADDR30", reloc_addr, refsym);
BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc); BIT_INSERT (*(Elf64_Word *) reloc_addr, delta, 0xfffffffc);
@@ -762,7 +782,7 @@ @@ -762,7 +782,7 @@
return; return;
case R_PPC64_ADDR32: case R_PPC64_ADDR32:
- if (dont_expect ((value + 0x80000000) >= 0x10000000)) - if (dont_expect ((value + 0x80000000) >= 0x10000000))
+ if (dont_expect ((value + 0x80000000) >= 0x100000000LL)) + if (dont_expect ((value + 0x80000000) >= 0x100000000LL))
_dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym); _dl_reloc_overflow (map, "R_PPC64_ADDR32", reloc_addr, refsym);
*(Elf64_Word *) reloc_addr = value; *(Elf64_Word *) reloc_addr = value;
return; return;

90
SOURCES/glibc-ppc64le-38.patch

@ -21,7 +21,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:56:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:56:37.000000000 -0500
@@ -60,18 +60,8 @@ @@ -60,18 +60,8 @@
.LC0: .LC0:
.tc PREINIT_FUNCTION[TC], PREINIT_FUNCTION .tc PREINIT_FUNCTION[TC], PREINIT_FUNCTION
#endif #endif
- .type BODY_LABEL (_init), @function - .type BODY_LABEL (_init), @function
- .globl _init - .globl _init
@ -34,13 +34,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6
-#else -#else
- .type _init, @function - .type _init, @function
-#endif -#endif
.section ".init", "ax", @progbits .section ".init", "ax", @progbits
+ ENTRY_2(_init) + ENTRY_2(_init)
.align ALIGNARG (2) .align ALIGNARG (2)
BODY_LABEL (_init): BODY_LABEL (_init):
mflr 0 mflr 0
@@ -87,18 +77,8 @@ @@ -87,18 +77,8 @@
nop nop
1: 1:
- .type BODY_LABEL (_fini), @function - .type BODY_LABEL (_fini), @function
@ -54,11 +54,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6
-#else -#else
- .type _fini, @function - .type _fini, @function
-#endif -#endif
.section ".fini", "ax", @progbits .section ".fini", "ax", @progbits
+ ENTRY_2(_fini) + ENTRY_2(_fini)
.align ALIGNARG (2) .align ALIGNARG (2)
BODY_LABEL (_fini): BODY_LABEL (_fini):
mflr 0 mflr 0
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:56:35.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:56:35.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:56:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h 2014-05-29 13:56:37.000000000 -0500
@ -113,9 +113,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 13:56:35.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 13:56:35.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 13:56:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 13:56:37.000000000 -0500
@@ -71,12 +71,8 @@ @@ -71,12 +71,8 @@
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
mtcrf 0xFF,r0 mtcrf 0xFF,r0
-/* Load the target address, toc and static chain reg from the function -/* Load the target address, toc and static chain reg from the function
- descriptor returned by fixup. */ - descriptor returned by fixup. */
- ld r0,0(r3) - ld r0,0(r3)
@ -124,13 +124,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
- ld r11,16(r3) - ld r11,16(r3)
+/* Prepare for calling the function returned by fixup. */ +/* Prepare for calling the function returned by fixup. */
+ PPC64_LOAD_FUNCPTR r3 + PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
/* Unwind the stack frame, and jump. */ /* Unwind the stack frame, and jump. */
addi r1,r1,FRAME_SIZE addi r1,r1,FRAME_SIZE
@@ -322,13 +318,9 @@ @@ -322,13 +318,9 @@
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
mtcrf 0xFF,r0 mtcrf 0xFF,r0
-/* Load the target address, toc and static chain reg from the function -/* Load the target address, toc and static chain reg from the function
- descriptor returned by fixup. */ - descriptor returned by fixup. */
- ld r0,0(r3) - ld r0,0(r3)
@ -138,34 +138,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
- ld r11,16(r3) - ld r11,16(r3)
+/* Prepare for calling the function returned by fixup. */ +/* Prepare for calling the function returned by fixup. */
+ PPC64_LOAD_FUNCPTR r3 + PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
- mtctr r0 - mtctr r0
/* Load the floating point registers. */ /* Load the floating point registers. */
lfd fp1,FPR_PARMS+0(r1) lfd fp1,FPR_PARMS+0(r1)
lfd fp2,FPR_PARMS+8(r1) lfd fp2,FPR_PARMS+8(r1)
@@ -386,14 +378,10 @@ @@ -386,14 +378,10 @@
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
mtcrf 0xFF,r0 mtcrf 0xFF,r0
-/* Load the target address, toc and static chain reg from the function -/* Load the target address, toc and static chain reg from the function
- descriptor returned by fixup. */ - descriptor returned by fixup. */
- ld r0,0(r3) - ld r0,0(r3)
+/* Prepare for calling the function returned by fixup. */ +/* Prepare for calling the function returned by fixup. */
std r2,40(r1) std r2,40(r1)
- ld r2,8(r3) - ld r2,8(r3)
- ld r11,16(r3) - ld r11,16(r3)
+ PPC64_LOAD_FUNCPTR r3 + PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
- mtctr r0 - mtctr r0
/* Load the floating point registers. */ /* Load the floating point registers. */
lfd fp1,FPR_PARMS+0(r1) lfd fp1,FPR_PARMS+0(r1)
lfd fp2,FPR_PARMS+8(r1) lfd fp2,FPR_PARMS+8(r1)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:56:35.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:56:35.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:56:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:56:37.000000000 -0500
@@ -74,6 +74,14 @@ @@ -74,6 +74,14 @@
#endif #endif
.endm .endm
+/* Macro to prepare for calling via a function pointer. */ +/* Macro to prepare for calling via a function pointer. */
+ .macro PPC64_LOAD_FUNCPTR PTR + .macro PPC64_LOAD_FUNCPTR PTR
@ -183,25 +183,25 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
#define ENTRY_1(name) \ #define ENTRY_1(name) \
- .section ".text"; \ - .section ".text"; \
.type BODY_LABEL(name),@function; \ .type BODY_LABEL(name),@function; \
.globl name; \ .globl name; \
.section ".opd","aw"; \ .section ".opd","aw"; \
@@ -110,6 +117,7 @@ @@ -110,6 +117,7 @@
#endif #endif
#define ENTRY(name) \ #define ENTRY(name) \
+ .section ".text"; \ + .section ".text"; \
ENTRY_2(name) \ ENTRY_2(name) \
.align ALIGNARG(2); \ .align ALIGNARG(2); \
BODY_LABEL(name): \ BODY_LABEL(name): \
@@ -127,6 +135,7 @@ @@ -127,6 +135,7 @@
/* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes /* EALIGN is like ENTRY, but does alignment to 'words'*4 bytes
past a 2^alignt boundary. */ past a 2^alignt boundary. */
#define EALIGN(name, alignt, words) \ #define EALIGN(name, alignt, words) \
+ .section ".text"; \ + .section ".text"; \
ENTRY_2(name) \ ENTRY_2(name) \
.align ALIGNARG(alignt); \ .align ALIGNARG(alignt); \
EALIGN_W_##words; \ EALIGN_W_##words; \
@@ -286,24 +295,42 @@ @@ -286,24 +295,42 @@
#else /* !__ASSEMBLER__ */ #else /* !__ASSEMBLER__ */
@ -231,11 +231,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
# define DOT_PREFIX "." # define DOT_PREFIX "."
# define BODY_PREFIX "." # define BODY_PREFIX "."
# define ENTRY_2(name) \ # define ENTRY_2(name) \
".globl " BODY_PREFIX #name ";\n" \ ".globl " BODY_PREFIX #name ";\n" \
+ ENTRY_1(name) "\n" \ + ENTRY_1(name) "\n" \
".size " #name ", 24;" ".size " #name ", 24;"
# define END_2(name) \ # define END_2(name) \
".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
#else #else
# define DOT_PREFIX "" # define DOT_PREFIX ""
# define BODY_PREFIX ".LY" # define BODY_PREFIX ".LY"
@ -244,19 +244,19 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
+ ".type " #name ",@function;\n" \ + ".type " #name ",@function;\n" \
+ ENTRY_1(name) + ENTRY_1(name)
# define END_2(name) \ # define END_2(name) \
".size " #name ",.-" BODY_PREFIX #name ";\n" \ ".size " #name ",.-" BODY_PREFIX #name ";\n" \
".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 13:56:35.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 13:56:35.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 13:56:37.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 13:56:37.000000000 -0500
@@ -104,9 +104,7 @@ @@ -104,9 +104,7 @@
std r2,40(r1) std r2,40(r1)
/* Call procedure. */ /* Call procedure. */
- ld r0,0(r30) - ld r0,0(r30)
- ld r2,8(r30) - ld r2,8(r30)
- mtctr r0 - mtctr r0
+ PPC64_LOAD_FUNCPTR r30 + PPC64_LOAD_FUNCPTR r30
mr r3,r31 mr r3,r31
bctrl bctrl
ld r2,40(r1) ld r2,40(r1)

126
SOURCES/glibc-ppc64le-39.patch

@ -53,21 +53,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a6
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:58:25.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:58:25.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 13:58:25.000000000 -0500
@@ -64,6 +64,7 @@ @@ -64,6 +64,7 @@
ENTRY_2(_init) ENTRY_2(_init)
.align ALIGNARG (2) .align ALIGNARG (2)
BODY_LABEL (_init): BODY_LABEL (_init):
+ LOCALENTRY(_init) + LOCALENTRY(_init)
mflr 0 mflr 0
std 0, 16(r1) std 0, 16(r1)
stdu r1, -112(r1) stdu r1, -112(r1)
@@ -81,6 +82,7 @@ @@ -81,6 +82,7 @@
ENTRY_2(_fini) ENTRY_2(_fini)
.align ALIGNARG (2) .align ALIGNARG (2)
BODY_LABEL (_fini): BODY_LABEL (_fini):
+ LOCALENTRY(_fini) + LOCALENTRY(_fini)
mflr 0 mflr 0
std 0, 16(r1) std 0, 16(r1)
stdu r1, -112(r1) stdu r1, -112(r1)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h 2014-05-29 13:58:25.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h 2014-05-29 13:58:25.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-irel.h 2014-05-29 13:58:25.000000000 -0500
@ -183,35 +183,35 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-
@@ -312,17 +353,12 @@ @@ -312,17 +353,12 @@
if (lazy) if (lazy)
{ {
- /* The function descriptor of the appropriate trampline - /* The function descriptor of the appropriate trampline
- routine is used to set the 1st and 2nd doubleword of the - routine is used to set the 1st and 2nd doubleword of the
- plt_reserve. */ - plt_reserve. */
- Elf64_FuncDesc *resolve_fd; - Elf64_FuncDesc *resolve_fd;
Elf64_Word glink_offset; Elf64_Word glink_offset;
- /* the plt_reserve area is the 1st 3 doublewords of the PLT */ - /* the plt_reserve area is the 1st 3 doublewords of the PLT */
- Elf64_FuncDesc *plt_reserve = (Elf64_FuncDesc *) plt; - Elf64_FuncDesc *plt_reserve = (Elf64_FuncDesc *) plt;
Elf64_Word offset; Elf64_Word offset;
+ Elf64_Addr dlrr; + Elf64_Addr dlrr;
- resolve_fd = (Elf64_FuncDesc *) (profile ? _dl_profile_resolve - resolve_fd = (Elf64_FuncDesc *) (profile ? _dl_profile_resolve
- : _dl_runtime_resolve); - : _dl_runtime_resolve);
+ dlrr = (Elf64_Addr) (profile ? _dl_profile_resolve + dlrr = (Elf64_Addr) (profile ? _dl_profile_resolve
+ : _dl_runtime_resolve); + : _dl_runtime_resolve);
if (profile && GLRO(dl_profile) != NULL if (profile && GLRO(dl_profile) != NULL
&& _dl_name_match_p (GLRO(dl_profile), map)) && _dl_name_match_p (GLRO(dl_profile), map))
/* This is the object we are looking for. Say that we really /* This is the object we are looking for. Say that we really
@@ -330,20 +366,33 @@ @@ -330,20 +366,33 @@
GL(dl_profile_map) = map; GL(dl_profile_map) = map;
+#if _CALL_ELF != 2 +#if _CALL_ELF != 2
/* We need to stuff the address/TOC of _dl_runtime_resolve /* We need to stuff the address/TOC of _dl_runtime_resolve
into doublewords 0 and 1 of plt_reserve. Then we need to into doublewords 0 and 1 of plt_reserve. Then we need to
stuff the map address into doubleword 2 of plt_reserve. stuff the map address into doubleword 2 of plt_reserve.
This allows the GLINK0 code to transfer control to the This allows the GLINK0 code to transfer control to the
correct trampoline which will transfer control to fixup correct trampoline which will transfer control to fixup
in dl-machine.c. */ in dl-machine.c. */
- plt_reserve->fd_func = resolve_fd->fd_func; - plt_reserve->fd_func = resolve_fd->fd_func;
- plt_reserve->fd_toc = resolve_fd->fd_toc; - plt_reserve->fd_toc = resolve_fd->fd_toc;
- plt_reserve->fd_aux = (Elf64_Addr) map; - plt_reserve->fd_aux = (Elf64_Addr) map;
@ -241,11 +241,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-
+ plt[1] = (Elf64_Addr) map; + plt[1] = (Elf64_Addr) map;
#endif #endif
/* Set up the lazy PLT entries. */ /* Set up the lazy PLT entries. */
@@ -354,14 +403,8 @@ @@ -354,14 +403,8 @@
{ {
plt[offset] = (Elf64_Xword) &glink[glink_offset]; plt[offset] = (Elf64_Xword) &glink[glink_offset];
- offset += 3; - offset += 3;
- /* The first 32k entries of glink can set an index and - /* The first 32k entries of glink can set an index and
- branch using two instructions; Past that point, - branch using two instructions; Past that point,
@ -256,12 +256,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-
- glink_offset += 3; - glink_offset += 3;
+ offset += PLT_ENTRY_WORDS; + offset += PLT_ENTRY_WORDS;
+ glink_offset += GLINK_ENTRY_WORDS (i); + glink_offset += GLINK_ENTRY_WORDS (i);
} }
/* Now, we've modified data. We need to write the changes from /* Now, we've modified data. We need to write the changes from
@@ -389,6 +432,7 @@ @@ -389,6 +432,7 @@
const Elf64_Rela *reloc, const Elf64_Rela *reloc,
Elf64_Addr *reloc_addr, Elf64_Addr finaladdr) Elf64_Addr *reloc_addr, Elf64_Addr finaladdr)
{ {
+#if _CALL_ELF != 2 +#if _CALL_ELF != 2
Elf64_FuncDesc *plt = (Elf64_FuncDesc *) reloc_addr; Elf64_FuncDesc *plt = (Elf64_FuncDesc *) reloc_addr;
@ -297,7 +297,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-machine.h glibc-2.17-
/* Return the final value of a plt relocation. */ /* Return the final value of a plt relocation. */
@@ -512,6 +563,7 @@ @@ -512,6 +563,7 @@
resolve_ifunc (Elf64_Addr value, resolve_ifunc (Elf64_Addr value,
const struct link_map *map, const struct link_map *sym_map) const struct link_map *map, const struct link_map *sym_map)
{ {
+#if _CALL_ELF != 2 +#if _CALL_ELF != 2
#ifndef RESOLVE_CONFLICT_FIND_MAP #ifndef RESOLVE_CONFLICT_FIND_MAP
@ -320,7 +320,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.
HAVE_CLEANUP_JMP_BUF is defined. */ HAVE_CLEANUP_JMP_BUF is defined. */
-ENTRY (BP_SYM (__GI__setjmp)) -ENTRY (BP_SYM (__GI__setjmp))
+ENTRY (__GI__setjmp) +ENTRY (__GI__setjmp)
std r2,40(r1) /* Save the callers TOC in the save area. */ std r2,40(r1) /* Save the callers TOC in the save area. */
- cfi_endproc - cfi_endproc
-END_2 (BP_SYM (__GI__setjmp)) -END_2 (BP_SYM (__GI__setjmp))
-/* Fall thru. */ -/* Fall thru. */
@ -332,37 +332,37 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.
-ENTRY (BP_SYM (_setjmp)) -ENTRY (BP_SYM (_setjmp))
+ENTRY (_setjmp) +ENTRY (_setjmp)
CALL_MCOUNT 1 CALL_MCOUNT 1
li r4,0 /* Set second argument to 0. */ li r4,0 /* Set second argument to 0. */
b JUMPTARGET (GLUE(__sigsetjmp,_ent)) b JUMPTARGET (GLUE(__sigsetjmp,_ent))
-END (BP_SYM (_setjmp)) -END (BP_SYM (_setjmp))
+END (_setjmp) +END (_setjmp)
libc_hidden_def (_setjmp) libc_hidden_def (_setjmp)
-ENTRY (BP_SYM (__sigsetjmp)) -ENTRY (BP_SYM (__sigsetjmp))
+ENTRY (__sigsetjmp) +ENTRY (__sigsetjmp)
CALL_MCOUNT 2 CALL_MCOUNT 2
JUMPTARGET(GLUE(__sigsetjmp,_ent)): JUMPTARGET(GLUE(__sigsetjmp,_ent)):
CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE) CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE)
@@ -215,18 +216,18 @@ @@ -215,18 +216,18 @@
li r3,0 li r3,0
blr blr
#elif defined SHARED #elif defined SHARED
- b JUMPTARGET (BP_SYM (__sigjmp_save)) - b JUMPTARGET (BP_SYM (__sigjmp_save))
+ b JUMPTARGET (__sigjmp_save) + b JUMPTARGET (__sigjmp_save)
#else #else
mflr r0 mflr r0
std r0,16(r1) std r0,16(r1)
stdu r1,-112(r1) stdu r1,-112(r1)
cfi_adjust_cfa_offset(112) cfi_adjust_cfa_offset(112)
cfi_offset(lr,16) cfi_offset(lr,16)
- bl JUMPTARGET (BP_SYM (__sigjmp_save)) - bl JUMPTARGET (BP_SYM (__sigjmp_save))
+ bl JUMPTARGET (__sigjmp_save) + bl JUMPTARGET (__sigjmp_save)
nop nop
ld r0,112+16(r1) ld r0,112+16(r1)
addi r1,r1,112 addi r1,r1,112
mtlr r0 mtlr r0
blr blr
#endif #endif
-END (BP_SYM (__sigsetjmp)) -END (BP_SYM (__sigsetjmp))
+END (__sigsetjmp) +END (__sigsetjmp)
@ -371,16 +371,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:58:25.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 13:58:25.000000000 -0500
@@ -74,6 +74,8 @@ @@ -74,6 +74,8 @@
#endif #endif
.endm .endm
+#if _CALL_ELF != 2 +#if _CALL_ELF != 2
+ +
/* Macro to prepare for calling via a function pointer. */ /* Macro to prepare for calling via a function pointer. */
.macro PPC64_LOAD_FUNCPTR PTR .macro PPC64_LOAD_FUNCPTR PTR
ld r12,0(\PTR) ld r12,0(\PTR)
@@ -115,13 +117,37 @@ @@ -115,13 +117,37 @@
.size name,.-BODY_LABEL(name); \ .size name,.-BODY_LABEL(name); \
.size BODY_LABEL(name),.-BODY_LABEL(name); .size BODY_LABEL(name),.-BODY_LABEL(name);
#endif #endif
+#define LOCALENTRY(name) +#define LOCALENTRY(name)
+ +
@ -407,9 +407,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
+#endif /* _CALL_ELF */ +#endif /* _CALL_ELF */
#define ENTRY(name) \ #define ENTRY(name) \
.section ".text"; \ .section ".text"; \
ENTRY_2(name) \ ENTRY_2(name) \
.align ALIGNARG(2); \ .align ALIGNARG(2); \
BODY_LABEL(name): \ BODY_LABEL(name): \
- cfi_startproc; - cfi_startproc;
+ cfi_startproc; \ + cfi_startproc; \
@ -418,8 +418,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
#define EALIGN_W_0 /* No words to insert. */ #define EALIGN_W_0 /* No words to insert. */
#define EALIGN_W_1 nop #define EALIGN_W_1 nop
@@ -140,7 +166,8 @@ @@ -140,7 +166,8 @@
.align ALIGNARG(alignt); \ .align ALIGNARG(alignt); \
EALIGN_W_##words; \ EALIGN_W_##words; \
BODY_LABEL(name): \ BODY_LABEL(name): \
- cfi_startproc; - cfi_startproc;
+ cfi_startproc; \ + cfi_startproc; \
@ -434,11 +434,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
+#if _CALL_ELF != 2 +#if _CALL_ELF != 2
+ +
#define PPC64_LOAD_FUNCPTR(ptr) \ #define PPC64_LOAD_FUNCPTR(ptr) \
"ld 12,0(" #ptr ");\n" \ "ld 12,0(" #ptr ");\n" \
"ld 2,8(" #ptr ");\n" \ "ld 2,8(" #ptr ");\n" \
@@ -335,5 +364,26 @@ @@ -335,5 +364,26 @@
".size " #name ",.-" BODY_PREFIX #name ";\n" \ ".size " #name ",.-" BODY_PREFIX #name ";\n" \
".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";" ".size " BODY_PREFIX #name ",.-" BODY_PREFIX #name ";"
#endif #endif
+#define LOCALENTRY(name) +#define LOCALENTRY(name)
+ +

16
SOURCES/glibc-ppc64le-40.patch

@ -137,23 +137,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:08:44.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:08:44.000000000 -0500
@@ -74,6 +74,10 @@ @@ -74,6 +74,10 @@
/* Prepare for calling the function returned by fixup. */ /* Prepare for calling the function returned by fixup. */
PPC64_LOAD_FUNCPTR r3 PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
+#if _CALL_ELF == 2 +#if _CALL_ELF == 2
+/* Restore the caller's TOC in case we jump to a local entry point. */ +/* Restore the caller's TOC in case we jump to a local entry point. */
+ ld r2,FRAME_SIZE+40(r1) + ld r2,FRAME_SIZE+40(r1)
+#endif +#endif
/* Unwind the stack frame, and jump. */ /* Unwind the stack frame, and jump. */
addi r1,r1,FRAME_SIZE addi r1,r1,FRAME_SIZE
bctr bctr
@@ -321,6 +325,10 @@ @@ -321,6 +325,10 @@
/* Prepare for calling the function returned by fixup. */ /* Prepare for calling the function returned by fixup. */
PPC64_LOAD_FUNCPTR r3 PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
+#if _CALL_ELF == 2 +#if _CALL_ELF == 2
+/* Restore the caller's TOC in case we jump to a local entry point. */ +/* Restore the caller's TOC in case we jump to a local entry point. */
+ ld r2,FRAME_SIZE+40(r1) + ld r2,FRAME_SIZE+40(r1)
+#endif +#endif
/* Load the floating point registers. */ /* Load the floating point registers. */
lfd fp1,FPR_PARMS+0(r1) lfd fp1,FPR_PARMS+0(r1)
lfd fp2,FPR_PARMS+8(r1) lfd fp2,FPR_PARMS+8(r1)

366
SOURCES/glibc-ppc64le-41.patch

@ -135,41 +135,41 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S glibc
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/__longjmp-common.S 2014-05-29 14:10:00.000000000 -0500
@@ -133,7 +133,7 @@ @@ -133,7 +133,7 @@
ld r14,((JB_GPRS+0)*8)(r3) ld r14,((JB_GPRS+0)*8)(r3)
lfd fp14,((JB_FPRS+0)*8)(r3) lfd fp14,((JB_FPRS+0)*8)(r3)
#if defined SHARED && !defined IS_IN_rtld #if defined SHARED && !defined IS_IN_rtld
- std r2,40(r1) /* Restore the callers TOC save area. */ - std r2,40(r1) /* Restore the callers TOC save area. */
+ std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */ + std r2,FRAME_TOC_SAVE(r1) /* Restore the callers TOC save area. */
#endif #endif
ld r15,((JB_GPRS+1)*8)(r3) ld r15,((JB_GPRS+1)*8)(r3)
lfd fp15,((JB_FPRS+1)*8)(r3) lfd fp15,((JB_FPRS+1)*8)(r3)
@@ -151,7 +151,7 @@ @@ -151,7 +151,7 @@
PTR_DEMANGLE2 (r0, r25) PTR_DEMANGLE2 (r0, r25)
#endif #endif
mtlr r0 mtlr r0
-/* std r2,40(r1) Restore the TOC save area. */ -/* std r2,40(r1) Restore the TOC save area. */
+/* std r2,FRAME_TOC_SAVE(r1) Restore the TOC save area. */ +/* std r2,FRAME_TOC_SAVE(r1) Restore the TOC save area. */
ld r21,((JB_GPRS+7)*8)(r3) ld r21,((JB_GPRS+7)*8)(r3)
lfd fp21,((JB_FPRS+7)*8)(r3) lfd fp21,((JB_FPRS+7)*8)(r3)
ld r22,((JB_GPRS+8)*8)(r3) ld r22,((JB_GPRS+8)*8)(r3)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crti.S 2014-05-29 14:10:00.000000000 -0500
@@ -66,8 +66,8 @@ @@ -66,8 +66,8 @@
BODY_LABEL (_init): BODY_LABEL (_init):
LOCALENTRY(_init) LOCALENTRY(_init)
mflr 0 mflr 0
- std 0, 16(r1) - std 0, 16(r1)
- stdu r1, -112(r1) - stdu r1, -112(r1)
+ std 0, FRAME_LR_SAVE(r1) + std 0, FRAME_LR_SAVE(r1)
+ stdu r1, -FRAME_MIN_SIZE_PARM(r1) + stdu r1, -FRAME_MIN_SIZE_PARM(r1)
#if PREINIT_FUNCTION_WEAK #if PREINIT_FUNCTION_WEAK
addis r9, r2, .LC0@toc@ha addis r9, r2, .LC0@toc@ha
ld r0, .LC0@toc@l(r9) ld r0, .LC0@toc@l(r9)
@@ -84,5 +84,5 @@ @@ -84,5 +84,5 @@
BODY_LABEL (_fini): BODY_LABEL (_fini):
LOCALENTRY(_fini) LOCALENTRY(_fini)
mflr 0 mflr 0
- std 0, 16(r1) - std 0, 16(r1)
- stdu r1, -112(r1) - stdu r1, -112(r1)
+ std 0, FRAME_LR_SAVE(r1) + std 0, FRAME_LR_SAVE(r1)
@ -180,21 +180,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/crtn.S glibc-2.17-c758a6
@@ -39,13 +39,13 @@ @@ -39,13 +39,13 @@
#include <sysdep.h> #include <sysdep.h>
.section .init,"ax",@progbits .section .init,"ax",@progbits
- addi r1, r1, 112 - addi r1, r1, 112
- ld r0, 16(r1) - ld r0, 16(r1)
+ addi r1, r1, FRAME_MIN_SIZE_PARM + addi r1, r1, FRAME_MIN_SIZE_PARM
+ ld r0, FRAME_LR_SAVE(r1) + ld r0, FRAME_LR_SAVE(r1)
mtlr r0 mtlr r0
blr blr
.section .fini,"ax",@progbits .section .fini,"ax",@progbits
- addi r1, r1, 112 - addi r1, r1, 112
- ld r0, 16(r1) - ld r0, 16(r1)
+ addi r1, r1, FRAME_MIN_SIZE_PARM + addi r1, r1, FRAME_MIN_SIZE_PARM
+ ld r0, FRAME_LR_SAVE(r1) + ld r0, FRAME_LR_SAVE(r1)
mtlr r0 mtlr r0
blr blr
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:10:00.000000000 -0500
@ -212,60 +212,60 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
-#define INT_PARMS 112 -#define INT_PARMS 112
+#define INT_PARMS FRAME_MIN_SIZE +#define INT_PARMS FRAME_MIN_SIZE
EALIGN(_dl_runtime_resolve, 4, 0) EALIGN(_dl_runtime_resolve, 4, 0)
stdu r1,-FRAME_SIZE(r1) stdu r1,-FRAME_SIZE(r1)
cfi_adjust_cfa_offset (FRAME_SIZE) cfi_adjust_cfa_offset (FRAME_SIZE)
@@ -48,25 +48,25 @@ @@ -48,25 +48,25 @@
mflr r0 mflr r0
std r8,INT_PARMS+40(r1) std r8,INT_PARMS+40(r1)
/* Store the LR in the LR Save area. */ /* Store the LR in the LR Save area. */
- std r0,FRAME_SIZE+16(r1) - std r0,FRAME_SIZE+16(r1)
- cfi_offset (lr, 16) - cfi_offset (lr, 16)
+ std r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + std r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
+ cfi_offset (lr, FRAME_LR_SAVE) + cfi_offset (lr, FRAME_LR_SAVE)
mfcr r0 mfcr r0
std r9,INT_PARMS+48(r1) std r9,INT_PARMS+48(r1)
std r10,INT_PARMS+56(r1) std r10,INT_PARMS+56(r1)
/* I'm almost certain we don't have to save cr... be safe. */ /* I'm almost certain we don't have to save cr... be safe. */
- std r0,FRAME_SIZE+8(r1) - std r0,FRAME_SIZE+8(r1)
+ std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) + std r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
bl JUMPTARGET(_dl_fixup) bl JUMPTARGET(_dl_fixup)
#ifndef SHARED #ifndef SHARED
nop nop
#endif #endif
/* Put the registers back. */ /* Put the registers back. */
- ld r0,FRAME_SIZE+16(r1) - ld r0,FRAME_SIZE+16(r1)
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
ld r10,INT_PARMS+56(r1) ld r10,INT_PARMS+56(r1)
ld r9,INT_PARMS+48(r1) ld r9,INT_PARMS+48(r1)
ld r8,INT_PARMS+40(r1) ld r8,INT_PARMS+40(r1)
ld r7,INT_PARMS+32(r1) ld r7,INT_PARMS+32(r1)
mtlr r0 mtlr r0
- ld r0,FRAME_SIZE+8(r1) - ld r0,FRAME_SIZE+8(r1)
+ ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r6,INT_PARMS+24(r1) ld r6,INT_PARMS+24(r1)
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
#if _CALL_ELF == 2 #if _CALL_ELF == 2
/* Restore the caller's TOC in case we jump to a local entry point. */ /* Restore the caller's TOC in case we jump to a local entry point. */
- ld r2,FRAME_SIZE+40(r1) - ld r2,FRAME_SIZE+40(r1)
+ ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1) + ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1)
#endif #endif
/* Unwind the stack frame, and jump. */ /* Unwind the stack frame, and jump. */
addi r1,r1,FRAME_SIZE addi r1,r1,FRAME_SIZE
@@ -86,6 +86,7 @@ @@ -86,6 +86,7 @@
#undef INT_PARMS #undef INT_PARMS
/* Stack layout: /* Stack layout:
+ (Note: some of these are not required for the ELFv2 ABI.) + (Note: some of these are not required for the ELFv2 ABI.)
+592 previous backchain +592 previous backchain
+584 spill_r31 +584 spill_r31
+576 spill_r30 +576 spill_r30
@@ -147,10 +148,11 @@ @@ -147,10 +148,11 @@
+64 parm3 +64 parm3
+56 parm2 +56 parm2
+48 parm1 +48 parm1
- * Parameter save area, Allocated by the call, at least 8 double words - * Parameter save area, Allocated by the call, at least 8 double words
- +40 TOC save area - +40 TOC save area
- +32 Reserved for linker - +32 Reserved for linker
@ -275,101 +275,101 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+ +40 v1 ABI: TOC save area + +40 v1 ABI: TOC save area
+ +32 v1 ABI: Reserved for linker + +32 v1 ABI: Reserved for linker
+ +24 v1 ABI: Reserved for compiler / v2 ABI: TOC save area + +24 v1 ABI: Reserved for compiler / v2 ABI: TOC save area
+16 LR save area +16 LR save area
+8 CR save area +8 CR save area
r1+0 stack back chain r1+0 stack back chain
@@ -206,15 +208,15 @@ @@ -206,15 +208,15 @@
/* Store the LR in the LR Save area of the previous frame. */ /* Store the LR in the LR Save area of the previous frame. */
/* XXX Do we have to do this? */ /* XXX Do we have to do this? */
la r8,FRAME_SIZE(r1) la r8,FRAME_SIZE(r1)
- std r5,FRAME_SIZE+16(r1) - std r5,FRAME_SIZE+16(r1)
- cfi_offset (lr, 16) - cfi_offset (lr, 16)
+ std r5,FRAME_SIZE+FRAME_LR_SAVE(r1) + std r5,FRAME_SIZE+FRAME_LR_SAVE(r1)
+ cfi_offset (lr, FRAME_LR_SAVE) + cfi_offset (lr, FRAME_LR_SAVE)
std r5,CALLING_LR(r1) std r5,CALLING_LR(r1)
mfcr r0 mfcr r0
std r9,INT_PARMS+48(r1) std r9,INT_PARMS+48(r1)
std r10,INT_PARMS+56(r1) std r10,INT_PARMS+56(r1)
std r8,CALLING_SP(r1) std r8,CALLING_SP(r1)
/* I'm almost certain we don't have to save cr... be safe. */ /* I'm almost certain we don't have to save cr... be safe. */
- std r0,FRAME_SIZE+8(r1) - std r0,FRAME_SIZE+8(r1)
+ std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) + std r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r12,.LC__dl_hwcap@toc(r2) ld r12,.LC__dl_hwcap@toc(r2)
#ifdef SHARED #ifdef SHARED
/* Load _rtld_local_ro._dl_hwcap. */ /* Load _rtld_local_ro._dl_hwcap. */
@@ -311,13 +313,13 @@ @@ -311,13 +313,13 @@
lvx v12,r11,r10 lvx v12,r11,r10
lvx v13,r11,r9 lvx v13,r11,r9
L(restoreFXR): L(restoreFXR):
- ld r0,FRAME_SIZE+16(r1) - ld r0,FRAME_SIZE+16(r1)
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
ld r10,INT_PARMS+56(r1) ld r10,INT_PARMS+56(r1)
ld r9,INT_PARMS+48(r1) ld r9,INT_PARMS+48(r1)
ld r8,INT_PARMS+40(r1) ld r8,INT_PARMS+40(r1)
ld r7,INT_PARMS+32(r1) ld r7,INT_PARMS+32(r1)
mtlr r0 mtlr r0
- ld r0,FRAME_SIZE+8(r1) - ld r0,FRAME_SIZE+8(r1)
+ ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r6,INT_PARMS+24(r1) ld r6,INT_PARMS+24(r1)
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
@@ -327,7 +329,7 @@ @@ -327,7 +329,7 @@
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
#if _CALL_ELF == 2 #if _CALL_ELF == 2
/* Restore the caller's TOC in case we jump to a local entry point. */ /* Restore the caller's TOC in case we jump to a local entry point. */
- ld r2,FRAME_SIZE+40(r1) - ld r2,FRAME_SIZE+40(r1)
+ ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1) + ld r2,FRAME_SIZE+FRAME_TOC_SAVE(r1)
#endif #endif
/* Load the floating point registers. */ /* Load the floating point registers. */
lfd fp1,FPR_PARMS+0(r1) lfd fp1,FPR_PARMS+0(r1)
@@ -375,19 +377,19 @@ @@ -375,19 +377,19 @@
lvx v12,r11,r10 lvx v12,r11,r10
lvx v13,r11,r9 lvx v13,r11,r9
L(restoreFXR2): L(restoreFXR2):
- ld r0,FRAME_SIZE+16(r1) - ld r0,FRAME_SIZE+16(r1)
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
ld r10,INT_PARMS+56(r1) ld r10,INT_PARMS+56(r1)
ld r9,INT_PARMS+48(r1) ld r9,INT_PARMS+48(r1)
ld r8,INT_PARMS+40(r1) ld r8,INT_PARMS+40(r1)
ld r7,INT_PARMS+32(r1) ld r7,INT_PARMS+32(r1)
mtlr r0 mtlr r0
- ld r0,FRAME_SIZE+8(r1) - ld r0,FRAME_SIZE+8(r1)
+ ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r6,INT_PARMS+24(r1) ld r6,INT_PARMS+24(r1)
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
mtcrf 0xFF,r0 mtcrf 0xFF,r0
/* Prepare for calling the function returned by fixup. */ /* Prepare for calling the function returned by fixup. */
- std r2,40(r1) - std r2,40(r1)
+ std r2,FRAME_TOC_SAVE(r1) + std r2,FRAME_TOC_SAVE(r1)
PPC64_LOAD_FUNCPTR r3 PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
/* Load the floating point registers. */ /* Load the floating point registers. */
@@ -406,7 +408,7 @@ @@ -406,7 +408,7 @@
lfd fp13,FPR_PARMS+96(r1) lfd fp13,FPR_PARMS+96(r1)
/* Call the target function. */ /* Call the target function. */
bctrl bctrl
- ld r2,40(r1) - ld r2,40(r1)
+ ld r2,FRAME_TOC_SAVE(r1) + ld r2,FRAME_TOC_SAVE(r1)
lwz r12,VR_VRSAVE(r1) lwz r12,VR_VRSAVE(r1)
/* But return here and store the return values. */ /* But return here and store the return values. */
std r3,INT_RTN(r1) std r3,INT_RTN(r1)
@@ -441,7 +443,7 @@ @@ -441,7 +443,7 @@
beq L(pltexitreturn) beq L(pltexitreturn)
lvx v2,0,r10 lvx v2,0,r10
L(pltexitreturn): L(pltexitreturn):
- ld r0,FRAME_SIZE+16(r1) - ld r0,FRAME_SIZE+16(r1)
+ ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) + ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
ld r31,584(r1) ld r31,584(r1)
ld r30,576(r1) ld r30,576(r1)
mtlr r0 mtlr r0
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S 2014-05-29 14:10:00.000000000 -0500
@@ -24,16 +24,16 @@ @@ -24,16 +24,16 @@
ENTRY(_mcount) ENTRY(_mcount)
mflr r4 mflr r4
ld r11, 0(r1) ld r11, 0(r1)
- stdu r1,-112(r1) - stdu r1,-112(r1)
- cfi_adjust_cfa_offset (112) - cfi_adjust_cfa_offset (112)
- std r4, 128(r1) - std r4, 128(r1)
@ -380,14 +380,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/ppc-mcount.S glibc-2.17-
+ std r4, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) + std r4, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
+ cfi_offset (lr, FRAME_LR_SAVE) + cfi_offset (lr, FRAME_LR_SAVE)
+ ld r3, FRAME_LR_SAVE(r11) + ld r3, FRAME_LR_SAVE(r11)
bl JUMPTARGET(__mcount_internal) bl JUMPTARGET(__mcount_internal)
nop nop
- ld r0, 128(r1) - ld r0, 128(r1)
+ ld r0, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) + ld r0, FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
mtlr r0 mtlr r0
- addi r1,r1,112 - addi r1,r1,112
+ addi r1,r1,FRAME_MIN_SIZE + addi r1,r1,FRAME_MIN_SIZE
blr blr
END(_mcount) END(_mcount)
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S
@ -399,22 +399,22 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.
ENTRY (__GI__setjmp) ENTRY (__GI__setjmp)
- std r2,40(r1) /* Save the callers TOC in the save area. */ - std r2,40(r1) /* Save the callers TOC in the save area. */
+ std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */ + std r2,FRAME_TOC_SAVE(r1) /* Save the callers TOC in the save area. */
CALL_MCOUNT 1 CALL_MCOUNT 1
li r4,0 /* Set second argument to 0. */ li r4,0 /* Set second argument to 0. */
b JUMPTARGET (GLUE(__sigsetjmp,_ent)) b JUMPTARGET (GLUE(__sigsetjmp,_ent))
@@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
#endif #endif
mflr r0 mflr r0
#if defined SHARED && !defined IS_IN_rtld #if defined SHARED && !defined IS_IN_rtld
- ld r5,40(r1) /* Retrieve the callers TOC. */ - ld r5,40(r1) /* Retrieve the callers TOC. */
+ ld r5,FRAME_TOC_SAVE(r1) /* Retrieve the callers TOC. */ + ld r5,FRAME_TOC_SAVE(r1) /* Retrieve the callers TOC. */
std r5,(JB_GPR2*8)(3) std r5,(JB_GPR2*8)(3)
#else #else
std r2,(JB_GPR2*8)(3) std r2,(JB_GPR2*8)(3)
@@ -219,14 +219,14 @@ @@ -219,14 +219,14 @@
b JUMPTARGET (__sigjmp_save) b JUMPTARGET (__sigjmp_save)
#else #else
mflr r0 mflr r0
- std r0,16(r1) - std r0,16(r1)
- stdu r1,-112(r1) - stdu r1,-112(r1)
- cfi_adjust_cfa_offset(112) - cfi_adjust_cfa_offset(112)
@ -423,14 +423,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/setjmp-common.S glibc-2.
+ stdu r1,-FRAME_MIN_SIZE(r1) + stdu r1,-FRAME_MIN_SIZE(r1)
+ cfi_adjust_cfa_offset(FRAME_MIN_SIZE) + cfi_adjust_cfa_offset(FRAME_MIN_SIZE)
+ cfi_offset(lr,FRAME_LR_SAVE) + cfi_offset(lr,FRAME_LR_SAVE)
bl JUMPTARGET (__sigjmp_save) bl JUMPTARGET (__sigjmp_save)
nop nop
- ld r0,112+16(r1) - ld r0,112+16(r1)
- addi r1,r1,112 - addi r1,r1,112
+ ld r0,FRAME_MIN_SIZE+FRAME_LR_SAVE(r1) + ld r0,FRAME_MIN_SIZE+FRAME_LR_SAVE(r1)
+ addi r1,r1,FRAME_MIN_SIZE + addi r1,r1,FRAME_MIN_SIZE
mtlr r0 mtlr r0
blr blr
#endif #endif
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h 2014-05-29 14:09:56.000000000 -0500
@ -482,34 +482,34 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
+#else +#else
+#define call_mcount_parm_offset FRAME_PARM_SAVE +#define call_mcount_parm_offset FRAME_PARM_SAVE
+#endif +#endif
.macro SAVE_ARG NARG .macro SAVE_ARG NARG
.if \NARG .if \NARG
SAVE_ARG \NARG-1 SAVE_ARG \NARG-1
- std 2+\NARG,40+8*(\NARG)(1) - std 2+\NARG,40+8*(\NARG)(1)
+ std 2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1) + std 2+\NARG,call_mcount_parm_offset-8+8*(\NARG)(1)
.endif .endif
.endm .endm
.macro REST_ARG NARG .macro REST_ARG NARG
.if \NARG .if \NARG
REST_ARG \NARG-1 REST_ARG \NARG-1
- ld 2+\NARG,112+40+8*(\NARG)(1) - ld 2+\NARG,112+40+8*(\NARG)(1)
+ ld 2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1) + ld 2+\NARG,FRAME_MIN_SIZE_PARM+call_mcount_parm_offset-8+8*(\NARG)(1)
.endif .endif
.endm .endm
.macro CFI_SAVE_ARG NARG .macro CFI_SAVE_ARG NARG
.if \NARG .if \NARG
CFI_SAVE_ARG \NARG-1 CFI_SAVE_ARG \NARG-1
- cfi_offset(2+\NARG,40+8*(\NARG)) - cfi_offset(2+\NARG,40+8*(\NARG))
+ cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG)) + cfi_offset(2+\NARG,call_mcount_parm_offset-8+8*(\NARG))
.endif .endif
.endm .endm
@@ -55,20 +97,20 @@ @@ -55,20 +97,20 @@
#ifdef PROF #ifdef PROF
mflr r0 mflr r0
SAVE_ARG \NARG SAVE_ARG \NARG
- std r0,16(r1) - std r0,16(r1)
- stdu r1,-112(r1) - stdu r1,-112(r1)
- cfi_adjust_cfa_offset(112) - cfi_adjust_cfa_offset(112)
@ -518,21 +518,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/sysdep.h glibc-2.17-c758
+ stdu r1,-FRAME_MIN_SIZE_PARM(r1) + stdu r1,-FRAME_MIN_SIZE_PARM(r1)
+ cfi_adjust_cfa_offset(FRAME_MIN_SIZE_PARM) + cfi_adjust_cfa_offset(FRAME_MIN_SIZE_PARM)
+ cfi_offset(lr,FRAME_LR_SAVE) + cfi_offset(lr,FRAME_LR_SAVE)
CFI_SAVE_ARG \NARG CFI_SAVE_ARG \NARG
bl JUMPTARGET (_mcount) bl JUMPTARGET (_mcount)
#ifndef SHARED #ifndef SHARED
nop nop
#endif #endif
- ld r0,128(r1) - ld r0,128(r1)
+ ld r0,FRAME_MIN_SIZE_PARM+FRAME_LR_SAVE(r1) + ld r0,FRAME_MIN_SIZE_PARM+FRAME_LR_SAVE(r1)
REST_ARG \NARG REST_ARG \NARG
mtlr r0 mtlr r0
- addi r1,r1,112 - addi r1,r1,112
- cfi_adjust_cfa_offset(-112) - cfi_adjust_cfa_offset(-112)
+ addi r1,r1,FRAME_MIN_SIZE_PARM + addi r1,r1,FRAME_MIN_SIZE_PARM
+ cfi_adjust_cfa_offset(-FRAME_MIN_SIZE_PARM) + cfi_adjust_cfa_offset(-FRAME_MIN_SIZE_PARM)
cfi_restore(lr) cfi_restore(lr)
CFI_REST_ARG \NARG CFI_REST_ARG \NARG
#endif #endif
@@ -267,15 +309,15 @@ @@ -267,15 +309,15 @@
.else; \ .else; \
@ -561,59 +561,59 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____long
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S 2014-05-29 14:10:00.000000000 -0500
@@ -33,24 +33,24 @@ @@ -33,24 +33,24 @@
cmpld reg, r1; \ cmpld reg, r1; \
bge+ .Lok; \ bge+ .Lok; \
mflr r0; \ mflr r0; \
- std r0,16(r1); \ - std r0,16(r1); \
+ std r0,FRAME_LR_SAVE(r1); \ + std r0,FRAME_LR_SAVE(r1); \
mr r31,r3; \ mr r31,r3; \
mr r30,r4; \ mr r30,r4; \
- stdu r1,-144(r1); \ - stdu r1,-144(r1); \
+ stdu r1,-FRAME_MIN_SIZE-32(r1); \ + stdu r1,-FRAME_MIN_SIZE-32(r1); \
cfi_remember_state; \ cfi_remember_state; \
- cfi_adjust_cfa_offset (144); \ - cfi_adjust_cfa_offset (144); \
- cfi_offset (lr, 16); \ - cfi_offset (lr, 16); \
+ cfi_adjust_cfa_offset (FRAME_MIN_SIZE+32); \ + cfi_adjust_cfa_offset (FRAME_MIN_SIZE+32); \
+ cfi_offset (lr, FRAME_LR_SAVE); \ + cfi_offset (lr, FRAME_LR_SAVE); \
li r3,0; \ li r3,0; \
- addi r4,r1,112; \ - addi r4,r1,112; \
+ addi r4,r1,FRAME_MIN_SIZE; \ + addi r4,r1,FRAME_MIN_SIZE; \
li r0,__NR_sigaltstack; \ li r0,__NR_sigaltstack; \
sc; \ sc; \
/* Without working sigaltstack we cannot perform the test. */ \ /* Without working sigaltstack we cannot perform the test. */ \
bso .Lok2; \ bso .Lok2; \
- lwz r0,112+8(r1); \ - lwz r0,112+8(r1); \
+ lwz r0,FRAME_MIN_SIZE+8(r1); \ + lwz r0,FRAME_MIN_SIZE+8(r1); \
andi. r4,r0,1; \ andi. r4,r0,1; \
beq .Lfail; \ beq .Lfail; \
- ld r0,112+16(r1); \ - ld r0,112+16(r1); \
- ld r4,112(r1); \ - ld r4,112(r1); \
+ ld r0,FRAME_MIN_SIZE+16(r1); \ + ld r0,FRAME_MIN_SIZE+16(r1); \
+ ld r4,FRAME_MIN_SIZE(r1); \ + ld r4,FRAME_MIN_SIZE(r1); \
add r4,r4,r0; \ add r4,r4,r0; \
sub r3,r3,reg; \ sub r3,r3,reg; \
cmpld r3,r0; \ cmpld r3,r0; \
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/brk.S 2014-05-29 14:10:00.000000000 -0500
@@ -31,9 +31,9 @@ @@ -31,9 +31,9 @@
CALL_MCOUNT 1 CALL_MCOUNT 1
DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */ DISCARD_BOUNDS (r3) /* the bounds are meaningless, so toss 'em. */
- std r3,48(r1) - std r3,48(r1)
+ std r3,-8(r1) + std r3,-8(r1)
DO_CALL(SYS_ify(brk)) DO_CALL(SYS_ify(brk))
- ld r6,48(r1) - ld r6,48(r1)
+ ld r6,-8(r1) + ld r6,-8(r1)
ld r5,.LC__curbrk@toc(r2) ld r5,.LC__curbrk@toc(r2)
std r3,0(r5) std r3,0(r5)
cmpld r6,r3 cmpld r6,r3
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S 2014-05-29 14:10:00.000000000 -0500
@@ -45,22 +45,22 @@ @@ -45,22 +45,22 @@
cror cr0*4+eq,cr1*4+eq,cr0*4+eq cror cr0*4+eq,cr1*4+eq,cr0*4+eq
beq- cr0,L(badargs) beq- cr0,L(badargs)
- /* Save some regs in parm save area. */ - /* Save some regs in parm save area. */
+ /* Save some regs in the "red zone". */ + /* Save some regs in the "red zone". */
@ -634,32 +634,32 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+ cfi_offset(r30,-16) + cfi_offset(r30,-16)
+ cfi_offset(r31,-8) + cfi_offset(r31,-8)
/* Set up stack frame for child. */ /* Set up stack frame for child. */
clrrdi r4,r4,4 clrrdi r4,r4,4
li r0,0 li r0,0
- stdu r0,-112(r4) /* min stack frame is 112 bytes per ABI */ - stdu r0,-112(r4) /* min stack frame is 112 bytes per ABI */
+ stdu r0,-FRAME_MIN_SIZE_PARM(r4) + stdu r0,-FRAME_MIN_SIZE_PARM(r4)
/* Save fn, args, stack across syscall. */ /* Save fn, args, stack across syscall. */
mr r30,r3 /* Function in r30. */ mr r30,r3 /* Function in r30. */
@@ -102,12 +102,12 @@ @@ -102,12 +102,12 @@
L(oldpid): L(oldpid):
#endif #endif
- std r2,40(r1) - std r2,40(r1)
+ std r2,FRAME_TOC_SAVE(r1) + std r2,FRAME_TOC_SAVE(r1)
/* Call procedure. */ /* Call procedure. */
PPC64_LOAD_FUNCPTR r30 PPC64_LOAD_FUNCPTR r30
mr r3,r31 mr r3,r31
bctrl bctrl
- ld r2,40(r1) - ld r2,40(r1)
+ ld r2,FRAME_TOC_SAVE(r1) + ld r2,FRAME_TOC_SAVE(r1)
/* Call _exit with result from procedure. */ /* Call _exit with result from procedure. */
#ifdef SHARED #ifdef SHARED
b JUMPTARGET(__GI__exit) b JUMPTARGET(__GI__exit)
@@ -126,15 +126,15 @@ @@ -126,15 +126,15 @@
L(parent): L(parent):
/* Parent. Restore registers & return. */ /* Parent. Restore registers & return. */
#ifdef RESET_PID #ifdef RESET_PID
- cfi_offset(r29,48) - cfi_offset(r29,48)
+ cfi_offset(r29,-24) + cfi_offset(r29,-24)
@ -677,7 +677,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S
+ ld r30,-16(r1) + ld r30,-16(r1)
+ ld r31,-8(r1) + ld r31,-8(r1)
#ifdef RESET_PID #ifdef RESET_PID
cfi_restore(r29) cfi_restore(r29)
#endif #endif
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S 2014-05-29 14:09:56.000000000 -0500
@ -696,23 +696,23 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
+#define stackblock (FRAMESIZE+FRAME_PARM_SAVE) /* offset to parm save area. */ +#define stackblock (FRAMESIZE+FRAME_PARM_SAVE) /* offset to parm save area. */
+#endif +#endif
.text .text
ENTRY(__socket) ENTRY(__socket)
@@ -98,22 +103,22 @@ @@ -98,22 +103,22 @@
.Lsocket_cancel: .Lsocket_cancel:
cfi_adjust_cfa_offset(FRAMESIZE) cfi_adjust_cfa_offset(FRAMESIZE)
mflr r9 mflr r9
- std r9,FRAMESIZE+16(r1) - std r9,FRAMESIZE+16(r1)
- cfi_offset (lr, 16) - cfi_offset (lr, 16)
+ std r9,FRAMESIZE+FRAME_LR_SAVE(r1) + std r9,FRAMESIZE+FRAME_LR_SAVE(r1)
+ cfi_offset (lr, FRAME_LR_SAVE) + cfi_offset (lr, FRAME_LR_SAVE)
CENABLE CENABLE
- std r3,120(r1) - std r3,120(r1)
+ std r3,FRAME_MIN_SIZE+8(r1) + std r3,FRAME_MIN_SIZE+8(r1)
li r3,P(SOCKOP_,socket) li r3,P(SOCKOP_,socket)
addi r4,r1,stackblock addi r4,r1,stackblock
DO_CALL(SYS_ify(socketcall)) DO_CALL(SYS_ify(socketcall))
mfcr r0 mfcr r0
- std r3,112(r1) - std r3,112(r1)
- std r0,FRAMESIZE+8(r1) - std r0,FRAMESIZE+8(r1)
- cfi_offset (cr, 8) - cfi_offset (cr, 8)
@ -721,16 +721,16 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/socket.S
+ std r0,FRAMESIZE+FRAME_CR_SAVE(r1) + std r0,FRAMESIZE+FRAME_CR_SAVE(r1)
+ cfi_offset (cr, FRAME_CR_SAVE) + cfi_offset (cr, FRAME_CR_SAVE)
+ ld r3,FRAME_MIN_SIZE+8(r1) + ld r3,FRAME_MIN_SIZE+8(r1)
CDISABLE CDISABLE
- ld r4,FRAMESIZE+16(r1) - ld r4,FRAMESIZE+16(r1)
- ld r0,FRAMESIZE+8(r1) - ld r0,FRAMESIZE+8(r1)
- ld r3,112(r1) - ld r3,112(r1)
+ ld r4,FRAMESIZE+FRAME_LR_SAVE(r1) + ld r4,FRAMESIZE+FRAME_LR_SAVE(r1)
+ ld r0,FRAMESIZE+FRAME_CR_SAVE(r1) + ld r0,FRAMESIZE+FRAME_CR_SAVE(r1)
+ ld r3,FRAME_MIN_SIZE(r1) + ld r3,FRAME_MIN_SIZE(r1)
mtlr r4 mtlr r4
mtcr r0 mtcr r0
addi r1,r1,FRAMESIZE addi r1,r1,FRAMESIZE
diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym
--- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:09:56.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:09:56.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:10:00.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/powerpc64/ucontext_i.sym 2014-05-29 14:10:00.000000000 -0500

154
SOURCES/glibc-ppc64le-42.patch

@ -101,8 +101,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/ldsodefs.h glibc-2.17-c758a686/sys
Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \ Elf32_Addr (*ppc32_gnu_pltenter) (Elf32_Sym *, unsigned int, uintptr_t *, \
@@ -34,7 +36,12 @@ @@ -34,7 +36,12 @@
Elf64_Addr (*ppc64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *, \ Elf64_Addr (*ppc64_gnu_pltenter) (Elf64_Sym *, unsigned int, uintptr_t *, \
uintptr_t *, struct La_ppc64_regs *, \ uintptr_t *, struct La_ppc64_regs *, \
unsigned int *, const char *name, \ unsigned int *, const char *name, \
- long int *framesizep) - long int *framesizep)
+ long int *framesizep); \ + long int *framesizep); \
+ Elf64_Addr (*ppc64v2_gnu_pltenter) (Elf64_Sym *, unsigned int, \ + Elf64_Addr (*ppc64v2_gnu_pltenter) (Elf64_Sym *, unsigned int, \
@ -114,9 +114,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/ldsodefs.h glibc-2.17-c758a686/sys
#define ARCH_PLTEXIT_MEMBERS \ #define ARCH_PLTEXIT_MEMBERS \
unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, \ unsigned int (*ppc32_gnu_pltexit) (Elf32_Sym *, unsigned int, \
@@ -47,7 +54,14 @@ @@ -47,7 +54,14 @@
uintptr_t *, \ uintptr_t *, \
uintptr_t *, \ uintptr_t *, \
const struct La_ppc64_regs *, \ const struct La_ppc64_regs *, \
- struct La_ppc64_retval *, const char *) - struct La_ppc64_retval *, const char *)
+ struct La_ppc64_retval *, \ + struct La_ppc64_retval *, \
+ const char *); \ + const char *); \
@ -151,28 +151,28 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:11:20.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S 2014-05-29 14:11:20.000000000 -0500
@@ -50,11 +50,8 @@ @@ -50,11 +50,8 @@
/* Store the LR in the LR Save area. */ /* Store the LR in the LR Save area. */
std r0,FRAME_SIZE+FRAME_LR_SAVE(r1) std r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
cfi_offset (lr, FRAME_LR_SAVE) cfi_offset (lr, FRAME_LR_SAVE)
- mfcr r0 - mfcr r0
std r9,INT_PARMS+48(r1) std r9,INT_PARMS+48(r1)
std r10,INT_PARMS+56(r1) std r10,INT_PARMS+56(r1)
-/* I'm almost certain we don't have to save cr... be safe. */ -/* I'm almost certain we don't have to save cr... be safe. */
- std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - std r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
bl JUMPTARGET(_dl_fixup) bl JUMPTARGET(_dl_fixup)
#ifndef SHARED #ifndef SHARED
nop nop
@@ -66,11 +63,9 @@ @@ -66,11 +63,9 @@
ld r8,INT_PARMS+40(r1) ld r8,INT_PARMS+40(r1)
ld r7,INT_PARMS+32(r1) ld r7,INT_PARMS+32(r1)
mtlr r0 mtlr r0
- ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r6,INT_PARMS+24(r1) ld r6,INT_PARMS+24(r1)
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
- mtcrf 0xFF,r0 - mtcrf 0xFF,r0
/* Prepare for calling the function returned by fixup. */ /* Prepare for calling the function returned by fixup. */
PPC64_LOAD_FUNCPTR r3 PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
@@ -85,18 +80,30 @@ @@ -85,18 +80,30 @@
#undef FRAME_SIZE #undef FRAME_SIZE
#undef INT_PARMS #undef INT_PARMS
@ -213,13 +213,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+ +528 fp1 +528 fp1 + +528 fp1 +528 fp1
+ +520 r4 +520 r4 + +520 r4 +520 r4
+ +512 r3 +512 r3 + +512 r3 +512 r3
return values return values
+504 free +504 free
+496 stackframe +496 stackframe
@@ -157,10 +164,15 @@ @@ -157,10 +164,15 @@
+8 CR save area +8 CR save area
r1+0 stack back chain r1+0 stack back chain
*/ */
-#define FRAME_SIZE 592 -#define FRAME_SIZE 592
+#if _CALL_ELF == 2 +#if _CALL_ELF == 2
+# define FRAME_SIZE 752 +# define FRAME_SIZE 752
@ -235,73 +235,73 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
#define CALLING_LR 488 #define CALLING_LR 488
#define CALLING_SP 480 #define CALLING_SP 480
@@ -205,18 +217,14 @@ @@ -205,18 +217,14 @@
mflr r5 mflr r5
std r7,INT_PARMS+32(r1) std r7,INT_PARMS+32(r1)
std r8,INT_PARMS+40(r1) std r8,INT_PARMS+40(r1)
-/* Store the LR in the LR Save area of the previous frame. */ -/* Store the LR in the LR Save area of the previous frame. */
-/* XXX Do we have to do this? */ -/* XXX Do we have to do this? */
+/* Store the LR in the LR Save area. */ +/* Store the LR in the LR Save area. */
la r8,FRAME_SIZE(r1) la r8,FRAME_SIZE(r1)
std r5,FRAME_SIZE+FRAME_LR_SAVE(r1) std r5,FRAME_SIZE+FRAME_LR_SAVE(r1)
cfi_offset (lr, FRAME_LR_SAVE) cfi_offset (lr, FRAME_LR_SAVE)
std r5,CALLING_LR(r1) std r5,CALLING_LR(r1)
- mfcr r0 - mfcr r0
std r9,INT_PARMS+48(r1) std r9,INT_PARMS+48(r1)
std r10,INT_PARMS+56(r1) std r10,INT_PARMS+56(r1)
std r8,CALLING_SP(r1) std r8,CALLING_SP(r1)
-/* I'm almost certain we don't have to save cr... be safe. */ -/* I'm almost certain we don't have to save cr... be safe. */
- std r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - std r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r12,.LC__dl_hwcap@toc(r2) ld r12,.LC__dl_hwcap@toc(r2)
#ifdef SHARED #ifdef SHARED
/* Load _rtld_local_ro._dl_hwcap. */ /* Load _rtld_local_ro._dl_hwcap. */
@@ -319,11 +327,9 @@ @@ -319,11 +327,9 @@
ld r8,INT_PARMS+40(r1) ld r8,INT_PARMS+40(r1)
ld r7,INT_PARMS+32(r1) ld r7,INT_PARMS+32(r1)
mtlr r0 mtlr r0
- ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r6,INT_PARMS+24(r1) ld r6,INT_PARMS+24(r1)
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
- mtcrf 0xFF,r0 - mtcrf 0xFF,r0
/* Prepare for calling the function returned by fixup. */ /* Prepare for calling the function returned by fixup. */
PPC64_LOAD_FUNCPTR r3 PPC64_LOAD_FUNCPTR r3
ld r3,INT_PARMS+0(r1) ld r3,INT_PARMS+0(r1)
@@ -346,10 +352,11 @@ @@ -346,10 +352,11 @@
lfd fp12,FPR_PARMS+88(r1) lfd fp12,FPR_PARMS+88(r1)
lfd fp13,FPR_PARMS+96(r1) lfd fp13,FPR_PARMS+96(r1)
/* Unwind the stack frame, and jump. */ /* Unwind the stack frame, and jump. */
- ld r31,584(r1) - ld r31,584(r1)
- ld r30,576(r1) - ld r30,576(r1)
+ ld r31,FRAME_SIZE-8(r1) + ld r31,FRAME_SIZE-8(r1)
+ ld r30,FRAME_SIZE-16(r1) + ld r30,FRAME_SIZE-16(r1)
addi r1,r1,FRAME_SIZE addi r1,r1,FRAME_SIZE
bctr bctr
+ +
L(do_pltexit): L(do_pltexit):
la r10,(VR_PARMS+0)(r1) la r10,(VR_PARMS+0)(r1)
la r9,(VR_PARMS+16)(r1) la r9,(VR_PARMS+16)(r1)
@@ -383,11 +390,9 @@ @@ -383,11 +390,9 @@
ld r8,INT_PARMS+40(r1) ld r8,INT_PARMS+40(r1)
ld r7,INT_PARMS+32(r1) ld r7,INT_PARMS+32(r1)
mtlr r0 mtlr r0
- ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1) - ld r0,FRAME_SIZE+FRAME_CR_SAVE(r1)
ld r6,INT_PARMS+24(r1) ld r6,INT_PARMS+24(r1)
ld r5,INT_PARMS+16(r1) ld r5,INT_PARMS+16(r1)
ld r4,INT_PARMS+8(r1) ld r4,INT_PARMS+8(r1)
- mtcrf 0xFF,r0 - mtcrf 0xFF,r0
/* Prepare for calling the function returned by fixup. */ /* Prepare for calling the function returned by fixup. */
std r2,FRAME_TOC_SAVE(r1) std r2,FRAME_TOC_SAVE(r1)
PPC64_LOAD_FUNCPTR r3 PPC64_LOAD_FUNCPTR r3
@@ -413,16 +418,37 @@ @@ -413,16 +418,37 @@
/* But return here and store the return values. */ /* But return here and store the return values. */
std r3,INT_RTN(r1) std r3,INT_RTN(r1)
std r4,INT_RTN+8(r1) std r4,INT_RTN+8(r1)
- stfd fp1,FPR_PARMS+0(r1) - stfd fp1,FPR_PARMS+0(r1)
- stfd fp2,FPR_PARMS+8(r1) - stfd fp2,FPR_PARMS+8(r1)
+ stfd fp1,FPR_RTN+0(r1) + stfd fp1,FPR_RTN+0(r1)
+ stfd fp2,FPR_RTN+8(r1) + stfd fp2,FPR_RTN+8(r1)
cmpdi cr0,r12,0 cmpdi cr0,r12,0
la r10,VR_RTN(r1) la r10,VR_RTN(r1)
- stfd fp3,FPR_PARMS+16(r1) - stfd fp3,FPR_PARMS+16(r1)
- stfd fp4,FPR_PARMS+24(r1) - stfd fp4,FPR_PARMS+24(r1)
+ stfd fp3,FPR_RTN+16(r1) + stfd fp3,FPR_RTN+16(r1)
@ -317,10 +317,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+ stfd fp9,FPR_RTN+64(r1) + stfd fp9,FPR_RTN+64(r1)
+ stfd fp10,FPR_RTN+72(r1) + stfd fp10,FPR_RTN+72(r1)
+#endif +#endif
mr r3,r31 mr r3,r31
mr r4,r30 mr r4,r30
beq L(callpltexit) beq L(callpltexit)
stvx v2,0,r10 stvx v2,0,r10
+#if _CALL_ELF == 2 +#if _CALL_ELF == 2
+ stvx v3,0,r12 + stvx v3,0,r12
+ stvx v4,r5,r10 + stvx v4,r5,r10
@ -332,17 +332,17 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+ stvx v9,r5,r12 + stvx v9,r5,r12
+#endif +#endif
L(callpltexit): L(callpltexit):
addi r5,r1,INT_PARMS addi r5,r1,INT_PARMS
addi r6,r1,INT_RTN addi r6,r1,INT_RTN
@@ -434,18 +460,39 @@ @@ -434,18 +460,39 @@
lwz r12,VR_VRSAVE(r1) lwz r12,VR_VRSAVE(r1)
ld r3,INT_RTN(r1) ld r3,INT_RTN(r1)
ld r4,INT_RTN+8(r1) ld r4,INT_RTN+8(r1)
- lfd fp1,FPR_PARMS+0(r1) - lfd fp1,FPR_PARMS+0(r1)
- lfd fp2,FPR_PARMS+8(r1) - lfd fp2,FPR_PARMS+8(r1)
+ lfd fp1,FPR_RTN+0(r1) + lfd fp1,FPR_RTN+0(r1)
+ lfd fp2,FPR_RTN+8(r1) + lfd fp2,FPR_RTN+8(r1)
cmpdi cr0,r12,0 cmpdi cr0,r12,0
- la r10,VR_RTN(r1) - la r10,VR_RTN(r1)
- lfd fp3,FPR_PARMS+16(r1) - lfd fp3,FPR_PARMS+16(r1)
- lfd fp4,FPR_PARMS+24(r1) - lfd fp4,FPR_PARMS+24(r1)
@ -360,7 +360,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+ lfd fp9,FPR_RTN+64(r1) + lfd fp9,FPR_RTN+64(r1)
+ lfd fp10,FPR_RTN+72(r1) + lfd fp10,FPR_RTN+72(r1)
+#endif +#endif
beq L(pltexitreturn) beq L(pltexitreturn)
- lvx v2,0,r10 - lvx v2,0,r10
+ lvx v2,0,r11 + lvx v2,0,r11
+#if _CALL_ELF == 2 +#if _CALL_ELF == 2
@ -374,14 +374,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/dl-trampoline.S glibc-2.
+ lvx v9,r30,r12 + lvx v9,r30,r12
+#endif +#endif
L(pltexitreturn): L(pltexitreturn):
ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1) ld r0,FRAME_SIZE+FRAME_LR_SAVE(r1)
- ld r31,584(r1) - ld r31,584(r1)
- ld r30,576(r1) - ld r30,576(r1)
+ ld r31,FRAME_SIZE-8(r1) + ld r31,FRAME_SIZE-8(r1)
+ ld r30,FRAME_SIZE-16(r1) + ld r30,FRAME_SIZE-16(r1)
mtlr r0 mtlr r0
ld r1,0(r1) ld r1,0(r1)
blr blr
diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h 2014-05-29 14:11:12.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h 2014-05-29 14:11:12.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h 2014-05-29 14:11:20.000000000 -0500 +++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/tst-audit.h 2014-05-29 14:11:20.000000000 -0500

12
SOURCES/glibc-ppc64le-44.patch

@ -16,11 +16,11 @@ diff -urN glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/fpu/s_copysign.S glibc-2
with the sign bit of y. */ with the sign bit of y. */
- stfd fp2,56(r1) - stfd fp2,56(r1)
+ stfd fp2,-8(r1) + stfd fp2,-8(r1)
nop nop
nop nop
nop nop
- ld r3,56(r1) - ld r3,56(r1)
+ ld r3,-8(r1) + ld r3,-8(r1)
cmpdi r3,0 cmpdi r3,0
blt L(0) blt L(0)
fabs fp1,fp1 fabs fp1,fp1

2
SOURCES/glibc-rh1000923.patch

@ -19,7 +19,7 @@ diff -pruN glibc-2.17-c758a686/nscd/aicache.c glibc-2.17-c758a686/nscd/aicache.c
#include "nscd.h" #include "nscd.h"
@@ -100,8 +101,11 @@ addhstaiX (struct database_dyn *db, int @@ -100,8 +101,11 @@ addhstaiX (struct database_dyn *db, int
no_more = __nss_database_lookup ("hosts", NULL, no_more = __nss_database_lookup ("hosts", NULL,
"dns [!UNAVAIL=return] files", &nip); "dns [!UNAVAIL=return] files", &nip);
+ /* Initialize configurations. */ + /* Initialize configurations. */
+ if (__builtin_expect (!_res_hconf.initialized, 0)) + if (__builtin_expect (!_res_hconf.initialized, 0))

4
SOURCES/glibc-rh1008298.patch

@ -28,7 +28,7 @@ index 3148c5f..f7718a9 100644
+ } + }
+ +
__malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t, __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
const __malloc_ptr_t)) = const __malloc_ptr_t)) =
force_reg (__memalign_hook); force_reg (__memalign_hook);
@@ -3082,6 +3082,13 @@ __libc_pvalloc(size_t bytes) @@ -3082,6 +3082,13 @@ __libc_pvalloc(size_t bytes)
size_t page_mask = GLRO(dl_pagesize) - 1; size_t page_mask = GLRO(dl_pagesize) - 1;
@ -42,5 +42,5 @@ index 3148c5f..f7718a9 100644
+ } + }
+ +
__malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t, __malloc_ptr_t (*hook) __MALLOC_PMT ((size_t, size_t,
const __malloc_ptr_t)) = const __malloc_ptr_t)) =
force_reg (__memalign_hook); force_reg (__memalign_hook);

12
SOURCES/glibc-rh1025612.patch

@ -15,7 +15,7 @@ index e6ce4cf..8ff74b4 100644
--- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
+++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
@@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, @@ -197,7 +197,22 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
&rc, &herrno, NULL, &localcanon)); \ &rc, &herrno, NULL, &localcanon)); \
if (rc != ERANGE || herrno != NETDB_INTERNAL) \ if (rc != ERANGE || herrno != NETDB_INTERNAL) \
break; \ break; \
- tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \ - tmpbuf = extend_alloca (tmpbuf, tmpbuflen, 2 * tmpbuflen); \
@ -39,12 +39,12 @@ index e6ce4cf..8ff74b4 100644
if (status == NSS_STATUS_SUCCESS && rc == 0) \ if (status == NSS_STATUS_SUCCESS && rc == 0) \
h = &th; \ h = &th; \
@@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp, @@ -209,7 +224,8 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
{ \ { \
__set_h_errno (herrno); \ __set_h_errno (herrno); \
_res.options |= old_res_options & RES_USE_INET6; \ _res.options |= old_res_options & RES_USE_INET6; \
- return -EAI_SYSTEM; \ - return -EAI_SYSTEM; \
+ result = -EAI_SYSTEM; \ + result = -EAI_SYSTEM; \
+ goto free_and_return; \ + goto free_and_return; \
} \ } \
if (herrno == TRY_AGAIN) \ if (herrno == TRY_AGAIN) \
no_data = EAI_AGAIN; \ no_data = EAI_AGAIN; \

20
SOURCES/glibc-rh1027101.patch

@ -11,8 +11,8 @@ Date: Tue Dec 24 09:44:50 2013 +1300
The fix is to add have_lock to the if-condition checks. The rest of the patch The fix is to add have_lock to the if-condition checks. The rest of the patch
only makes code more readable. only makes code more readable.
* malloc/malloc.c (_int_free): Perform sanity check only if we * malloc/malloc.c (_int_free): Perform sanity check only if we
have_lock. have_lock.


Index: b/malloc/malloc.c Index: b/malloc/malloc.c
=================================================================== ===================================================================
@ -33,18 +33,18 @@ Index: b/malloc/malloc.c
- record we are going to add (i.e., double free). */ - record we are going to add (i.e., double free). */
+ /* Check that the top of the bin is not the record we are going to add + /* Check that the top of the bin is not the record we are going to add
+ (i.e., double free). */ + (i.e., double free). */
if (__builtin_expect (old == p, 0)) if (__builtin_expect (old == p, 0))
{ {
errstr = "double free or corruption (fasttop)"; errstr = "double free or corruption (fasttop)";
goto errout; goto errout;
} }
- if (old != NULL) - if (old != NULL)
+ /* Check that size of fastbin chunk at the top is the same as + /* Check that size of fastbin chunk at the top is the same as
+ size of the chunk that we are adding. We can dereference OLD + size of the chunk that we are adding. We can dereference OLD
+ only if we have the lock, otherwise it might have already been + only if we have the lock, otherwise it might have already been
+ deallocated. See use of OLD_IDX below for the actual check. */ + deallocated. See use of OLD_IDX below for the actual check. */
+ if (have_lock && old != NULL) + if (have_lock && old != NULL)
old_idx = fastbin_index(chunksize(old)); old_idx = fastbin_index(chunksize(old));
- p->fd = fd = old; - p->fd = fd = old;
+ p->fd = old2 = old; + p->fd = old2 = old;
} }
@ -54,5 +54,5 @@ Index: b/malloc/malloc.c
- if (fd != NULL && __builtin_expect (old_idx != idx, 0)) - if (fd != NULL && __builtin_expect (old_idx != idx, 0))
+ if (have_lock && old != NULL && __builtin_expect (old_idx != idx, 0)) + if (have_lock && old != NULL && __builtin_expect (old_idx != idx, 0))
{ {
errstr = "invalid fastbin entry (free)"; errstr = "invalid fastbin entry (free)";
goto errout; goto errout;

2
SOURCES/glibc-rh1027348-1.patch

@ -198,7 +198,7 @@ Index: glibc-2.17-c758a686/sysdeps/s390/bits/atomic.h
({ __typeof (mem) __archmem = (mem); \ ({ __typeof (mem) __archmem = (mem); \
__typeof (*mem) __archold = (oldval); \ __typeof (*mem) __archold = (oldval); \
@@ -67,6 +70,7 @@ typedef uintmax_t uatomic_max_t; @@ -67,6 +70,7 @@ typedef uintmax_t uatomic_max_t;
: "d" ((long) (newval)), "m" (*__archmem) : "cc", "memory" ); \ : "d" ((long) (newval)), "m" (*__archmem) : "cc", "memory" ); \
__archold; }) __archold; })
#else #else
+# define __HAVE_64B_ATOMICS 0 +# define __HAVE_64B_ATOMICS 0

20
SOURCES/glibc-rh1027348-3.patch

@ -9,13 +9,13 @@ Index: glibc-2.17-c758a686/nptl/Makefile
--- glibc-2.17-c758a686.orig/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile
+++ glibc-2.17-c758a686/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile
@@ -224,6 +224,7 @@ tests = tst-typesizes \ @@ -224,6 +224,7 @@ tests = tst-typesizes \
tst-key1 tst-key2 tst-key3 tst-key4 \ tst-key1 tst-key2 tst-key3 tst-key4 \
tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \ tst-sem1 tst-sem2 tst-sem3 tst-sem4 tst-sem5 tst-sem6 tst-sem7 \
tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \ tst-sem8 tst-sem9 tst-sem10 tst-sem11 tst-sem12 tst-sem13 tst-sem14 \
+ tst-sem15 \ + tst-sem15 \
tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \ tst-barrier1 tst-barrier2 tst-barrier3 tst-barrier4 \
tst-align tst-align2 tst-align3 \ tst-align tst-align2 tst-align3 \
tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \ tst-basic1 tst-basic2 tst-basic3 tst-basic4 tst-basic5 tst-basic6 \
Index: glibc-2.17-c758a686/nptl/tst-sem15.c Index: glibc-2.17-c758a686/nptl/tst-sem15.c
=================================================================== ===================================================================
--- /dev/null --- /dev/null
@ -130,10 +130,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c
{ {
- if ((v << SEM_VALUE_SHIFT) == SEM_VALUE_MAX) - if ((v << SEM_VALUE_SHIFT) == SEM_VALUE_MAX)
+ if ((v >> SEM_VALUE_SHIFT) == SEM_VALUE_MAX) + if ((v >> SEM_VALUE_SHIFT) == SEM_VALUE_MAX)
{ {
__set_errno (EOVERFLOW); __set_errno (EOVERFLOW);
return -1; return -1;
} }
} }
- while (!atomic_compare_exchange_weak_release (&isem->value, - while (!atomic_compare_exchange_weak_release (&isem->value,
- &v, v + (1 << SEM_VALUE_SHIFT))); - &v, v + (1 << SEM_VALUE_SHIFT)));

4
SOURCES/glibc-rh1027348-4.patch

@ -92,7 +92,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_waitcommon.c
rt.tv_nsec = nsec; rt.tv_nsec = nsec;
+#endif +#endif
if (cancel) if (cancel)
oldtype = __pthread_enable_asynccancel (); oldtype = __pthread_enable_asynccancel ();
+#if (defined __ASSUME_FUTEX_CLOCK_REALTIME \ +#if (defined __ASSUME_FUTEX_CLOCK_REALTIME \
+ && defined lll_futex_timed_wait_bitset) + && defined lll_futex_timed_wait_bitset)
+ err = lll_futex_timed_wait_bitset (futex, expected, abstime, + err = lll_futex_timed_wait_bitset (futex, expected, abstime,
@ -101,5 +101,5 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_waitcommon.c
err = lll_futex_timed_wait (futex, expected, &rt, private); err = lll_futex_timed_wait (futex, expected, &rt, private);
+#endif +#endif
if (cancel) if (cancel)
__pthread_disable_asynccancel (oldtype); __pthread_disable_asynccancel (oldtype);
} }

52
SOURCES/glibc-rh1027348.patch

@ -80,14 +80,14 @@ Index: glibc-2.17-c758a686/nptl/Makefile
--- glibc-2.17-c758a686.orig/nptl/Makefile --- glibc-2.17-c758a686.orig/nptl/Makefile
+++ glibc-2.17-c758a686/nptl/Makefile +++ glibc-2.17-c758a686/nptl/Makefile
@@ -95,7 +95,7 @@ libpthread-routines = nptl-init vars eve @@ -95,7 +95,7 @@ libpthread-routines = nptl-init vars eve
sem_init sem_destroy \ sem_init sem_destroy \
sem_open sem_close sem_unlink \ sem_open sem_close sem_unlink \
sem_getvalue \ sem_getvalue \
- sem_wait sem_trywait sem_timedwait sem_post \ - sem_wait sem_trywait sem_timedwait sem_post \
+ sem_wait sem_timedwait sem_post \ + sem_wait sem_timedwait sem_post \
cleanup cleanup_defer cleanup_compat \ cleanup cleanup_defer cleanup_compat \
cleanup_defer_compat unwind \ cleanup_defer_compat unwind \
pt-longjmp pt-cleanup\ pt-longjmp pt-cleanup\
Index: glibc-2.17-c758a686/nptl/sem_getvalue.c Index: glibc-2.17-c758a686/nptl/sem_getvalue.c
=================================================================== ===================================================================
--- glibc-2.17-c758a686.orig/nptl/sem_getvalue.c --- glibc-2.17-c758a686.orig/nptl/sem_getvalue.c
@ -201,7 +201,7 @@ Index: glibc-2.17-c758a686/nptl/sem_open.c
--- glibc-2.17-c758a686.orig/nptl/sem_open.c --- glibc-2.17-c758a686.orig/nptl/sem_open.c
+++ glibc-2.17-c758a686/nptl/sem_open.c +++ glibc-2.17-c758a686/nptl/sem_open.c
@@ -307,9 +307,14 @@ sem_open (const char *name, int oflag, . @@ -307,9 +307,14 @@ sem_open (const char *name, int oflag, .
struct new_sem newsem; struct new_sem newsem;
} sem; } sem;
- sem.newsem.value = value; - sem.newsem.value = value;
@ -1558,10 +1558,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c
- cur = isem->value; - cur = isem->value;
- if (isem->value == SEM_VALUE_MAX) - if (isem->value == SEM_VALUE_MAX)
+ if ((d & SEM_VALUE_MASK) == SEM_VALUE_MAX) + if ((d & SEM_VALUE_MASK) == SEM_VALUE_MAX)
{ {
__set_errno (EOVERFLOW); __set_errno (EOVERFLOW);
return -1; return -1;
} }
} }
- while (atomic_compare_and_exchange_bool_rel (&isem->value, cur + 1, cur)); - while (atomic_compare_and_exchange_bool_rel (&isem->value, cur + 1, cur));
+ while (!atomic_compare_exchange_weak_release (&isem->data, &d, d + 1)); + while (!atomic_compare_exchange_weak_release (&isem->data, &d, d + 1));
@ -1580,11 +1580,11 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/sem_post.c
- isem->private ^ FUTEX_PRIVATE_FLAG); - isem->private ^ FUTEX_PRIVATE_FLAG);
- if (__builtin_expect (err, 0) < 0) - if (__builtin_expect (err, 0) < 0)
+ if ((v << SEM_VALUE_SHIFT) == SEM_VALUE_MAX) + if ((v << SEM_VALUE_SHIFT) == SEM_VALUE_MAX)
{ {
- __set_errno (-err); - __set_errno (-err);
+ __set_errno (EOVERFLOW); + __set_errno (EOVERFLOW);
return -1; return -1;
} }
} }
+ while (!atomic_compare_exchange_weak_release (&isem->value, + while (!atomic_compare_exchange_weak_release (&isem->value,
+ &v, v + (1 << SEM_VALUE_SHIFT))); + &v, v + (1 << SEM_VALUE_SHIFT)));
@ -3851,7 +3851,7 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -24,8 +24,7 @@ libpthread-sysdep_routines += pt-fork pt @@ -24,8 +24,7 @@ libpthread-sysdep_routines += pt-fork pt
gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \ gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
lowlevelbarrier.sym unwindbuf.sym \ lowlevelbarrier.sym unwindbuf.sym \
- lowlevelrobustlock.sym pthread-pi-defines.sym \ - lowlevelrobustlock.sym pthread-pi-defines.sym \
- structsem.sym - structsem.sym
+ lowlevelrobustlock.sym pthread-pi-defines.sym + lowlevelrobustlock.sym pthread-pi-defines.sym
@ -3875,10 +3875,10 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
__asm __volatile ("syscall" \ __asm __volatile ("syscall" \
- : "=a" (__ignore) \ - : "=a" (__ignore) \
+ : "=a" (__status) \ + : "=a" (__status) \
: "0" (SYS_futex), "D" (futex), \ : "0" (SYS_futex), "D" (futex), \
"S" (__lll_private_flag (FUTEX_WAKE, private)), \ "S" (__lll_private_flag (FUTEX_WAKE, private)), \
"d" (_nr) \ "d" (_nr) \
: "memory", "cc", "r10", "r11", "cx"); \ : "memory", "cc", "r10", "r11", "cx"); \
- } while (0) - } while (0)
+ __status; \ + __status; \
+ }) + })
@ -3900,15 +3900,15 @@ Index: glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h
register __typeof (nr) _nr asm ("edx") = (nr); \ register __typeof (nr) _nr asm ("edx") = (nr); \
LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \ LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
__asm __volatile (LLL_EBX_LOAD \ __asm __volatile (LLL_EBX_LOAD \
LLL_ENTER_KERNEL \ LLL_ENTER_KERNEL \
LLL_EBX_LOAD \ LLL_EBX_LOAD \
- : "=a" (__ignore) \ - : "=a" (__ignore) \
+ : "=a" (__status) \ + : "=a" (__status) \
: "0" (SYS_futex), LLL_EBX_REG (futex), \ : "0" (SYS_futex), LLL_EBX_REG (futex), \
"c" (__lll_private_flag (FUTEX_WAKE, private)), \ "c" (__lll_private_flag (FUTEX_WAKE, private)), \
"d" (_nr), \ "d" (_nr), \
"i" (0) /* phony, to align next arg's number */, \ "i" (0) /* phony, to align next arg's number */, \
"i" (offsetof (tcbhead_t, sysinfo))); \ "i" (offsetof (tcbhead_t, sysinfo))); \
- } while (0) - } while (0)
+ __status; \ + __status; \
+ }) + })

24
SOURCES/glibc-rh1032435.patch

@ -94,7 +94,7 @@ diff -u b/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
+/* Parsing the database file into `struct STRUCTURE' data structures. */ +/* Parsing the database file into `struct STRUCTURE' data structures. */
static enum nss_status static enum nss_status
internal_getent (struct STRUCTURE *result, internal_getent (struct STRUCTURE *result,
char *buffer, size_t buflen, int *errnop H_ERRNO_PROTO char *buffer, size_t buflen, int *errnop H_ERRNO_PROTO
@@ -188,7 +233,7 @@ @@ -188,7 +233,7 @@
{ {
char *p; char *p;
@ -115,26 +115,26 @@ diff -u b/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
- p = fgets_unlocked (data->linebuffer, linebuflen, stream); - p = fgets_unlocked (data->linebuffer, linebuflen, stream);
- if (p == NULL) - if (p == NULL)
+ if (r == gcr_error) + if (r == gcr_error)
{ {
/* End of file or read error. */ /* End of file or read error. */
H_ERRNO_SET (HOST_NOT_FOUND); H_ERRNO_SET (HOST_NOT_FOUND);
return NSS_STATUS_NOTFOUND; return NSS_STATUS_NOTFOUND;
} }
- else if (((unsigned char *) data->linebuffer)[linebuflen - 1] != 0xff) - else if (((unsigned char *) data->linebuffer)[linebuflen - 1] != 0xff)
+ +
+ if (r == gcr_overflow) + if (r == gcr_overflow)
{ {
/* The line is too long. Give the user the opportunity to /* The line is too long. Give the user the opportunity to
enlarge the buffer. */ enlarge the buffer. */
@@ -219,7 +263,8 @@ @@ -219,7 +263,8 @@
return NSS_STATUS_TRYAGAIN; return NSS_STATUS_TRYAGAIN;
} }
- /* Skip leading blanks. */ - /* Skip leading blanks. */
+ /* Everything OK. Now skip leading blanks. */ + /* Everything OK. Now skip leading blanks. */
+ p = data->linebuffer; + p = data->linebuffer;
while (isspace (*p)) while (isspace (*p))
++p; ++p;
} }


diff a/nss/bug17079.c b/nss/bug17079.c diff a/nss/bug17079.c b/nss/bug17079.c

12
SOURCES/glibc-rh1039970.patch

@ -111,14 +111,14 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
@@ -167,6 +190,7 @@ addgetnetgrentX (struct database_dyn *db @@ -167,6 +190,7 @@ addgetnetgrentX (struct database_dyn *db
if (status == NSS_STATUS_SUCCESS) if (status == NSS_STATUS_SUCCESS)
{ {
+ found = true; + found = true;
union union
{ {
enum nss_status (*f) (struct __netgrent *, char *, size_t, enum nss_status (*f) (struct __netgrent *, char *, size_t,
@@ -325,6 +349,15 @@ addgetnetgrentX (struct database_dyn *db @@ -325,6 +349,15 @@ addgetnetgrentX (struct database_dyn *db
} }
} }
+ /* No results. Return a failure and write out a notfound record in the + /* No results. Return a failure and write out a notfound record in the

12
SOURCES/glibc-rh1046199.patch

@ -8,9 +8,9 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
--- glibc-2.17-c758a686/nscd/netgroupcache.c 2013-12-20 04:38:40.432000000 -0500 --- glibc-2.17-c758a686/nscd/netgroupcache.c 2013-12-20 04:38:40.432000000 -0500
+++ glibc-2.17-c758a686/nscd/netgroupcache.c 2013-12-20 04:37:29.945000000 -0500 +++ glibc-2.17-c758a686/nscd/netgroupcache.c 2013-12-20 04:37:29.945000000 -0500
@@ -204,9 +204,10 @@ addgetnetgrentX (struct database_dyn *db @@ -204,9 +204,10 @@ addgetnetgrentX (struct database_dyn *db
int e; int e;
status = getfct.f (&data, buffer + buffilled, status = getfct.f (&data, buffer + buffilled,
buflen - buffilled, &e); buflen - buffilled, &e);
- if (status == NSS_STATUS_RETURN) - if (status == NSS_STATUS_RETURN)
- /* This was the last one for this group. Look - /* This was the last one for this group. Look
- at next group if available. */ - at next group if available. */
@ -18,6 +18,6 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
+ || status == NSS_STATUS_NOTFOUND) + || status == NSS_STATUS_NOTFOUND)
+ /* This was either the last one for this group or the + /* This was either the last one for this group or the
+ group was empty. Look at next group if available. */ + group was empty. Look at next group if available. */
break; break;
if (status == NSS_STATUS_SUCCESS) if (status == NSS_STATUS_SUCCESS)
{ {

2
SOURCES/glibc-rh1047983.patch

@ -290,7 +290,7 @@ index 6db2535..957c9aa 100644
gethostbyaddr() function is an IPv6 address. */ gethostbyaddr() function is an IPv6 address. */
#define EXTRA_ARGS_VALUE \ #define EXTRA_ARGS_VALUE \
@@ -365,6 +115,263 @@ DB_LOOKUP (hostbyaddr, ,,, @@ -365,6 +115,263 @@ DB_LOOKUP (hostbyaddr, ,,,
}, const void *addr, socklen_t len, int af) }, const void *addr, socklen_t len, int af)
#undef EXTRA_ARGS_VALUE #undef EXTRA_ARGS_VALUE
+enum nss_status +enum nss_status

24
SOURCES/glibc-rh1048036.patch

@ -3,18 +3,18 @@ index 87d3cdc..877fc1f 100644
--- glibc-2.17-c758a686/libio/wfileops.c --- glibc-2.17-c758a686/libio/wfileops.c
+++ glibc-2.17-c758a686/libio/wfileops.c +++ glibc-2.17-c758a686/libio/wfileops.c
@@ -715,7 +715,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) @@ -715,7 +715,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
- fp->_wide_data->_IO_write_base) / clen; - fp->_wide_data->_IO_write_base) / clen;
else else
{ {
- enum __codecvt_result status; - enum __codecvt_result status;
+ enum __codecvt_result status = __codecvt_ok; + enum __codecvt_result status = __codecvt_ok;
delta = (fp->_wide_data->_IO_write_ptr delta = (fp->_wide_data->_IO_write_ptr
- fp->_wide_data->_IO_write_base); - fp->_wide_data->_IO_write_base);
const wchar_t *write_base = fp->_wide_data->_IO_write_base; const wchar_t *write_base = fp->_wide_data->_IO_write_base;
@@ -728,9 +728,12 @@ _IO_wfile_seekoff (fp, offset, dir, mode) @@ -728,9 +728,12 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
flush buffers for every ftell. */ flush buffers for every ftell. */
do do
{ {
- /* Ugh, no point trying to avoid the flush. Just do it - /* Ugh, no point trying to avoid the flush. Just do it
- and go back to how it was with the read mode. */ - and go back to how it was with the read mode. */
- if (delta > 0 && new_write_ptr == fp->_IO_buf_end) - if (delta > 0 && new_write_ptr == fp->_IO_buf_end)
@ -24,6 +24,6 @@ index 87d3cdc..877fc1f 100644
+ the read mode. */ + the read mode. */
+ if (status == __codecvt_partial + if (status == __codecvt_partial
+ || (delta > 0 && new_write_ptr == fp->_IO_buf_end)) + || (delta > 0 && new_write_ptr == fp->_IO_buf_end))
{ {
if (_IO_switch_to_wget_mode (fp)) if (_IO_switch_to_wget_mode (fp))
return WEOF; return WEOF;

108
SOURCES/glibc-rh1048123.patch

@ -36,26 +36,26 @@ index f463f45..180ae77 100644
--- glibc-2.17-c758a686/nscd/connections.c --- glibc-2.17-c758a686/nscd/connections.c
+++ glibc-2.17-c758a686/nscd/connections.c +++ glibc-2.17-c758a686/nscd/connections.c
@@ -649,8 +649,8 @@ cannot create read-only descriptor for \"%s\"; no mmap"), @@ -649,8 +649,8 @@ cannot create read-only descriptor for \"%s\"; no mmap"),
close (fd); close (fd);
} }
else if (errno == EACCES) else if (errno == EACCES)
- error (EXIT_FAILURE, 0, _("cannot access '%s'"), - error (EXIT_FAILURE, 0, _("cannot access '%s'"),
- dbs[cnt].db_filename); - dbs[cnt].db_filename);
+ do_exit (EXIT_FAILURE, 0, _("cannot access '%s'"), + do_exit (EXIT_FAILURE, 0, _("cannot access '%s'"),
+ dbs[cnt].db_filename); + dbs[cnt].db_filename);
} }
if (dbs[cnt].head == NULL) if (dbs[cnt].head == NULL)
@@ -699,8 +699,7 @@ cannot create read-only descriptor for \"%s\"; no mmap"), @@ -699,8 +699,7 @@ cannot create read-only descriptor for \"%s\"; no mmap"),
{ {
dbg_log (_("database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"), dbg_log (_("database for %s corrupted or simultaneously used; remove %s manually if necessary and restart"),
dbnames[cnt], dbs[cnt].db_filename); dbnames[cnt], dbs[cnt].db_filename);
- // XXX Correct way to terminate? - // XXX Correct way to terminate?
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
if (dbs[cnt].persistent) if (dbs[cnt].persistent)
@@ -867,7 +866,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), @@ -867,7 +866,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"),
if (sock < 0) if (sock < 0)
{ {
@ -75,78 +75,78 @@ index f463f45..180ae77 100644
#ifndef __ASSUME_SOCK_CLOEXEC #ifndef __ASSUME_SOCK_CLOEXEC
@@ -888,7 +887,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), @@ -888,7 +887,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"),
{ {
dbg_log (_("cannot change socket to nonblocking mode: %s"), dbg_log (_("cannot change socket to nonblocking mode: %s"),
strerror (errno)); strerror (errno));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
/* The descriptor needs to be closed on exec. */ /* The descriptor needs to be closed on exec. */
@@ -896,7 +895,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), @@ -896,7 +895,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"),
{ {
dbg_log (_("cannot set socket to close on exec: %s"), dbg_log (_("cannot set socket to close on exec: %s"),
strerror (errno)); strerror (errno));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
} }
#endif #endif
@@ -909,7 +908,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), @@ -909,7 +908,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"),
{ {
dbg_log (_("cannot enable socket to accept connections: %s"), dbg_log (_("cannot enable socket to accept connections: %s"),
strerror (errno)); strerror (errno));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
#ifdef HAVE_NETLINK #ifdef HAVE_NETLINK
@@ -953,7 +952,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"), @@ -953,7 +952,7 @@ cannot set socket to close on exec: %s; disabling paranoia mode"),
dbg_log (_("\ dbg_log (_("\
cannot change socket to nonblocking mode: %s"), cannot change socket to nonblocking mode: %s"),
strerror (errno)); strerror (errno));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
/* The descriptor needs to be closed on exec. */ /* The descriptor needs to be closed on exec. */
@@ -962,7 +961,7 @@ cannot change socket to nonblocking mode: %s"), @@ -962,7 +961,7 @@ cannot change socket to nonblocking mode: %s"),
{ {
dbg_log (_("cannot set socket to close on exec: %s"), dbg_log (_("cannot set socket to close on exec: %s"),
strerror (errno)); strerror (errno));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
} }
# endif # endif
@@ -2392,7 +2391,7 @@ start_threads (void) @@ -2392,7 +2391,7 @@ start_threads (void)
if (pthread_cond_init (&dbs[i].prune_cond, &condattr) != 0) if (pthread_cond_init (&dbs[i].prune_cond, &condattr) != 0)
{ {
dbg_log (_("could not initialize conditional variable")); dbg_log (_("could not initialize conditional variable"));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
pthread_t th; pthread_t th;
@@ -2400,7 +2399,7 @@ start_threads (void) @@ -2400,7 +2399,7 @@ start_threads (void)
&& pthread_create (&th, &attr, nscd_run_prune, (void *) i) != 0) && pthread_create (&th, &attr, nscd_run_prune, (void *) i) != 0)
{ {
dbg_log (_("could not start clean-up thread; terminating")); dbg_log (_("could not start clean-up thread; terminating"));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
} }
@@ -2414,13 +2413,17 @@ start_threads (void) @@ -2414,13 +2413,17 @@ start_threads (void)
if (i == 0) if (i == 0)
{ {
dbg_log (_("could not start any worker thread; terminating")); dbg_log (_("could not start any worker thread; terminating"));
- exit (1); - exit (1);
+ do_exit (1, 0, NULL); + do_exit (1, 0, NULL);
} }
break; break;
} }
} }
+ /* Now it is safe to let the parent know that we're doing fine and it can + /* Now it is safe to let the parent know that we're doing fine and it can
@ -247,17 +247,17 @@ index 63d9d83..5680378 100644
@@ -196,11 +200,27 @@ main (int argc, char **argv) @@ -196,11 +200,27 @@ main (int argc, char **argv)
/* Behave like a daemon. */ /* Behave like a daemon. */
if (run_mode == RUN_DAEMONIZE) if (run_mode == RUN_DAEMONIZE)
{ {
+ int fd[2]; + int fd[2];
+ +
+ if (pipe (fd) != 0) + if (pipe (fd) != 0)
+ error (EXIT_FAILURE, errno, + error (EXIT_FAILURE, errno,
+ _("cannot create a pipe to talk to the child")); + _("cannot create a pipe to talk to the child"));
+ +
pid = fork (); pid = fork ();
if (pid == -1) if (pid == -1)
error (EXIT_FAILURE, errno, _("cannot fork")); error (EXIT_FAILURE, errno, _("cannot fork"));
if (pid != 0) if (pid != 0)
- exit (0); - exit (0);
+ { + {
+ /* The parent only reads from the child. */ + /* The parent only reads from the child. */
@ -270,23 +270,23 @@ index 63d9d83..5680378 100644
+ close (fd[0]); + close (fd[0]);
+ parent_fd = fd[1]; + parent_fd = fd[1];
+ } + }
} }
int nullfd = open (_PATH_DEVNULL, O_RDWR); int nullfd = open (_PATH_DEVNULL, O_RDWR);
@@ -242,7 +262,8 @@ main (int argc, char **argv) @@ -242,7 +262,8 @@ main (int argc, char **argv)
char *endp; char *endp;
long int fdn = strtol (dirent->d_name, &endp, 10); long int fdn = strtol (dirent->d_name, &endp, 10);
- if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd) - if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd)
+ if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd + if (*endp == '\0' && fdn != dfdn && fdn >= min_close_fd
+ && fdn != parent_fd) + && fdn != parent_fd)
close ((int) fdn); close ((int) fdn);
} }
@@ -250,22 +271,14 @@ main (int argc, char **argv) @@ -250,22 +271,14 @@ main (int argc, char **argv)
} }
else else
for (i = min_close_fd; i < getdtablesize (); i++) for (i = min_close_fd; i < getdtablesize (); i++)
- close (i); - close (i);
+ if (i != parent_fd) + if (i != parent_fd)
+ close (i); + close (i);
@ -417,7 +417,7 @@ index e477254..46b0ea9 100644
} }
@@ -194,7 +194,7 @@ preserve_capabilities (void) @@ -194,7 +194,7 @@ preserve_capabilities (void)
cap_free (tmp_caps); cap_free (tmp_caps);
dbg_log (_("Failed to initialize drop of capabilities")); dbg_log (_("Failed to initialize drop of capabilities"));
- error (EXIT_FAILURE, 0, _("cap_init failed")); - error (EXIT_FAILURE, 0, _("cap_init failed"));

36
SOURCES/glibc-rh1063681.patch

@ -3,9 +3,9 @@ index 22dbcae..488ee51 100644
--- glibc-2.17-c758a686/libio/Makefile --- glibc-2.17-c758a686/libio/Makefile
+++ glibc-2.17-c758a686/libio/Makefile +++ glibc-2.17-c758a686/libio/Makefile
@@ -60,7 +60,7 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ @@ -60,7 +60,7 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
tst-wmemstream1 tst-wmemstream2 \ tst-wmemstream1 tst-wmemstream2 \
bug-memstream1 bug-wmemstream1 \ bug-memstream1 bug-wmemstream1 \
tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
- tst-fwrite-error - tst-fwrite-error
+ tst-fwrite-error tst-ftell-active-handler + tst-fwrite-error tst-ftell-active-handler
ifeq (yes,$(build-shared)) ifeq (yes,$(build-shared))
@ -125,7 +125,7 @@ index a3499be..2e7bc8d 100644
int must_be_exact = (fp->_IO_read_base == fp->_IO_read_end int must_be_exact = (fp->_IO_read_base == fp->_IO_read_end
@@ -948,9 +1042,6 @@ _IO_new_file_seekoff (fp, offset, dir, mode) @@ -948,9 +1042,6 @@ _IO_new_file_seekoff (fp, offset, dir, mode)
bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base
|| _IO_in_put_mode (fp)); || _IO_in_put_mode (fp));
- if (mode == 0) - if (mode == 0)
- dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */ - dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */
@ -199,7 +199,7 @@ index 066ff19..3f266f7 100644
- call _IO_file_attach or else it will allocate a buffer immediately. */ - call _IO_file_attach or else it will allocate a buffer immediately. */
_IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, _IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd,
#ifdef _G_HAVE_MMAP #ifdef _G_HAVE_MMAP
(use_mmap && (read_write & _IO_NO_WRITES)) (use_mmap && (read_write & _IO_NO_WRITES))
@@ -159,13 +156,12 @@ _IO_new_fdopen (fd, mode) @@ -159,13 +156,12 @@ _IO_new_fdopen (fd, mode)
#if !_IO_UNIFIED_JUMPTABLES #if !_IO_UNIFIED_JUMPTABLES
new_f->fp.vtable = NULL; new_f->fp.vtable = NULL;
@ -687,11 +687,11 @@ index 9cebe77..8b2e108 100644
+ || _IO_in_put_mode (fp)); + || _IO_in_put_mode (fp));
+ +
/* XXX For wide stream with backup store it is not very /* XXX For wide stream with backup store it is not very
reasonable to determine the offset. The pushed-back reasonable to determine the offset. The pushed-back
character might require a state change and we need not be character might require a state change and we need not be
@@ -633,14 +629,142 @@ _IO_wfile_seekoff (fp, offset, dir, mode) @@ -633,14 +629,142 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
return -1; return -1;
} }
- /* There is no more data in the backup buffer. We can - /* There is no more data in the backup buffer. We can
- switch back. */ - switch back. */
@ -769,7 +769,7 @@ index 9cebe77..8b2e108 100644
+ /* _IO_read_end coincides with fp._offset, so the actual file + /* _IO_read_end coincides with fp._offset, so the actual file
+ position is fp._offset - (_IO_read_end - new_write_ptr). */ + position is fp._offset - (_IO_read_end - new_write_ptr). */
+ offset -= fp->_IO_read_end - fp->_IO_write_ptr; + offset -= fp->_IO_read_end - fp->_IO_write_ptr;
} }
- dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */ - dir = _IO_seek_cur, offset = 0; /* Don't move any pointers. */
+ /* It is safe to use the cached offset when available if there is + /* It is safe to use the cached offset when available if there is
@ -846,17 +846,17 @@ index 9cebe77..8b2e108 100644
if (fp->_wide_data->_IO_buf_base == NULL) if (fp->_wide_data->_IO_buf_base == NULL)
@@ -693,7 +817,6 @@ _IO_wfile_seekoff (fp, offset, dir, mode) @@ -693,7 +817,6 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
{ {
int nread; int nread;
- flushed: - flushed:
delta = (fp->_wide_data->_IO_read_ptr delta = (fp->_wide_data->_IO_read_ptr
- fp->_wide_data->_IO_read_base); - fp->_wide_data->_IO_read_base);
fp->_wide_data->_IO_state = fp->_wide_data->_IO_last_state; fp->_wide_data->_IO_state = fp->_wide_data->_IO_last_state;
@@ -706,80 +829,9 @@ _IO_wfile_seekoff (fp, offset, dir, mode) @@ -706,80 +829,9 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
offset -= fp->_IO_read_end - fp->_IO_read_base - nread; offset -= fp->_IO_read_end - fp->_IO_read_base - nread;
} }
} }
- else - else
- { - {
- char *new_write_ptr = fp->_IO_write_ptr; - char *new_write_ptr = fp->_IO_write_ptr;

2
SOURCES/glibc-rh1064063.patch

@ -21,7 +21,7 @@ Date: Mon Jan 11 17:24:04 2016 -0500


2016-01-15 Martin Sebor <msebor@redhat.com> 2016-01-15 Martin Sebor <msebor@redhat.com>
[BZ #19432] [BZ #19432]
diff --git a/rt/tst-mqueue5.c b/rt/tst-mqueue5.c diff --git a/rt/tst-mqueue5.c b/rt/tst-mqueue5.c
index aa74fa3..25042bc 100644 index aa74fa3..25042bc 100644
--- a/rt/tst-mqueue5.c --- a/rt/tst-mqueue5.c

10
SOURCES/glibc-rh1064066.patch

@ -8,8 +8,8 @@
+/* Attributes work around suspected gcc 4.8 bug #1209619. */ +/* Attributes work around suspected gcc 4.8 bug #1209619. */
+static void __attribute__ ((noclone, noinline)) +static void __attribute__ ((noclone, noinline))
check_float_internal (const char *test_name, FLOAT computed, FLOAT expected, check_float_internal (const char *test_name, FLOAT computed, FLOAT expected,
FLOAT max_ulp, int xfail, int exceptions, FLOAT max_ulp, int xfail, int exceptions,
FLOAT *curr_max_error) FLOAT *curr_max_error)
@@ -610,7 +611,8 @@ @@ -610,7 +611,8 @@
} }
@ -18,7 +18,7 @@
+/* Attributes work around suspected gcc 4.8 bug #1209619. */ +/* Attributes work around suspected gcc 4.8 bug #1209619. */
+static void __attribute__ ((noclone, noinline)) +static void __attribute__ ((noclone, noinline))
check_float (const char *test_name, FLOAT computed, FLOAT expected, check_float (const char *test_name, FLOAT computed, FLOAT expected,
FLOAT max_ulp, int xfail, int exceptions) FLOAT max_ulp, int xfail, int exceptions)
{ {
@@ -619,7 +621,8 @@ @@ -619,7 +621,8 @@
} }
@ -28,5 +28,5 @@
+/* Attributes work around suspected gcc 4.8 bug #1209619. */ +/* Attributes work around suspected gcc 4.8 bug #1209619. */
+static void __attribute__ ((noclone, noinline)) +static void __attribute__ ((noclone, noinline))
check_complex (const char *test_name, __complex__ FLOAT computed, check_complex (const char *test_name, __complex__ FLOAT computed,
__complex__ FLOAT expected, __complex__ FLOAT expected,
__complex__ FLOAT max_ulp, __complex__ int xfail, __complex__ FLOAT max_ulp, __complex__ int xfail,

1
SOURCES/glibc-rh1064945.patch

@ -75,3 +75,4 @@ index 089d0b6..023bc02 100644
+#endif +#endif
#else #else

10
SOURCES/glibc-rh1073667.patch

@ -9,9 +9,9 @@ index cff81c7..10e0709 100644
--- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S --- glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
+++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S +++ glibc-2.17-c758a686/ports/sysdeps/aarch64/setjmp.S
@@ -44,8 +44,14 @@ ENTRY (__sigsetjmp) @@ -44,8 +44,14 @@ ENTRY (__sigsetjmp)
stp d10, d11, [x0, #JB_D10<<3] stp d10, d11, [x0, #JB_D10<<3]
stp d12, d13, [x0, #JB_D12<<3] stp d12, d13, [x0, #JB_D12<<3]
stp d14, d15, [x0, #JB_D14<<3] stp d14, d15, [x0, #JB_D14<<3]
- mov x1, sp - mov x1, sp
- str x1, [x0, #JB_SP<<3] - str x1, [x0, #JB_SP<<3]
+ mov x2, sp + mov x2, sp
@ -21,7 +21,7 @@ index cff81c7..10e0709 100644
+ mov w0, #0 + mov w0, #0
+ RET + RET
+#else +#else
b C_SYMBOL_NAME(__sigjmp_save) b C_SYMBOL_NAME(__sigjmp_save)
+#endif +#endif
END (__sigsetjmp) END (__sigsetjmp)
hidden_def (__sigsetjmp) hidden_def (__sigsetjmp)
@ -31,7 +31,7 @@ index 6124333..913359c 100644
+++ glibc-2.17-c758a686/setjmp/Makefile +++ glibc-2.17-c758a686/setjmp/Makefile
@@ -25,7 +25,8 @@ headers := setjmp.h bits/setjmp.h bits/setjmp2.h @@ -25,7 +25,8 @@ headers := setjmp.h bits/setjmp.h bits/setjmp2.h
routines := setjmp sigjmp bsd-setjmp bsd-_setjmp \ routines := setjmp sigjmp bsd-setjmp bsd-_setjmp \
longjmp __longjmp jmp-unwind longjmp __longjmp jmp-unwind
-tests := tst-setjmp jmpbug bug269-setjmp -tests := tst-setjmp jmpbug bug269-setjmp
+tests := tst-setjmp jmpbug bug269-setjmp \ +tests := tst-setjmp jmpbug bug269-setjmp \

17
SOURCES/glibc-rh1074410-2.patch

@ -19,9 +19,9 @@ index 69c25c0..4bedfad 100644
--- glibc-2.17-c758a686/libio/Makefile --- glibc-2.17-c758a686/libio/Makefile
+++ glibc-2.17-c758a686/libio/Makefile +++ glibc-2.17-c758a686/libio/Makefile
@@ -60,7 +60,8 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \ @@ -60,7 +60,8 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc \
tst-wmemstream1 tst-wmemstream2 \ tst-wmemstream1 tst-wmemstream2 \
bug-memstream1 bug-wmemstream1 \ bug-memstream1 bug-wmemstream1 \
tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \ tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
- tst-fwrite-error tst-ftell-active-handler - tst-fwrite-error tst-ftell-active-handler
+ tst-fwrite-error tst-ftell-active-handler \ + tst-fwrite-error tst-ftell-active-handler \
+ tst-ftell-append + tst-ftell-append
@ -46,7 +46,7 @@ index cf68dbf..204cfea 100644
@@ -966,6 +968,14 @@ do_ftell (_IO_FILE *fp) @@ -966,6 +968,14 @@ do_ftell (_IO_FILE *fp)
/* Adjust for unflushed data. */ /* Adjust for unflushed data. */
if (!was_writing) if (!was_writing)
offset -= fp->_IO_read_end - fp->_IO_read_ptr; offset -= fp->_IO_read_end - fp->_IO_read_ptr;
+ /* We don't trust _IO_read_end to represent the current file offset when + /* We don't trust _IO_read_end to represent the current file offset when
+ writing in append mode because the value would have to be shifted to + writing in append mode because the value would have to be shifted to
+ the end of the file during a flush. Use the write base instead, along + the end of the file during a flush. Use the write base instead, along
@ -56,7 +56,7 @@ index cf68dbf..204cfea 100644
+ offset += fp->_IO_write_ptr - fp->_IO_write_base; + offset += fp->_IO_write_ptr - fp->_IO_write_base;
+ /* For all other modes, _IO_read_end represents the file offset. */ + /* For all other modes, _IO_read_end represents the file offset. */
else else
offset += fp->_IO_write_ptr - fp->_IO_read_end; offset += fp->_IO_write_ptr - fp->_IO_read_end;
} }
diff --git glibc-2.17-c758a686/libio/tst-ftell-append.c glibc-2.17-c758a686/libio/tst-ftell-append.c diff --git glibc-2.17-c758a686/libio/tst-ftell-append.c glibc-2.17-c758a686/libio/tst-ftell-append.c
new file mode 100644 new file mode 100644
@ -238,8 +238,8 @@ index 3199861..f123add 100644
--- glibc-2.17-c758a686/libio/wfileops.c --- glibc-2.17-c758a686/libio/wfileops.c
+++ glibc-2.17-c758a686/libio/wfileops.c +++ glibc-2.17-c758a686/libio/wfileops.c
@@ -713,9 +713,16 @@ do_ftell_wide (_IO_FILE *fp) @@ -713,9 +713,16 @@ do_ftell_wide (_IO_FILE *fp)
offset += outstop - out; offset += outstop - out;
} }
- /* _IO_read_end coincides with fp._offset, so the actual file - /* _IO_read_end coincides with fp._offset, so the actual file
- position is fp._offset - (_IO_read_end - new_write_ptr). */ - position is fp._offset - (_IO_read_end - new_write_ptr). */
@ -254,5 +254,6 @@ index 3199861..f123add 100644
+ /* For all other modes, _IO_read_end represents the file offset. */ + /* For all other modes, _IO_read_end represents the file offset. */
+ else + else
+ offset += fp->_IO_write_ptr - fp->_IO_read_end; + offset += fp->_IO_write_ptr - fp->_IO_read_end;
} }
} }

107
SOURCES/glibc-rh1074410.patch

@ -73,10 +73,10 @@ Date: Mon Mar 10 16:20:01 2014 +0530
This is now fixed by making sure that the ret variable is used only This is now fixed by making sure that the ret variable is used only
for recording test failures. for recording test failures.
* libio/tst-ftell-active-handler.c (do_ftell_test): Don't mix * libio/tst-ftell-active-handler.c (do_ftell_test): Don't mix
up test status with function return status. up test status with function return status.
(do_write_test): Likewise. (do_write_test): Likewise.
(do_append_test): Likewise. (do_append_test): Likewise.
diff --git glibc-2.17-c758a686/libio/fileops.c glibc-2.17-c758a686/libio/fileops.c diff --git glibc-2.17-c758a686/libio/fileops.c glibc-2.17-c758a686/libio/fileops.c
index 2e7bc8d..cf68dbf 100644 index 2e7bc8d..cf68dbf 100644
--- glibc-2.17-c758a686/libio/fileops.c --- glibc-2.17-c758a686/libio/fileops.c
@ -157,7 +157,7 @@ index 2e7bc8d..cf68dbf 100644
yet. */ yet. */
@@ -974,39 +949,37 @@ do_ftell (_IO_FILE *fp) @@ -974,39 +949,37 @@ do_ftell (_IO_FILE *fp)
bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base bool was_writing = (fp->_IO_write_ptr > fp->_IO_write_base
|| _IO_in_put_mode (fp)); || _IO_in_put_mode (fp));
+ bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING; + bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING;
+ +
@ -250,7 +250,7 @@ index 3f266f7..b36d21d 100644
#endif #endif
@@ -167,6 +173,16 @@ _IO_new_fdopen (fd, mode) @@ -167,6 +173,16 @@ _IO_new_fdopen (fd, mode)
_IO_mask_flags (&new_f->fp.file, read_write, _IO_mask_flags (&new_f->fp.file, read_write,
_IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING); _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
+ /* For append mode, set the file offset to the end of the file if we added + /* For append mode, set the file offset to the end of the file if we added
+ O_APPEND to the file descriptor flags. Don't update the offset cache + O_APPEND to the file descriptor flags. Don't update the offset cache
@ -378,38 +378,38 @@ index 54bfe63..e9dc7b3 100644
active. */ active. */
static int static int
@@ -107,11 +208,13 @@ do_ftell_test (const char *filename) @@ -107,11 +208,13 @@ do_ftell_test (const char *filename)
{"w", O_WRONLY, 0, data_len}, {"w", O_WRONLY, 0, data_len},
{"w+", O_RDWR, 0, data_len}, {"w+", O_RDWR, 0, data_len},
{"r+", O_RDWR, 0, data_len}, {"r+", O_RDWR, 0, data_len},
- /* For 'a' and 'a+' modes, the initial file position should be the - /* For 'a' and 'a+' modes, the initial file position should be the
+ /* For the 'a' mode, the initial file position should be the + /* For the 'a' mode, the initial file position should be the
current end of file. After the write, the offset has data_len current end of file. After the write, the offset has data_len
- added to the old value. */ - added to the old value. */
+ added to the old value. For a+ mode however, the initial file + added to the old value. For a+ mode however, the initial file
+ position is the file position of the underlying file descriptor, + position is the file position of the underlying file descriptor,
+ since it is initially assumed to be in read mode. */ + since it is initially assumed to be in read mode. */
{"a", O_WRONLY, data_len, 2 * data_len}, {"a", O_WRONLY, data_len, 2 * data_len},
- {"a+", O_RDWR, 2 * data_len, 3 * data_len}, - {"a+", O_RDWR, 2 * data_len, 3 * data_len},
+ {"a+", O_RDWR, 0, 3 * data_len}, + {"a+", O_RDWR, 0, 3 * data_len},
}; };
for (int j = 0; j < 2; j++) for (int j = 0; j < 2; j++)
{ {
@@ -119,17 +222,20 @@ do_ftell_test (const char *filename) @@ -119,17 +222,20 @@ do_ftell_test (const char *filename)
{ {
FILE *fp; FILE *fp;
int fd; int fd;
+ int fileret; + int fileret;
+ +
printf ("\tftell: %s (file, \"%s\"): ", j == 0 ? "fdopen" : "fopen", printf ("\tftell: %s (file, \"%s\"): ", j == 0 ? "fdopen" : "fopen",
test_modes[i].mode); test_modes[i].mode);
if (j == 0) if (j == 0)
- ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode, - ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode,
- test_modes[i].mode); - test_modes[i].mode);
+ fileret = get_handles_fdopen (filename, fd, fp, + fileret = get_handles_fdopen (filename, fd, fp,
+ test_modes[i].fd_mode, + test_modes[i].fd_mode,
+ test_modes[i].mode); + test_modes[i].mode);
else else
- ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); - ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode);
+ fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); + fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode);
@ -418,12 +418,12 @@ index 54bfe63..e9dc7b3 100644
+ if (fileret != 0) + if (fileret != 0)
+ return fileret; + return fileret;
long off = ftell (fp); long off = ftell (fp);
if (off != test_modes[i].old_off) if (off != test_modes[i].old_off)
@@ -143,13 +249,18 @@ do_ftell_test (const char *filename) @@ -143,13 +249,18 @@ do_ftell_test (const char *filename)
/* The effect of this write on the offset should be seen in the ftell /* The effect of this write on the offset should be seen in the ftell
call that follows it. */ call that follows it. */
- int ret = write (fd, data, data_len); - int ret = write (fd, data, data_len);
+ int write_ret = write (fd, data, data_len); + int write_ret = write (fd, data, data_len);
+ if (write_ret != data_len) + if (write_ret != data_len)
@ -431,28 +431,28 @@ index 54bfe63..e9dc7b3 100644
+ printf ("write failed (%m)\n"); + printf ("write failed (%m)\n");
+ ret |= 1; + ret |= 1;
+ } + }
off = ftell (fp); off = ftell (fp);
if (off != test_modes[i].new_off) if (off != test_modes[i].new_off)
{ {
printf ("Incorrect new offset. Expected %zu but got %ld\n", printf ("Incorrect new offset. Expected %zu but got %ld\n",
- test_modes[i].old_off, off); - test_modes[i].old_off, off);
+ test_modes[i].new_off, off); + test_modes[i].new_off, off);
ret |= 1; ret |= 1;
} }
else else
@@ -184,21 +295,23 @@ do_write_test (const char *filename) @@ -184,21 +295,23 @@ do_write_test (const char *filename)
{ {
for (int i = 0; i < sizeof (test_modes) / sizeof (struct test); i++) for (int i = 0; i < sizeof (test_modes) / sizeof (struct test); i++)
{ {
+ int fileret; + int fileret;
printf ("\twrite: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen", printf ("\twrite: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen",
test_modes[i].mode); test_modes[i].mode);
if (j == 0) if (j == 0)
- ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); - ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode);
+ fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); + fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode);
else else
- ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode, - ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode,
- test_modes[i].mode); - test_modes[i].mode);
+ fileret = get_handles_fdopen (filename, fd, fp, + fileret = get_handles_fdopen (filename, fd, fp,
@ -464,27 +464,27 @@ index 54bfe63..e9dc7b3 100644
+ if (fileret != 0) + if (fileret != 0)
+ return fileret; + return fileret;
/* Move offset to just before the end of the file. */ /* Move offset to just before the end of the file. */
- off_t ret = lseek (fd, file_len - 1, SEEK_SET); - off_t ret = lseek (fd, file_len - 1, SEEK_SET);
- if (ret == -1) - if (ret == -1)
+ off_t seek_ret = lseek (fd, file_len - 1, SEEK_SET); + off_t seek_ret = lseek (fd, file_len - 1, SEEK_SET);
+ if (seek_ret == -1) + if (seek_ret == -1)
{ {
printf ("lseek failed: %m\n"); printf ("lseek failed: %m\n");
ret |= 1; ret |= 1;
@@ -258,17 +371,20 @@ do_append_test (const char *filename) @@ -258,17 +371,20 @@ do_append_test (const char *filename)
{ {
for (int i = 0; i < sizeof (test_modes) / sizeof (struct test); i++) for (int i = 0; i < sizeof (test_modes) / sizeof (struct test); i++)
{ {
+ int fileret; + int fileret;
+ +
printf ("\tappend: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen", printf ("\tappend: %s (file, \"%s\"): ", j == 0 ? "fopen" : "fdopen",
test_modes[i].mode); test_modes[i].mode);
if (j == 0) if (j == 0)
- ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); - ret = get_handles_fopen (filename, fd, fp, test_modes[i].mode);
+ fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode); + fileret = get_handles_fopen (filename, fd, fp, test_modes[i].mode);
else else
- ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode, - ret = get_handles_fdopen (filename, fd, fp, test_modes[i].fd_mode,
- test_modes[i].mode); - test_modes[i].mode);
+ fileret = get_handles_fdopen (filename, fd, fp, + fileret = get_handles_fdopen (filename, fd, fp,
@ -496,10 +496,10 @@ index 54bfe63..e9dc7b3 100644
+ if (fileret != 0) + if (fileret != 0)
+ return fileret; + return fileret;
/* Write some data. */ /* Write some data. */
size_t written = fputs_func (data, fp); size_t written = fputs_func (data, fp);
@@ -298,6 +414,61 @@ do_append_test (const char *filename) @@ -298,6 +414,61 @@ do_append_test (const char *filename)
} }
} }
+ /* For fdopen in 'a' mode, the file descriptor should not change if the file + /* For fdopen in 'a' mode, the file descriptor should not change if the file
@ -588,8 +588,8 @@ index 8b2e108..3199861 100644
/* No point looking for offsets in the buffer if it hasn't even been /* No point looking for offsets in the buffer if it hasn't even been
allocated. */ allocated. */
@@ -615,6 +615,20 @@ do_ftell_wide (_IO_FILE *fp) @@ -615,6 +615,20 @@ do_ftell_wide (_IO_FILE *fp)
> fp->_wide_data->_IO_write_base) > fp->_wide_data->_IO_write_base)
|| _IO_in_put_mode (fp)); || _IO_in_put_mode (fp));
+ bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING; + bool append_mode = (fp->_flags & _IO_IS_APPENDING) == _IO_IS_APPENDING;
+ +
@ -606,12 +606,12 @@ index 8b2e108..3199861 100644
+ } + }
+ +
/* XXX For wide stream with backup store it is not very /* XXX For wide stream with backup store it is not very
reasonable to determine the offset. The pushed-back reasonable to determine the offset. The pushed-back
character might require a state change and we need not be character might require a state change and we need not be
@@ -703,37 +717,24 @@ do_ftell_wide (_IO_FILE *fp) @@ -703,37 +717,24 @@ do_ftell_wide (_IO_FILE *fp)
position is fp._offset - (_IO_read_end - new_write_ptr). */ position is fp._offset - (_IO_read_end - new_write_ptr). */
offset -= fp->_IO_read_end - fp->_IO_write_ptr; offset -= fp->_IO_read_end - fp->_IO_write_ptr;
} }
- -
- /* It is safe to use the cached offset when available if there is - /* It is safe to use the cached offset when available if there is
- unbuffered data (indicating that the file handle is active) and - unbuffered data (indicating that the file handle is active) and
@ -653,3 +653,4 @@ index 8b2e108..3199861 100644
+ +
return result; return result;
} }

1
SOURCES/glibc-rh1077389-p1.patch

@ -75,3 +75,4 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-
+# include <dl-machine.h> +# include <dl-machine.h>
void *time_ifunc (void) asm ("time"); void *time_ifunc (void) asm ("time");

1
SOURCES/glibc-rh1077389-p2.patch

@ -50,3 +50,4 @@ diff -urN glibc-2.17-c758a686/sysdeps/unix/sysv/linux/powerpc/time.c glibc-2.17-
+ : (void*)time_syscall); + : (void*)time_syscall);
} }
asm (".type time, %gnu_indirect_function"); asm (".type time, %gnu_indirect_function");

22
SOURCES/glibc-rh1078225.patch

@ -17,27 +17,27 @@ Index: glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
--- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S --- glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
+++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S +++ glibc-2.17-c758a686/ports/sysdeps/unix/sysv/linux/aarch64/clone.S
@@ -63,6 +63,7 @@ ENTRY(__clone) @@ -63,6 +63,7 @@ ENTRY(__clone)
mov x8, #SYS_ify(clone) mov x8, #SYS_ify(clone)
/* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */ /* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid. */
svc 0x0 svc 0x0
+ cfi_endproc + cfi_endproc
cmp x0, #0 cmp x0, #0
beq 2f beq 2f
blt C_SYMBOL_NAME(__syscall_error) blt C_SYMBOL_NAME(__syscall_error)
@@ -71,6 +72,9 @@ ENTRY(__clone) @@ -71,6 +72,9 @@ ENTRY(__clone)
b syscall_error b syscall_error
2: 2:
+ cfi_startproc + cfi_startproc
+ cfi_undefined (x30) + cfi_undefined (x30)
+ mov x29, 0 + mov x29, 0
#ifdef RESET_PID #ifdef RESET_PID
tbnz x5, #CLONE_THREAD_BIT, 3f tbnz x5, #CLONE_THREAD_BIT, 3f
mov x0, #-1 mov x0, #-1
@@ -92,7 +96,8 @@ ENTRY(__clone) @@ -92,7 +96,8 @@ ENTRY(__clone)
/* We are done, pass the return value through x0. */ /* We are done, pass the return value through x0. */
b HIDDEN_JUMPTARGET(_exit) b HIDDEN_JUMPTARGET(_exit)
- -
+ cfi_endproc + cfi_endproc
+ cfi_startproc + cfi_startproc

24
SOURCES/glibc-rh1080766.patch

@ -24,34 +24,34 @@ Date: Thu Mar 27 07:15:22 2014 +0530
fix adds this additional check for all three parts of the triplet so fix adds this additional check for all three parts of the triplet so
that it gives the correct result. that it gives the correct result.
[BZ #16758] [BZ #16758]
* nscd/netgroupcache.c (addinnetgrX): Succeed if triplet has * nscd/netgroupcache.c (addinnetgrX): Succeed if triplet has
blank values. blank values.


diff --git glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c diff --git glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/netgroupcache.c
index 5ba1e1f..5d15aa4 100644 index 5ba1e1f..5d15aa4 100644
--- glibc-2.17-c758a686/nscd/netgroupcache.c --- glibc-2.17-c758a686/nscd/netgroupcache.c
+++ glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c
@@ -560,15 +560,19 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req, @@ -560,15 +560,19 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req,
{ {
bool success = true; bool success = true;
- if (host != NULL) - if (host != NULL)
+ /* For the host, user and domain in each triplet, we assume success + /* For the host, user and domain in each triplet, we assume success
+ if the value is blank because that is how the wildcard entry to + if the value is blank because that is how the wildcard entry to
+ match anything is stored in the netgroup cache. */ + match anything is stored in the netgroup cache. */
+ if (host != NULL && *triplets != '\0') + if (host != NULL && *triplets != '\0')
success = strcmp (host, triplets) == 0; success = strcmp (host, triplets) == 0;
triplets = (const char *) rawmemchr (triplets, '\0') + 1; triplets = (const char *) rawmemchr (triplets, '\0') + 1;
- if (success && user != NULL) - if (success && user != NULL)
+ if (success && user != NULL && *triplets != '\0') + if (success && user != NULL && *triplets != '\0')
success = strcmp (user, triplets) == 0; success = strcmp (user, triplets) == 0;
triplets = (const char *) rawmemchr (triplets, '\0') + 1; triplets = (const char *) rawmemchr (triplets, '\0') + 1;
- if (success && (domain == NULL || strcmp (domain, triplets) == 0)) - if (success && (domain == NULL || strcmp (domain, triplets) == 0))
+ if (success && (domain == NULL || *triplets == '\0' + if (success && (domain == NULL || *triplets == '\0'
+ || strcmp (domain, triplets) == 0)) + || strcmp (domain, triplets) == 0))
{ {
dataset->resp.result = 1; dataset->resp.result = 1;
break; break;

28
SOURCES/glibc-rh1083644.patch

@ -25,30 +25,30 @@ index 5d15aa4..820d823 100644
--- glibc-2.17-c758a686/nscd/netgroupcache.c --- glibc-2.17-c758a686/nscd/netgroupcache.c
+++ glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c
@@ -216,6 +216,10 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, @@ -216,6 +216,10 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
const char *nuser = data.val.triple.user; const char *nuser = data.val.triple.user;
const char *ndomain = data.val.triple.domain; const char *ndomain = data.val.triple.domain;
+ size_t hostlen = strlen (nhost ?: "") + 1; + size_t hostlen = strlen (nhost ?: "") + 1;
+ size_t userlen = strlen (nuser ?: "") + 1; + size_t userlen = strlen (nuser ?: "") + 1;
+ size_t domainlen = strlen (ndomain ?: "") + 1; + size_t domainlen = strlen (ndomain ?: "") + 1;
+ +
if (nhost == NULL || nuser == NULL || ndomain == NULL if (nhost == NULL || nuser == NULL || ndomain == NULL
|| nhost > nuser || nuser > ndomain) || nhost > nuser || nuser > ndomain)
{ {
@@ -233,9 +237,6 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, @@ -233,9 +237,6 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
: last + strlen (last) + 1 - buffer); : last + strlen (last) + 1 - buffer);
/* We have to make temporary copies. */ /* We have to make temporary copies. */
- size_t hostlen = strlen (nhost ?: "") + 1; - size_t hostlen = strlen (nhost ?: "") + 1;
- size_t userlen = strlen (nuser ?: "") + 1; - size_t userlen = strlen (nuser ?: "") + 1;
- size_t domainlen = strlen (ndomain ?: "") + 1; - size_t domainlen = strlen (ndomain ?: "") + 1;
size_t needed = hostlen + userlen + domainlen; size_t needed = hostlen + userlen + domainlen;
if (buflen - req->key_len - bufused < needed) if (buflen - req->key_len - bufused < needed)
@@ -269,9 +270,12 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, @@ -269,9 +270,12 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
} }
char *wp = buffer + buffilled; char *wp = buffer + buffilled;
- wp = stpcpy (wp, nhost) + 1; - wp = stpcpy (wp, nhost) + 1;
- wp = stpcpy (wp, nuser) + 1; - wp = stpcpy (wp, nuser) + 1;
- wp = stpcpy (wp, ndomain) + 1; - wp = stpcpy (wp, ndomain) + 1;
@ -58,6 +58,6 @@ index 5d15aa4..820d823 100644
+ wp += userlen; + wp += userlen;
+ wp = memmove (wp, ndomain ?: "", domainlen); + wp = memmove (wp, ndomain ?: "", domainlen);
+ wp += domainlen; + wp += domainlen;
buffilled = wp - buffer; buffilled = wp - buffer;
++nentries; ++nentries;
} }

82
SOURCES/glibc-rh1083646.patch

@ -30,8 +30,8 @@ index 98d40a1..d7966bd 100644
--- glibc-2.17-c758a686/nscd/aicache.c --- glibc-2.17-c758a686/nscd/aicache.c
+++ glibc-2.17-c758a686/nscd/aicache.c +++ glibc-2.17-c758a686/nscd/aicache.c
@@ -383,17 +383,12 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req, @@ -383,17 +383,12 @@ addhstaiX (struct database_dyn *db, int fd, request_header *req,
cp = family; cp = family;
} }
- /* Fill in the rest of the dataset. */ - /* Fill in the rest of the dataset. */
- dataset->head.allocsize = total + req->key_len; - dataset->head.allocsize = total + req->key_len;
@ -54,8 +54,8 @@ index 98d40a1..d7966bd 100644
dataset->resp.naddrs = naddrs; dataset->resp.naddrs = naddrs;
@@ -528,15 +523,9 @@ next_nip: @@ -528,15 +523,9 @@ next_nip:
else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) else if ((dataset = mempool_alloc (db, (sizeof (struct dataset)
+ req->key_len), 1)) != NULL) + req->key_len), 1)) != NULL)
{ {
- dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
- dataset->head.recsize = total; - dataset->head.recsize = total;
- dataset->head.notfound = true; - dataset->head.notfound = true;
@ -69,16 +69,16 @@ index 98d40a1..d7966bd 100644
+ sizeof (struct dataset) + req->key_len, + sizeof (struct dataset) + req->key_len,
+ total, db->negtimeout); + total, db->negtimeout);
/* This is the reply. */ /* This is the reply. */
memcpy (&dataset->resp, &notfound, total); memcpy (&dataset->resp, &notfound, total);
diff --git glibc-2.17-c758a686/nscd/grpcache.c glibc-2.17-c758a686/nscd/grpcache.c diff --git glibc-2.17-c758a686/nscd/grpcache.c glibc-2.17-c758a686/nscd/grpcache.c
index b5a33eb..df59fa7 100644 index b5a33eb..df59fa7 100644
--- glibc-2.17-c758a686/nscd/grpcache.c --- glibc-2.17-c758a686/nscd/grpcache.c
+++ glibc-2.17-c758a686/nscd/grpcache.c +++ glibc-2.17-c758a686/nscd/grpcache.c
@@ -128,14 +128,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, @@ -128,14 +128,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
} }
else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL) else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{ {
- dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
- dataset->head.recsize = total; - dataset->head.recsize = total;
- dataset->head.notfound = true; - dataset->head.notfound = true;
@ -92,11 +92,11 @@ index b5a33eb..df59fa7 100644
+ + req->key_len), total, + + req->key_len), total,
+ db->negtimeout); + db->negtimeout);
/* This is the reply. */ /* This is the reply. */
memcpy (&dataset->resp, &notfound, total); memcpy (&dataset->resp, &notfound, total);
@@ -232,14 +228,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req, @@ -232,14 +228,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
dataset_temporary = true; dataset_temporary = true;
} }
- dataset->head.allocsize = total + n; - dataset->head.allocsize = total + n;
- dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.recsize = total - offsetof (struct dataset, resp);
@ -118,9 +118,9 @@ index a79b67a..d4f1ad2 100644
--- glibc-2.17-c758a686/nscd/hstcache.c --- glibc-2.17-c758a686/nscd/hstcache.c
+++ glibc-2.17-c758a686/nscd/hstcache.c +++ glibc-2.17-c758a686/nscd/hstcache.c
@@ -152,15 +152,11 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, @@ -152,15 +152,11 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) else if ((dataset = mempool_alloc (db, (sizeof (struct dataset)
+ req->key_len), 1)) != NULL) + req->key_len), 1)) != NULL)
{ {
- dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
- dataset->head.recsize = total; - dataset->head.recsize = total;
- dataset->head.notfound = true; - dataset->head.notfound = true;
@ -136,11 +136,11 @@ index a79b67a..d4f1ad2 100644
+ (ttl == INT32_MAX + (ttl == INT32_MAX
+ ? db->negtimeout : ttl)); + ? db->negtimeout : ttl));
/* This is the reply. */ /* This is the reply. */
memcpy (&dataset->resp, resp, total); memcpy (&dataset->resp, resp, total);
@@ -257,15 +253,10 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, @@ -257,15 +253,10 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
alloca_used = true; alloca_used = true;
} }
- dataset->head.allocsize = total + req->key_len; - dataset->head.allocsize = total + req->key_len;
- dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.recsize = total - offsetof (struct dataset, resp);
@ -163,9 +163,9 @@ index 1bf9f0d..361319f 100644
--- glibc-2.17-c758a686/nscd/initgrcache.c --- glibc-2.17-c758a686/nscd/initgrcache.c
+++ glibc-2.17-c758a686/nscd/initgrcache.c +++ glibc-2.17-c758a686/nscd/initgrcache.c
@@ -213,14 +213,10 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, @@ -213,14 +213,10 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) else if ((dataset = mempool_alloc (db, (sizeof (struct dataset)
+ req->key_len), 1)) != NULL) + req->key_len), 1)) != NULL)
{ {
- dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
- dataset->head.recsize = total; - dataset->head.recsize = total;
- dataset->head.notfound = true; - dataset->head.notfound = true;
@ -179,11 +179,11 @@ index 1bf9f0d..361319f 100644
+ + req->key_len), total, + + req->key_len), total,
+ db->negtimeout); + db->negtimeout);
/* This is the reply. */ /* This is the reply. */
memcpy (&dataset->resp, &notfound, total); memcpy (&dataset->resp, &notfound, total);
@@ -276,14 +272,10 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req, @@ -276,14 +272,10 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
alloca_used = true; alloca_used = true;
} }
- dataset->head.allocsize = total + req->key_len; - dataset->head.allocsize = total + req->key_len;
- dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.recsize = total - offsetof (struct dataset, resp);
@ -317,9 +317,9 @@ index fa355c3..41c245b 100644
--- glibc-2.17-c758a686/nscd/pwdcache.c --- glibc-2.17-c758a686/nscd/pwdcache.c
+++ glibc-2.17-c758a686/nscd/pwdcache.c +++ glibc-2.17-c758a686/nscd/pwdcache.c
@@ -135,14 +135,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req, @@ -135,14 +135,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) else if ((dataset = mempool_alloc (db, (sizeof (struct dataset)
+ req->key_len), 1)) != NULL) + req->key_len), 1)) != NULL)
{ {
- dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
- dataset->head.recsize = total; - dataset->head.recsize = total;
- dataset->head.notfound = true; - dataset->head.notfound = true;
@ -333,11 +333,11 @@ index fa355c3..41c245b 100644
+ + req->key_len), total, + + req->key_len), total,
+ db->negtimeout); + db->negtimeout);
/* This is the reply. */ /* This is the reply. */
memcpy (&dataset->resp, &notfound, total); memcpy (&dataset->resp, &notfound, total);
@@ -215,14 +211,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req, @@ -215,14 +211,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
alloca_used = true; alloca_used = true;
} }
- dataset->head.allocsize = total + n; - dataset->head.allocsize = total + n;
- dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.recsize = total - offsetof (struct dataset, resp);
@ -359,9 +359,9 @@ index 12ce9b2..95bdcfe 100644
--- glibc-2.17-c758a686/nscd/servicescache.c --- glibc-2.17-c758a686/nscd/servicescache.c
+++ glibc-2.17-c758a686/nscd/servicescache.c +++ glibc-2.17-c758a686/nscd/servicescache.c
@@ -120,14 +120,10 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req, @@ -120,14 +120,10 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) else if ((dataset = mempool_alloc (db, (sizeof (struct dataset)
+ req->key_len), 1)) != NULL) + req->key_len), 1)) != NULL)
{ {
- dataset->head.allocsize = sizeof (struct dataset) + req->key_len; - dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
- dataset->head.recsize = total; - dataset->head.recsize = total;
- dataset->head.notfound = true; - dataset->head.notfound = true;
@ -375,11 +375,11 @@ index 12ce9b2..95bdcfe 100644
+ + req->key_len), total, + + req->key_len), total,
+ db->negtimeout); + db->negtimeout);
/* This is the reply. */ /* This is the reply. */
memcpy (&dataset->resp, &notfound, total); memcpy (&dataset->resp, &notfound, total);
@@ -207,14 +203,10 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req, @@ -207,14 +203,10 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
alloca_used = true; alloca_used = true;
} }
- dataset->head.allocsize = total + req->key_len; - dataset->head.allocsize = total + req->key_len;
- dataset->head.recsize = total - offsetof (struct dataset, resp); - dataset->head.recsize = total - offsetof (struct dataset, resp);

12
SOURCES/glibc-rh1083647.patch

@ -16,11 +16,11 @@ index 426d3c5..5ba1e1f 100644
--- glibc-2.17-c758a686/nscd/netgroupcache.c --- glibc-2.17-c758a686/nscd/netgroupcache.c
+++ glibc-2.17-c758a686/nscd/netgroupcache.c +++ glibc-2.17-c758a686/nscd/netgroupcache.c
@@ -202,7 +202,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req, @@ -202,7 +202,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
{ {
int e; int e;
status = getfct.f (&data, buffer + buffilled, status = getfct.f (&data, buffer + buffilled,
- buflen - buffilled, &e); - buflen - buffilled, &e);
+ buflen - buffilled - req->key_len, &e); + buflen - buffilled - req->key_len, &e);
if (status == NSS_STATUS_RETURN if (status == NSS_STATUS_RETURN
|| status == NSS_STATUS_NOTFOUND) || status == NSS_STATUS_NOTFOUND)
/* This was either the last one for this group or the /* This was either the last one for this group or the

12
SOURCES/glibc-rh1084089.patch

@ -38,11 +38,11 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock
@@ -106,6 +108,7 @@ @@ -106,6 +108,7 @@
INTERNAL_SYSCALL_DECL (__err); \ INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \ long int __ret; \
\ \
+ LIBC_PROBE (lll_futex_wake, 3, futexp, nr, private); \ + LIBC_PROBE (lll_futex_wake, 3, futexp, nr, private); \
__ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \ __ret = INTERNAL_SYSCALL (futex, __err, 4, (futexp), \
__lll_private_flag (FUTEX_WAKE, private), \ __lll_private_flag (FUTEX_WAKE, private), \
(nr), 0); \ (nr), 0); \
diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
--- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2012-12-25 08:32:13.000000000 +0530 --- glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2012-12-25 08:32:13.000000000 +0530
+++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2014-09-05 21:51:58.722483631 +0530 +++ glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h 2014-09-05 21:51:58.722483631 +0530
@ -58,8 +58,8 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -122,6 +124,7 @@ @@ -122,6 +124,7 @@
register unsigned long int __r4 asm ("4") = (unsigned long int) (nr); \ register unsigned long int __r4 asm ("4") = (unsigned long int) (nr); \
register unsigned long int __result asm ("2"); \ register unsigned long int __result asm ("2"); \
\ \
+ LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \ + LIBC_PROBE (lll_futex_wake, 3, futex, nr, private); \
__asm __volatile ("svc %b1" \ __asm __volatile ("svc %b1" \
: "=d" (__result) \ : "=d" (__result) \
: "i" (SYS_futex), "0" (__r2), "d" (__r3), "d" (__r4) \ : "i" (SYS_futex), "0" (__r2), "d" (__r3), "d" (__r4) \

40
SOURCES/glibc-rh1084395.patch

@ -25917,7 +25917,7 @@ diff -urN glibc-2.17-c758a686/elf/rtld.c glibc-2.17-c758a686/elf/rtld.c
if (! HP_TIMING_INLINE) if (! HP_TIMING_INLINE)
@@ -277,9 +271,6 @@ @@ -277,9 +271,6 @@
else else
start_time = info->start_time; start_time = info->start_time;
#endif #endif
- -
- /* Initialize the timing functions. */ - /* Initialize the timing functions. */
@ -25982,11 +25982,11 @@ diff -urN glibc-2.17-c758a686/Makefile.in glibc-2.17-c758a686/Makefile.in
+.PHONY: all install bench +.PHONY: all install bench
all .DEFAULT: all .DEFAULT:
$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
@@ -11,3 +11,6 @@ @@ -11,3 +11,6 @@
install: install:
LANGUAGE=C LC_ALL=C; export LANGUAGE LC_ALL; \ LANGUAGE=C LC_ALL=C; export LANGUAGE LC_ALL; \
$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@ $(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
+ +
+bench bench-clean: +bench bench-clean:
+ $(MAKE) -C $(srcdir)/benchtests $(PARALLELMFLAGS) objdir=`pwd` $@ + $(MAKE) -C $(srcdir)/benchtests $(PARALLELMFLAGS) objdir=`pwd` $@
@ -26279,13 +26279,13 @@ diff -urN glibc-2.17-c758a686/Rules glibc-2.17-c758a686/Rules
tests := $(filter-out $(tests-ifunc), $(tests)) tests := $(filter-out $(tests-ifunc), $(tests))
xtests := $(filter-out $(xtests-ifunc), $(xtests)) xtests := $(filter-out $(xtests-ifunc), $(xtests))
@@ -192,6 +192,7 @@ @@ -192,6 +192,7 @@
$(make-test-out) > $@ $(make-test-out) > $@
endif # tests endif # tests
+ +
.PHONY: distclean realclean subdir_distclean subdir_realclean \ .PHONY: distclean realclean subdir_distclean subdir_realclean \
subdir_clean subdir_mostlyclean subdir_testclean subdir_clean subdir_mostlyclean subdir_testclean
diff -urN glibc-2.17-c758a686/scripts/pylint glibc-2.17-c758a686/scripts/pylint diff -urN glibc-2.17-c758a686/scripts/pylint glibc-2.17-c758a686/scripts/pylint
--- glibc-2.17-c758a686/scripts/pylint 1969-12-31 19:00:00.000000000 -0500 --- glibc-2.17-c758a686/scripts/pylint 1969-12-31 19:00:00.000000000 -0500
+++ glibc-2.17-c758a686/scripts/pylint 2015-06-20 21:22:16.305457862 -0400 +++ glibc-2.17-c758a686/scripts/pylint 2015-06-20 21:22:16.305457862 -0400
@ -26588,7 +26588,7 @@ diff -urN glibc-2.17-c758a686/string/strtok.c glibc-2.17-c758a686/string/strtok.
If S is NULL, the last string strtok() was called with is If S is NULL, the last string strtok() was called with is
used. For example: used. For example:
@@ -33,9 +37,7 @@ @@ -33,9 +37,7 @@
// s = "abc\0=-def\0" // s = "abc\0=-def\0"
*/ */
char * char *
-strtok (s, delim) -strtok (s, delim)
@ -26775,7 +26775,7 @@ diff -urN glibc-2.17-c758a686/string/test-memmem.c glibc-2.17-c758a686/string/te
+++ glibc-2.17-c758a686/string/test-memmem.c 2015-06-20 23:36:49.736443184 -0400 +++ glibc-2.17-c758a686/string/test-memmem.c 2015-06-20 23:36:49.736443184 -0400
@@ -82,24 +82,6 @@ @@ -82,24 +82,6 @@
if (check_result (impl, haystack, haystack_len, needle, needle_len, if (check_result (impl, haystack, haystack_len, needle, needle_len,
expected) < 0) expected) < 0)
return; return;
- -
- if (HP_TIMING_AVAIL) - if (HP_TIMING_AVAIL)
@ -26816,15 +26816,15 @@ diff -urN glibc-2.17-c758a686/string/test-memmem.c glibc-2.17-c758a686/string/te
static void static void
@@ -143,16 +119,10 @@ @@ -143,16 +119,10 @@
buf1[idx + off] = ch; buf1[idx + off] = ch;
} }
- if (HP_TIMING_AVAIL) - if (HP_TIMING_AVAIL)
- printf ("String %.*s, offset %zd:", (int) len, buf1 + idx, idx); - printf ("String %.*s, offset %zd:", (int) len, buf1 + idx, idx);
- -
FOR_EACH_IMPL (impl, 0) FOR_EACH_IMPL (impl, 0)
do_one_test (impl, buf1, BUF1PAGES * page_size, buf1 + idx, len, do_one_test (impl, buf1, BUF1PAGES * page_size, buf1 + idx, len,
buf1 + idx); buf1 + idx);
- if (HP_TIMING_AVAIL) - if (HP_TIMING_AVAIL)
- putchar ('\n'); - putchar ('\n');
@ -27294,8 +27294,8 @@ diff -urN glibc-2.17-c758a686/string/test-string.h glibc-2.17-c758a686/string/te
-#if defined TEST_IFUNC && defined TEST_NAME -#if defined TEST_IFUNC && defined TEST_NAME
+#ifdef TEST_NAME +#ifdef TEST_NAME
func_count = __libc_ifunc_impl_list (TEST_NAME, func_list, func_count = __libc_ifunc_impl_list (TEST_NAME, func_list,
(sizeof func_list (sizeof func_list
/ sizeof func_list[0])); / sizeof func_list[0]));
@@ -199,7 +186,6 @@ @@ -199,7 +186,6 @@
error (EXIT_FAILURE, errno, "mmap failed"); error (EXIT_FAILURE, errno, "mmap failed");
if (mprotect (buf2 + page_size, page_size, PROT_NONE)) if (mprotect (buf2 + page_size, page_size, PROT_NONE))
@ -27473,7 +27473,7 @@ diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/t
- printf ("Length %4zd/%4zd:", len, n); - printf ("Length %4zd/%4zd:", len, n);
FOR_EACH_IMPL (impl, 0) FOR_EACH_IMPL (impl, 0)
do_one_test (impl, s1, s2, n, 0); do_one_test (impl, s1, s2, n, 0);
- if (HP_TIMING_AVAIL) - if (HP_TIMING_AVAIL)
- putchar ('\n'); - putchar ('\n');
@ -27482,7 +27482,7 @@ diff -urN glibc-2.17-c758a686/string/test-strncmp.c glibc-2.17-c758a686/string/t
} }
@@ -144,14 +121,8 @@ @@ -144,14 +121,8 @@
s1[len] = 64; s1[len] = 64;
} }
- if (HP_TIMING_AVAIL) - if (HP_TIMING_AVAIL)
@ -27515,8 +27515,8 @@ diff -urN glibc-2.17-c758a686/string/test-strncpy.c glibc-2.17-c758a686/string/t
--- glibc-2.17-c758a686/string/test-strncpy.c 2012-12-24 22:02:13.000000000 -0500 --- glibc-2.17-c758a686/string/test-strncpy.c 2012-12-24 22:02:13.000000000 -0500
+++ glibc-2.17-c758a686/string/test-strncpy.c 2015-06-20 23:36:59.695145204 -0400 +++ glibc-2.17-c758a686/string/test-strncpy.c 2015-06-20 23:36:59.695145204 -0400
@@ -90,24 +90,6 @@ @@ -90,24 +90,6 @@
return; return;
} }
} }
- -
- if (HP_TIMING_AVAIL) - if (HP_TIMING_AVAIL)
@ -28601,8 +28601,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/sparc/sparc32/sparcv9/hp-timing.h glibc-2.
- -
#define HP_TIMING_NOW(Var) \ #define HP_TIMING_NOW(Var) \
__asm__ __volatile__ ("rd %%tick, %L0\n\t" \ __asm__ __volatile__ ("rd %%tick, %L0\n\t" \
"srlx %L0, 32, %H0" \ "srlx %L0, 32, %H0" \
: "=r" (Var)) : "=r" (Var))
-#define HP_TIMING_DIFF_INIT() \ -#define HP_TIMING_DIFF_INIT() \
- do { \ - do { \

12
SOURCES/glibc-rh1085313.patch

@ -12,9 +12,9 @@ Date: Wed Sep 10 21:51:50 2014 +0530
remaining groups if the current group is entry. This patch implements remaining groups if the current group is entry. This patch implements
this fix. Tested on x86_64. this fix. Tested on x86_64.
[BZ #17363] [BZ #17363]
* inet/getnetgrent_r.c (__internal_getnetgrent_r): Try next * inet/getnetgrent_r.c (__internal_getnetgrent_r): Try next
group if the current group is empty. group if the current group is empty.


diff --git glibc-2.17-c758a686/inet/getnetgrent_r.c glibc-2.17-c758a686/inet/getnetgrent_r.c diff --git glibc-2.17-c758a686/inet/getnetgrent_r.c glibc-2.17-c758a686/inet/getnetgrent_r.c
index f6d064d..e101537 100644 index f6d064d..e101537 100644
@ -29,6 +29,6 @@ index f6d064d..e101537 100644
+ /* The service returned a NOTFOUND, but there are more groups that we + /* The service returned a NOTFOUND, but there are more groups that we
+ need to resolve before we give up. */ + need to resolve before we give up. */
+ || (status == NSS_STATUS_NOTFOUND && datap->needed_groups != NULL)) + || (status == NSS_STATUS_NOTFOUND && datap->needed_groups != NULL))
{ {
/* This was the last one for this group. Look at next group /* This was the last one for this group. Look at next group
if available. */ if available. */

12
SOURCES/glibc-rh1098042.patch

@ -17,12 +17,12 @@ index 6258330..8f392b9 100644
--- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c --- glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
+++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c +++ glibc-2.17-c758a686/sysdeps/posix/getaddrinfo.c
@@ -867,8 +867,7 @@ gaih_inet (const char *name, const struct gaih_service *service, @@ -867,8 +867,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
if (status != NSS_STATUS_TRYAGAIN if (status != NSS_STATUS_TRYAGAIN
|| rc != ERANGE || herrno != NETDB_INTERNAL) || rc != ERANGE || herrno != NETDB_INTERNAL)
{ {
- if (status == NSS_STATUS_TRYAGAIN - if (status == NSS_STATUS_TRYAGAIN
- && herrno == TRY_AGAIN) - && herrno == TRY_AGAIN)
+ if (herrno == TRY_AGAIN) + if (herrno == TRY_AGAIN)
no_data = EAI_AGAIN; no_data = EAI_AGAIN;
else else
no_data = herrno == NO_DATA; no_data = herrno == NO_DATA;

60
SOURCES/glibc-rh1098047.patch

@ -118,7 +118,7 @@ Date: Wed Apr 30 11:48:43 2014 +0530
static bool first_error = true; static bool first_error = true;
static ssize_t (*real_recvfrom) (int sockfd, void *buf, size_t len, int flags, static ssize_t (*real_recvfrom) (int sockfd, void *buf, size_t len, int flags,
struct sockaddr *src_addr, socklen_t *addrlen); struct sockaddr *src_addr, socklen_t *addrlen);
void void
__attribute__ ((constructor)) __attribute__ ((constructor))
@ -144,9 +144,9 @@ Date: Wed Apr 30 11:48:43 2014 +0530
printf ("(Modifying header)"); printf ("(Modifying header)");
if (first_error && done == 1) if (first_error && done == 1)
h->rcode = 3; h->rcode = 3;
else else
h->rcode = 0; /* NOERROR == 0. */ h->rcode = 0; /* NOERROR == 0. */
h->ancount = 0; h->ancount = 0;
h->aa = 0; h->aa = 0;
h->ra = 0; h->ra = 0;
@ -157,7 +157,7 @@ Date: Wed Apr 30 11:48:43 2014 +0530
ssize_t ssize_t
recvfrom (int sockfd, void *buf, size_t len, int flags, recvfrom (int sockfd, void *buf, size_t len, int flags,
struct sockaddr *src_addr, socklen_t *addrlen) struct sockaddr *src_addr, socklen_t *addrlen)
{ {
ssize_t ret = real_recvfrom (sockfd, buf, len, flags, src_addr, addrlen); ssize_t ret = real_recvfrom (sockfd, buf, len, flags, src_addr, addrlen);
int port = htons (((struct sockaddr_in *) src_addr)->sin_port); int port = htons (((struct sockaddr_in *) src_addr)->sin_port);
@ -196,52 +196,52 @@ diff -pruN glibc-2.17-c758a686/resolv/res_query.c glibc-2.17-c758a686/resolv/res
--- glibc-2.17-c758a686/resolv/res_query.c 2012-12-25 08:32:13.000000000 +0530 --- glibc-2.17-c758a686/resolv/res_query.c 2012-12-25 08:32:13.000000000 +0530
+++ glibc-2.17-c758a686/resolv/res_query.c 2014-09-05 14:28:06.439191017 +0530 +++ glibc-2.17-c758a686/resolv/res_query.c 2014-09-05 14:28:06.439191017 +0530
@@ -378,7 +378,9 @@ __libc_res_nsearch(res_state statp, @@ -378,7 +378,9 @@ __libc_res_nsearch(res_state statp,
ret = __libc_res_nquerydomain(statp, name, NULL, class, type, ret = __libc_res_nquerydomain(statp, name, NULL, class, type,
answer, anslen, answerp, answer, anslen, answerp,
answerp2, nanswerp2, resplen2); answerp2, nanswerp2, resplen2);
- if (ret > 0 || trailing_dot) - if (ret > 0 || trailing_dot)
+ if (ret > 0 || trailing_dot + if (ret > 0 || trailing_dot
+ /* If the second response is valid then we use that. */ + /* If the second response is valid then we use that. */
+ || (ret == 0 && resplen2 != NULL && *resplen2 > 0)) + || (ret == 0 && resplen2 != NULL && *resplen2 > 0))
return (ret); return (ret);
saved_herrno = h_errno; saved_herrno = h_errno;
tried_as_is++; tried_as_is++;
@@ -418,7 +420,8 @@ __libc_res_nsearch(res_state statp, @@ -418,7 +420,8 @@ __libc_res_nsearch(res_state statp,
answer, anslen, answerp, answer, anslen, answerp,
answerp2, nanswerp2, answerp2, nanswerp2,
resplen2); resplen2);
- if (ret > 0) - if (ret > 0)
+ if (ret > 0 || (ret == 0 && resplen2 != NULL + if (ret > 0 || (ret == 0 && resplen2 != NULL
+ && *resplen2 > 0)) + && *resplen2 > 0))
return (ret); return (ret);
if (answerp && *answerp != answer) { if (answerp && *answerp != answer) {
@@ -487,7 +490,8 @@ __libc_res_nsearch(res_state statp, @@ -487,7 +490,8 @@ __libc_res_nsearch(res_state statp,
ret = __libc_res_nquerydomain(statp, name, NULL, class, type, ret = __libc_res_nquerydomain(statp, name, NULL, class, type,
answer, anslen, answerp, answer, anslen, answerp,
answerp2, nanswerp2, resplen2); answerp2, nanswerp2, resplen2);
- if (ret > 0) - if (ret > 0)
+ if (ret > 0 || (ret == 0 && resplen2 != NULL + if (ret > 0 || (ret == 0 && resplen2 != NULL
+ && *resplen2 > 0)) + && *resplen2 > 0))
return (ret); return (ret);
} }
diff -pruN glibc-2.17-c758a686/resolv/res_send.c glibc-2.17-c758a686/resolv/res_send.c diff -pruN glibc-2.17-c758a686/resolv/res_send.c glibc-2.17-c758a686/resolv/res_send.c
--- glibc-2.17-c758a686/resolv/res_send.c 2014-09-05 14:28:30.039337246 +0530 --- glibc-2.17-c758a686/resolv/res_send.c 2014-09-05 14:28:30.039337246 +0530
+++ glibc-2.17-c758a686/resolv/res_send.c 2014-09-05 14:28:06.439191017 +0530 +++ glibc-2.17-c758a686/resolv/res_send.c 2014-09-05 14:28:06.439191017 +0530
@@ -1343,6 +1343,7 @@ send_dg(res_state statp, @@ -1343,6 +1343,7 @@ send_dg(res_state statp,
(*thisresplenp > *thisanssizp) (*thisresplenp > *thisanssizp)
? *thisanssizp : *thisresplenp); ? *thisanssizp : *thisresplenp);
+ next_ns: + next_ns:
if (recvresp1 || (buf2 != NULL && recvresp2)) { if (recvresp1 || (buf2 != NULL && recvresp2)) {
*resplen2 = 0; *resplen2 = 0;
return resplen; return resplen;
@@ -1360,7 +1361,6 @@ send_dg(res_state statp, @@ -1360,7 +1361,6 @@ send_dg(res_state statp,
goto wait; goto wait;
} }
- next_ns: - next_ns:
__res_iclose(statp, false); __res_iclose(statp, false);
/* don't retry if called from dig */ /* don't retry if called from dig */
if (!statp->pfcode) if (!statp->pfcode)

21
SOURCES/glibc-rh1103856.patch

@ -13,15 +13,16 @@ diff -pruN glibc-2.17-c758a686/malloc/malloc.c glibc-2.17-c758a686/malloc/malloc
+++ glibc-2.17-c758a686/malloc/malloc.c 2014-06-02 07:34:58.856257177 +0530 +++ glibc-2.17-c758a686/malloc/malloc.c 2014-06-02 07:34:58.856257177 +0530
@@ -6553,12 +6553,14 @@ malloc_info (int options, FILE *fp) @@ -6553,12 +6553,14 @@ malloc_info (int options, FILE *fp)
fprintf (fp, fprintf (fp,
"<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n" "<total type=\"fast\" count=\"%zu\" size=\"%zu\"/>\n"
"<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n" "<total type=\"rest\" count=\"%zu\" size=\"%zu\"/>\n"
+ "<total type=\"mmap\" count=\"%d\" size=\"%zu\"/>\n" + "<total type=\"mmap\" count=\"%d\" size=\"%zu\"/>\n"
"<system type=\"current\" size=\"%zu\"/>\n" "<system type=\"current\" size=\"%zu\"/>\n"
"<system type=\"max\" size=\"%zu\"/>\n" "<system type=\"max\" size=\"%zu\"/>\n"
"<aspace type=\"total\" size=\"%zu\"/>\n" "<aspace type=\"total\" size=\"%zu\"/>\n"
"<aspace type=\"mprotect\" size=\"%zu\"/>\n" "<aspace type=\"mprotect\" size=\"%zu\"/>\n"
"</malloc>\n", "</malloc>\n",
total_nfastblocks, total_fastavail, total_nblocks, total_avail, total_nfastblocks, total_fastavail, total_nblocks, total_avail,
+ mp_.n_mmaps, mp_.mmapped_mem, + mp_.n_mmaps, mp_.mmapped_mem,
total_system, total_max_system, total_system, total_max_system,
total_aspace, total_aspace_mprotect); total_aspace, total_aspace_mprotect);

8
SOURCES/glibc-rh1103874.patch

@ -55,8 +55,8 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc-
void (*resume) (struct _Unwind_Exception *exc) = libgcc_s_resume; void (*resume) (struct _Unwind_Exception *exc) = libgcc_s_resume;
PTR_DEMANGLE (resume); PTR_DEMANGLE (resume);
@@ -108,10 +123,7 @@ __gcc_personality_v0 (int version, _Unwi @@ -108,10 +123,7 @@ __gcc_personality_v0 (int version, _Unwi
struct _Unwind_Exception *ue_header, struct _Unwind_Exception *ue_header,
struct _Unwind_Context *context) struct _Unwind_Context *context)
{ {
- if (__builtin_expect (libgcc_s_handle == NULL, 0)) - if (__builtin_expect (libgcc_s_handle == NULL, 0))
- pthread_cancel_init (); - pthread_cancel_init ();
@ -68,7 +68,7 @@ diff -pruN glibc-2.17-c758a686/nptl/sysdeps/pthread/unwind-forcedunwind.c glibc-
(int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *, (int, _Unwind_Action, _Unwind_Exception_Class, struct _Unwind_Exception *,
@@ -122,10 +136,7 @@ _Unwind_Reason_Code @@ -122,10 +136,7 @@ _Unwind_Reason_Code
_Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop, _Unwind_ForcedUnwind (struct _Unwind_Exception *exc, _Unwind_Stop_Fn stop,
void *stop_argument) void *stop_argument)
{ {
- if (__builtin_expect (libgcc_s_handle == NULL, 0)) - if (__builtin_expect (libgcc_s_handle == NULL, 0))
- pthread_cancel_init (); - pthread_cancel_init ();
@ -148,5 +148,5 @@ diff -pruN glibc-2.17-c758a686/sysdeps/gnu/unwind-resume.c glibc-2.17-c758a686/s
- init (); - init ();
+ _maybe_init (); + _maybe_init ();
return libgcc_s_personality (version, actions, exception_class, return libgcc_s_personality (version, actions, exception_class,
ue_header, context); ue_header, context);
} }

34
SOURCES/glibc-rh1120490.patch

@ -42,9 +42,9 @@ Date: Tue Sep 16 22:16:01 2014 +0530
[1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html [1] https://sourceware.org/ml/libc-alpha/2012-12/msg00306.html
[BZ #17266] [BZ #17266]
* misc/sys/cdefs.h: Define __extern_always_inline for clang * misc/sys/cdefs.h: Define __extern_always_inline for clang
4.2 and newer. 4.2 and newer.


commit 884ddc5081278f488ef8cd49951f41cfdbb480ce commit 884ddc5081278f488ef8cd49951f41cfdbb480ce
Author: Siddhesh Poyarekar <siddhesh@redhat.com> Author: Siddhesh Poyarekar <siddhesh@redhat.com>
@ -77,20 +77,20 @@ Date: Tue Sep 16 14:08:48 2014 +0530
definition imply proper extern inline semantics. definition imply proper extern inline semantics.
2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com> 2014-09-16 Siddhesh Poyarekar <siddhesh@redhat.com>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>

[BZ #17266] [BZ #17266]
* libio/stdio.h: Check definition of __fortify_function * libio/stdio.h: Check definition of __fortify_function
instead of __extern_always_inline to include bits/stdio2.h. instead of __extern_always_inline to include bits/stdio2.h.
* math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also * math/bits/math-finite.h [__USE_XOPEN || __USE_ISOC99]: Also
check if __extern_always_inline is defined. check if __extern_always_inline is defined.
[__USE_MISC || __USE_XOPEN]: Likewise. [__USE_MISC || __USE_XOPEN]: Likewise.
[__USE_ISOC99] Likewise. [__USE_ISOC99] Likewise.
* misc/sys/cdefs.h (__fortify_function): Define only if * misc/sys/cdefs.h (__fortify_function): Define only if
__extern_always_inline is defined. __extern_always_inline is defined.
[!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining [!__cplusplus || __GNUC_PREREQ (4,3)]: Revert to defining
__extern_always_inline and __extern_inline only for g++-4.3 __extern_always_inline and __extern_inline only for g++-4.3
and newer or a compatible gcc. and newer or a compatible gcc.


diff --git glibc-2.17-c758a686/libio/stdio.h glibc-2.17-c758a686/libio/stdio.h diff --git glibc-2.17-c758a686/libio/stdio.h glibc-2.17-c758a686/libio/stdio.h
index d8c0bdb..1f4f837 100644 index d8c0bdb..1f4f837 100644

46
SOURCES/glibc-rh1132518-mpx.patch

@ -137,7 +137,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/configure.in glibc-2.17-c758a686/sy
--- glibc-2.17-c758a686/sysdeps/x86_64/configure.in 2014-09-10 23:26:03.468045806 -0400 --- glibc-2.17-c758a686/sysdeps/x86_64/configure.in 2014-09-10 23:26:03.468045806 -0400
+++ glibc-2.17-c758a686/sysdeps/x86_64/configure.in 2014-09-10 23:27:41.532851928 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/configure.in 2014-09-10 23:27:41.532851928 -0400
@@ -70,6 +70,21 @@ @@ -70,6 +70,21 @@
[libc_cv_cc_novzeroupper=no]) [libc_cv_cc_novzeroupper=no])
]) ])
+dnl Check whether asm supports Intel MPX +dnl Check whether asm supports Intel MPX
@ -162,8 +162,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686
--- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:26:03.468045806 -0400 --- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:26:03.468045806 -0400
+++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:27:41.535851922 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h 2014-09-10 23:27:41.535851922 -0400
@@ -63,6 +63,20 @@ @@ -63,6 +63,20 @@
movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6 movaps (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp), %xmm6
movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7 movaps (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp), %xmm7
+#ifndef __ILP32__ +#ifndef __ILP32__
+# ifdef HAVE_MPX_SUPPORT +# ifdef HAVE_MPX_SUPPORT
@ -180,10 +180,10 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686
+#endif +#endif
+ +
#ifdef RESTORE_AVX #ifdef RESTORE_AVX
/* Check if any xmm0-xmm7 registers are changed by audit /* Check if any xmm0-xmm7 registers are changed by audit
module. */ module. */
@@ -222,6 +236,16 @@ @@ -222,6 +236,16 @@
vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx) vmovdqa %xmm1, (LRV_SIZE + XMM_SIZE)(%rcx)
#endif #endif
+#ifndef __ILP32__ +#ifndef __ILP32__
@ -196,8 +196,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686
+# endif +# endif
+#endif +#endif
+ +
fstpt LRV_ST0_OFFSET(%rcx) fstpt LRV_ST0_OFFSET(%rcx)
fstpt LRV_ST1_OFFSET(%rcx) fstpt LRV_ST1_OFFSET(%rcx)
@@ -254,6 +278,16 @@ @@ -254,6 +278,16 @@
1: 1:
@ -213,8 +213,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686
+# endif +# endif
+#endif +#endif
+ +
fldt LRV_ST1_OFFSET(%rsp) fldt LRV_ST1_OFFSET(%rsp)
fldt LRV_ST0_OFFSET(%rsp) fldt LRV_ST0_OFFSET(%rsp)
diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S
--- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:26:03.468045806 -0400 --- glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:26:03.468045806 -0400
@ -247,13 +247,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+#define REGISTER_SAVE_R8 (REGISTER_SAVE_RDI + 8) +#define REGISTER_SAVE_R8 (REGISTER_SAVE_RDI + 8)
+#define REGISTER_SAVE_R9 (REGISTER_SAVE_R8 + 8) +#define REGISTER_SAVE_R9 (REGISTER_SAVE_R8 + 8)
+ +
.text .text
.globl _dl_runtime_resolve .globl _dl_runtime_resolve
.type _dl_runtime_resolve, @function .type _dl_runtime_resolve, @function
@@ -31,28 +55,63 @@ @@ -31,28 +55,63 @@
cfi_startproc cfi_startproc
_dl_runtime_resolve: _dl_runtime_resolve:
cfi_adjust_cfa_offset(16) # Incorporate PLT cfi_adjust_cfa_offset(16) # Incorporate PLT
- subq $56,%rsp - subq $56,%rsp
- cfi_adjust_cfa_offset(56) - cfi_adjust_cfa_offset(56)
- movq %rax,(%rsp) # Preserve registers otherwise clobbered. - movq %rax,(%rsp) # Preserve registers otherwise clobbered.
@ -294,8 +294,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+ # %rdi: link_map, %rsi: reloc_index + # %rdi: link_map, %rsi: reloc_index
+ movq (REGISTER_SAVE_AREA + 8)(%rsp), %rsi + movq (REGISTER_SAVE_AREA + 8)(%rsp), %rsi
+ movq REGISTER_SAVE_AREA(%rsp), %rdi + movq REGISTER_SAVE_AREA(%rsp), %rdi
call _dl_fixup # Call resolver. call _dl_fixup # Call resolver.
movq %rax, %r11 # Save return value movq %rax, %r11 # Save return value
- movq 48(%rsp), %r9 # Get register content back. - movq 48(%rsp), %r9 # Get register content back.
- movq 40(%rsp), %r8 - movq 40(%rsp), %r8
- movq 32(%rsp), %rdi - movq 32(%rsp), %rdi
@ -331,12 +331,12 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+ # Adjust stack(PLT did 2 pushes) + # Adjust stack(PLT did 2 pushes)
+ addq $(REGISTER_SAVE_AREA + 16), %rsp + addq $(REGISTER_SAVE_AREA + 16), %rsp
+ cfi_adjust_cfa_offset(-(REGISTER_SAVE_AREA + 16)) + cfi_adjust_cfa_offset(-(REGISTER_SAVE_AREA + 16))
jmp *%r11 # Jump to function address. jmp *%r11 # Jump to function address.
cfi_endproc cfi_endproc
.size _dl_runtime_resolve, .-_dl_runtime_resolve .size _dl_runtime_resolve, .-_dl_runtime_resolve
@@ -130,6 +189,20 @@ @@ -130,6 +189,20 @@
movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp)
movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp)
+# ifndef __ILP32__ +# ifndef __ILP32__
+# ifdef HAVE_MPX_SUPPORT +# ifdef HAVE_MPX_SUPPORT
@ -353,7 +353,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+# endif +# endif
+ +
# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT # if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT
.data .data
L(have_avx): L(have_avx):
diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym
--- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-09-10 23:26:03.468045806 -0400 --- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-09-10 23:26:03.468045806 -0400

1
SOURCES/glibc-rh1133812-1.patch

@ -205,3 +205,4 @@ index 1e25854..d71c029 100644
} }
-- --
1.9.3 1.9.3


28
SOURCES/glibc-rh1133812-2.patch

@ -95,14 +95,14 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi
+ if (loc_name[0] == '\0') + if (loc_name[0] == '\0')
{ {
/* The user decides which locale to use by setting environment /* The user decides which locale to use by setting environment
variables. */ variables. */
- *name = getenv ("LC_ALL"); - *name = getenv ("LC_ALL");
- if (*name == NULL || (*name)[0] == '\0') - if (*name == NULL || (*name)[0] == '\0')
- *name = getenv (_nl_category_names.str - *name = getenv (_nl_category_names.str
+ loc_name = getenv ("LC_ALL"); + loc_name = getenv ("LC_ALL");
+ if (!name_present (loc_name)) + if (!name_present (loc_name))
+ loc_name = getenv (_nl_category_names.str + loc_name = getenv (_nl_category_names.str
+ _nl_category_name_idxs[category]); + _nl_category_name_idxs[category]);
- if (*name == NULL || (*name)[0] == '\0') - if (*name == NULL || (*name)[0] == '\0')
- *name = getenv ("LANG"); - *name = getenv ("LANG");
+ if (!name_present (loc_name)) + if (!name_present (loc_name))
@ -125,7 +125,7 @@ diff -pruN glibc-2.17-c758a686/locale/findlocale.c glibc-2.17-c758a686/locale/fi
+ || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0) + || __builtin_expect (strcmp (loc_name, _nl_POSIX_name), 1) == 0)
{ {
/* We need not load anything. The needed data is contained in /* We need not load anything. The needed data is contained in
the library itself. */ the library itself. */
*name = (char *) _nl_C_name; *name = (char *) _nl_C_name;
return _nl_C[category]; return _nl_C[category];
} }
@ -143,7 +143,7 @@ diff -pruN glibc-2.17-c758a686/locale/setlocale.c glibc-2.17-c758a686/locale/set
--- glibc-2.17-c758a686/locale/setlocale.c 2013-08-11 04:22:55.000000000 +0530 --- glibc-2.17-c758a686/locale/setlocale.c 2013-08-11 04:22:55.000000000 +0530
+++ glibc-2.17-c758a686/locale/setlocale.c 2014-08-26 16:14:50.401253764 +0530 +++ glibc-2.17-c758a686/locale/setlocale.c 2014-08-26 16:14:50.401253764 +0530
@@ -272,6 +272,8 @@ setlocale (int category, const char *loc @@ -272,6 +272,8 @@ setlocale (int category, const char *loc
of entries of the form `CATEGORY=VALUE'. */ of entries of the form `CATEGORY=VALUE'. */
const char *newnames[__LC_LAST]; const char *newnames[__LC_LAST];
struct __locale_data *newdata[__LC_LAST]; struct __locale_data *newdata[__LC_LAST];
+ /* Copy of the locale argument, for in-place splitting. */ + /* Copy of the locale argument, for in-place splitting. */
@ -153,8 +153,8 @@ diff -pruN glibc-2.17-c758a686/locale/setlocale.c glibc-2.17-c758a686/locale/set
for (category = 0; category < __LC_LAST; ++category) for (category = 0; category < __LC_LAST; ++category)
@@ -281,7 +283,13 @@ setlocale (int category, const char *loc @@ -281,7 +283,13 @@ setlocale (int category, const char *loc
if (__builtin_expect (strchr (locale, ';') != NULL, 0)) if (__builtin_expect (strchr (locale, ';') != NULL, 0))
{ {
/* This is a composite name. Make a copy and split it up. */ /* This is a composite name. Make a copy and split it up. */
- char *np = strdupa (locale); - char *np = strdupa (locale);
+ locale_copy = strdup (locale); + locale_copy = strdup (locale);
+ if (__glibc_unlikely (locale_copy == NULL)) + if (__glibc_unlikely (locale_copy == NULL))
@ -163,17 +163,17 @@ diff -pruN glibc-2.17-c758a686/locale/setlocale.c glibc-2.17-c758a686/locale/set
+ return NULL; + return NULL;
+ } + }
+ char *np = locale_copy; + char *np = locale_copy;
char *cp; char *cp;
int cnt; int cnt;
@@ -299,6 +307,7 @@ setlocale (int category, const char *loc @@ -299,6 +307,7 @@ setlocale (int category, const char *loc
{ {
error_return: error_return:
__libc_rwlock_unlock (__libc_setlocale_lock); __libc_rwlock_unlock (__libc_setlocale_lock);
+ free (locale_copy); + free (locale_copy);
/* Bogus category name. */ /* Bogus category name. */
ERROR_RETURN; ERROR_RETURN;
@@ -391,8 +400,9 @@ setlocale (int category, const char *loc @@ -391,8 +400,9 @@ setlocale (int category, const char *loc
/* Critical section left. */ /* Critical section left. */
__libc_rwlock_unlock (__libc_setlocale_lock); __libc_rwlock_unlock (__libc_setlocale_lock);
@ -191,7 +191,7 @@ diff -pruN glibc-2.17-c758a686/localedata/Makefile glibc-2.17-c758a686/localedat
@@ -77,7 +77,7 @@ locale_test_suite := tst_iswalnum tst_is @@ -77,7 +77,7 @@ locale_test_suite := tst_iswalnum tst_is
tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \ tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \ tst-leaks tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
- tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 - tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2
+ tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 + tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3
ifeq (yes,$(build-shared)) ifeq (yes,$(build-shared))

302
SOURCES/glibc-rh1133812-3.patch

@ -38,153 +38,153 @@ Date: Wed Jun 4 23:37:25 2014 +0000
Tested x86_64 and x86. Tested x86_64 and x86.
* Rules (make-test-out): Include * Rules (make-test-out): Include
LOCPATH=$(common-objpfx)localedata in default environment. LOCPATH=$(common-objpfx)localedata in default environment.
* debug/Makefile (tst-chk1-ENV): Remove variable. * debug/Makefile (tst-chk1-ENV): Remove variable.
(tst-chk2-ENV): Likewise. (tst-chk2-ENV): Likewise.
(tst-chk3-ENV): Likewise. (tst-chk3-ENV): Likewise.
(tst-chk4-ENV): Likewise. (tst-chk4-ENV): Likewise.
(tst-chk5-ENV): Likewise. (tst-chk5-ENV): Likewise.
(tst-chk6-ENV): Likewise. (tst-chk6-ENV): Likewise.
(tst-lfschk1-ENV): Likewise. (tst-lfschk1-ENV): Likewise.
(tst-lfschk2-ENV): Likewise. (tst-lfschk2-ENV): Likewise.
(tst-lfschk3-ENV): Likewise. (tst-lfschk3-ENV): Likewise.
(tst-lfschk4-ENV): Likewise. (tst-lfschk4-ENV): Likewise.
(tst-lfschk5-ENV): Likewise. (tst-lfschk5-ENV): Likewise.
(tst-lfschk6-ENV): Likewise. (tst-lfschk6-ENV): Likewise.
* iconvdata/Makefile (bug-iconv6-ENV): Likewise. * iconvdata/Makefile (bug-iconv6-ENV): Likewise.
(tst-iconv7-ENV): Likewise. (tst-iconv7-ENV): Likewise.
* intl/Makefile (LOCPATH-ENV): Likewise. * intl/Makefile (LOCPATH-ENV): Likewise.
(tst-codeset-ENV): Likewise. (tst-codeset-ENV): Likewise.
(tst-gettext3-ENV): Likewise. (tst-gettext3-ENV): Likewise.
(tst-gettext5-ENV): Likewise. (tst-gettext5-ENV): Likewise.
* libio/Makefile (tst-widetext-ENV): Don't set LOCPATH. * libio/Makefile (tst-widetext-ENV): Don't set LOCPATH.
(tst-fopenloc-ENV): Likewise. (tst-fopenloc-ENV): Likewise.
(tst-fgetws-ENV): Remove variable. (tst-fgetws-ENV): Remove variable.
(tst-ungetwc1-ENV): Likewise. (tst-ungetwc1-ENV): Likewise.
(tst-ungetwc2-ENV): Likewise. (tst-ungetwc2-ENV): Likewise.
(bug-ungetwc2-ENV): Likewise. (bug-ungetwc2-ENV): Likewise.
(tst-swscanf-ENV): Likewise. (tst-swscanf-ENV): Likewise.
(bug-ftell-ENV): Likewise. (bug-ftell-ENV): Likewise.
(tst-fgetwc-ENV): Likewise. (tst-fgetwc-ENV): Likewise.
(tst-fseek-ENV): Likewise. (tst-fseek-ENV): Likewise.
(tst-ftell-partial-wide-ENV): Likewise. (tst-ftell-partial-wide-ENV): Likewise.
(tst-ftell-active-handler-ENV): Likewise. (tst-ftell-active-handler-ENV): Likewise.
(tst-ftell-append-ENV): Likewise. (tst-ftell-append-ENV): Likewise.
* posix/Makefile (tst-fnmatch-ENV): Likewise. * posix/Makefile (tst-fnmatch-ENV): Likewise.
(tst-regexloc-ENV): Likewise. (tst-regexloc-ENV): Likewise.
(bug-regex1-ENV): Likewise. (bug-regex1-ENV): Likewise.
(tst-regex-ENV): Likewise. (tst-regex-ENV): Likewise.
(tst-regex2-ENV): Likewise. (tst-regex2-ENV): Likewise.
(bug-regex5-ENV): Likewise. (bug-regex5-ENV): Likewise.
(bug-regex6-ENV): Likewise. (bug-regex6-ENV): Likewise.
(bug-regex17-ENV): Likewise. (bug-regex17-ENV): Likewise.
(bug-regex18-ENV): Likewise. (bug-regex18-ENV): Likewise.
(bug-regex19-ENV): Likewise. (bug-regex19-ENV): Likewise.
(bug-regex20-ENV): Likewise. (bug-regex20-ENV): Likewise.
(bug-regex22-ENV): Likewise. (bug-regex22-ENV): Likewise.
(bug-regex23-ENV): Likewise. (bug-regex23-ENV): Likewise.
(bug-regex25-ENV): Likewise. (bug-regex25-ENV): Likewise.
(bug-regex26-ENV): Likewise. (bug-regex26-ENV): Likewise.
(bug-regex30-ENV): Likewise. (bug-regex30-ENV): Likewise.
(bug-regex32-ENV): Likewise. (bug-regex32-ENV): Likewise.
(bug-regex33-ENV): Likewise. (bug-regex33-ENV): Likewise.
(bug-regex34-ENV): Likewise. (bug-regex34-ENV): Likewise.
(bug-regex35-ENV): Likewise. (bug-regex35-ENV): Likewise.
(tst-rxspencer-ENV): Likewise. (tst-rxspencer-ENV): Likewise.
(tst-rxspencer-no-utf8-ENV): Likewise. (tst-rxspencer-no-utf8-ENV): Likewise.
* stdio-common/Makefile (tst-sprintf-ENV): Likewise. * stdio-common/Makefile (tst-sprintf-ENV): Likewise.
(tst-sscanf-ENV): Likewise. (tst-sscanf-ENV): Likewise.
(tst-swprintf-ENV): Likewise. (tst-swprintf-ENV): Likewise.
(tst-swscanf-ENV): Likewise. (tst-swscanf-ENV): Likewise.
(test-vfprintf-ENV): Likewise. (test-vfprintf-ENV): Likewise.
(scanf13-ENV): Likewise. (scanf13-ENV): Likewise.
(bug14-ENV): Likewise. (bug14-ENV): Likewise.
(tst-grouping-ENV): Likewise. (tst-grouping-ENV): Likewise.
* stdlib/Makefile (tst-strtod-ENV): Likewise. * stdlib/Makefile (tst-strtod-ENV): Likewise.
(tst-strtod3-ENV): Likewise. (tst-strtod3-ENV): Likewise.
(tst-strtod4-ENV): Likewise. (tst-strtod4-ENV): Likewise.
(tst-strtod5-ENV): Likewise. (tst-strtod5-ENV): Likewise.
(testmb2-ENV): Likewise./ (testmb2-ENV): Likewise./
* string/Makefile (tst-strxfrm-ENV): Likewise. * string/Makefile (tst-strxfrm-ENV): Likewise.
(tst-strxfrm2-ENV): Likewise. (tst-strxfrm2-ENV): Likewise.
(bug-strcoll1-ENV): Likewise. (bug-strcoll1-ENV): Likewise.
(test-strcasecmp-ENV): Likewise. (test-strcasecmp-ENV): Likewise.
(test-strncasecmp-ENV): Likewise. (test-strncasecmp-ENV): Likewise.
* time/Makefile (tst-strptime-ENV): Likewise. * time/Makefile (tst-strptime-ENV): Likewise.
(tst-ftime_l-ENV): Likewise. (tst-ftime_l-ENV): Likewise.
* wcsmbs/Makefile (tst-btowc-ENV): Likewise. * wcsmbs/Makefile (tst-btowc-ENV): Likewise.
(tst-mbrtowc-ENV): Likewise. (tst-mbrtowc-ENV): Likewise.
(tst-wcrtomb-ENV): Likewise. (tst-wcrtomb-ENV): Likewise.
(tst-mbrtowc2-ENV): Likewise. (tst-mbrtowc2-ENV): Likewise.
(tst-c16c32-1-ENV): Likewise. (tst-c16c32-1-ENV): Likewise.
(tst-mbsnrtowcs-ENV): Likewise. (tst-mbsnrtowcs-ENV): Likewise.
localedata/ChangeLog: localedata/ChangeLog:
* Makefile (TEST_MBWC_ENV): Remove variable. * Makefile (TEST_MBWC_ENV): Remove variable.
(tst_iswalnum-ENV): Likewise. (tst_iswalnum-ENV): Likewise.
(tst_iswalpha-ENV): Likewise. (tst_iswalpha-ENV): Likewise.
(tst_iswcntrl-ENV): Likewise. (tst_iswcntrl-ENV): Likewise.
(tst_iswctype-ENV): Likewise. (tst_iswctype-ENV): Likewise.
(tst_iswdigit-ENV): Likewise. (tst_iswdigit-ENV): Likewise.
(tst_iswgraph-ENV): Likewise. (tst_iswgraph-ENV): Likewise.
(tst_iswlower-ENV): Likewise. (tst_iswlower-ENV): Likewise.
(tst_iswprint-ENV): Likewise. (tst_iswprint-ENV): Likewise.
(tst_iswpunct-ENV): Likewise. (tst_iswpunct-ENV): Likewise.
(tst_iswspace-ENV): Likewise. (tst_iswspace-ENV): Likewise.
(tst_iswupper-ENV): Likewise. (tst_iswupper-ENV): Likewise.
(tst_iswxdigit-ENV): Likewise. (tst_iswxdigit-ENV): Likewise.
(tst_mblen-ENV): Likewise. (tst_mblen-ENV): Likewise.
(tst_mbrlen-ENV): Likewise. (tst_mbrlen-ENV): Likewise.
(tst_mbrtowc-ENV): Likewise. (tst_mbrtowc-ENV): Likewise.
(tst_mbsrtowcs-ENV): Likewise. (tst_mbsrtowcs-ENV): Likewise.
(tst_mbstowcs-ENV): Likewise. (tst_mbstowcs-ENV): Likewise.
(tst_mbtowc-ENV): Likewise. (tst_mbtowc-ENV): Likewise.
(tst_strcoll-ENV): Likewise. (tst_strcoll-ENV): Likewise.
(tst_strfmon-ENV): Likewise. (tst_strfmon-ENV): Likewise.
(tst_strxfrm-ENV): Likewise. (tst_strxfrm-ENV): Likewise.
(tst_swscanf-ENV): Likewise. (tst_swscanf-ENV): Likewise.
(tst_towctrans-ENV): Likewise. (tst_towctrans-ENV): Likewise.
(tst_towlower-ENV): Likewise. (tst_towlower-ENV): Likewise.
(tst_towupper-ENV): Likewise. (tst_towupper-ENV): Likewise.
(tst_wcrtomb-ENV): Likewise. (tst_wcrtomb-ENV): Likewise.
(tst_wcscat-ENV): Likewise. (tst_wcscat-ENV): Likewise.
(tst_wcschr-ENV): Likewise. (tst_wcschr-ENV): Likewise.
(tst_wcscmp-ENV): Likewise. (tst_wcscmp-ENV): Likewise.
(tst_wcscoll-ENV): Likewise. (tst_wcscoll-ENV): Likewise.
(tst_wcscpy-ENV): Likewise. (tst_wcscpy-ENV): Likewise.
(tst_wcscspn-ENV): Likewise. (tst_wcscspn-ENV): Likewise.
(tst_wcslen-ENV): Likewise. (tst_wcslen-ENV): Likewise.
(tst_wcsncat-ENV): Likewise. (tst_wcsncat-ENV): Likewise.
(tst_wcsncmp-ENV): Likewise. (tst_wcsncmp-ENV): Likewise.
(tst_wcsncpy-ENV): Likewise. (tst_wcsncpy-ENV): Likewise.
(tst_wcspbrk-ENV): Likewise. (tst_wcspbrk-ENV): Likewise.
(tst_wcsrtombs-ENV): Likewise. (tst_wcsrtombs-ENV): Likewise.
(tst_wcsspn-ENV): Likewise. (tst_wcsspn-ENV): Likewise.
(tst_wcsstr-ENV): Likewise. (tst_wcsstr-ENV): Likewise.
(tst_wcstod-ENV): Likewise. (tst_wcstod-ENV): Likewise.
(tst_wcstok-ENV): Likewise. (tst_wcstok-ENV): Likewise.
(tst_wcstombs-ENV): Likewise. (tst_wcstombs-ENV): Likewise.
(tst_wcswidth-ENV): Likewise. (tst_wcswidth-ENV): Likewise.
(tst_wcsxfrm-ENV): Likewise. (tst_wcsxfrm-ENV): Likewise.
(tst_wctob-ENV): Likewise. (tst_wctob-ENV): Likewise.
(tst_wctomb-ENV): Likewise. (tst_wctomb-ENV): Likewise.
(tst_wctrans-ENV): Likewise. (tst_wctrans-ENV): Likewise.
(tst_wctype-ENV): Likewise. (tst_wctype-ENV): Likewise.
(tst_wcwidth-ENV): Likewise. (tst_wcwidth-ENV): Likewise.
(tst-digits-ENV): Likewise. (tst-digits-ENV): Likewise.
(tst-mbswcs6-ENV): Likewise. (tst-mbswcs6-ENV): Likewise.
(tst-xlocale1-ENV): Likewise. (tst-xlocale1-ENV): Likewise.
(tst-xlocale2-ENV): Likewise. (tst-xlocale2-ENV): Likewise.
(tst-strfmon1-ENV): Likewise. (tst-strfmon1-ENV): Likewise.
(tst-strptime-ENV): Likewise. (tst-strptime-ENV): Likewise.
(tst-setlocale-ENV): Don't set LOCPATH. (tst-setlocale-ENV): Don't set LOCPATH.
(bug-iconv-trans-ENV): Remove variable. (bug-iconv-trans-ENV): Remove variable.
(tst-sscanf-ENV): Likewise. (tst-sscanf-ENV): Likewise.
(tst-leaks-ENV): Don't set LOCPATH. (tst-leaks-ENV): Don't set LOCPATH.
(bug-setlocale1-ENV): Remove variable. (bug-setlocale1-ENV): Remove variable.
(bug-setlocale1-static-ENV): Likewise. (bug-setlocale1-static-ENV): Likewise.
(tst-setlocale2-ENV): Likewise. (tst-setlocale2-ENV): Likewise.


diff --git glibc-2.17-c758a686/Rules glibc-2.17-c758a686/Rules diff --git glibc-2.17-c758a686/Rules glibc-2.17-c758a686/Rules
index feb304d..9f1a445 100644 index feb304d..9f1a445 100644
@ -197,9 +197,9 @@ index feb304d..9f1a445 100644
- GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \ - GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
+ GCONV_PATH=$(common-objpfx)iconvdata \ + GCONV_PATH=$(common-objpfx)iconvdata \
+ LOCPATH=$(common-objpfx)localedata LC_ALL=C \ + LOCPATH=$(common-objpfx)localedata LC_ALL=C \
$($*-ENV) $(host-built-program-cmd) $($*-ARGS) $($*-ENV) $(host-built-program-cmd) $($*-ARGS)
$(objpfx)%-bp.out: %.input $(objpfx)%-bp $(objpfx)%-bp.out: %.input $(objpfx)%-bp
$(make-test-out) > $@ < $(word 1,$^) $(make-test-out) > $@ < $(word 1,$^)
diff --git glibc-2.17-c758a686/debug/Makefile glibc-2.17-c758a686/debug/Makefile diff --git glibc-2.17-c758a686/debug/Makefile glibc-2.17-c758a686/debug/Makefile
index b599a22..c284c51 100644 index b599a22..c284c51 100644
--- glibc-2.17-c758a686/debug/Makefile --- glibc-2.17-c758a686/debug/Makefile
@ -282,8 +282,8 @@ index d7ab445..20da00c 100644
--- glibc-2.17-c758a686/localedata/Makefile --- glibc-2.17-c758a686/localedata/Makefile
+++ glibc-2.17-c758a686/localedata/Makefile +++ glibc-2.17-c758a686/localedata/Makefile
@@ -215,79 +215,13 @@ @@ -215,79 +215,13 @@
$(addprefix --prefix=,$(install_root)) $$locale; \ $(addprefix --prefix=,$(install_root)) $$locale; \
echo ' done'; \ echo ' done'; \
-# The mbwc-tests need some environment setup to find the locale data files -# The mbwc-tests need some environment setup to find the locale data files
-TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)localedata -TEST_MBWC_ENV:= LOCPATH=$(common-objpfx)localedata
@ -355,14 +355,14 @@ index d7ab445..20da00c 100644
- LOCPATH=$(common-objpfx)localedata - LOCPATH=$(common-objpfx)localedata
+tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace +tst-leaks-ENV = MALLOC_TRACE=$(objpfx)tst-leaks.mtrace
$(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out $(objpfx)mtrace-tst-leaks: $(objpfx)tst-leaks.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@ $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks.mtrace > $@
-bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata -bug-setlocale1-ENV = LOCPATH=$(common-objpfx)localedata
bug-setlocale1-ARGS = $(common-objpfx) bug-setlocale1-ARGS = $(common-objpfx)
-tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata -tst-setlocale2-ENV = LOCPATH=$(common-objpfx)localedata
$(objdir)/iconvdata/gconv-modules: $(objdir)/iconvdata/gconv-modules:
$(MAKE) -C ../iconvdata subdir=iconvdata $@ $(MAKE) -C ../iconvdata subdir=iconvdata $@
diff --git glibc-2.17-c758a686/posix/Makefile glibc-2.17-c758a686/posix/Makefile diff --git glibc-2.17-c758a686/posix/Makefile glibc-2.17-c758a686/posix/Makefile
index 328c2c5..3d75971 100644 index 328c2c5..3d75971 100644
--- glibc-2.17-c758a686/posix/Makefile --- glibc-2.17-c758a686/posix/Makefile

19
SOURCES/glibc-rh1138520.patch

@ -74,8 +74,8 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
data.needed_groups = &first_needed.elem; data.needed_groups = &first_needed.elem;
@@ -218,21 +217,24 @@ addgetnetgrentX (struct database_dyn *db @@ -218,21 +217,24 @@ addgetnetgrentX (struct database_dyn *db
if (buflen - req->key_len - bufused < needed) if (buflen - req->key_len - bufused < needed)
{ {
- size_t newsize = MAX (2 * buflen, - size_t newsize = MAX (2 * buflen,
- buflen + 2 * needed); - buflen + 2 * needed);
- if (use_malloc || newsize > 1024 * 1024) - if (use_malloc || newsize > 1024 * 1024)
@ -109,13 +109,13 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
+ ndomain = (ndomain ? newbuf + ndomaindiff + ndomain = (ndomain ? newbuf + ndomaindiff
+ : NULL); + : NULL);
+ buffer = newbuf; + buffer = newbuf;
} }
nhost = memcpy (buffer + bufused, nhost = memcpy (buffer + bufused,
@@ -299,18 +301,8 @@ addgetnetgrentX (struct database_dyn *db @@ -299,18 +301,8 @@ addgetnetgrentX (struct database_dyn *db
} }
else if (status == NSS_STATUS_UNAVAIL && e == ERANGE) else if (status == NSS_STATUS_UNAVAIL && e == ERANGE)
{ {
- size_t newsize = 2 * buflen; - size_t newsize = 2 * buflen;
- if (use_malloc || newsize > 1024 * 1024) - if (use_malloc || newsize > 1024 * 1024)
- { - {
@ -130,8 +130,8 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
- extend_alloca (buffer, buflen, newsize); - extend_alloca (buffer, buflen, newsize);
+ buflen *= 2; + buflen *= 2;
+ buffer = xrealloc (buffer, buflen); + buffer = xrealloc (buffer, buflen);
} }
} }
@@ -446,8 +438,7 @@ addgetnetgrentX (struct database_dyn *db @@ -446,8 +438,7 @@ addgetnetgrentX (struct database_dyn *db
} }
@ -142,3 +142,4 @@ diff -pruN glibc-2.17-c758a686/nscd/netgroupcache.c glibc-2.17-c758a686/nscd/net
+ free (buffer); + free (buffer);
*resultp = dataset; *resultp = dataset;

12
SOURCES/glibc-rh1140250.patch

@ -187,8 +187,8 @@ Index: b/sysdeps/posix/posix_fallocate.c
+ /* This is racy, but there is no good way to satisfy a + /* This is racy, but there is no good way to satisfy a
+ zero-length allocation request. */ + zero-length allocation request. */
if (st.st_size < offset) if (st.st_size < offset)
{ {
int ret = __ftruncate (fd, offset); int ret = __ftruncate (fd, offset);
@@ -58,19 +70,36 @@ posix_fallocate (int fd, __off_t offset, @@ -58,19 +70,36 @@ posix_fallocate (int fd, __off_t offset,
return 0; return 0;
} }
@ -237,7 +237,7 @@ Index: b/sysdeps/posix/posix_fallocate.c
+ len -= increment; + len -= increment;
if (offset < st.st_size) if (offset < st.st_size)
{ {
Index: b/sysdeps/posix/posix_fallocate64.c Index: b/sysdeps/posix/posix_fallocate64.c
=================================================================== ===================================================================
--- a/sysdeps/posix/posix_fallocate64.c --- a/sysdeps/posix/posix_fallocate64.c
@ -293,8 +293,8 @@ Index: b/sysdeps/posix/posix_fallocate64.c
+ /* This is racy, but there is no good way to satisfy a + /* This is racy, but there is no good way to satisfy a
+ zero-length allocation request. */ + zero-length allocation request. */
if (st.st_size < offset) if (st.st_size < offset)
{ {
int ret = __ftruncate64 (fd, offset); int ret = __ftruncate64 (fd, offset);
@@ -58,19 +70,36 @@ __posix_fallocate64_l64 (int fd, __off64 @@ -58,19 +70,36 @@ __posix_fallocate64_l64 (int fd, __off64
return 0; return 0;
} }
@ -343,4 +343,4 @@ Index: b/sysdeps/posix/posix_fallocate64.c
+ len -= increment; + len -= increment;
if (offset < st.st_size) if (offset < st.st_size)
{ {

200
SOURCES/glibc-rh1140272-avx512.patch

@ -201,7 +201,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686
@@ -19,14 +19,14 @@ @@ -19,14 +19,14 @@
#ifdef RESTORE_AVX #ifdef RESTORE_AVX
/* This is to support AVX audit modules. */ /* This is to support AVX audit modules. */
- vmovdqu %ymm0, (LR_VECTOR_OFFSET)(%rsp) - vmovdqu %ymm0, (LR_VECTOR_OFFSET)(%rsp)
- vmovdqu %ymm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) - vmovdqu %ymm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp)
- vmovdqu %ymm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) - vmovdqu %ymm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp)
@ -219,102 +219,102 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.h glibc-2.17-c758a686
+ VMOV %VEC(6), (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) + VMOV %VEC(6), (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp)
+ VMOV %VEC(7), (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) + VMOV %VEC(7), (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp)
/* Save xmm0-xmm7 registers to detect if any of them are /* Save xmm0-xmm7 registers to detect if any of them are
changed by audit module. */ changed by audit module. */
@@ -72,7 +72,7 @@ @@ -72,7 +72,7 @@
je 2f je 2f
vmovdqa %xmm0, (LR_VECTOR_OFFSET)(%rsp) vmovdqa %xmm0, (LR_VECTOR_OFFSET)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET)(%rsp), %ymm0 -2: vmovdqu (LR_VECTOR_OFFSET)(%rsp), %ymm0
+2: VMOV (LR_VECTOR_OFFSET)(%rsp), %VEC(0) +2: VMOV (LR_VECTOR_OFFSET)(%rsp), %VEC(0)
vmovdqa %xmm0, (LR_XMM_OFFSET)(%rsp) vmovdqa %xmm0, (LR_XMM_OFFSET)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm8
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
je 2f je 2f
vmovdqa %xmm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp) vmovdqa %xmm1, (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %ymm1 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %ymm1
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %VEC(1) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE)(%rsp), %VEC(1)
vmovdqa %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp) vmovdqa %xmm1, (LR_XMM_OFFSET + XMM_SIZE)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE*2)(%rsp), %xmm2, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE*2)(%rsp), %xmm2, %xmm8
@@ -90,7 +90,7 @@ @@ -90,7 +90,7 @@
je 2f je 2f
vmovdqa %xmm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp) vmovdqa %xmm2, (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %ymm2 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %ymm2
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %VEC(2) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*2)(%rsp), %VEC(2)
vmovdqa %xmm2, (LR_XMM_OFFSET + XMM_SIZE*2)(%rsp) vmovdqa %xmm2, (LR_XMM_OFFSET + XMM_SIZE*2)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE*3)(%rsp), %xmm3, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE*3)(%rsp), %xmm3, %xmm8
@@ -99,7 +99,7 @@ @@ -99,7 +99,7 @@
je 2f je 2f
vmovdqa %xmm3, (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp) vmovdqa %xmm3, (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %ymm3 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %ymm3
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %VEC(3) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*3)(%rsp), %VEC(3)
vmovdqa %xmm3, (LR_XMM_OFFSET + XMM_SIZE*3)(%rsp) vmovdqa %xmm3, (LR_XMM_OFFSET + XMM_SIZE*3)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE*4)(%rsp), %xmm4, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE*4)(%rsp), %xmm4, %xmm8
@@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
je 2f je 2f
vmovdqa %xmm4, (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp) vmovdqa %xmm4, (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %ymm4 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %ymm4
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %VEC(4) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*4)(%rsp), %VEC(4)
vmovdqa %xmm4, (LR_XMM_OFFSET + XMM_SIZE*4)(%rsp) vmovdqa %xmm4, (LR_XMM_OFFSET + XMM_SIZE*4)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE*5)(%rsp), %xmm5, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE*5)(%rsp), %xmm5, %xmm8
@@ -117,7 +117,7 @@ @@ -117,7 +117,7 @@
je 2f je 2f
vmovdqa %xmm5, (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp) vmovdqa %xmm5, (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %ymm5 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %ymm5
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %VEC(5) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*5)(%rsp), %VEC(5)
vmovdqa %xmm5, (LR_XMM_OFFSET + XMM_SIZE*5)(%rsp) vmovdqa %xmm5, (LR_XMM_OFFSET + XMM_SIZE*5)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE*6)(%rsp), %xmm6, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE*6)(%rsp), %xmm6, %xmm8
@@ -126,7 +126,7 @@ @@ -126,7 +126,7 @@
je 2f je 2f
vmovdqa %xmm6, (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp) vmovdqa %xmm6, (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %ymm6 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %ymm6
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %VEC(6) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*6)(%rsp), %VEC(6)
vmovdqa %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) vmovdqa %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp)
1: vpcmpeqq (LR_SIZE + XMM_SIZE*7)(%rsp), %xmm7, %xmm8 1: vpcmpeqq (LR_SIZE + XMM_SIZE*7)(%rsp), %xmm7, %xmm8
@@ -135,7 +135,7 @@ @@ -135,7 +135,7 @@
je 2f je 2f
vmovdqa %xmm7, (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp) vmovdqa %xmm7, (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp)
jmp 1f jmp 1f
-2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %ymm7 -2: vmovdqu (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %ymm7
+2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %VEC(7) +2: VMOV (LR_VECTOR_OFFSET + VECTOR_SIZE*7)(%rsp), %VEC(7)
vmovdqa %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) vmovdqa %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp)
1: 1:
@@ -213,8 +213,8 @@ @@ -213,8 +213,8 @@
#ifdef RESTORE_AVX #ifdef RESTORE_AVX
/* This is to support AVX audit modules. */ /* This is to support AVX audit modules. */
- vmovdqu %ymm0, LRV_VECTOR0_OFFSET(%rcx) - vmovdqu %ymm0, LRV_VECTOR0_OFFSET(%rcx)
- vmovdqu %ymm1, LRV_VECTOR1_OFFSET(%rcx) - vmovdqu %ymm1, LRV_VECTOR1_OFFSET(%rcx)
+ VMOV %VEC(0), LRV_VECTOR0_OFFSET(%rcx) + VMOV %VEC(0), LRV_VECTOR0_OFFSET(%rcx)
+ VMOV %VEC(1), LRV_VECTOR1_OFFSET(%rcx) + VMOV %VEC(1), LRV_VECTOR1_OFFSET(%rcx)
/* Save xmm0/xmm1 registers to detect if they are changed /* Save xmm0/xmm1 registers to detect if they are changed
by audit module. */ by audit module. */
@@ -243,13 +243,13 @@ @@ -243,13 +243,13 @@
vpmovmskb %xmm2, %esi vpmovmskb %xmm2, %esi
cmpl $0xffff, %esi cmpl $0xffff, %esi
jne 1f jne 1f
- vmovdqu LRV_VECTOR0_OFFSET(%rsp), %ymm0 - vmovdqu LRV_VECTOR0_OFFSET(%rsp), %ymm0
+ VMOV LRV_VECTOR0_OFFSET(%rsp), %VEC(0) + VMOV LRV_VECTOR0_OFFSET(%rsp), %VEC(0)
1: vpcmpeqq (LRV_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm2 1: vpcmpeqq (LRV_SIZE + XMM_SIZE)(%rsp), %xmm1, %xmm2
vpmovmskb %xmm2, %esi vpmovmskb %xmm2, %esi
cmpl $0xffff, %esi cmpl $0xffff, %esi
jne 1f jne 1f
- vmovdqu LRV_VECTOR1_OFFSET(%rsp), %ymm1 - vmovdqu LRV_VECTOR1_OFFSET(%rsp), %ymm1
+ VMOV LRV_VECTOR1_OFFSET(%rsp), %VEC(1) + VMOV LRV_VECTOR1_OFFSET(%rsp), %VEC(1)
@ -325,35 +325,35 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:16:36.334167050 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S 2014-09-10 23:16:36.334167050 -0400
@@ -96,7 +96,7 @@ @@ -96,7 +96,7 @@
/* Actively align the La_x86_64_regs structure. */ /* Actively align the La_x86_64_regs structure. */
andq $0xfffffffffffffff0, %rsp andq $0xfffffffffffffff0, %rsp
-# ifdef HAVE_AVX_SUPPORT -# ifdef HAVE_AVX_SUPPORT
+# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT
/* sizeof(La_x86_64_regs). Need extra space for 8 SSE registers /* sizeof(La_x86_64_regs). Need extra space for 8 SSE registers
to detect if any xmm0-xmm7 registers are changed by audit to detect if any xmm0-xmm7 registers are changed by audit
module. */ module. */
@@ -130,7 +130,7 @@ @@ -130,7 +130,7 @@
movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp) movaps %xmm6, (LR_XMM_OFFSET + XMM_SIZE*6)(%rsp)
movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp) movaps %xmm7, (LR_XMM_OFFSET + XMM_SIZE*7)(%rsp)
-# ifdef HAVE_AVX_SUPPORT -# ifdef HAVE_AVX_SUPPORT
+# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT
.data .data
L(have_avx): L(have_avx):
.zero 4 .zero 4
@@ -138,7 +138,7 @@ @@ -138,7 +138,7 @@
.previous .previous
cmpl $0, L(have_avx)(%rip) cmpl $0, L(have_avx)(%rip)
- jne 1f - jne 1f
+ jne L(defined) + jne L(defined)
movq %rbx, %r11 # Save rbx movq %rbx, %r11 # Save rbx
movl $1, %eax movl $1, %eax
cpuid cpuid
@@ -147,18 +147,54 @@ @@ -147,18 +147,54 @@
// AVX and XSAVE supported? // AVX and XSAVE supported?
andl $((1 << 28) | (1 << 27)), %ecx andl $((1 << 28) | (1 << 27)), %ecx
cmpl $((1 << 28) | (1 << 27)), %ecx cmpl $((1 << 28) | (1 << 27)), %ecx
- jne 2f - jne 2f
+ jne 10f + jne 10f
+# ifdef HAVE_AVX512_ASM_SUPPORT +# ifdef HAVE_AVX512_ASM_SUPPORT
@ -364,9 +364,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+ cpuid + cpuid
+ andl $(1 << 16), %ebx + andl $(1 << 16), %ebx
+# endif +# endif
xorl %ecx, %ecx xorl %ecx, %ecx
// Get XFEATURE_ENABLED_MASK // Get XFEATURE_ENABLED_MASK
xgetbv xgetbv
- andl $0x6, %eax - andl $0x6, %eax
-2: subl $0x5, %eax -2: subl $0x5, %eax
+# ifdef HAVE_AVX512_ASM_SUPPORT +# ifdef HAVE_AVX512_ASM_SUPPORT
@ -392,8 +392,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+# endif +# endif
+20: andl $0x6, %eax +20: andl $0x6, %eax
+10: subl $0x5, %eax +10: subl $0x5, %eax
movl %eax, L(have_avx)(%rip) movl %eax, L(have_avx)(%rip)
cmpl $0, %eax cmpl $0, %eax
-1: js L(no_avx) -1: js L(no_avx)
+L(defined): +L(defined):
@ -410,21 +410,21 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
# include "dl-trampoline.h" # include "dl-trampoline.h"
@@ -180,9 +216,9 @@ @@ -180,9 +216,9 @@
.align 16 .align 16
cfi_startproc cfi_startproc
_dl_x86_64_save_sse: _dl_x86_64_save_sse:
-# ifdef HAVE_AVX_SUPPORT -# ifdef HAVE_AVX_SUPPORT
+# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT
cmpl $0, L(have_avx)(%rip) cmpl $0, L(have_avx)(%rip)
- jne 1f - jne 1f
+ jne L(defined_5) + jne L(defined_5)
movq %rbx, %r11 # Save rbx movq %rbx, %r11 # Save rbx
movl $1, %eax movl $1, %eax
cpuid cpuid
@@ -191,21 +227,43 @@ @@ -191,21 +227,43 @@
// AVX and XSAVE supported? // AVX and XSAVE supported?
andl $((1 << 28) | (1 << 27)), %ecx andl $((1 << 28) | (1 << 27)), %ecx
cmpl $((1 << 28) | (1 << 27)), %ecx cmpl $((1 << 28) | (1 << 27)), %ecx
- jne 2f - jne 2f
+ jne 1f + jne 1f
+# ifdef HAVE_AVX512_ASM_SUPPORT +# ifdef HAVE_AVX512_ASM_SUPPORT
@ -435,9 +435,9 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+ cpuid + cpuid
+ andl $(1 << 16), %ebx + andl $(1 << 16), %ebx
+# endif +# endif
xorl %ecx, %ecx xorl %ecx, %ecx
// Get XFEATURE_ENABLED_MASK // Get XFEATURE_ENABLED_MASK
xgetbv xgetbv
- andl $0x6, %eax - andl $0x6, %eax
- cmpl $0x6, %eax - cmpl $0x6, %eax
- // Nonzero if SSE and AVX state saving is enabled. - // Nonzero if SSE and AVX state saving is enabled.
@ -458,8 +458,8 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+ +
+2: andl $0x6, %eax +2: andl $0x6, %eax
+1: subl $0x5, %eax +1: subl $0x5, %eax
movl %eax, L(have_avx)(%rip) movl %eax, L(have_avx)(%rip)
cmpl $0, %eax cmpl $0, %eax
-1: js L(no_avx5) -1: js L(no_avx5)
+L(defined_5): +L(defined_5):
@ -470,13 +470,13 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+# endif +# endif
-# define YMM_SIZE 32 -# define YMM_SIZE 32
vmovdqa %ymm0, %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE vmovdqa %ymm0, %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE
vmovdqa %ymm1, %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE vmovdqa %ymm1, %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE
vmovdqa %ymm2, %fs:RTLD_SAVESPACE_SSE+2*YMM_SIZE vmovdqa %ymm2, %fs:RTLD_SAVESPACE_SSE+2*YMM_SIZE
@@ -215,6 +273,18 @@ @@ -215,6 +273,18 @@
vmovdqa %ymm6, %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE vmovdqa %ymm6, %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE
vmovdqa %ymm7, %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE vmovdqa %ymm7, %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE
ret ret
+# ifdef HAVE_AVX512_ASM_SUPPORT +# ifdef HAVE_AVX512_ASM_SUPPORT
+L(avx512_5): +L(avx512_5):
+ vmovdqu64 %zmm0, %fs:RTLD_SAVESPACE_SSE+0*ZMM_SIZE + vmovdqu64 %zmm0, %fs:RTLD_SAVESPACE_SSE+0*ZMM_SIZE
@ -491,26 +491,26 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+# endif +# endif
L(no_avx5): L(no_avx5):
# endif # endif
movdqa %xmm0, %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE movdqa %xmm0, %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE
@@ -235,9 +305,13 @@ @@ -235,9 +305,13 @@
.align 16 .align 16
cfi_startproc cfi_startproc
_dl_x86_64_restore_sse: _dl_x86_64_restore_sse:
-# ifdef HAVE_AVX_SUPPORT -# ifdef HAVE_AVX_SUPPORT
+# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT +# if defined HAVE_AVX_SUPPORT || defined HAVE_AVX512_ASM_SUPPORT
cmpl $0, L(have_avx)(%rip) cmpl $0, L(have_avx)(%rip)
js L(no_avx6) js L(no_avx6)
+# ifdef HAVE_AVX512_ASM_SUPPORT +# ifdef HAVE_AVX512_ASM_SUPPORT
+ cmpl $0xe6, L(have_avx)(%rip) + cmpl $0xe6, L(have_avx)(%rip)
+ je L(avx512_6) + je L(avx512_6)
+# endif +# endif
vmovdqa %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE, %ymm0 vmovdqa %fs:RTLD_SAVESPACE_SSE+0*YMM_SIZE, %ymm0
vmovdqa %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE, %ymm1 vmovdqa %fs:RTLD_SAVESPACE_SSE+1*YMM_SIZE, %ymm1
@@ -248,6 +322,18 @@ @@ -248,6 +322,18 @@
vmovdqa %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE, %ymm6 vmovdqa %fs:RTLD_SAVESPACE_SSE+6*YMM_SIZE, %ymm6
vmovdqa %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE, %ymm7 vmovdqa %fs:RTLD_SAVESPACE_SSE+7*YMM_SIZE, %ymm7
ret ret
+# ifdef HAVE_AVX512_ASM_SUPPORT +# ifdef HAVE_AVX512_ASM_SUPPORT
+L(avx512_6): +L(avx512_6):
+ vmovdqu64 %fs:RTLD_SAVESPACE_SSE+0*ZMM_SIZE, %zmm0 + vmovdqu64 %fs:RTLD_SAVESPACE_SSE+0*ZMM_SIZE, %zmm0
@ -525,7 +525,7 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86_64/dl-trampoline.S glibc-2.17-c758a686
+# endif +# endif
L(no_avx6): L(no_avx6):
# endif # endif
movdqa %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE, %xmm0 movdqa %fs:RTLD_SAVESPACE_SSE+0*XMM_SIZE, %xmm0
diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym diff -urN glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym
--- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2012-12-24 22:02:13.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2012-12-24 22:02:13.000000000 -0500
+++ glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-09-10 23:16:36.335167048 -0400 +++ glibc-2.17-c758a686/sysdeps/x86_64/link-defines.sym 2014-09-10 23:16:36.335167048 -0400
@ -933,14 +933,14 @@ diff -urN glibc-2.17-c758a686/sysdeps/x86/Makefile glibc-2.17-c758a686/sysdeps/x
+++ glibc-2.17-c758a686/sysdeps/x86/Makefile 2014-09-11 16:06:03.121319867 -0400 +++ glibc-2.17-c758a686/sysdeps/x86/Makefile 2014-09-11 16:06:03.121319867 -0400
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\ CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
-mno-sse -mno-mmx) -mno-sse -mno-mmx)
-tests: $(objpfx)tst-xmmymm.out -tests: $(objpfx)tst-xmmymm.out
-$(objpfx)tst-xmmymm.out: ../sysdeps/x86/tst-xmmymm.sh $(objpfx)ld.so -$(objpfx)tst-xmmymm.out: ../sysdeps/x86/tst-xmmymm.sh $(objpfx)ld.so
+tests: $(objpfx)tst-xmmymmzmm.out +tests: $(objpfx)tst-xmmymmzmm.out
+$(objpfx)tst-xmmymmzmm.out: ../sysdeps/x86/tst-xmmymmzmm.sh $(objpfx)ld.so +$(objpfx)tst-xmmymmzmm.out: ../sysdeps/x86/tst-xmmymmzmm.sh $(objpfx)ld.so
@echo "Checking ld.so for SSE register use. This will take a few seconds..." @echo "Checking ld.so for SSE register use. This will take a few seconds..."
$(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@ $(SHELL) $< $(objpfx) '$(NM)' '$(OBJDUMP)' '$(READELF)' > $@
endif endif
diff -urN glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh diff -urN glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh
--- glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh 2012-12-24 22:02:13.000000000 -0500 --- glibc-2.17-c758a686/sysdeps/x86/tst-xmmymm.sh 2012-12-24 22:02:13.000000000 -0500

102
SOURCES/glibc-rh1140474.patch

@ -13,10 +13,10 @@ index 0a410a1..b6327d6 100644
+++ glibc-2.17-c758a686/iconvdata/Makefile +++ glibc-2.17-c758a686/iconvdata/Makefile
@@ -297,6 +297,7 @@ $(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \ @@ -297,6 +297,7 @@ $(objpfx)tst-iconv7.out: $(objpfx)gconv-modules \
$(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \ $(objpfx)iconv-test.out: run-iconv-test.sh $(objpfx)gconv-modules \
$(addprefix $(objpfx),$(modules.so)) \ $(addprefix $(objpfx),$(modules.so)) \
$(common-objdir)/iconv/iconv_prog TESTS $(common-objdir)/iconv/iconv_prog TESTS
+ iconv_modules="$(modules)" \ + iconv_modules="$(modules)" \
$(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@ $(SHELL) $< $(common-objdir) '$(test-wrapper)' > $@
$(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \ $(objpfx)tst-tables.out: tst-tables.sh $(objpfx)gconv-modules \
diff --git glibc-2.17-c758a686/iconvdata/ibm1364.c glibc-2.17-c758a686/iconvdata/ibm1364.c diff --git glibc-2.17-c758a686/iconvdata/ibm1364.c glibc-2.17-c758a686/iconvdata/ibm1364.c
@ -24,105 +24,105 @@ index 0b5484f..cf80993 100644
--- glibc-2.17-c758a686/iconvdata/ibm1364.c --- glibc-2.17-c758a686/iconvdata/ibm1364.c
+++ glibc-2.17-c758a686/iconvdata/ibm1364.c +++ glibc-2.17-c758a686/iconvdata/ibm1364.c
@@ -221,7 +221,8 @@ enum @@ -221,7 +221,8 @@ enum
++rp2; \ ++rp2; \
\ \
uint32_t res; \ uint32_t res; \
- if (__builtin_expect (ch < rp2->start, 0) \ - if (__builtin_expect (ch < rp2->start, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \
+ || __builtin_expect (ch < rp2->start, 0) \ + || __builtin_expect (ch < rp2->start, 0) \
|| (res = DB_TO_UCS4[ch + rp2->idx], \ || (res = DB_TO_UCS4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
{ \ { \
diff --git glibc-2.17-c758a686/iconvdata/ibm932.c glibc-2.17-c758a686/iconvdata/ibm932.c diff --git glibc-2.17-c758a686/iconvdata/ibm932.c glibc-2.17-c758a686/iconvdata/ibm932.c
index f5dca59..aa69d65 100644 index f5dca59..aa69d65 100644
--- glibc-2.17-c758a686/iconvdata/ibm932.c --- glibc-2.17-c758a686/iconvdata/ibm932.c
+++ glibc-2.17-c758a686/iconvdata/ibm932.c +++ glibc-2.17-c758a686/iconvdata/ibm932.c
@@ -74,11 +74,12 @@ @@ -74,11 +74,12 @@
} \ } \
\ \
ch = (ch * 0x100) + inptr[1]; \ ch = (ch * 0x100) + inptr[1]; \
+ /* ch was less than 0xfd. */ \ + /* ch was less than 0xfd. */ \
+ assert (ch < 0xfd00); \ + assert (ch < 0xfd00); \
while (ch > rp2->end) \ while (ch > rp2->end) \
++rp2; \ ++rp2; \
\ \
- if (__builtin_expect (rp2 == NULL, 0) \ - if (__builtin_expect (rp2 == NULL, 0) \
- || __builtin_expect (ch < rp2->start, 0) \ - || __builtin_expect (ch < rp2->start, 0) \
+ if (__builtin_expect (ch < rp2->start, 0) \ + if (__builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm932db_to_ucs4[ch + rp2->idx], \ || (res = __ibm932db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, '\1') == 0 && ch !=0)) \ __builtin_expect (res, '\1') == 0 && ch !=0)) \
{ \ { \
diff --git glibc-2.17-c758a686/iconvdata/ibm933.c glibc-2.17-c758a686/iconvdata/ibm933.c diff --git glibc-2.17-c758a686/iconvdata/ibm933.c glibc-2.17-c758a686/iconvdata/ibm933.c
index f46dfb5..461fb5e 100644 index f46dfb5..461fb5e 100644
--- glibc-2.17-c758a686/iconvdata/ibm933.c --- glibc-2.17-c758a686/iconvdata/ibm933.c
+++ glibc-2.17-c758a686/iconvdata/ibm933.c +++ glibc-2.17-c758a686/iconvdata/ibm933.c
@@ -162,7 +162,7 @@ enum @@ -162,7 +162,7 @@ enum
while (ch > rp2->end) \ while (ch > rp2->end) \
++rp2; \ ++rp2; \
\ \
- if (__builtin_expect (rp2 == NULL, 0) \ - if (__builtin_expect (rp2 == NULL, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \
|| __builtin_expect (ch < rp2->start, 0) \ || __builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm933db_to_ucs4[ch + rp2->idx], \ || (res = __ibm933db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
diff --git glibc-2.17-c758a686/iconvdata/ibm935.c glibc-2.17-c758a686/iconvdata/ibm935.c diff --git glibc-2.17-c758a686/iconvdata/ibm935.c glibc-2.17-c758a686/iconvdata/ibm935.c
index a8e4e6c..132d816 100644 index a8e4e6c..132d816 100644
--- glibc-2.17-c758a686/iconvdata/ibm935.c --- glibc-2.17-c758a686/iconvdata/ibm935.c
+++ glibc-2.17-c758a686/iconvdata/ibm935.c +++ glibc-2.17-c758a686/iconvdata/ibm935.c
@@ -162,7 +162,7 @@ enum @@ -162,7 +162,7 @@ enum
while (ch > rp2->end) \ while (ch > rp2->end) \
++rp2; \ ++rp2; \
\ \
- if (__builtin_expect (rp2 == NULL, 0) \ - if (__builtin_expect (rp2 == NULL, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \
|| __builtin_expect (ch < rp2->start, 0) \ || __builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm935db_to_ucs4[ch + rp2->idx], \ || (res = __ibm935db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
diff --git glibc-2.17-c758a686/iconvdata/ibm937.c glibc-2.17-c758a686/iconvdata/ibm937.c diff --git glibc-2.17-c758a686/iconvdata/ibm937.c glibc-2.17-c758a686/iconvdata/ibm937.c
index 239be61..69b154d 100644 index 239be61..69b154d 100644
--- glibc-2.17-c758a686/iconvdata/ibm937.c --- glibc-2.17-c758a686/iconvdata/ibm937.c
+++ glibc-2.17-c758a686/iconvdata/ibm937.c +++ glibc-2.17-c758a686/iconvdata/ibm937.c
@@ -162,7 +162,7 @@ enum @@ -162,7 +162,7 @@ enum
while (ch > rp2->end) \ while (ch > rp2->end) \
++rp2; \ ++rp2; \
\ \
- if (__builtin_expect (rp2 == NULL, 0) \ - if (__builtin_expect (rp2 == NULL, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \
|| __builtin_expect (ch < rp2->start, 0) \ || __builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm937db_to_ucs4[ch + rp2->idx], \ || (res = __ibm937db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
diff --git glibc-2.17-c758a686/iconvdata/ibm939.c glibc-2.17-c758a686/iconvdata/ibm939.c diff --git glibc-2.17-c758a686/iconvdata/ibm939.c glibc-2.17-c758a686/iconvdata/ibm939.c
index 5d0db36..9936e2c 100644 index 5d0db36..9936e2c 100644
--- glibc-2.17-c758a686/iconvdata/ibm939.c --- glibc-2.17-c758a686/iconvdata/ibm939.c
+++ glibc-2.17-c758a686/iconvdata/ibm939.c +++ glibc-2.17-c758a686/iconvdata/ibm939.c
@@ -162,7 +162,7 @@ enum @@ -162,7 +162,7 @@ enum
while (ch > rp2->end) \ while (ch > rp2->end) \
++rp2; \ ++rp2; \
\ \
- if (__builtin_expect (rp2 == NULL, 0) \ - if (__builtin_expect (rp2 == NULL, 0) \
+ if (__builtin_expect (rp2->start == 0xffff, 0) \ + if (__builtin_expect (rp2->start == 0xffff, 0) \
|| __builtin_expect (ch < rp2->start, 0) \ || __builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm939db_to_ucs4[ch + rp2->idx], \ || (res = __ibm939db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \ __builtin_expect (res, L'\1') == L'\0' && ch != '\0')) \
diff --git glibc-2.17-c758a686/iconvdata/ibm943.c glibc-2.17-c758a686/iconvdata/ibm943.c diff --git glibc-2.17-c758a686/iconvdata/ibm943.c glibc-2.17-c758a686/iconvdata/ibm943.c
index be0c14f..c5d5742 100644 index be0c14f..c5d5742 100644
--- glibc-2.17-c758a686/iconvdata/ibm943.c --- glibc-2.17-c758a686/iconvdata/ibm943.c
+++ glibc-2.17-c758a686/iconvdata/ibm943.c +++ glibc-2.17-c758a686/iconvdata/ibm943.c
@@ -75,11 +75,12 @@ @@ -75,11 +75,12 @@
} \ } \
\ \
ch = (ch * 0x100) + inptr[1]; \ ch = (ch * 0x100) + inptr[1]; \
+ /* ch was less than 0xfd. */ \ + /* ch was less than 0xfd. */ \
+ assert (ch < 0xfd00); \ + assert (ch < 0xfd00); \
while (ch > rp2->end) \ while (ch > rp2->end) \
++rp2; \ ++rp2; \
\ \
- if (__builtin_expect (rp2 == NULL, 0) \ - if (__builtin_expect (rp2 == NULL, 0) \
- || __builtin_expect (ch < rp2->start, 0) \ - || __builtin_expect (ch < rp2->start, 0) \
+ if (__builtin_expect (ch < rp2->start, 0) \ + if (__builtin_expect (ch < rp2->start, 0) \
|| (res = __ibm943db_to_ucs4[ch + rp2->idx], \ || (res = __ibm943db_to_ucs4[ch + rp2->idx], \
__builtin_expect (res, '\1') == 0 && ch !=0)) \ __builtin_expect (res, '\1') == 0 && ch !=0)) \
{ \ { \
diff --git glibc-2.17-c758a686/iconvdata/run-iconv-test.sh glibc-2.17-c758a686/iconvdata/run-iconv-test.sh diff --git glibc-2.17-c758a686/iconvdata/run-iconv-test.sh glibc-2.17-c758a686/iconvdata/run-iconv-test.sh
index c98c929..5dfb69f 100755 index c98c929..5dfb69f 100755
--- glibc-2.17-c758a686/iconvdata/run-iconv-test.sh --- glibc-2.17-c758a686/iconvdata/run-iconv-test.sh

16
SOURCES/glibc-rh1144133.patch

@ -30,17 +30,17 @@ Date: Mon Sep 29 13:14:21 2014 -0400
For more details see: For more details see:
https://sourceware.org/ml/libc-alpha/2014-09/msg00513.html https://sourceware.org/ml/libc-alpha/2014-09/msg00513.html
[BZ #17411] [BZ #17411]
* elf/dl-reloc.c (_dl_relocate_object): Allocate correct amount for * elf/dl-reloc.c (_dl_relocate_object): Allocate correct amount for
l_reloc_result. l_reloc_result.


diff --git glibc-2.17-c758a686/elf/dl-reloc.c glibc-2.17-c758a686/elf/dl-reloc.c diff --git glibc-2.17-c758a686/elf/dl-reloc.c glibc-2.17-c758a686/elf/dl-reloc.c
index d2c6dac..97a7119 100644 index d2c6dac..97a7119 100644
--- glibc-2.17-c758a686/elf/dl-reloc.c --- glibc-2.17-c758a686/elf/dl-reloc.c
+++ glibc-2.17-c758a686/elf/dl-reloc.c +++ glibc-2.17-c758a686/elf/dl-reloc.c
@@ -279,8 +279,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[], @@ -279,8 +279,12 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
l->l_name); l->l_name);
} }
- l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]), - l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]),
- l->l_info[DT_PLTRELSZ]->d_un.d_val); - l->l_info[DT_PLTRELSZ]->d_un.d_val);
@ -50,6 +50,6 @@ index d2c6dac..97a7119 100644
+ size_t relcount = l->l_info[DT_PLTRELSZ]->d_un.d_val / sizeofrel; + size_t relcount = l->l_info[DT_PLTRELSZ]->d_un.d_val / sizeofrel;
+ l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]), relcount); + l->l_reloc_result = calloc (sizeof (l->l_reloc_result[0]), relcount);
+ +
if (l->l_reloc_result == NULL) if (l->l_reloc_result == NULL)
{ {
errstring = N_("\ errstring = N_("\

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save