summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2018-01-04 19:46:31 +0000
committerkettenis <kettenis@openbsd.org>2018-01-04 19:46:31 +0000
commitc7cbac187684cfb8bf7fa4d2401eb831ecbf60be (patch)
tree94f672cbb46039f62bce2ff1f098fe5eebd6f8b6
parentBack out sign compare changes that appear to cause problems on hppa. (diff)
downloadwireguard-openbsd-c7cbac187684cfb8bf7fa4d2401eb831ecbf60be.tar.xz
wireguard-openbsd-c7cbac187684cfb8bf7fa4d2401eb831ecbf60be.zip
Add ARM EABI aliases and remove functions that are also provided by our libc.
This allows linking code compiled by clang with the gcc compiler driver and makes sure we always use the softfloat implementation in libc. The libc softfloat implementation is preferred over the one in libgcc as it implements rounding modes and floating point exceptions. ok patrick@
-rw-r--r--gnu/gcc/gcc/config/arm/openbsd1.h35
-rw-r--r--gnu/gcc/gcc/config/floatunsidf.c4
-rw-r--r--gnu/gcc/gcc/config/floatunsisf.c4
-rw-r--r--gnu/usr.bin/cc/libgcc/Makefile7
4 files changed, 49 insertions, 1 deletions
diff --git a/gnu/gcc/gcc/config/arm/openbsd1.h b/gnu/gcc/gcc/config/arm/openbsd1.h
index afd2e3b1762..ed79f6e4c4f 100644
--- a/gnu/gcc/gcc/config/arm/openbsd1.h
+++ b/gnu/gcc/gcc/config/arm/openbsd1.h
@@ -24,3 +24,38 @@ Boston, MA 02111-1307, USA. */
/* use EABI frame unwinding tables. */
#define TARGET_UNWIND_INFO 1
+
+#if defined (__thumb__)
+#define RENAME_LIBRARY_SET ".thumb_set"
+#else
+#define RENAME_LIBRARY_SET ".set"
+#endif
+
+/* Make __aeabi_AEABI_NAME an alias for __GCC_NAME. */
+#define RENAME_LIBRARY(GCC_NAME, AEABI_NAME) \
+ __asm__ (".globl\t__aeabi_" #AEABI_NAME "\n" \
+ RENAME_LIBRARY_SET "\t__aeabi_" #AEABI_NAME \
+ ", __" #GCC_NAME "\n");
+
+/* Give some libgcc functions an additional __aeabi name. */
+#ifdef L_muldi3
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (muldi3, lmul)
+#endif
+#ifdef L_fixdfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixdfdi, d2lz)
+#endif
+#ifdef L_fixunsdfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunsdfdi, d2ulz)
+#endif
+#ifdef L_fixsfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixsfdi, f2lz)
+#endif
+#ifdef L_fixunssfdi
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (fixunssfdi, f2ulz)
+#endif
+#ifdef L_floatdidf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdidf, l2d)
+#endif
+#ifdef L_floatdisf
+#define DECLARE_LIBRARY_RENAMES RENAME_LIBRARY (floatdisf, l2f)
+#endif
diff --git a/gnu/gcc/gcc/config/floatunsidf.c b/gnu/gcc/gcc/config/floatunsidf.c
index ff28112502b..c23d3a117ff 100644
--- a/gnu/gcc/gcc/config/floatunsidf.c
+++ b/gnu/gcc/gcc/config/floatunsidf.c
@@ -13,3 +13,7 @@ __floatunsidf (USItype u)
<< (sizeof (USItype) * __CHAR_BIT__ - 1));
return r;
}
+
+#ifdef __ARM_EABI__
+__asm__ (".globl\t__aeabi_ui2d\n.set\t__aeabi_ui2d, __floatunsidf\n");
+#endif
diff --git a/gnu/gcc/gcc/config/floatunsisf.c b/gnu/gcc/gcc/config/floatunsisf.c
index 11d4aa78cbe..69951efaa89 100644
--- a/gnu/gcc/gcc/config/floatunsisf.c
+++ b/gnu/gcc/gcc/config/floatunsisf.c
@@ -16,3 +16,7 @@ __floatunsisf (USItype u)
else
return (SFtype) s;
}
+
+#ifdef __ARM_EABI__
+__asm__ (".globl\t__aeabi_ui2f\n.set\t__aeabi_ui2f, __floatunsisf\n");
+#endif
diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile
index 0f82f3b45a3..d83f6ac801d 100644
--- a/gnu/usr.bin/cc/libgcc/Makefile
+++ b/gnu/usr.bin/cc/libgcc/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD: src/gnu/lib/libgcc/Makefile,v 1.58.8.1 2009/04/15 03:14:26 kensmith Exp $
-# $OpenBSD: Makefile,v 1.29 2016/09/01 11:03:09 patrick Exp $
+# $OpenBSD: Makefile,v 1.30 2018/01/04 19:46:31 kettenis Exp $
.include <bsd.own.mk>
@@ -124,8 +124,13 @@ LIB2FUNCS_EXTRA = qrnnd.asm
CFLAGS+= -Dinhibit_libc -fno-inline
LIB1ASMSRC = lib1funcs.asm
LIB1ASMFUNCS = _dvmd_tls _bb_init_func
+LIB1ASMFUNCS+= _aeabi_lcmp _aeabi_ulcmp _aeabi_ldivmod _aeabi_uldivmod
+LIB1ASMFUNCS+= _cmpsf2 _fixunssfsi _negsf2
+LIB1ASMFUNCS+= _cmpdf2 _fixunsdfsi _negdf2
LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c
LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c
+SWFLOATFUNCS =
+DWFLOATFUNCS = _floatundisf _floatundidf
# Not now
#LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func