summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2014-05-19 22:29:41 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2014-05-19 22:29:41 +0000
commitf07d7ec99a10f02ce897d5a0b26e01cbcab4be52 (patch)
tree06c91d003b850a2cd39bf396f32d52f2d941df7f
parent273571fc2ba61df3c6b4426decc17d95a84750bd (diff)
downloadgcc-48-f07d7ec99a10f02ce897d5a0b26e01cbcab4be52.tar.gz
* Build libitm on AArch64, patch taken from the trunk.
git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.8@7394 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r--debian/changelog6
-rw-r--r--debian/libitm1.symbols4
-rw-r--r--debian/patches/libitm-aarch64.diff155
-rw-r--r--debian/rules.defs2
-rw-r--r--debian/rules.patch1
5 files changed, 165 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog
index 2e700aa..6719c29 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gcc-4.8 (4.8.2-24) UNRELEASED; urgency=medium
+
+ * Build libitm on AArch64, patch taken from the trunk.
+
+ -- Matthias Klose <doko@debian.org> Tue, 20 May 2014 00:27:51 +0200
+
gcc-4.8 (4.8.2-23) unstable; urgency=medium
* GCC 4.8.3 release candidate 1.
diff --git a/debian/libitm1.symbols b/debian/libitm1.symbols
index 1b53660..6f22170 100644
--- a/debian/libitm1.symbols
+++ b/debian/libitm1.symbols
@@ -1,5 +1,5 @@
libitm.so.1 libitm1 #MINVER#
#include "libitm1.symbols.common"
(arch=amd64 i386 x32)#include "libitm1.symbols.x86"
-(arch=!alpha !amd64 !ia64 !ppc64 !ppc64el !s390x !sparc64 !kfreebsd-amd64)#include "libitm1.symbols.32bit"
-(arch=alpha amd64 ia64 ppc64 ppc64el s390x sparc64 kfreebsd-amd64)#include "libitm1.symbols.64bit"
+(arch=!alpha !amd64 !arm64 !ia64 !ppc64 !ppc64el !s390x !sparc64 !kfreebsd-amd64)#include "libitm1.symbols.32bit"
+(arch=alpha amd64 arm64 ia64 ppc64 ppc64el s390x sparc64 kfreebsd-amd64)#include "libitm1.symbols.64bit"
diff --git a/debian/patches/libitm-aarch64.diff b/debian/patches/libitm-aarch64.diff
new file mode 100644
index 0000000..faf93cd
--- /dev/null
+++ b/debian/patches/libitm-aarch64.diff
@@ -0,0 +1,155 @@
+# DP: Build libitm on AArch64, patch taken from the trunk.
+--- /dev/null
++++ b/src/libitm/config/aarch64/sjlj.S
+@@ -0,0 +1,93 @@
++/* Copyright (C) 2014 Free Software Foundation, Inc.
++ Contributed by Richard Henderson <rth@redhat.com>.
++
++ This file is part of the GNU Transactional Memory Library (libitm).
++
++ Libitm is free software; you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
++ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
++ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ more details.
++
++ Under Section 7 of GPL version 3, you are granted additional
++ permissions described in the GCC Runtime Library Exception, version
++ 3.1, as published by the Free Software Foundation.
++
++ You should have received a copy of the GNU General Public License and
++ a copy of the GCC Runtime Library Exception along with this program;
++ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++ <http://www.gnu.org/licenses/>. */
++
++#include "asmcfi.h"
++
++ .text
++ .align 2
++ .global _ITM_beginTransaction
++ .type _ITM_beginTransaction, %function
++
++_ITM_beginTransaction:
++ cfi_startproc
++ mov x1, sp
++ stp x29, x30, [sp, -11*16]!
++ cfi_adjust_cfa_offset(11*16)
++ cfi_rel_offset(x29, 0)
++ cfi_rel_offset(x30, 8)
++ mov x29, sp
++ stp x19, x20, [sp, 1*16]
++ stp x21, x22, [sp, 2*16]
++ stp x23, x24, [sp, 3*16]
++ stp x25, x26, [sp, 4*16]
++ stp x27, x28, [sp, 5*16]
++ stp d8, d9, [sp, 6*16]
++ stp d10, d11, [sp, 7*16]
++ stp d12, d13, [sp, 8*16]
++ stp d14, d15, [sp, 9*16]
++ str x1, [sp, 10*16]
++
++ /* Invoke GTM_begin_transaction with the struct we just built. */
++ mov x1, sp
++ bl GTM_begin_transaction
++
++ /* Return; we don't need to restore any of the call-saved regs. */
++ ldp x29, x30, [sp]
++ add sp, sp, #11*16
++ cfi_adjust_cfa_offset(-11*16)
++ cfi_restore(x29)
++ cfi_restore(x30)
++ ret
++ cfi_endproc
++ .size _ITM_beginTransaction, . - _ITM_beginTransaction
++
++ .align 2
++ .global GTM_longjmp
++ .hidden GTM_longjmp
++ .type GTM_longjmp, %function
++
++GTM_longjmp:
++ /* The first parameter becomes the return value (x0).
++ The third parameter is ignored for now. */
++ cfi_startproc
++ ldp x19, x20, [x1, 1*16]
++ ldp x21, x22, [x1, 2*16]
++ ldp x23, x24, [x1, 3*16]
++ ldp x25, x26, [x1, 4*16]
++ ldp x27, x28, [x1, 5*16]
++ ldp d8, d9, [x1, 6*16]
++ ldp d10, d11, [x1, 7*16]
++ ldp d12, d13, [x1, 8*16]
++ ldp d14, d15, [x1, 9*16]
++ ldr x3, [x1, 10*16]
++ ldp x29, x30, [x1]
++ cfi_def_cfa(x1, 0)
++ mov sp, x3
++ br x30
++ cfi_endproc
++ .size GTM_longjmp, . - GTM_longjmp
++
++#ifdef __linux__
++.section .note.GNU-stack, "", %progbits
++#endif
+--- /dev/null
++++ b/src/libitm/config/aarch64/target.h
+@@ -0,0 +1,45 @@
++/* Copyright (C) 2014 Free Software Foundation, Inc.
++ Contributed by Richard Henderson <rth@redhat.com>.
++
++ This file is part of the GNU Transactional Memory Library (libitm).
++
++ Libitm is free software; you can redistribute it and/or modify it
++ under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 3 of the License, or
++ (at your option) any later version.
++
++ Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
++ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
++ FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ more details.
++
++ Under Section 7 of GPL version 3, you are granted additional
++ permissions described in the GCC Runtime Library Exception, version
++ 3.1, as published by the Free Software Foundation.
++
++ You should have received a copy of the GNU General Public License and
++ a copy of the GCC Runtime Library Exception along with this program;
++ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
++ <http://www.gnu.org/licenses/>. */
++
++namespace GTM HIDDEN {
++
++typedef struct gtm_jmpbuf
++{
++ unsigned long long fp; /* x29 */
++ unsigned long long pc; /* x30 */
++ unsigned long long gr[10]; /* x19-x28 */
++ unsigned long long vr[8]; /* d8-d15 */
++ void *cfa;
++} gtm_jmpbuf;
++
++/* ??? The size of one line in hardware caches (in bytes). */
++#define HW_CACHELINE_SIZE 128
++
++static inline void
++cpu_relax (void)
++{
++ __asm volatile ("" : : : "memory");
++}
++
++} // namespace GTM
+--- a/src/libitm/configure.tgt
++++ b/src/libitm/configure.tgt
+@@ -46,6 +46,7 @@ fi
+ # Map the target cpu to an ARCH sub-directory. At the same time,
+ # work out any special compilation flags as necessary.
+ case "${target_cpu}" in
++ aarch64*) ARCH=aarch64 ;;
+ alpha*) ARCH=alpha ;;
+ rs6000 | powerpc*)
+ XCFLAGS="${XCFLAGS} -mhtm"
diff --git a/debian/rules.defs b/debian/rules.defs
index 02299f6..0844e21 100644
--- a/debian/rules.defs
+++ b/debian/rules.defs
@@ -968,7 +968,7 @@ ifneq (,$(filter $(DEB_TARGET_ARCH),$(gomp_no_archs)))
endif
# itm --------------------
-itm_archs = amd64 i386 x32 ppc64 ppc64el
+itm_archs = amd64 arm64 i386 x32 ppc64 ppc64el
ifneq (,$(filter $(DEB_TARGET_ARCH),$(itm_archs)))
with_itm := yes
endif
diff --git a/debian/rules.patch b/debian/rules.patch
index 3cd2d44..d76324b 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -94,6 +94,7 @@ debian_patches += \
pr61126 \
pr57653 \
testsuite-hardening-ssp \
+ libitm-aarch64 \
# FIXME: still necessary for cross building the native compiler?
# gcc-auto-build \