diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2016-09-01 11:03:10 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2016-09-01 11:03:10 +0000 |
commit | 9b29a0c9dd265acbfde2fe1fcf012e05035514ba (patch) | |
tree | 1b0c67e0d46f20af18036db65ef8577de740be39 | |
parent | cc0ba76d1364499a76720de2920f78d97327cc80 (diff) |
Switch OpenBSD/armv7 to ARM EABI (soft-float). This is a complete ABI
break which cannot be easily crossed.
ok kettenis@ jsg@
-rw-r--r-- | gnu/gcc/gcc/config/arm/openbsd.h | 18 | ||||
-rw-r--r-- | gnu/gcc/gcc/config/arm/openbsd1.h | 26 | ||||
-rw-r--r-- | gnu/gcc/gcc/config/arm/unwind-arm.h | 2 | ||||
-rw-r--r-- | gnu/lib/Makefile | 5 | ||||
-rw-r--r-- | gnu/lib/libstdc++-v3/Makefile | 5 | ||||
-rw-r--r-- | gnu/lib/libsupc++-v3/Makefile | 6 | ||||
-rw-r--r-- | gnu/usr.bin/binutils-2.17/gas/Makefile.am | 1 | ||||
-rw-r--r-- | gnu/usr.bin/binutils-2.17/gas/Makefile.in | 1 | ||||
-rw-r--r-- | gnu/usr.bin/binutils-2.17/gas/config/te-armobsd.h | 5 | ||||
-rw-r--r-- | gnu/usr.bin/binutils-2.17/gas/configure.tgt | 2 | ||||
-rw-r--r-- | gnu/usr.bin/cc/cc_tools/Makefile | 8 | ||||
-rw-r--r-- | gnu/usr.bin/cc/include/Makefile | 8 | ||||
-rw-r--r-- | gnu/usr.bin/cc/libgcc/Makefile | 3 |
13 files changed, 67 insertions, 23 deletions
diff --git a/gnu/gcc/gcc/config/arm/openbsd.h b/gnu/gcc/gcc/config/arm/openbsd.h index f76f1646635..91475ffb8d1 100644 --- a/gnu/gcc/gcc/config/arm/openbsd.h +++ b/gnu/gcc/gcc/config/arm/openbsd.h @@ -41,18 +41,20 @@ Boston, MA 02111-1307, USA. */ /* armv5te default cpu. */ #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9e -/* Default is to use APCS-32 mode. */ - -/* Default it to use ATPCS with soft-VFP. */ -#undef TARGET_DEFAULT -#define TARGET_DEFAULT \ - (MASK_APCS_FRAME \ - | TARGET_ENDIAN_DEFAULT) +/* We default to a soft-float ABI so that binaries can run on all + target hardware. */ +#undef TARGET_DEFAULT_FLOAT_ABI +#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT +/* We default to the "aapcs-linux" ABI so that enums are int-sized by + default. */ +#undef ARM_DEFAULT_ABI +#define ARM_DEFAULT_ABI ARM_ABI_AAPCS_LINUX #define TARGET_OS_CPP_BUILTINS() \ do \ { \ + builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ OPENBSD_OS_CPP_BUILTINS_ELF(); \ } \ while (0) @@ -79,7 +81,7 @@ Boston, MA 02111-1307, USA. */ #undef SUBTARGET_EXTRA_ASM_SPEC #define SUBTARGET_EXTRA_ASM_SPEC \ - "-matpcs %{fpic|fPIC|fpie|fPIE:-k}" + "%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=4} %{fpic|fPIC|fpie|fPIE:-k}" /* Default floating point model is soft-VFP. FIXME: -mhard-float currently implies FPA. */ diff --git a/gnu/gcc/gcc/config/arm/openbsd1.h b/gnu/gcc/gcc/config/arm/openbsd1.h new file mode 100644 index 00000000000..afd2e3b1762 --- /dev/null +++ b/gnu/gcc/gcc/config/arm/openbsd1.h @@ -0,0 +1,26 @@ +/* Definitions of target machine for GNU compiler, OpenBSD/arm ELF version. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Wasabi Systems, Inc. + +This file is part of GNU CC. + +GNU CC 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 2, or (at your option) +any later version. + +GNU CC 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. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#define OBSD_HAS_DECLARE_FUNCTION_NAME +#define OBSD_HAS_DECLARE_FUNCTION_SIZE + +/* use EABI frame unwinding tables. */ +#define TARGET_UNWIND_INFO 1 diff --git a/gnu/gcc/gcc/config/arm/unwind-arm.h b/gnu/gcc/gcc/config/arm/unwind-arm.h index a3040d7ad77..8a1bf2494b5 100644 --- a/gnu/gcc/gcc/config/arm/unwind-arm.h +++ b/gnu/gcc/gcc/config/arm/unwind-arm.h @@ -225,7 +225,7 @@ extern "C" { if (!tmp) return 0; -#if defined(linux) || defined(__NetBSD__) +#if defined(linux) || defined(__NetBSD__) || defined(__OpenBSD__) /* Pc-relative indirect. */ tmp += ptr; tmp = *(_Unwind_Word *) tmp; diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile index 5aa9429368e..2fdfd6dc03a 100644 --- a/gnu/lib/Makefile +++ b/gnu/lib/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.17 2013/08/06 19:11:53 miod Exp $ +# $OpenBSD: Makefile,v 1.18 2016/09/01 11:03:09 patrick Exp $ .include <bsd.own.mk> @@ -10,7 +10,10 @@ SUBDIR+=libobjc libstdc++ libstdc++-v3 libsupc++-v3 ../usr.bin/cc/libobjc SUBDIR+=libobjc libstdc++ . else # XXX make sure we build libobjc & libstdc++-v3 from gcc4 +# XXX arm: libocj from gcc 4.2.1 does not build with ARM EHABI +. if ${MACHINE_ARCH} != "arm" SUBDIR+=../usr.bin/cc/libobjc +. endif SUBDIR+=libstdc++-v3 libsupc++-v3 . endif .endif diff --git a/gnu/lib/libstdc++-v3/Makefile b/gnu/lib/libstdc++-v3/Makefile index 8203a96bb7f..97cc97b436c 100644 --- a/gnu/lib/libstdc++-v3/Makefile +++ b/gnu/lib/libstdc++-v3/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/lib/libstdc++/Makefile,v 1.63.2.1 2009/08/03 08:13:06 kensmith Exp $ -# $OpenBSD: Makefile,v 1.10 2016/03/28 00:04:26 deraadt Exp $ +# $OpenBSD: Makefile,v 1.11 2016/09/01 11:03:09 patrick Exp $ .include "${.CURDIR}/Makefile.common" @@ -8,9 +8,6 @@ GCC_TARGET= ${MACHINE_ARCH}-unknown-openbsd${OSREV} LIB= stdc++ CPPFLAGS+= -DIN_GLIBCPP_V3 -DHAVE_CONFIG_H -.if ${MACHINE_ARCH} == "arm" -CPPFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 -.endif CPPFLAGS+= -I${.CURDIR} -I${SUPDIR} -I${GCCDIR} -I${SRCDIR}/include CPPFLAGS+= -I${GCCLIB}/include -I${SRCDIR}/include -I${.CURDIR}/../libiberty/include -I. CFLAGS+= -frandom-seed=RepeatabilityConsideredGood diff --git a/gnu/lib/libsupc++-v3/Makefile b/gnu/lib/libsupc++-v3/Makefile index 08ebd18c00d..41e22ee67f3 100644 --- a/gnu/lib/libsupc++-v3/Makefile +++ b/gnu/lib/libsupc++-v3/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.4 2015/05/14 02:56:01 jsg Exp $ +# $OpenBSD: Makefile,v 1.5 2016/09/01 11:03:09 patrick Exp $ .include "${.CURDIR}/../libstdc++-v3/Makefile.common" @@ -8,10 +8,6 @@ LIB= supc++ # Pulled from Makefile.common SRCS= ${SUPSRCS} -.if ${MACHINE_ARCH} == "arm" -CPPFLAGS+= -D_GLIBCXX_SJLJ_EXCEPTIONS=1 -.endif - # Build a standard .a lib with PIC objects NOPIC= CFLAGS+= ${PICFLAG} diff --git a/gnu/usr.bin/binutils-2.17/gas/Makefile.am b/gnu/usr.bin/binutils-2.17/gas/Makefile.am index a43e0268fc5..f67ccec30dc 100644 --- a/gnu/usr.bin/binutils-2.17/gas/Makefile.am +++ b/gnu/usr.bin/binutils-2.17/gas/Makefile.am @@ -351,6 +351,7 @@ OBJ_FORMAT_HFILES = \ TARG_ENV_HFILES = \ config/te-386bsd.h \ config/te-armlinuxeabi.h \ + config/te-armobsd.h \ config/te-aux.h \ config/te-delta.h \ config/te-delt88.h \ diff --git a/gnu/usr.bin/binutils-2.17/gas/Makefile.in b/gnu/usr.bin/binutils-2.17/gas/Makefile.in index 9e41c01b668..35f9f85170c 100644 --- a/gnu/usr.bin/binutils-2.17/gas/Makefile.in +++ b/gnu/usr.bin/binutils-2.17/gas/Makefile.in @@ -580,6 +580,7 @@ OBJ_FORMAT_HFILES = \ TARG_ENV_HFILES = \ config/te-386bsd.h \ config/te-armlinuxeabi.h \ + config/te-armobsd.h \ config/te-aux.h \ config/te-delta.h \ config/te-delt88.h \ diff --git a/gnu/usr.bin/binutils-2.17/gas/config/te-armobsd.h b/gnu/usr.bin/binutils-2.17/gas/config/te-armobsd.h new file mode 100644 index 00000000000..46ef5e420d8 --- /dev/null +++ b/gnu/usr.bin/binutils-2.17/gas/config/te-armobsd.h @@ -0,0 +1,5 @@ +#include "te-obsd.h" + +/* The EABI requires the use of VFP. */ +#define FPU_DEFAULT FPU_ARCH_VFP_V2 +#define EABI_DEFAULT EF_ARM_EABI_VER4 diff --git a/gnu/usr.bin/binutils-2.17/gas/configure.tgt b/gnu/usr.bin/binutils-2.17/gas/configure.tgt index 00b7ed4042b..dbc0bd71571 100644 --- a/gnu/usr.bin/binutils-2.17/gas/configure.tgt +++ b/gnu/usr.bin/binutils-2.17/gas/configure.tgt @@ -112,7 +112,7 @@ case ${generic_target} in arm-*-uclinux*) fmt=elf em=linux ;; arm-*-netbsdelf*) fmt=elf em=nbsd ;; arm-*-netbsd*) fmt=aout em=nbsd ;; - arm-*-openbsd*) fmt=elf em=obsd ;; + arm-*-openbsd*) fmt=elf em=armobsd ;; arm-*-nto*) fmt=elf ;; arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; arm-wince-pe | arm-*-wince) fmt=coff em=wince-pe ;; diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile index 97bbe0a2555..92f6984ac72 100644 --- a/gnu/usr.bin/cc/cc_tools/Makefile +++ b/gnu/usr.bin/cc/cc_tools/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/cc_tools/Makefile,v 1.88.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.13 2015/09/16 10:55:39 kettenis Exp $ +# $OpenBSD: Makefile,v 1.14 2016/09/01 11:03:09 patrick Exp $ .include <bsd.own.mk> @@ -51,6 +51,7 @@ TARGET_INC+= elfos.h .if ${TARGET_ARCH} == "arm" TARGET_INC+= arm/elf.h TARGET_INC+= arm/aout.h +TARGET_INC+= arm/openbsd1.h TARGET_INC+= arm/arm.h .endif .if ${TARGET_ARCH} == "sh" @@ -361,8 +362,13 @@ gthr-default.h: ${GCCDIR}/gthr-posix.h GENSRCS+= gthr-default.h +.if ${TARGET_ARCH} == "arm" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h + ln -sf ${.ALLSRC} ${.TARGET} +.else unwind.h: ${GCCDIR}/unwind-generic.h ln -sf ${.ALLSRC} ${.TARGET} +.endif GENSRCS+= unwind.h diff --git a/gnu/usr.bin/cc/include/Makefile b/gnu/usr.bin/cc/include/Makefile index 874deb9f92a..64ea98e910e 100644 --- a/gnu/usr.bin/cc/include/Makefile +++ b/gnu/usr.bin/cc/include/Makefile @@ -1,5 +1,5 @@ # $FreeBSD: src/gnu/usr.bin/cc/include/Makefile,v 1.9.8.1 2009/04/15 03:14:26 kensmith Exp $ -# $OpenBSD: Makefile,v 1.10 2014/09/10 04:40:02 jsg Exp $ +# $OpenBSD: Makefile,v 1.11 2016/09/01 11:03:09 patrick Exp $ .include <bsd.own.mk> @@ -23,9 +23,15 @@ mm_malloc.h: pmm_malloc.h @cp ${.ALLSRC} ${.TARGET} CLEANFILES+= mm_malloc.h +.if ${TARGET_ARCH} == "arm" +unwind.h: ${GCCDIR}/config/arm/unwind-arm.h + @rm -rf ${.TARGET} + @cp ${.ALLSRC} ${.TARGET} +.else unwind.h: ${GCCDIR}/unwind-generic.h @rm -rf ${.TARGET} @cp ${.ALLSRC} ${.TARGET} +.endif CLEANFILES+= unwind.h all: ${INCS} diff --git a/gnu/usr.bin/cc/libgcc/Makefile b/gnu/usr.bin/cc/libgcc/Makefile index b1982132839..0f82f3b45a3 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.28 2016/09/01 10:40:38 tedu Exp $ +# $OpenBSD: Makefile,v 1.29 2016/09/01 11:03:09 patrick Exp $ .include <bsd.own.mk> @@ -125,6 +125,7 @@ CFLAGS+= -Dinhibit_libc -fno-inline LIB1ASMSRC = lib1funcs.asm LIB1ASMFUNCS = _dvmd_tls _bb_init_func LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c +LIB2ADDEH = unwind-arm.c libunwind.S pr-support.c unwind-c.c # Not now #LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func |