aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-09-18 22:25:49 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-09-18 22:25:49 +0000
commitc6b4b58325509f0caa7950059675457263bf6957 (patch)
treef5611c9ae75464917085d30247d878e8d5610e3b /libgcc
parentd0e7a96e3f2cc1814a081478be732fb116af5c24 (diff)
downloadgcc-c6b4b58325509f0caa7950059675457263bf6957.zip
gcc-c6b4b58325509f0caa7950059675457263bf6957.tar.gz
gcc-c6b4b58325509f0caa7950059675457263bf6957.tar.bz2
Merge from trunk revision 252949.
From-SVN: r252952
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog147
-rw-r--r--libgcc/config.host38
-rw-r--r--libgcc/config/aarch64/linux-unwind.h2
-rw-r--r--libgcc/config/alpha/linux-unwind.h2
-rw-r--r--libgcc/config/arm/lib1funcs.S2
-rw-r--r--libgcc/config/arm/t-vxworks71
-rw-r--r--libgcc/config/arm/unwind-arm-vxworks.c33
-rw-r--r--libgcc/config/bfin/linux-unwind.h2
-rw-r--r--libgcc/config/i386/avx_resms64.S2
-rw-r--r--libgcc/config/i386/avx_resms64f.S2
-rw-r--r--libgcc/config/i386/avx_resms64fx.S2
-rw-r--r--libgcc/config/i386/avx_resms64x.S2
-rw-r--r--libgcc/config/i386/avx_savms64.S2
-rw-r--r--libgcc/config/i386/avx_savms64f.S2
-rw-r--r--libgcc/config/i386/dragonfly-unwind.h59
-rw-r--r--libgcc/config/i386/i386-asm.h115
-rw-r--r--libgcc/config/i386/linux-unwind.h4
-rw-r--r--libgcc/config/i386/resms64.h (renamed from libgcc/config/i386/resms64.S)30
-rw-r--r--libgcc/config/i386/resms64f.h (renamed from libgcc/config/i386/resms64f.S)26
-rw-r--r--libgcc/config/i386/resms64fx.h (renamed from libgcc/config/i386/resms64fx.S)26
-rw-r--r--libgcc/config/i386/resms64x.h (renamed from libgcc/config/i386/resms64x.S)30
-rw-r--r--libgcc/config/i386/savms64.h (renamed from libgcc/config/i386/savms64.S)30
-rw-r--r--libgcc/config/i386/savms64f.h (renamed from libgcc/config/i386/savms64f.S)26
-rw-r--r--libgcc/config/i386/sse_resms64.S2
-rw-r--r--libgcc/config/i386/sse_resms64f.S2
-rw-r--r--libgcc/config/i386/sse_resms64fx.S2
-rw-r--r--libgcc/config/i386/sse_resms64x.S2
-rw-r--r--libgcc/config/i386/sse_savms64.S2
-rw-r--r--libgcc/config/i386/sse_savms64f.S2
-rw-r--r--libgcc/config/i386/t-msabi18
-rw-r--r--libgcc/config/m68k/linux-unwind.h2
-rw-r--r--libgcc/config/nios2/linux-unwind.h2
-rw-r--r--libgcc/config/pa/linux-unwind.h2
-rw-r--r--libgcc/config/riscv/linux-unwind.h2
-rw-r--r--libgcc/config/rs6000/float128-ifunc.c42
-rw-r--r--libgcc/config/rs6000/ibm-ldouble.c3
-rw-r--r--libgcc/config/sh/linux-unwind.h2
-rw-r--r--libgcc/config/t-vxworks11
-rw-r--r--libgcc/config/t-vxworks717
-rw-r--r--libgcc/config/tilepro/linux-unwind.h2
-rw-r--r--libgcc/config/xtensa/linux-unwind.h2
-rw-r--r--libgcc/configure11
-rw-r--r--libgcc/configure.ac11
43 files changed, 492 insertions, 232 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index 1b5d2b5..b548922 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,150 @@
+2017-09-17 Daniel Santos <daniel.santos@pobox.com>
+
+ config/i386/i386-asm.h (PASTE2): New macro.
+ (ASMNAME): Modify to use PASTE2.
+ (MS2SYSV_STUB_PREFIX): New macro for isa prefix.
+ (MS2SYSV_STUB_BEGIN, MS2SYSV_STUB_END): New macros for stub headers.
+ config/i386/resms64.S: Rename to a header file, use MS2SYSV_STUB_BEGIN
+ instead of HIDDEN_FUNC and MS2SYSV_STUB_END instead of FUNC_END.
+ config/i386/resms64f.S: Likewise.
+ config/i386/resms64fx.S: Likewise.
+ config/i386/resms64x.S: Likewise.
+ config/i386/savms64.S: Likewise.
+ config/i386/savms64f.S: Likewise.
+ config/i386/avx_resms64.S: New file that only defines a macro and
+ includes it's corresponding header file.
+ config/i386/avx_resms64f.S: Likewise.
+ config/i386/avx_resms64fx.S: Likewise.
+ config/i386/avx_resms64x.S: Likewise.
+ config/i386/avx_savms64.S: Likewise.
+ config/i386/avx_savms64f.S: Likewise.
+ config/i386/sse_resms64.S: Likewise.
+ config/i386/sse_resms64f.S: Likewise.
+ config/i386/sse_resms64fx.S: Likewise.
+ config/i386/sse_resms64x.S: Likewise.
+ config/i386/sse_savms64.S: Likewise.
+ config/i386/sse_savms64f.S: Likewise.
+ config/i386/t-msabi: Modified to add avx and sse versions of stubs.
+
+2017-09-01 Olivier Hainque <hainque@adacore.com>
+
+ * config.host (*-*-vxworks7): Widen scope to vxworks7*.
+
+2017-08-31 Olivier Hainque <hainque@adacore.com>
+
+ * config.host (powerpc-wrs-vxworks|vxworksae|vxworksmils): Now
+ match as powerpc-wrs-vxworks*.
+
+2017-08-07 Jonathan Yong <10walls@gmail.com>
+
+ * config.host (*-cygwin): Include file from mingw
+ config/i386/enable-execute-stack-mingw32.c
+
+2017-08-01 Jerome Lambourg <lambourg@adacore.com>
+ Doug Rupp <rupp@adacore.com>
+ Olivier Hainque <hainque@adacore.com>
+
+ * config.host (arm-wrs-vxworks*): Rework to handle arm-wrs-vxworks7
+ as well as arm-wrs-vxworks.
+ * config/arm/t-vxworks7: New file. Add unwind-arm-vxworks.c to
+ LIB2ADDEH.
+ * config/arm/unwind-arm-vxworks.c: New file. Provide dummy
+ __exidx_start and __exidx_end for downloadable modules.
+
+2017-08-01 Olivier Hainque <hainque@adacore.com>
+
+ * config/t-vxworks (LIBGCC2_INCLUDES): Start with -I. after -nostdinc.
+ * config/t-vxworks7: Likewise.
+
+2017-08-01 Olivier Hainque <hainque@adacore.com>
+
+ * config/t-vxworks: Instead of redefining LIB2ADD,
+ augment LIB2ADDEH with vxlib.c and vxlib-tls.c.
+
+2017-07-28 Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+ * config/rs6000/ibm-ldouble.c: Disable if defined __rtems__.
+
+2017-07-24 Daniel Santos <daniel.santos@pobox.com>
+
+ PR testsuite/80759
+ * config.host: include i386/t-msabi for darwin and solaris.
+ * config/i386/i386-asm.h
+ (ELFFN): Rename to FN_TYPE.
+ (FN_SIZE): New macro.
+ (FN_HIDDEN): Likewise.
+ (ASMNAME): Likewise.
+ (FUNC_START): Rename to FUNC_BEGIN, use ASMNAME, replace .global with
+ .globl.
+ (HIDDEN_FUNC): Use ASMNAME and .globl instead of .global.
+ (SSE_SAVE): Convert to cpp macro, hard-code offset (always 0x60).
+ * config/i386/resms64.S: Use SSE_SAVE as cpp macro instead of gas
+ .macro.
+ * config/i386/resms64f.S: Likewise.
+ * config/i386/resms64fx.S: Likewise.
+ * config/i386/resms64x.S: Likewise.
+ * config/i386/savms64.S: Likewise.
+ * config/i386/savms64f.S: Likewise.
+
+2017-07-19 John Marino <gnugcc@marino.st>
+
+ * config/i386/dragonfly-unwind.h: Handle sigtramp relocation.
+
+2017-07-12 Michael Meissner <meissner@linux.vnet.ibm.com>
+
+ PR target/81193
+ * configure.ac (PowerPC float128 hardware support): Test whether
+ we can use __builtin_cpu_supports before enabling the ifunc
+ handler.
+ * configure: Regenerate.
+
+2017-07-10 Vineet Gupta <vgupta@synopsys.com>
+
+ * config.host: Remove uclibc from arc target spec.
+
+2017-07-09 Krister Walfridsson <krister.walfridsson@gmail.com>
+
+ * config.host (*-*-netbsd*): Remove check for aout NetBSD releases.
+
+2017-07-07 Peter Bergner <bergner@vnet.ibm.com>
+
+ * config/rs6000/float128-ifunc.c: Don't include auxv.h.
+ (have_ieee_hw_p): Delete function.
+ (SW_OR_HW) Use __builtin_cpu_supports().
+
+2017-07-06 Thomas Preud'homme <thomas.preudhomme@arm.com>
+
+ * config/arm/lib1funcs.S: Defined __ARM_ARCH__ to 8 for ARMv8-R.
+
+2017-07-03 Olivier Hainque <hainque@adacore.com>
+
+ * config/t-vxworks7: New file, really.
+
+2017-06-28 Joseph Myers <joseph@codesourcery.com>
+
+ * config/aarch64/linux-unwind.h (aarch64_fallback_frame_state),
+ config/alpha/linux-unwind.h (alpha_fallback_frame_state),
+ config/bfin/linux-unwind.h (bfin_fallback_frame_state),
+ config/i386/linux-unwind.h (x86_64_fallback_frame_state,
+ x86_fallback_frame_state), config/m68k/linux-unwind.h (struct
+ uw_ucontext), config/nios2/linux-unwind.h (struct nios2_ucontext),
+ config/pa/linux-unwind.h (pa32_fallback_frame_state),
+ config/riscv/linux-unwind.h (riscv_fallback_frame_state),
+ config/sh/linux-unwind.h (sh_fallback_frame_state),
+ config/tilepro/linux-unwind.h (tile_fallback_frame_state),
+ config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Use
+ ucontext_t instead of struct ucontext.
+
+2017-06-27 Jerome Lambourg <lambourg@adacore.com>
+
+ * config.host (i*86-wrs-vxworks7): Handle new acceptable triplet.
+ (x86_64-wrs-vxworks7): Likewise.
+
+2017-06-27 Olivier Hainque <hainque@adacore.com>
+
+ * config/t-vxworks7: New file.
+ * config.host (*-*-vxworks7): Use it.
+
2017-06-22 Matt Turner <mattst88@gmail.com>
* config/i386/cpuinfo.c (get_intel_cpu): Add Kaby Lake models to
diff --git a/libgcc/config.host b/libgcc/config.host
index 7711abf..68d8fe6 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -250,14 +250,7 @@ case ${host} in
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
tmake_file="$tmake_file t-slibgcc-libgcc"
- # NetBSD 1.7 and later are set up to use GCC's crtstuff for
- # ELF configurations. We will clear extra_parts in the
- # a.out configurations.
- case ${host} in
- *-*-netbsd*1.[7-9]* | *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
- extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- ;;
- esac
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
;;
*-*-openbsd*)
tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
@@ -312,6 +305,9 @@ case ${host} in
tmake_file="vms/t-vms"
extra_parts="crt0.o crtbegin.o crtbeginS.o crtend.o crtendS.o"
;;
+*-*-vxworks7*)
+ tmake_file=t-vxworks7
+ ;;
*-*-vxworks*)
tmake_file=t-vxworks
;;
@@ -328,6 +324,9 @@ case ${host} in
i[34567]86-*-mingw* | x86_64-*-mingw*)
enable_execute_stack=config/i386/enable-execute-stack-mingw32.c
;;
+i[34567]86-*-cygwin* | x86_64-*-cygwin*)
+ enable_execute_stack=config/i386/enable-execute-stack-mingw32.c
+ ;;
*)
enable_execute_stack=enable-execute-stack-empty.c;
;;
@@ -387,14 +386,23 @@ arc*-*-elf*)
extra_parts="crti.o crtn.o crtend.o crtbegin.o crtendS.o crtbeginS.o"
extra_parts="$extra_parts crttls.o"
;;
-arc*-*-linux-uclibc*)
+arc*-*-linux*)
tmake_file="${tmake_file} t-slibgcc-libgcc t-slibgcc-nolc-override arc/t-arc-uClibc arc/t-arc"
extra_parts="$extra_parts crti.o crtn.o"
extra_parts="$extra_parts crttls.o"
;;
-arm-wrs-vxworks)
+arm-wrs-vxworks|arm-wrs-vxworks7)
tmake_file="$tmake_file arm/t-arm arm/t-elf t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
extra_parts="$extra_parts crti.o crtn.o"
+ case ${host} in
+ *-*-vxworks7)
+ # Note that arm/t-bpabi will reset the LIB2ADDEH macro.
+ # This is intentional.
+ tmake_file="$tmake_file arm/t-bpabi arm/t-vxworks7"
+ tm_file="$tm_file arm/bpabi-lib.h"
+ unwind_header=config/arm/unwind-arm.h
+ ;;
+ esac
;;
arm*-*-freebsd*) # ARM FreeBSD EABI
tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix arm/t-elf"
@@ -585,12 +593,12 @@ hppa*-*-openbsd*)
tmake_file="$tmake_file pa/t-openbsd"
;;
i[34567]86-*-darwin*)
- tmake_file="$tmake_file i386/t-crtpc t-crtfm"
+ tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-msabi"
tm_file="$tm_file i386/darwin-lib.h"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
x86_64-*-darwin*)
- tmake_file="$tmake_file i386/t-crtpc t-crtfm"
+ tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-msabi"
tm_file="$tm_file i386/darwin-lib.h"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
;;
@@ -667,12 +675,12 @@ i[34567]86-*-rtems*)
extra_parts="$extra_parts crti.o crtn.o"
;;
i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
- tmake_file="$tmake_file i386/t-crtpc t-crtfm"
+ tmake_file="$tmake_file i386/t-crtpc t-crtfm i386/t-msabi"
extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
tm_file="${tm_file} i386/elf-lib.h"
md_unwind_header=i386/sol2-unwind.h
;;
-i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
+i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae|i[4567]86-wrs-vxworks7|x86_64-wrs-vxworks7)
;;
i[34567]86-*-cygwin*)
extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
@@ -1096,7 +1104,7 @@ powerpc*-*-linux*)
extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
md_unwind_header=rs6000/linux-unwind.h
;;
-powerpc-wrs-vxworks|powerpc-wrs-vxworksae|powerpc-wrs-vxworksmils)
+powerpc-wrs-vxworks*)
tmake_file="$tmake_file rs6000/t-ppccomm rs6000/t-savresfgpr t-fdpbit"
;;
powerpc-*-lynxos*)
diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
index d5d6980..d46d5f5 100644
--- a/libgcc/config/aarch64/linux-unwind.h
+++ b/libgcc/config/aarch64/linux-unwind.h
@@ -55,7 +55,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context *context,
struct rt_sigframe
{
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
};
struct rt_sigframe *rt_;
diff --git a/libgcc/config/alpha/linux-unwind.h b/libgcc/config/alpha/linux-unwind.h
index a91a5f4..7202516 100644
--- a/libgcc/config/alpha/linux-unwind.h
+++ b/libgcc/config/alpha/linux-unwind.h
@@ -51,7 +51,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
{
struct rt_sigframe {
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context->cfa;
sc = &rt_->uc.uc_mcontext;
}
diff --git a/libgcc/config/arm/lib1funcs.S b/libgcc/config/arm/lib1funcs.S
index 89ebebc..8d8c3ce 100644
--- a/libgcc/config/arm/lib1funcs.S
+++ b/libgcc/config/arm/lib1funcs.S
@@ -109,7 +109,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif
#if defined(__ARM_ARCH_8A__) || defined(__ARM_ARCH_8M_BASE__) \
- || defined(__ARM_ARCH_8M_MAIN__)
+ || defined(__ARM_ARCH_8M_MAIN__) || defined(__ARM_ARCH_8R__)
# define __ARM_ARCH__ 8
#endif
diff --git a/libgcc/config/arm/t-vxworks7 b/libgcc/config/arm/t-vxworks7
new file mode 100644
index 0000000..bead336
--- /dev/null
+++ b/libgcc/config/arm/t-vxworks7
@@ -0,0 +1 @@
+LIB2ADDEH += $(srcdir)/config/arm/unwind-arm-vxworks.c
diff --git a/libgcc/config/arm/unwind-arm-vxworks.c b/libgcc/config/arm/unwind-arm-vxworks.c
new file mode 100644
index 0000000..ed23ab9
--- /dev/null
+++ b/libgcc/config/arm/unwind-arm-vxworks.c
@@ -0,0 +1,33 @@
+/* Support for ARM EABI unwinding in VxWorks Downloadable Kernel Modules.
+ Copyright (C) 2017 Free Software Foundation, Inc.
+
+ This file 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, or (at your option) any
+ later version.
+
+ This file 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/>. */
+
+#if defined(__vxworks) && !defined (__RTP__)
+/* Vxworks for ARM uses __gnu_Unwind_Find_exidx to retrieve the exception
+ table for downloadable kernel modules. As those modules are only partially
+ linked, the linker won't generate __exidx_start|end, but the two symbols
+ are still used in alternate paths from unwind-arm-common.inc.
+
+ As we don't rely on them, but still need the symbols, we define dummy
+ values here. */
+void *__exidx_start __attribute__((__visibility__ ("hidden")));
+void *__exidx_end __attribute__((__visibility__ ("hidden")));
+#endif
diff --git a/libgcc/config/bfin/linux-unwind.h b/libgcc/config/bfin/linux-unwind.h
index 9412c76..37e9feb 100644
--- a/libgcc/config/bfin/linux-unwind.h
+++ b/libgcc/config/bfin/linux-unwind.h
@@ -52,7 +52,7 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
void *puc;
char retcode[8];
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
diff --git a/libgcc/config/i386/avx_resms64.S b/libgcc/config/i386/avx_resms64.S
new file mode 100644
index 0000000..2be74493
--- /dev/null
+++ b/libgcc/config/i386/avx_resms64.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_AVX
+#include "resms64.h"
diff --git a/libgcc/config/i386/avx_resms64f.S b/libgcc/config/i386/avx_resms64f.S
new file mode 100644
index 0000000..76a1340
--- /dev/null
+++ b/libgcc/config/i386/avx_resms64f.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_AVX
+#include "resms64f.h"
diff --git a/libgcc/config/i386/avx_resms64fx.S b/libgcc/config/i386/avx_resms64fx.S
new file mode 100644
index 0000000..2ea4738
--- /dev/null
+++ b/libgcc/config/i386/avx_resms64fx.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_AVX
+#include "resms64fx.h"
diff --git a/libgcc/config/i386/avx_resms64x.S b/libgcc/config/i386/avx_resms64x.S
new file mode 100644
index 0000000..14a53d4
--- /dev/null
+++ b/libgcc/config/i386/avx_resms64x.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_AVX
+#include "resms64x.h"
diff --git a/libgcc/config/i386/avx_savms64.S b/libgcc/config/i386/avx_savms64.S
new file mode 100644
index 0000000..fed1620
--- /dev/null
+++ b/libgcc/config/i386/avx_savms64.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_AVX
+#include "savms64.h"
diff --git a/libgcc/config/i386/avx_savms64f.S b/libgcc/config/i386/avx_savms64f.S
new file mode 100644
index 0000000..3227965
--- /dev/null
+++ b/libgcc/config/i386/avx_savms64f.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_AVX
+#include "savms64f.h"
diff --git a/libgcc/config/i386/dragonfly-unwind.h b/libgcc/config/i386/dragonfly-unwind.h
index 18b90fc..ca1f46e 100644
--- a/libgcc/config/i386/dragonfly-unwind.h
+++ b/libgcc/config/i386/dragonfly-unwind.h
@@ -28,9 +28,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#include <sys/types.h>
#include <sys/sysctl.h>
+#include <sys/param.h>
#include <signal.h>
#include <sys/ucontext.h>
#include <machine/sigframe.h>
+#if __DragonFly_version > 400800
+#include <sys/kinfo.h>
+#endif
#define REG_NAME(reg) sf_uc.uc_mcontext.mc_## reg
@@ -39,20 +43,44 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define MD_FALLBACK_FRAME_STATE_FOR x86_64_dragonfly_fallback_frame_state
-static void
-x86_64_sigtramp_range (unsigned char **start, unsigned char **end)
+static int
+x86_64_outside_sigtramp_range (unsigned char *pc)
{
- unsigned long ps_strings;
- int mib[2];
- size_t len;
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PS_STRINGS;
- len = sizeof (ps_strings);
- sysctl (mib, 2, &ps_strings, &len, NULL, 0);
-
- *start = (unsigned char *)ps_strings - 32;
- *end = (unsigned char *)ps_strings;
+ static int sigtramp_range_determined = 0;
+ static unsigned char *sigtramp_start, *sigtramp_end;
+
+ if (sigtramp_range_determined == 0)
+ {
+#if __DragonFly_version > 400800
+ struct kinfo_sigtramp kst = {0};
+ size_t len = sizeof (kst);
+ int mib[3] = { CTL_KERN, KERN_PROC, KERN_PROC_SIGTRAMP };
+
+ sigtramp_range_determined = 1;
+ if (sysctl (mib, 3, &kst, &len, NULL, 0) == 0)
+ {
+ sigtramp_range_determined = 2;
+ sigtramp_start = kst.ksigtramp_start;
+ sigtramp_end = kst.ksigtramp_end;
+ }
+#else
+ unsigned long ps_strings;
+ size_t len = sizeof (ps_strings);
+ int mib[2] = { CTL_KERN, KERN_PS_STRINGS };
+
+ sigtramp_range_determined = 1;
+ if (sysctl (mib, 2, &ps_strings, &len, NULL, 0) == 0)
+ {
+ sigtramp_range_determined = 2;
+ sigtramp_start = (unsigned char *)ps_strings - 32;
+ sigtramp_end = (unsigned char *)ps_strings;
+ }
+#endif
+ }
+ if (sigtramp_range_determined < 2) /* sysctl failed if < 2 */
+ return 1;
+
+ return (pc < sigtramp_start || pc >= sigtramp_end );
}
@@ -60,13 +88,10 @@ static _Unwind_Reason_Code
x86_64_dragonfly_fallback_frame_state
(struct _Unwind_Context *context, _Unwind_FrameState *fs)
{
- unsigned char *pc = context->ra;
- unsigned char *sigtramp_start, *sigtramp_end;
struct sigframe *sf;
long new_cfa;
- x86_64_sigtramp_range(&sigtramp_start, &sigtramp_end);
- if (pc >= sigtramp_end || pc < sigtramp_start)
+ if (x86_64_outside_sigtramp_range(context->ra))
return _URC_END_OF_STACK;
sf = (struct sigframe *) context->cfa;
diff --git a/libgcc/config/i386/i386-asm.h b/libgcc/config/i386/i386-asm.h
index c613e9f..424e0f7 100644
--- a/libgcc/config/i386/i386-asm.h
+++ b/libgcc/config/i386/i386-asm.h
@@ -26,57 +26,88 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef I386_ASM_H
#define I386_ASM_H
+#include "auto-host.h"
+
+#define PASTE2(a, b) PASTE2a(a, b)
+#define PASTE2a(a, b) a ## b
+
+/* These macros currently support GNU/Linux, Solaris and Darwin. */
+
#ifdef __ELF__
-# define ELFFN(fn) .type fn,@function
+# define FN_TYPE(fn) .type fn,@function
+# define FN_SIZE(fn) .size fn,.-fn
+# ifdef HAVE_GAS_HIDDEN
+# define FN_HIDDEN(fn) .hidden fn
+# endif
#else
-# define ELFFN(fn)
+# define FN_TYPE(fn)
+# define FN_SIZE(fn)
#endif
-#define FUNC_START(fn) \
- .global fn; \
- ELFFN (fn); \
-fn:
+#ifndef FN_HIDDEN
+# define FN_HIDDEN(fn)
+#endif
-#define HIDDEN_FUNC(fn)\
- FUNC_START (fn) \
- .hidden fn; \
+#ifdef __USER_LABEL_PREFIX__
+# define ASMNAME(name) PASTE2(__USER_LABEL_PREFIX__, name)
+#else
+# define ASMNAME(name) name
+#endif
-#define FUNC_END(fn) .size fn,.-fn
+#define FUNC_BEGIN(fn) \
+ .globl ASMNAME(fn); \
+ FN_TYPE (ASMNAME(fn)); \
+ASMNAME(fn):
-#ifdef __SSE2__
-# ifdef __AVX__
-# define MOVAPS vmovaps
-# else
-# define MOVAPS movaps
-# endif
+#define HIDDEN_FUNC(fn) \
+ .globl ASMNAME(fn); \
+ FN_TYPE(ASMNAME(fn)); \
+ FN_HIDDEN(ASMNAME(fn)); \
+ASMNAME(fn):
+
+#define FUNC_END(fn) FN_SIZE(ASMNAME(fn))
+
+#ifdef MS2SYSV_STUB_AVX
+# define MS2SYSV_STUB_PREFIX __avx_
+# define MOVAPS vmovaps
+#elif defined(MS2SYSV_STUB_SSE)
+# define MS2SYSV_STUB_PREFIX __sse_
+# define MOVAPS movaps
+#endif
+
+#if defined (MS2SYSV_STUB_PREFIX) && defined (MOVAPS)
+
+# define MS2SYSV_STUB_BEGIN(base_name) \
+ HIDDEN_FUNC(PASTE2(MS2SYSV_STUB_PREFIX, base_name))
+
+# define MS2SYSV_STUB_END(base_name) \
+ FUNC_END(PASTE2(MS2SYSV_STUB_PREFIX, base_name))
/* Save SSE registers 6-15. off is the offset of rax to get to xmm6. */
-.macro SSE_SAVE off=0
- MOVAPS %xmm15,(\off - 0x90)(%rax)
- MOVAPS %xmm14,(\off - 0x80)(%rax)
- MOVAPS %xmm13,(\off - 0x70)(%rax)
- MOVAPS %xmm12,(\off - 0x60)(%rax)
- MOVAPS %xmm11,(\off - 0x50)(%rax)
- MOVAPS %xmm10,(\off - 0x40)(%rax)
- MOVAPS %xmm9, (\off - 0x30)(%rax)
- MOVAPS %xmm8, (\off - 0x20)(%rax)
- MOVAPS %xmm7, (\off - 0x10)(%rax)
- MOVAPS %xmm6, \off(%rax)
-.endm
+# define SSE_SAVE \
+ MOVAPS %xmm15,-0x30(%rax); \
+ MOVAPS %xmm14,-0x20(%rax); \
+ MOVAPS %xmm13,-0x10(%rax); \
+ MOVAPS %xmm12, (%rax); \
+ MOVAPS %xmm11, 0x10(%rax); \
+ MOVAPS %xmm10, 0x20(%rax); \
+ MOVAPS %xmm9, 0x30(%rax); \
+ MOVAPS %xmm8, 0x40(%rax); \
+ MOVAPS %xmm7, 0x50(%rax); \
+ MOVAPS %xmm6, 0x60(%rax)
/* Restore SSE registers 6-15. off is the offset of rsi to get to xmm6. */
-.macro SSE_RESTORE off=0
- MOVAPS (\off - 0x90)(%rsi), %xmm15
- MOVAPS (\off - 0x80)(%rsi), %xmm14
- MOVAPS (\off - 0x70)(%rsi), %xmm13
- MOVAPS (\off - 0x60)(%rsi), %xmm12
- MOVAPS (\off - 0x50)(%rsi), %xmm11
- MOVAPS (\off - 0x40)(%rsi), %xmm10
- MOVAPS (\off - 0x30)(%rsi), %xmm9
- MOVAPS (\off - 0x20)(%rsi), %xmm8
- MOVAPS (\off - 0x10)(%rsi), %xmm7
- MOVAPS \off(%rsi), %xmm6
-.endm
-
-#endif /* __SSE2__ */
+# define SSE_RESTORE \
+ MOVAPS -0x30(%rsi), %xmm15; \
+ MOVAPS -0x20(%rsi), %xmm14; \
+ MOVAPS -0x10(%rsi), %xmm13; \
+ MOVAPS (%rsi), %xmm12; \
+ MOVAPS 0x10(%rsi), %xmm11; \
+ MOVAPS 0x20(%rsi), %xmm10; \
+ MOVAPS 0x30(%rsi), %xmm9 ; \
+ MOVAPS 0x40(%rsi), %xmm8 ; \
+ MOVAPS 0x50(%rsi), %xmm7 ; \
+ MOVAPS 0x60(%rsi), %xmm6
+
+#endif /* defined (MS2SYSV_STUB_ISA) && defined (MOVAPS) */
#endif /* I386_ASM_H */
diff --git a/libgcc/config/i386/linux-unwind.h b/libgcc/config/i386/linux-unwind.h
index b1d5040..2009ad7 100644
--- a/libgcc/config/i386/linux-unwind.h
+++ b/libgcc/config/i386/linux-unwind.h
@@ -58,7 +58,7 @@ x86_64_fallback_frame_state (struct _Unwind_Context *context,
if (*(unsigned char *)(pc+0) == 0x48
&& *(unsigned long long *)(pc+1) == RT_SIGRETURN_SYSCALL)
{
- struct ucontext *uc_ = context->cfa;
+ ucontext_t *uc_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
because it does not alias anything. */
@@ -138,7 +138,7 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
siginfo_t *pinfo;
void *puc;
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
diff --git a/libgcc/config/i386/resms64.S b/libgcc/config/i386/resms64.h
index f47e2f0..f01b418 100644
--- a/libgcc/config/i386/resms64.S
+++ b/libgcc/config/i386/resms64.h
@@ -29,29 +29,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Epilogue routine for restoring 64-bit ms/sysv registers. */
.text
-HIDDEN_FUNC(__resms64_18)
+MS2SYSV_STUB_BEGIN(resms64_18)
mov -0x70(%rsi),%r15
-HIDDEN_FUNC(__resms64_17)
+MS2SYSV_STUB_BEGIN(resms64_17)
mov -0x68(%rsi),%r14
-HIDDEN_FUNC(__resms64_16)
+MS2SYSV_STUB_BEGIN(resms64_16)
mov -0x60(%rsi),%r13
-HIDDEN_FUNC(__resms64_15)
+MS2SYSV_STUB_BEGIN(resms64_15)
mov -0x58(%rsi),%r12
-HIDDEN_FUNC(__resms64_14)
+MS2SYSV_STUB_BEGIN(resms64_14)
mov -0x50(%rsi),%rbp
-HIDDEN_FUNC(__resms64_13)
+MS2SYSV_STUB_BEGIN(resms64_13)
mov -0x48(%rsi),%rbx
-HIDDEN_FUNC(__resms64_12)
+MS2SYSV_STUB_BEGIN(resms64_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
ret
-FUNC_END(__resms64_12)
-FUNC_END(__resms64_13)
-FUNC_END(__resms64_14)
-FUNC_END(__resms64_15)
-FUNC_END(__resms64_16)
-FUNC_END(__resms64_17)
-FUNC_END(__resms64_18)
+MS2SYSV_STUB_END(resms64_12)
+MS2SYSV_STUB_END(resms64_13)
+MS2SYSV_STUB_END(resms64_14)
+MS2SYSV_STUB_END(resms64_15)
+MS2SYSV_STUB_END(resms64_16)
+MS2SYSV_STUB_END(resms64_17)
+MS2SYSV_STUB_END(resms64_18)
#endif /* __x86_64__ */
diff --git a/libgcc/config/i386/resms64f.S b/libgcc/config/i386/resms64f.h
index 817da60..743ec51 100644
--- a/libgcc/config/i386/resms64f.S
+++ b/libgcc/config/i386/resms64f.h
@@ -30,26 +30,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
pointer is used. */
.text
-HIDDEN_FUNC(__resms64f_17)
+MS2SYSV_STUB_BEGIN(resms64f_17)
mov -0x68(%rsi),%r15
-HIDDEN_FUNC(__resms64f_16)
+MS2SYSV_STUB_BEGIN(resms64f_16)
mov -0x60(%rsi),%r14
-HIDDEN_FUNC(__resms64f_15)
+MS2SYSV_STUB_BEGIN(resms64f_15)
mov -0x58(%rsi),%r13
-HIDDEN_FUNC(__resms64f_14)
+MS2SYSV_STUB_BEGIN(resms64f_14)
mov -0x50(%rsi),%r12
-HIDDEN_FUNC(__resms64f_13)
+MS2SYSV_STUB_BEGIN(resms64f_13)
mov -0x48(%rsi),%rbx
-HIDDEN_FUNC(__resms64f_12)
+MS2SYSV_STUB_BEGIN(resms64f_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
ret
-FUNC_END(__resms64f_12)
-FUNC_END(__resms64f_13)
-FUNC_END(__resms64f_14)
-FUNC_END(__resms64f_15)
-FUNC_END(__resms64f_16)
-FUNC_END(__resms64f_17)
+MS2SYSV_STUB_END(resms64f_12)
+MS2SYSV_STUB_END(resms64f_13)
+MS2SYSV_STUB_END(resms64f_14)
+MS2SYSV_STUB_END(resms64f_15)
+MS2SYSV_STUB_END(resms64f_16)
+MS2SYSV_STUB_END(resms64f_17)
#endif /* __x86_64__ */
diff --git a/libgcc/config/i386/resms64fx.S b/libgcc/config/i386/resms64fx.h
index 5dba584..965807a 100644
--- a/libgcc/config/i386/resms64fx.S
+++ b/libgcc/config/i386/resms64fx.h
@@ -31,27 +31,27 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
* from the function. */
.text
-HIDDEN_FUNC(__resms64fx_17)
+MS2SYSV_STUB_BEGIN(resms64fx_17)
mov -0x68(%rsi),%r15
-HIDDEN_FUNC(__resms64fx_16)
+MS2SYSV_STUB_BEGIN(resms64fx_16)
mov -0x60(%rsi),%r14
-HIDDEN_FUNC(__resms64fx_15)
+MS2SYSV_STUB_BEGIN(resms64fx_15)
mov -0x58(%rsi),%r13
-HIDDEN_FUNC(__resms64fx_14)
+MS2SYSV_STUB_BEGIN(resms64fx_14)
mov -0x50(%rsi),%r12
-HIDDEN_FUNC(__resms64fx_13)
+MS2SYSV_STUB_BEGIN(resms64fx_13)
mov -0x48(%rsi),%rbx
-HIDDEN_FUNC(__resms64fx_12)
+MS2SYSV_STUB_BEGIN(resms64fx_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
leaveq
ret
-FUNC_END(__resms64fx_12)
-FUNC_END(__resms64fx_13)
-FUNC_END(__resms64fx_14)
-FUNC_END(__resms64fx_15)
-FUNC_END(__resms64fx_16)
-FUNC_END(__resms64fx_17)
+MS2SYSV_STUB_END(resms64fx_12)
+MS2SYSV_STUB_END(resms64fx_13)
+MS2SYSV_STUB_END(resms64fx_14)
+MS2SYSV_STUB_END(resms64fx_15)
+MS2SYSV_STUB_END(resms64fx_16)
+MS2SYSV_STUB_END(resms64fx_17)
#endif /* __x86_64__ */
diff --git a/libgcc/config/i386/resms64x.S b/libgcc/config/i386/resms64x.h
index 7770447..689a1de 100644
--- a/libgcc/config/i386/resms64x.S
+++ b/libgcc/config/i386/resms64x.h
@@ -30,30 +30,30 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
* function. */
.text
-HIDDEN_FUNC(__resms64x_18)
+MS2SYSV_STUB_BEGIN(resms64x_18)
mov -0x70(%rsi),%r15
-HIDDEN_FUNC(__resms64x_17)
+MS2SYSV_STUB_BEGIN(resms64x_17)
mov -0x68(%rsi),%r14
-HIDDEN_FUNC(__resms64x_16)
+MS2SYSV_STUB_BEGIN(resms64x_16)
mov -0x60(%rsi),%r13
-HIDDEN_FUNC(__resms64x_15)
+MS2SYSV_STUB_BEGIN(resms64x_15)
mov -0x58(%rsi),%r12
-HIDDEN_FUNC(__resms64x_14)
+MS2SYSV_STUB_BEGIN(resms64x_14)
mov -0x50(%rsi),%rbp
-HIDDEN_FUNC(__resms64x_13)
+MS2SYSV_STUB_BEGIN(resms64x_13)
mov -0x48(%rsi),%rbx
-HIDDEN_FUNC(__resms64x_12)
+MS2SYSV_STUB_BEGIN(resms64x_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
mov %r10,%rsp
ret
-FUNC_END(__resms64x_12)
-FUNC_END(__resms64x_13)
-FUNC_END(__resms64x_14)
-FUNC_END(__resms64x_15)
-FUNC_END(__resms64x_16)
-FUNC_END(__resms64x_17)
-FUNC_END(__resms64x_18)
+MS2SYSV_STUB_END(resms64x_12)
+MS2SYSV_STUB_END(resms64x_13)
+MS2SYSV_STUB_END(resms64x_14)
+MS2SYSV_STUB_END(resms64x_15)
+MS2SYSV_STUB_END(resms64x_16)
+MS2SYSV_STUB_END(resms64x_17)
+MS2SYSV_STUB_END(resms64x_18)
#endif /* __x86_64__ */
diff --git a/libgcc/config/i386/savms64.S b/libgcc/config/i386/savms64.h
index 2067dd8..28d5e35 100644
--- a/libgcc/config/i386/savms64.S
+++ b/libgcc/config/i386/savms64.h
@@ -29,29 +29,29 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* Prologue routine for saving 64-bit ms/sysv registers. */
.text
-HIDDEN_FUNC(__savms64_18)
+MS2SYSV_STUB_BEGIN(savms64_18)
mov %r15,-0x70(%rax)
-HIDDEN_FUNC(__savms64_17)
+MS2SYSV_STUB_BEGIN(savms64_17)
mov %r14,-0x68(%rax)
-HIDDEN_FUNC(__savms64_16)
+MS2SYSV_STUB_BEGIN(savms64_16)
mov %r13,-0x60(%rax)
-HIDDEN_FUNC(__savms64_15)
+MS2SYSV_STUB_BEGIN(savms64_15)
mov %r12,-0x58(%rax)
-HIDDEN_FUNC(__savms64_14)
+MS2SYSV_STUB_BEGIN(savms64_14)
mov %rbp,-0x50(%rax)
-HIDDEN_FUNC(__savms64_13)
+MS2SYSV_STUB_BEGIN(savms64_13)
mov %rbx,-0x48(%rax)
-HIDDEN_FUNC(__savms64_12)
+MS2SYSV_STUB_BEGIN(savms64_12)
mov %rdi,-0x40(%rax)
mov %rsi,-0x38(%rax)
- SSE_SAVE off=0x60
+ SSE_SAVE
ret
-FUNC_END(__savms64_12)
-FUNC_END(__savms64_13)
-FUNC_END(__savms64_14)
-FUNC_END(__savms64_15)
-FUNC_END(__savms64_16)
-FUNC_END(__savms64_17)
-FUNC_END(__savms64_18)
+MS2SYSV_STUB_END(savms64_12)
+MS2SYSV_STUB_END(savms64_13)
+MS2SYSV_STUB_END(savms64_14)
+MS2SYSV_STUB_END(savms64_15)
+MS2SYSV_STUB_END(savms64_16)
+MS2SYSV_STUB_END(savms64_17)
+MS2SYSV_STUB_END(savms64_18)
#endif /* __x86_64__ */
diff --git a/libgcc/config/i386/savms64f.S b/libgcc/config/i386/savms64f.h
index 81583b6..723e108 100644
--- a/libgcc/config/i386/savms64f.S
+++ b/libgcc/config/i386/savms64f.h
@@ -30,26 +30,26 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
* needed or hard frame pointer used. */
.text
-HIDDEN_FUNC(__savms64f_17)
+MS2SYSV_STUB_BEGIN(savms64f_17)
mov %r15,-0x68(%rax)
-HIDDEN_FUNC(__savms64f_16)
+MS2SYSV_STUB_BEGIN(savms64f_16)
mov %r14,-0x60(%rax)
-HIDDEN_FUNC(__savms64f_15)
+MS2SYSV_STUB_BEGIN(savms64f_15)
mov %r13,-0x58(%rax)
-HIDDEN_FUNC(__savms64f_14)
+MS2SYSV_STUB_BEGIN(savms64f_14)
mov %r12,-0x50(%rax)
-HIDDEN_FUNC(__savms64f_13)
+MS2SYSV_STUB_BEGIN(savms64f_13)
mov %rbx,-0x48(%rax)
-HIDDEN_FUNC(__savms64f_12)
+MS2SYSV_STUB_BEGIN(savms64f_12)
mov %rdi,-0x40(%rax)
mov %rsi,-0x38(%rax)
- SSE_SAVE off=0x60
+ SSE_SAVE
ret
-FUNC_END(__savms64f_12)
-FUNC_END(__savms64f_13)
-FUNC_END(__savms64f_14)
-FUNC_END(__savms64f_15)
-FUNC_END(__savms64f_16)
-FUNC_END(__savms64f_17)
+MS2SYSV_STUB_END(savms64f_12)
+MS2SYSV_STUB_END(savms64f_13)
+MS2SYSV_STUB_END(savms64f_14)
+MS2SYSV_STUB_END(savms64f_15)
+MS2SYSV_STUB_END(savms64f_16)
+MS2SYSV_STUB_END(savms64f_17)
#endif /* __x86_64__ */
diff --git a/libgcc/config/i386/sse_resms64.S b/libgcc/config/i386/sse_resms64.S
new file mode 100644
index 0000000..c87f5cc
--- /dev/null
+++ b/libgcc/config/i386/sse_resms64.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_SSE
+#include "resms64.h"
diff --git a/libgcc/config/i386/sse_resms64f.S b/libgcc/config/i386/sse_resms64f.S
new file mode 100644
index 0000000..3a066bc
--- /dev/null
+++ b/libgcc/config/i386/sse_resms64f.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_SSE
+#include "resms64f.h"
diff --git a/libgcc/config/i386/sse_resms64fx.S b/libgcc/config/i386/sse_resms64fx.S
new file mode 100644
index 0000000..142667a
--- /dev/null
+++ b/libgcc/config/i386/sse_resms64fx.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_SSE
+#include "resms64fx.h"
diff --git a/libgcc/config/i386/sse_resms64x.S b/libgcc/config/i386/sse_resms64x.S
new file mode 100644
index 0000000..2cfc2b0
--- /dev/null
+++ b/libgcc/config/i386/sse_resms64x.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_SSE
+#include "resms64x.h"
diff --git a/libgcc/config/i386/sse_savms64.S b/libgcc/config/i386/sse_savms64.S
new file mode 100644
index 0000000..52f4307
--- /dev/null
+++ b/libgcc/config/i386/sse_savms64.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_SSE
+#include "savms64.h"
diff --git a/libgcc/config/i386/sse_savms64f.S b/libgcc/config/i386/sse_savms64f.S
new file mode 100644
index 0000000..426be35
--- /dev/null
+++ b/libgcc/config/i386/sse_savms64f.S
@@ -0,0 +1,2 @@
+#define MS2SYSV_STUB_SSE
+#include "savms64f.h"
diff --git a/libgcc/config/i386/t-msabi b/libgcc/config/i386/t-msabi
index f9806a6..ffc9c4f 100644
--- a/libgcc/config/i386/t-msabi
+++ b/libgcc/config/i386/t-msabi
@@ -1,7 +1,13 @@
# Makefile fragment to support -mcall-ms2sysv-xlogues
-LIB2ADD_ST += $(srcdir)/config/i386/savms64.S \
- $(srcdir)/config/i386/resms64.S \
- $(srcdir)/config/i386/resms64x.S \
- $(srcdir)/config/i386/savms64f.S \
- $(srcdir)/config/i386/resms64f.S \
- $(srcdir)/config/i386/resms64fx.S
+LIB2ADD_ST += $(srcdir)/config/i386/avx_savms64.S \
+ $(srcdir)/config/i386/avx_resms64.S \
+ $(srcdir)/config/i386/avx_resms64x.S \
+ $(srcdir)/config/i386/avx_savms64f.S \
+ $(srcdir)/config/i386/avx_resms64f.S \
+ $(srcdir)/config/i386/avx_resms64fx.S \
+ $(srcdir)/config/i386/sse_savms64.S \
+ $(srcdir)/config/i386/sse_resms64.S \
+ $(srcdir)/config/i386/sse_resms64x.S \
+ $(srcdir)/config/i386/sse_savms64f.S \
+ $(srcdir)/config/i386/sse_resms64f.S \
+ $(srcdir)/config/i386/sse_resms64fx.S
diff --git a/libgcc/config/m68k/linux-unwind.h b/libgcc/config/m68k/linux-unwind.h
index 82c7a29..9ea39d4 100644
--- a/libgcc/config/m68k/linux-unwind.h
+++ b/libgcc/config/m68k/linux-unwind.h
@@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
/* <sys/ucontext.h> is unfortunately broken right now. */
struct uw_ucontext {
unsigned long uc_flags;
- struct ucontext *uc_link;
+ ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
unsigned long uc_filler[80];
diff --git a/libgcc/config/nios2/linux-unwind.h b/libgcc/config/nios2/linux-unwind.h
index ae82efd..204359d 100644
--- a/libgcc/config/nios2/linux-unwind.h
+++ b/libgcc/config/nios2/linux-unwind.h
@@ -38,7 +38,7 @@ struct nios2_mcontext {
struct nios2_ucontext {
unsigned long uc_flags;
- struct ucontext *uc_link;
+ ucontext_t *uc_link;
stack_t uc_stack;
struct nios2_mcontext uc_mcontext;
sigset_t uc_sigmask; /* mask last for extensibility */
diff --git a/libgcc/config/pa/linux-unwind.h b/libgcc/config/pa/linux-unwind.h
index 580c18d..c2c3409 100644
--- a/libgcc/config/pa/linux-unwind.h
+++ b/libgcc/config/pa/linux-unwind.h
@@ -80,7 +80,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
struct sigcontext *sc;
struct rt_sigframe {
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *frame;
/* rt_sigreturn trampoline:
diff --git a/libgcc/config/riscv/linux-unwind.h b/libgcc/config/riscv/linux-unwind.h
index a051a28..1c8aeff 100644
--- a/libgcc/config/riscv/linux-unwind.h
+++ b/libgcc/config/riscv/linux-unwind.h
@@ -42,7 +42,7 @@ riscv_fallback_frame_state (struct _Unwind_Context *context,
struct rt_sigframe
{
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
};
struct rt_sigframe *rt_;
diff --git a/libgcc/config/rs6000/float128-ifunc.c b/libgcc/config/rs6000/float128-ifunc.c
index e456ab1..882c56e 100644
--- a/libgcc/config/rs6000/float128-ifunc.c
+++ b/libgcc/config/rs6000/float128-ifunc.c
@@ -45,47 +45,7 @@
#error "This module must not be compiled with IEEE 128-bit hardware support"
#endif
-#include <sys/auxv.h>
-
-/* Use the namespace clean version of getauxval. However, not all versions of
- sys/auxv.h declare it, so declare it here. This code is intended to be
- temporary until a suitable version of __builtin_cpu_supports is added that
- allows us to tell quickly if the machine supports IEEE 128-bit hardware. */
-extern unsigned long __getauxval (unsigned long);
-
-static int
-have_ieee_hw_p (void)
-{
- static int ieee_hw_p = -1;
-
- if (ieee_hw_p < 0)
- {
- char *p = (char *) __getauxval (AT_PLATFORM);
-
- ieee_hw_p = 0;
-
- /* Don't use atoi/strtol/strncmp/etc. These may require the normal
- environment to be setup to set errno to 0, and the ifunc resolvers run
- before the whole glibc environment is initialized. */
- if (p && p[0] == 'p' && p[1] == 'o' && p[2] == 'w' && p[3] == 'e'
- && p[4] == 'r')
- {
- long n = 0;
- char ch;
-
- p += 5;
- while ((ch = *p++) >= '0' && (ch <= '9'))
- n = (n * 10) + (ch - '0');
-
- if (n >= 9)
- ieee_hw_p = 1;
- }
- }
-
- return ieee_hw_p;
-}
-
-#define SW_OR_HW(SW, HW) (have_ieee_hw_p () ? HW : SW)
+#define SW_OR_HW(SW, HW) (__builtin_cpu_supports ("ieee128") ? HW : SW)
/* Resolvers. */
diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c
index 949b50c..e99652e 100644
--- a/libgcc/config/rs6000/ibm-ldouble.c
+++ b/libgcc/config/rs6000/ibm-ldouble.c
@@ -45,7 +45,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
This code currently assumes the most significant double is in
the lower numbered register or lower addressed memory. */
-#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX)
+#if (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)) \
+ && !defined (__rtems__)
#define fabs(x) __builtin_fabs(x)
#define isless(x, y) __builtin_isless (x, y)
diff --git a/libgcc/config/sh/linux-unwind.h b/libgcc/config/sh/linux-unwind.h
index 1038cae..a8c9822 100644
--- a/libgcc/config/sh/linux-unwind.h
+++ b/libgcc/config/sh/linux-unwind.h
@@ -82,7 +82,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
{
struct rt_sigframe {
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_ = context->cfa;
/* The void * cast is necessary to avoid an aliasing warning.
The aliasing warning is correct, but should not be a problem
diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks
index d67e446..bbbb16d 100644
--- a/libgcc/config/t-vxworks
+++ b/libgcc/config/t-vxworks
@@ -2,12 +2,13 @@
LIBGCC2_DEBUG_CFLAGS =
# Extra libgcc2 modules used by gthr-vxworks.h functions
-LIB2ADD = $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
+LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
-# This ensures that the correct target headers are used; some
-# VxWorks system headers have names that collide with GCC's
-# internal (host) headers, e.g. regs.h.
-LIBGCC2_INCLUDES = -nostdinc \
+# This ensures that the correct target headers are used; some VxWorks
+# system headers have names that collide with GCC's internal (host)
+# headers, e.g. regs.h. Make sure the local libgcc headers still
+# prevail (e.g. unwind.h).
+LIBGCC2_INCLUDES = -nostdinc -I. \
`case "/$(MULTIDIR)" in \
*/mrtp*) echo -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip ;; \
*) echo -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip ;; \
diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7
new file mode 100644
index 0000000..ae1dff9
--- /dev/null
+++ b/libgcc/config/t-vxworks7
@@ -0,0 +1,17 @@
+# Don't build libgcc.a with debug info
+LIBGCC2_DEBUG_CFLAGS =
+
+# Extra libgcc2 modules used by gthr-vxworks.h functions
+LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c
+
+# This ensures that the correct target headers are used; some VxWorks
+# system headers have names that collide with GCC's internal (host)
+# headers, e.g. regs.h. Make sure the local libgcc headers still
+# prevail (e.g. unwind.h).
+LIBGCC2_INCLUDES = -nostdinc \
+ -I. -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \
+ `case "/$(MULTIDIR)" in \
+ */mrtp*) echo -I$(VSB_DIR)/usr/h/public -I$(VSB_DIR)/usr/h ;; \
+ *) echo -I$(VSB_DIR)/krnl/h/system -I$(VSB_DIR)/krnl/h/public ;; \
+ esac`
+
diff --git a/libgcc/config/tilepro/linux-unwind.h b/libgcc/config/tilepro/linux-unwind.h
index a8dc440..dba3b41 100644
--- a/libgcc/config/tilepro/linux-unwind.h
+++ b/libgcc/config/tilepro/linux-unwind.h
@@ -61,7 +61,7 @@ tile_fallback_frame_state (struct _Unwind_Context *context,
struct rt_sigframe {
unsigned char save_area[C_ABI_SAVE_AREA_SIZE];
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_;
/* Return if this is not a signal handler. */
diff --git a/libgcc/config/xtensa/linux-unwind.h b/libgcc/config/xtensa/linux-unwind.h
index 67c2728..2cb9eb1 100644
--- a/libgcc/config/xtensa/linux-unwind.h
+++ b/libgcc/config/xtensa/linux-unwind.h
@@ -67,7 +67,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
struct rt_sigframe {
siginfo_t info;
- struct ucontext uc;
+ ucontext_t uc;
} *rt_;
/* movi a2, __NR_rt_sigreturn; syscall */
diff --git a/libgcc/configure b/libgcc/configure
index 42dda7f..15d34b2 100644
--- a/libgcc/configure
+++ b/libgcc/configure
@@ -4975,10 +4975,10 @@ esac
esac
case ${host} in
-# At present, we cannot turn -mfloat128 on via #pragma GCC target,
-# so just check if we have VSX (ISA 2.06) support to build the
-# software libraries, and whether the assembler can handle xsaddqp
-# for hardware support.
+# At present, we cannot turn -mfloat128 on via #pragma GCC target, so just
+# check if we have VSX (ISA 2.06) support to build the software libraries, and
+# whether the assembler can handle xsaddqp for hardware support. Also check if
+# a new glibc is being used so that __builtin_cpu_supports can be used.
powerpc*-*-linux*)
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
@@ -5013,6 +5013,9 @@ else
#ifndef AT_PLATFORM
#error "AT_PLATFORM is not defined"
#endif
+ #ifndef __BUILTIN_CPU_SUPPORTS__
+ #error "__builtin_cpu_supports is not available"
+ #endif
vector unsigned char add (vector unsigned char a, vector unsigned char b)
{
vector unsigned char ret;
diff --git a/libgcc/configure.ac b/libgcc/configure.ac
index 6bcaad6..da49971 100644
--- a/libgcc/configure.ac
+++ b/libgcc/configure.ac
@@ -376,10 +376,10 @@ esac
esac
case ${host} in
-# At present, we cannot turn -mfloat128 on via #pragma GCC target,
-# so just check if we have VSX (ISA 2.06) support to build the
-# software libraries, and whether the assembler can handle xsaddqp
-# for hardware support.
+# At present, we cannot turn -mfloat128 on via #pragma GCC target, so just
+# check if we have VSX (ISA 2.06) support to build the software libraries, and
+# whether the assembler can handle xsaddqp for hardware support. Also check if
+# a new glibc is being used so that __builtin_cpu_supports can be used.
powerpc*-*-linux*)
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -mabi=altivec -mvsx -mfloat128"
@@ -398,6 +398,9 @@ powerpc*-*-linux*)
#ifndef AT_PLATFORM
#error "AT_PLATFORM is not defined"
#endif
+ #ifndef __BUILTIN_CPU_SUPPORTS__
+ #error "__builtin_cpu_supports is not available"
+ #endif
vector unsigned char add (vector unsigned char a, vector unsigned char b)
{
vector unsigned char ret;