aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog51
-rw-r--r--libgcc/config.host20
-rw-r--r--libgcc/config/arm/t-vxworks71
-rw-r--r--libgcc/config/arm/unwind-arm-vxworks.c33
-rw-r--r--libgcc/config/i386/i386-asm.h89
-rw-r--r--libgcc/config/i386/resms64.S2
-rw-r--r--libgcc/config/i386/resms64f.S2
-rw-r--r--libgcc/config/i386/resms64fx.S2
-rw-r--r--libgcc/config/i386/resms64x.S2
-rw-r--r--libgcc/config/i386/savms64.S2
-rw-r--r--libgcc/config/i386/savms64f.S2
-rw-r--r--libgcc/config/rs6000/ibm-ldouble.c3
-rw-r--r--libgcc/config/t-vxworks11
-rw-r--r--libgcc/config/t-vxworks79
14 files changed, 175 insertions, 54 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index db33eea1378..14d20fbfac8 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,3 +1,54 @@
+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.
diff --git a/libgcc/config.host b/libgcc/config.host
index a5ab4536321..546b12b5971 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -324,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;
;;
@@ -388,9 +391,18 @@ arc*-*-linux*)
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"
@@ -581,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"
;;
@@ -663,7 +675,7 @@ 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
diff --git a/libgcc/config/arm/t-vxworks7 b/libgcc/config/arm/t-vxworks7
new file mode 100644
index 00000000000..bead3369a59
--- /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 00000000000..ed23ab9fc3c
--- /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/i386/i386-asm.h b/libgcc/config/i386/i386-asm.h
index c613e9fd83d..1387fd24b4f 100644
--- a/libgcc/config/i386/i386-asm.h
+++ b/libgcc/config/i386/i386-asm.h
@@ -26,22 +26,45 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#ifndef I386_ASM_H
#define I386_ASM_H
+#include "auto-host.h"
+
+/* 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 FN_TYPE(fn)
+# define FN_SIZE(fn)
+#endif
+
+#ifndef FN_HIDDEN
+# define FN_HIDDEN(fn)
+#endif
+
+#ifdef __USER_LABEL_PREFIX__
+# define ASMNAME2(prefix, name) prefix ## name
+# define ASMNAME1(prefix, name) ASMNAME2(prefix, name)
+# define ASMNAME(name) ASMNAME1(__USER_LABEL_PREFIX__, name)
#else
-# define ELFFN(fn)
+# define ASMNAME(name) name
#endif
-#define FUNC_START(fn) \
- .global fn; \
- ELFFN (fn); \
-fn:
+#define FUNC_BEGIN(fn) \
+ .globl ASMNAME(fn); \
+ FN_TYPE (ASMNAME(fn)); \
+ASMNAME(fn):
-#define HIDDEN_FUNC(fn)\
- FUNC_START (fn) \
- .hidden fn; \
+#define HIDDEN_FUNC(fn) \
+ .globl ASMNAME(fn); \
+ FN_TYPE(ASMNAME(fn)); \
+ FN_HIDDEN(ASMNAME(fn)); \
+ASMNAME(fn):
-#define FUNC_END(fn) .size fn,.-fn
+#define FUNC_END(fn) FN_SIZE(ASMNAME(fn))
#ifdef __SSE2__
# ifdef __AVX__
@@ -51,32 +74,30 @@ fn:
# endif
/* 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
+#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 /* __SSE2__ */
#endif /* I386_ASM_H */
diff --git a/libgcc/config/i386/resms64.S b/libgcc/config/i386/resms64.S
index f47e2f066fb..f842c20a77a 100644
--- a/libgcc/config/i386/resms64.S
+++ b/libgcc/config/i386/resms64.S
@@ -43,7 +43,7 @@ HIDDEN_FUNC(__resms64_13)
mov -0x48(%rsi),%rbx
HIDDEN_FUNC(__resms64_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
ret
FUNC_END(__resms64_12)
diff --git a/libgcc/config/i386/resms64f.S b/libgcc/config/i386/resms64f.S
index 817da60cf15..81946cda944 100644
--- a/libgcc/config/i386/resms64f.S
+++ b/libgcc/config/i386/resms64f.S
@@ -42,7 +42,7 @@ HIDDEN_FUNC(__resms64f_13)
mov -0x48(%rsi),%rbx
HIDDEN_FUNC(__resms64f_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
ret
FUNC_END(__resms64f_12)
diff --git a/libgcc/config/i386/resms64fx.S b/libgcc/config/i386/resms64fx.S
index 5dba5848dee..acf34fa0837 100644
--- a/libgcc/config/i386/resms64fx.S
+++ b/libgcc/config/i386/resms64fx.S
@@ -43,7 +43,7 @@ HIDDEN_FUNC(__resms64fx_13)
mov -0x48(%rsi),%rbx
HIDDEN_FUNC(__resms64fx_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
leaveq
ret
diff --git a/libgcc/config/i386/resms64x.S b/libgcc/config/i386/resms64x.S
index 7770447cf38..e27aab7d881 100644
--- a/libgcc/config/i386/resms64x.S
+++ b/libgcc/config/i386/resms64x.S
@@ -44,7 +44,7 @@ HIDDEN_FUNC(__resms64x_13)
mov -0x48(%rsi),%rbx
HIDDEN_FUNC(__resms64x_12)
mov -0x40(%rsi),%rdi
- SSE_RESTORE off=0x60
+ SSE_RESTORE
mov -0x38(%rsi),%rsi
mov %r10,%rsp
ret
diff --git a/libgcc/config/i386/savms64.S b/libgcc/config/i386/savms64.S
index 2067dd8614f..44dda46ec54 100644
--- a/libgcc/config/i386/savms64.S
+++ b/libgcc/config/i386/savms64.S
@@ -44,7 +44,7 @@ HIDDEN_FUNC(__savms64_13)
HIDDEN_FUNC(__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)
diff --git a/libgcc/config/i386/savms64f.S b/libgcc/config/i386/savms64f.S
index 81583b6eb68..64e91ac0394 100644
--- a/libgcc/config/i386/savms64f.S
+++ b/libgcc/config/i386/savms64f.S
@@ -43,7 +43,7 @@ HIDDEN_FUNC(__savms64f_13)
HIDDEN_FUNC(__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)
diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c
index 949b50c98ca..e99652e523f 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/t-vxworks b/libgcc/config/t-vxworks
index d67e446b46d..bbbb16deede 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
index 77591cd642c..ae1dff9ccbd 100644
--- a/libgcc/config/t-vxworks7
+++ b/libgcc/config/t-vxworks7
@@ -4,11 +4,12 @@ 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.
+# 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$(VSB_DIR)/h -I$(VSB_DIR)/share/h \
+ -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 ;; \