[glibc] Backport some upstream-wards patches to fix TLS issues on AArch64.

Kyle McMartin kyle at fedoraproject.org
Thu May 22 02:07:10 UTC 2014


commit b39b864460e0356ad144c9b8e81a471fcaa41a02
Author: Kyle McMartin <kmcmarti at redhat.com>
Date:   Wed May 21 22:06:41 2014 -0400

    Backport some upstream-wards patches to fix TLS issues on AArch64.

 glibc-aarch64-tls-fixes.patch |   35 +++++++++++++++++++++++++++++++++++
 glibc.spec                    |    8 +++++++-
 2 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/glibc-aarch64-tls-fixes.patch b/glibc-aarch64-tls-fixes.patch
new file mode 100644
index 0000000..996f378
--- /dev/null
+++ b/glibc-aarch64-tls-fixes.patch
@@ -0,0 +1,35 @@
+diff --git a/sysdeps/aarch64/dl-machine.h b/sysdeps/aarch64/dl-machine.h
+index 997c860..50b37b0 100644
+--- a/sysdeps/aarch64/dl-machine.h
++++ b/sysdeps/aarch64/dl-machine.h
+@@ -295,7 +295,7 @@ elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
+ # ifndef SHARED
+ 		CHECK_STATIC_TLS (map, sym_map);
+ # else
+-		if (!TRY_STATIC_TLS (map, sym_map))
++		if (1)
+ 		  {
+ 		    td->arg = _dl_make_tlsdesc_dynamic
+ 		      (sym_map, sym->st_value + reloc->r_addend);
+diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h
+index ae2e6c4..8b260a1 100644
+--- a/sysdeps/aarch64/nptl/tls.h
++++ b/sysdeps/aarch64/nptl/tls.h
+@@ -63,7 +63,7 @@ typedef struct
+ # define TLS_INIT_TCB_SIZE	sizeof (tcbhead_t)
+ 
+ /* Alignment requirements for the initial TCB.  */
+-# define TLS_INIT_TCB_ALIGN	__alignof__ (tcbhead_t)
++# define TLS_INIT_TCB_ALIGN	__alignof__ (struct pthread)
+ 
+ /* This is the size of the TCB.  */
+ # define TLS_TCB_SIZE		sizeof (tcbhead_t)
+@@ -72,7 +72,7 @@ typedef struct
+ # define TLS_PRE_TCB_SIZE	sizeof (struct pthread)
+ 
+ /* Alignment requirements for the TCB.  */
+-# define TLS_TCB_ALIGN		__alignof__ (tcbhead_t)
++# define TLS_TCB_ALIGN		__alignof__ (struct pthread)
+ 
+ /* Install the dtv pointer.  The pointer passed is to the element with
+    index -1 which contain the length.  */
diff --git a/glibc.spec b/glibc.spec
index a1a5e1b..8052aaa 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,6 +1,6 @@
 %define glibcsrcdir  glibc-2.19-418-ga5d87b3
 %define glibcversion 2.19.90
-%define glibcrelease 16%{?dist}
+%define glibcrelease 17%{?dist}
 # Pre-release tarballs are pulled in from git using a command that is
 # effectively:
 #
@@ -224,6 +224,8 @@ Patch2031: %{name}-rh1070416.patch
 # Upstream 16724
 Patch2032: %{name}-rh1078355.patch
 
+Patch2033: glibc-aarch64-tls-fixes.patch
+
 ##############################################################################
 # End of glibc patches.
 ##############################################################################
@@ -554,6 +556,7 @@ package or when debugging this package.
 %patch0047 -p1
 %patch2032 -p1
 %patch1000 -p1
+%patch2033 -p1
 
 ##############################################################################
 # %%prep - Additional prep required...
@@ -1643,6 +1646,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Wed May 21 2014 Kyle McMartin <kyle at fedoraproject.org> - 2.19.90-17
+- Backport some upstream-wards patches to fix TLS issues on AArch64.
+
 * Wed May 21 2014 Kyle McMartin <kyle at fedoraproject.org> - 2.19.90-16
 - AArch64: Fix handling of nocancel syscall failures (#1098327)
 


More information about the scm-commits mailing list