]> git.ipfire.org Git - people/ms/ipfire-3.x.git/commitdiff
glibc: Add support for aarch64
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 17 Jan 2015 21:00:18 +0000 (16:00 -0500)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 23 Feb 2015 16:26:58 +0000 (11:26 -0500)
gcc/gcc.nm
glibc/glibc.nm
glibc/patches/glibc-aarch64-tls-fixes.patch [new file with mode: 0644]
glibc/patches/glibc-aarch64-workaround-nzcv-clobber-in-tlsdesc.patch [new file with mode: 0644]

index e3ac2a214423c818371ce14d335f0ade98f75906..c47c77ed490d928ac1358cbdeac76caf7994e105 100644 (file)
@@ -8,7 +8,7 @@ build_cloog = 1
 
 name       = gcc
 version    = 4.9.2
-release    = 1
+release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = Development/Compilers
@@ -63,6 +63,9 @@ build
        # Build libtasn (only on x86_64).
        build_libtsan = 0
 
+       # Build libubsan
+       build_libubsan = 0
+
        # Build libcilkrts (only x86)
        build_libcilkrts = 0
 
@@ -78,6 +81,7 @@ build
                build_libquadmath = 1
                build_liblsan = 1
                build_libtsan = 1
+               build_libubsan = 1
                build_libcilkrts = 1
        end
 
@@ -85,14 +89,12 @@ build
                configure_options = --with-arch=%{DISTRO_ARCH} --with-tune=generic
 
                build_libquadmath = 1
+               build_libubsan = 1
                build_libcilkrts = 1
        end
 
-       if "%{DISTRO_ARCH}" == "armv5tel"
+       if "%{DISTRO_ARCH}" == "aarch64"
                make_bootstrap = bootstrap
-
-               configure_options += --disable-sjlj-exceptions
-               configure_options += --with-float=soft
        end
 
        if "%{DISTRO_ARCH}" == "armv7hl"
@@ -107,6 +109,17 @@ build
                        --with-float=hard \
                        --with-fpu=vfpv3-d16 \
                        --with-abi=aapcs-linux
+
+               build_libubsan = 1
+       end
+
+       if "%{DISTRO_ARCH}" == "armv5tel"
+               make_bootstrap = bootstrap
+
+               configure_options += --disable-sjlj-exceptions
+               configure_options += --with-float=soft
+
+               build_libubsan = 1
        end
 
        if "%{build_cloog}" == "1"
@@ -317,8 +330,10 @@ build
                fi
 
                # libubsan
-               ln -svf ../../../libubsan.so.0.0.0 ${FULLPATH}/libubsan.so
-               chmod 755 %{BUILDROOT}%{libdir}/libubsan.so.*
+               if [ "%{build_libubsan}" = "1" ]; then
+                       ln -svf ../../../libubsan.so.0.0.0 ${FULLPATH}/libubsan.so
+                       chmod 755 %{BUILDROOT}%{libdir}/libubsan.so.*
+               fi
 
                # libcilkrts
                if [ "%{build_libcilkrts}" = "1" ]; then
@@ -579,15 +594,17 @@ packages
                end
        end
 
-       package libubsan
-               summary = The Undefined Behavior Sanitizer runtime library
-               description
-                       This package contains the Undefined Behavior Sanitizer library
-                       which is used for -fsanitize=undefined instrumented programs.
-               end
+       if "%{build_libubsan}" == "1"
+               package libubsan
+                       summary = The Undefined Behavior Sanitizer runtime library
+                       description
+                               This package contains the Undefined Behavior Sanitizer library
+                               which is used for -fsanitize=undefined instrumented programs.
+                       end
 
-               files
-                       %{libdir}/libubsan.so.0*
+                       files
+                               %{libdir}/libubsan.so.0*
+                       end
                end
        end
 
index 813b988414c674bcde84cd6c3f4ef731d81a5ceb..7fc7a65f70594c4e1f03bdf38f087c65236d6e50 100644 (file)
@@ -5,7 +5,7 @@
 
 name       = glibc
 version    = 2.20
-release    = 1
+release    = 2
 
 maintainer = Michael Tremer <michael.tremer@ipfire.org>
 groups     = System/Base
diff --git a/glibc/patches/glibc-aarch64-tls-fixes.patch b/glibc/patches/glibc-aarch64-tls-fixes.patch
new file mode 100644 (file)
index 0000000..a05d905
--- /dev/null
@@ -0,0 +1,13 @@
+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/glibc/patches/glibc-aarch64-workaround-nzcv-clobber-in-tlsdesc.patch b/glibc/patches/glibc-aarch64-workaround-nzcv-clobber-in-tlsdesc.patch
new file mode 100644 (file)
index 0000000..ed628ac
--- /dev/null
@@ -0,0 +1,33 @@
+diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
+index ded5471..7d28496 100644
+--- a/sysdeps/aarch64/dl-tlsdesc.S
++++ b/sysdeps/aarch64/dl-tlsdesc.S
+@@ -140,7 +140,7 @@ _dl_tlsdesc_undefweak:
+       cfi_startproc
+       .align 2
+ _dl_tlsdesc_dynamic:
+-# define NSAVEXREGPAIRS 2
++# define NSAVEXREGPAIRS 3
+       stp     x29, x30, [sp,#-(32+16*NSAVEXREGPAIRS)]!
+       cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)
+       mov     x29, sp
+@@ -151,6 +151,10 @@ _dl_tlsdesc_dynamic:
+       stp     x1,  x2, [sp, #32+16*0]
+       stp     x3,  x4, [sp, #32+16*1]
++      /* Work around GCC rescheduling compares across tlsdesc calls.  */
++      mrs     x30, nzcv
++      stp     xzr, x30, [sp, #32+16*2]
++
+       mrs     x4, tpidr_el0
+       ldr     x1, [x0,#8]
+       ldr     x0, [x4]
+@@ -169,6 +173,8 @@ _dl_tlsdesc_dynamic:
+ 1:
+       ldp      x1,  x2, [sp, #32+16*0]
+       ldp      x3,  x4, [sp, #32+16*1]
++      ldp      xzr, x30, [sp, #32+16*2]
++      msr      nzcv, x30
+       ldp     x29, x30, [sp], #(32+16*NSAVEXREGPAIRS)
+       cfi_adjust_cfa_offset (32+16*NSAVEXREGPAIRS)