summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2019-10-24 18:46:20 +0000
committerchristos <christos@NetBSD.org>2019-10-24 18:46:20 +0000
commite2f7c08f0578d0ae84cf134504945cb2749e9fcc (patch)
tree5150c6ad8f9f27d82c95e0f09d7b589f8841fc76
parent7b38ef3daf23a1f352e55f2e77a1ca50b371cce1 (diff)
1. All Makefiles that use ARM_APCS_FLAGS add -marm unconditionally and
bsd.own.mk also adds it for gcc only (so we end up with 2 -marm for gcc). Just add -marm unconditionally in bsd.own.mk in ARM_APCS_FLAGS and remove it from everywhere else. 2. gcc-8 now warns about thumb internetwork in APCS mode. This does not make sense because the documentation says that this flag does not make a difference in apcs mode, but might produce larger code in non-APCS mode. So we just add it to silence the warnings.
-rw-r--r--compat/arm/oabi/bsd.oabi.mk3
-rw-r--r--share/mk/bsd.own.mk6
-rw-r--r--sys/arch/acorn32/stand/Makefile.buildboot3
-rw-r--r--sys/arch/evbarm/stand/boot2440/Makefile3
-rw-r--r--sys/arch/evbarm/stand/bootimx23/Makefile3
-rw-r--r--sys/arch/evbarm/stand/gzboot/Makefile.gzboot3
-rw-r--r--sys/arch/zaurus/stand/zboot/Makefile3
7 files changed, 10 insertions, 14 deletions
diff --git a/compat/arm/oabi/bsd.oabi.mk b/compat/arm/oabi/bsd.oabi.mk
index e5659e156dd..92b41aed540 100644
--- a/compat/arm/oabi/bsd.oabi.mk
+++ b/compat/arm/oabi/bsd.oabi.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.oabi.mk,v 1.4 2015/06/24 22:20:24 matt Exp $
+# $NetBSD: bsd.oabi.mk,v 1.5 2019/10/24 18:46:20 christos Exp $
.if !defined(MLIBDIR)
MLIBDIR= oabi
@@ -11,6 +11,7 @@ ARM_LD= -m armelf_nbsd
LDFLAGS+= -Wl,-m,armelf_nbsd
COPTS+= -mcpu=cortex-a53
ARM_APCS_FLAGS= ${${ACTIVE_CC} == "clang":? -target arm--netbsdelf -B ${TOOLDIR}/aarch64--netbsd/bin :} -mabi=apcs-gnu -mfloat-abi=soft
+ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :}
.elif !empty(MACHINE_ARCH:M*eb)
ARM_MACHINE_ARCH= armeb
ARM_LD= -m armelfb_nbsd
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index cce9bc5e82f..ea9d91db369 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.own.mk,v 1.1157 2019/10/22 13:49:30 christos Exp $
+# $NetBSD: bsd.own.mk,v 1.1158 2019/10/24 18:46:20 christos Exp $
# This needs to be before bsd.init.mk
.if defined(BSD_MK_COMPAT_FILE)
@@ -890,8 +890,8 @@ MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
.if !empty(MACHINE_ARCH:M*arm*)
# Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
-ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft
-ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
+ARM_APCS_FLAGS= -mabi=apcs-gnu -mfloat-abi=soft -marm
+ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :}
ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
.endif
diff --git a/sys/arch/acorn32/stand/Makefile.buildboot b/sys/arch/acorn32/stand/Makefile.buildboot
index cf8abc0dd0f..21eae6f7db0 100644
--- a/sys/arch/acorn32/stand/Makefile.buildboot
+++ b/sys/arch/acorn32/stand/Makefile.buildboot
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.buildboot,v 1.24 2017/04/09 16:29:46 christos Exp $
+# $NetBSD: Makefile.buildboot,v 1.25 2019/10/24 18:46:20 christos Exp $
S?= ${.CURDIR}/../../../..
@@ -40,7 +40,6 @@ CPPFLAGS+= -D_STANDALONE
CPPFLAGS+= -I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
CPPFLAGS+= -I${.CURDIR}/../lib
CPPFLAGS+= ${ARM_APCS_FLAGS} -march=armv3m
-CPPFLAGS+= -marm
CPUFLAGS=
CFLAGS= -O2
CFLAGS+= -ffreestanding -fno-unwind-tables
diff --git a/sys/arch/evbarm/stand/boot2440/Makefile b/sys/arch/evbarm/stand/boot2440/Makefile
index 7619c621e81..b10eab2e94f 100644
--- a/sys/arch/evbarm/stand/boot2440/Makefile
+++ b/sys/arch/evbarm/stand/boot2440/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2017/04/08 19:53:20 christos Exp $
+# $NetBSD: Makefile,v 1.19 2019/10/24 18:46:20 christos Exp $
S= ${.CURDIR}/../../../..
@@ -16,7 +16,6 @@ CPPFLAGS+= -DDM9000MAC="0x08,0x08,0x11,0x18,0x12,0x27"
CPPFLAGS+= -DDEFAULT_BOOTFILE="ld0a:netbsd;net:"
CPPFLAGS+= -nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch
CPPFLAGS+= -march=armv4 ${ARM_APCS_FLAGS}
-CPPFLAGS+= -marm
CPUFLAGS=
DBG= -Os
diff --git a/sys/arch/evbarm/stand/bootimx23/Makefile b/sys/arch/evbarm/stand/bootimx23/Makefile
index ed1b4b99c8e..d023d049e5d 100644
--- a/sys/arch/evbarm/stand/bootimx23/Makefile
+++ b/sys/arch/evbarm/stand/bootimx23/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.15 2017/02/22 13:14:45 maya Exp $
+# $Id: Makefile,v 1.16 2019/10/24 18:46:21 christos Exp $
S= ${.CURDIR}/../../../../
PROG= bootimx23
@@ -13,7 +13,6 @@ CPPFLAGS+= -D_STANDALONE -DMEMSIZE=64
CPPFLAGS+= -DKERNEL_BOOT_ARGS=\"root=ld0a\"
CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S} -I${S}/arch
CPPFLAGS+= ${ARM_APCS_FLAGS}
-CPPFLAGS+= -marm
#CPPFLAGS+= -DDEBUG
#CPPFLAGS+= -DDIAGNOSTIC
DBG= -g
diff --git a/sys/arch/evbarm/stand/gzboot/Makefile.gzboot b/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
index 48cb8d87563..14913bb2aca 100644
--- a/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
+++ b/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.gzboot,v 1.36 2017/04/08 19:53:20 christos Exp $
+# $NetBSD: Makefile.gzboot,v 1.37 2019/10/24 18:46:21 christos Exp $
NOMAN= # defined
@@ -37,7 +37,6 @@ CPPFLAGS+= -nostdinc -I. -I${EVBARM_STAND}/gzboot -I${EVBARM_STAND}/board
CPPFLAGS+= -I${S} -I${S}/arch -I${S}/lib/libsa
CPPFLAGS+= -I${S}/../common/dist/zlib
CPPFLAGS+= ${ARM_APCS_FLAGS}
-CPPFLAGS+= -marm
CPPFLAGS+= -D_STANDALONE
diff --git a/sys/arch/zaurus/stand/zboot/Makefile b/sys/arch/zaurus/stand/zboot/Makefile
index 74be05bc5c1..9e16e4a5af7 100644
--- a/sys/arch/zaurus/stand/zboot/Makefile
+++ b/sys/arch/zaurus/stand/zboot/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2019/09/23 13:42:37 christos Exp $
+# $NetBSD: Makefile,v 1.22 2019/10/24 18:46:21 christos Exp $
PROG= zboot
@@ -22,7 +22,6 @@ CPPFLAGS+= -nostdinc -I. -I${.CURDIR} -I${.OBJDIR} -I${S}
CPPFLAGS+= -D_STANDALONE -DHEAP_VARIABLE
CPPFLAGS+= -DLIBSA_ENABLE_LS_OP
CPPFLAGS+= ${ARM_APCS_FLAGS} -mcpu=xscale
-CPPFLAGS+= -marm
CPUFLAGS=
AFLAGS+= -D_LOCORE
LDFLAGS+= -nostdlib -Bstatic