MKCOMPAT fixes for aarch64

This commit is contained in:
matt 2014-08-10 23:26:25 +00:00
parent 11614bb2b2
commit 7b20bc5be5
4 changed files with 174 additions and 30 deletions

View File

@ -1,28 +1,70 @@
# $NetBSD: bsd.eabi.mk,v 1.2 2013/04/27 08:44:35 matt Exp $
# $NetBSD: bsd.eabi.mk,v 1.3 2014/08/10 23:26:25 matt Exp $
.if !defined(MLIBDIR)
MLIBDIR= eabi
.if ${MACHINE_ARCH:M*eb} != ""
EARM_MACHINE_ARCH= earmeb
LD+= -m armelfb_nbsd_eabi
.else
EARM_MACHINE_ARCH= earm
LD+= -m armelf_nbsd_eabi
.endif
LIBC_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
LIBGCC_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
COMMON_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
KVM_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
PTHREAD_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
BFD_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
CSU_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
CRYPTO_MACHINE_CPU= ${EARM_MACHINE_ARCH}
LDELFSO_MACHINE_CPU= ${EARM_MACHINE_ARCH}
GOMP_MACHINE_ARCH= ${EARM_MACHINE_ARCH}
COPTS+= -mabi=aapcs-linux -mfloat-abi=soft -Wa,-meabi=5
CPUFLAGS+= -mabi=aapcs-linux -mfloat-abi=soft -Wa,-meabi=5
LDADD+= -mabi=aapcs-linux -mfloat-abi=soft -Wa,-meabi=5
LDFLAGS+= -mabi=aapcs-linux -mfloat-abi=soft -Wa,-meabi=5
MKDEPFLAGS+= -mabi=aapcs-linux -mfloat-abi=soft -Wa,-meabi=5
EARM_COMPAT_FLAGS= -mfloat-abi=soft
EARM_COMPAT_FLAGS+= -mabi=aapcs-linux
MKSOFTFLOAT=yes
.if ${MACHINE_ARCH} == "aarch64eb"
EARM_COMPAT_FLAGS+= -target armeb--netbsdelf-gnueabi
EARM_COMPAT_FLAGS+= -mcpu=cortex-a53
ARM_MACHINE_ARCH= earmv7eb
LDFLAGS+= -Wl,--be8
ARM_LD= -m armelfb_nbsd_eabi --be8
.elif ${MACHINE_ARCH} == "aarch64"
EARM_COMPAT_FLAGS+= -target arm--netbsdelf-gnueabi
EARM_COMPAT_FLAGS+= -mcpu=cortex-a53
ARM_MACHINE_ARCH= earmv7
ARM_LD= -m armelf_nbsd_eabi
.elif !empty(MACHINE_ARCH:M*eb)
EARM_COMPAT_FLAGS+= -target armeb--netbsdelf-gnueabi
ARM_MACHINE_ARCH= earmeb
ARM_LD= -m armelfb_nbsd_eabi
.else
EARM_COMPAT_FLAGS+= -target arm--netbsdelf-gnueabi
ARM_MACHINE_ARCH= earm
ARM_LD= -m armelf_nbsd_eabi
.endif
EARM_COMPAT_FLAGS+= -B ${TOOLDIR}/aarch64--netbsd/bin
LIBC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBGCC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBEXECINFO_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBM_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
COMMON_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
KVM_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
PTHREAD_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
BFD_MACHINE_ARCH= earm
CSU_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
GOMP_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
COMMON_MACHINE_CPU= arm
COMPAT_MACHINE_CPU= arm
CRYPTO_MACHINE_CPU= arm
CSU_MACHINE_CPU= arm
KVM_MACHINE_CPU= arm
LDELFSO_MACHINE_CPU= arm
LIBC_MACHINE_CPU= arm
PTHREAD_MACHINE_CPU= arm
.if defined(ACTIVE_CC)
EARM_COMPAT_FLAGS+= ${${ACTIVE_CC} == "gcc":?-Wa,-meabi=5:}
.endif
COPTS+= ${EARM_COMPAT_FLAGS}
CPUFLAGS+= ${EARM_COMPAT_FLAGS}
LDADD+= ${EARM_COMPAT_FLAGS}
LDFLAGS+= ${EARM_COMPAT_FLAGS}
MKDEPFLAGS+= ${EARM_COMPAT_FLAGS}
.include "${.PARSEDIR}/../../Makefile.compat"
.endif
.if empty(LD:M-m)
LD+= ${ARM_LD}
.endif

View File

@ -0,0 +1,5 @@
# $NetBSD: Makefile,v 1.1 2014/08/10 23:26:25 matt Exp $
BSD_MK_COMPAT_FILE=${.CURDIR}/bsd.eabihf.mk
.include "../../compatsubdir.mk"

View File

