Rename MACHINE_ABI and TARGET_ABI

The MACHINE_ABI and TARGET_ABI variables are used to set the middle of
the target triple (e.g., "-unknown-" or "-gnueabihf-"). They are not set
by any tool in the base system and I've only found the latter mentioned
in one review online. As such, rename them to to MACHINE_TRIPLE_ABI and
TARGET_TRIPLE_ABI to clear the way to use MACHINE_ABI as a supplement to
MACHINE_CPU, etc.

Reviewed by:	imp, jhb
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D36420
This commit is contained in:
Brooks Davis 2022-10-05 17:26:30 +01:00
parent d701f45aba
commit 77becb9325
2 changed files with 10 additions and 10 deletions

View File

@ -132,15 +132,15 @@ _TARGET_CPUTYPE=dummy
.endif
.if ${TARGET} == "arm"
.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == ""
TARGET_ABI= gnueabihf
TARGET_TRIPLE_ABI= gnueabihf
.else
TARGET_ABI= gnueabi
TARGET_TRIPLE_ABI= gnueabi
.endif
.endif
MACHINE_ABI?= unknown
MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/sf$//}-${MACHINE_ABI}-freebsd${OS_REVISION}
TARGET_ABI?= unknown
TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/sf$//}-${TARGET_ABI}-freebsd${OS_REVISION}
MACHINE_TRIPLE_ABI?= unknown
MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/sf$//}-${MACHINE_TRIPLE_ABI}-freebsd${OS_REVISION}
TARGET_TRIPLE_ABI?= unknown
TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/sf$//}-${TARGET_TRIPLE_ABI}-freebsd${OS_REVISION}
KNOWN_ARCHES?= aarch64/arm64 \
amd64 \
armv6/arm \

View File

@ -36,15 +36,15 @@ BUILD_ARCH?= ${MACHINE_ARCH}
# arm (for armv4 and armv5 CPUs) always uses the soft float ABI.
# For all other targets, we stick with 'unknown'.
.if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "")
TARGET_ABI= -gnueabihf
TARGET_TRIPLE_ABI= -gnueabihf
.elif ${MACHINE_ARCH:Marm*}
TARGET_ABI= -gnueabi
TARGET_TRIPLE_ABI= -gnueabi
.else
TARGET_ABI=
TARGET_TRIPLE_ABI=
.endif
VENDOR= unknown
LLVM_TARGET_TRIPLE?= ${MACHINE_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_ABI}
LLVM_TARGET_TRIPLE?= ${MACHINE_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}${TARGET_TRIPLE_ABI}
LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/[hs]f$//:S/mipsn32/mips64/}-${VENDOR}-freebsd${OS_REVISION}
CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\"