@ -0,0 +1,70 @@
# $NetBSD: bsd.eabihf.mk,v 1.1 2014/08/10 23:26:25 matt Exp $
.if !defined(MLIBDIR)
MLIBDIR= eabihf
EARM_COMPAT_FLAGS= -mfloat-abi=hard
EARM_COMPAT_FLAGS+= -mabi=aapcs-linux
MKSOFTFLOAT=no
.if ${MACHINE_ARCH} == "aarch64eb"
EARM_COMPAT_FLAGS+= -target armeb--netbsdelf-gnueabi
EARM_COMPAT_FLAGS+= -mcpu=cortex-a53
ARM_MACHINE_ARCH= earmv7hfeb
LDFLAGS+= -Wl,--be8
ARM_LD= -m armelfb_nbsd_eabihf --be8
.elif ${MACHINE_ARCH} == "aarch64"
EARM_COMPAT_FLAGS+= -target arm--netbsdelf-gnueabi
EARM_COMPAT_FLAGS+= -mcpu=cortex-a53
ARM_MACHINE_ARCH= earmv7hf
ARM_LD= -m armelf_nbsd_eabihf
.elif !empty(MACHINE_ARCH:M*eb)
EARM_COMPAT_FLAGS+= -target armeb--netbsdelf-gnueabi
ARM_MACHINE_ARCH= earmhfeb
ARM_LD= -m armelfb_nbsd_eabihf
.else
EARM_COMPAT_FLAGS+= -target arm--netbsdelf-gnueabi
ARM_MACHINE_ARCH= earmhf
ARM_LD= -m armelf_nbsd_eabihf
.endif
EARM_COMPAT_FLAGS+= -B ${TOOLDIR}/aarch64--netbsd/bin
LIBC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBGCC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBEXECINFO_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBM_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
COMMON_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
KVM_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
PTHREAD_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
BFD_MACHINE_ARCH= earmhf
CSU_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
GOMP_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
COMMON_MACHINE_CPU= arm
COMPAT_MACHINE_CPU= arm
CRYPTO_MACHINE_CPU= arm
CSU_MACHINE_CPU= arm
KVM_MACHINE_CPU= arm
LDELFSO_MACHINE_CPU= arm
LIBC_MACHINE_CPU= arm
PTHREAD_MACHINE_CPU= arm
.if defined(ACTIVE_CC)
EARM_COMPAT_FLAGS+= ${${ACTIVE_CC} == "gcc":?-Wa,-meabi=5:}
.endif
COPTS+= ${EARM_COMPAT_FLAGS}
CPUFLAGS+= ${EARM_COMPAT_FLAGS}
LDADD+= ${EARM_COMPAT_FLAGS}
LDFLAGS+= ${EARM_COMPAT_FLAGS}
MKDEPFLAGS+= ${EARM_COMPAT_FLAGS}
.include "${.PARSEDIR}/../../Makefile.compat"
.endif
.if empty(LD:M-m)
LD+= ${ARM_LD}
.endif

View File

@ -1,29 +1,56 @@
# $NetBSD: bsd.oabi.mk,v 1.2 2013/12/15 18:08:37 joerg Exp $
# $NetBSD: bsd.oabi.mk,v 1.3 2014/08/10 23:26:26 matt Exp $
.if !defined(MLIBDIR)
MLIBDIR= oabi
.if ${MACHINE_ARCH:M*eb} != ""
.if ${MACHINE_ARCH} == "aarch64eb"
.error oabi is not supported on big endian AARCH64
.elif ${MACHINE_ARCH} == "aarch64"
ARM_MACHINE_ARCH= arm
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
.elif !empty(MACHINE_ARCH:M*eb)
ARM_MACHINE_ARCH= armeb
LD+= -m armelfb
ARM_LD= -m armelfb_nbsd
LDFLAGS+= -Wl,-m,armelfb_nbsd
.else
ARM_MACHINE_ARCH= arm
LD+= -m armelf
ARM_LD= -m armelf_nbsd
LDFLAGS+= -Wl,-m,armelf_nbsd
.endif
LIBC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBGCC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBEXECINFO_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
LIBM_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
COMMON_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
KVM_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
PTHREAD_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
BFD_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
CSU_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
CRYPTO_MACHINE_CPU= ${ARM_MACHINE_ARCH}
LDELFSO_MACHINE_CPU= ${ARM_MACHINE_ARCH}
GOMP_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
COMMON_MACHINE_CPU= arm
COMPAT_MACHINE_CPU= arm
CRYPTO_MACHINE_CPU= arm
CSU_MACHINE_CPU= arm
KVM_MACHINE_CPU= arm
LIBC_MACHINE_CPU= arm
LDELFSO_MACHINE_CPU= arm
PTHREAD_MACHINE_CPU= arm
MKSOFTFLOAT= yes
COPTS+= ${ARM_APCS_FLAGS}
CPUFLAGS+= ${ARM_APCS_FLAGS}
LDADD+= ${ARM_APCS_FLAGS}
LDFLAGS+= ${ARM_APCS_FLAGS}
MKDEPFLAGS+= ${ARM_APCS_FLAGS}
.include "${.PARSEDIR}/../../Makefile.compat"
.endif
.if empty(LD:M-m)
LD+= ${ARM_LD}
.endif