From 4e2a44900d158313b8f76c7d6bf523a4e0629ef7 Mon Sep 17 00:00:00 2001 From: Bryan Drewery Date: Wed, 27 Jun 2018 21:36:57 +0000 Subject: [PATCH] LLVM_TARGET_ALL: Default LLVM_TARGET_ARM on for aarch64. This is needed for -m32 support which is used in the kernel cloudabi32 module. Tweak the style to make it easier to understand. MFC after: 2 weeks X-MFC-with: r335706 Reported by: Mark Millard Sponsored by: Dell EMC --- share/mk/src.opts.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index f949161f9572..d2c993590663 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -259,15 +259,17 @@ __LLVM_TARGETS= \ sparc \ x86 __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/ -# Default the given TARGET_ARCH's LLVM_TARGET support to the value of -# MK_CLANG. +.for __llt in ${__LLVM_TARGETS} +# Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. +.if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} +__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG +# aarch64 needs arm for -m32 support. +.elif ${__TT} == "arm64" && ${__llt} == "arm" +__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 # Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL # which is based on MK_CLANG. -.for __llt in ${__LLVM_TARGETS} -.if ${__llt} != ${__TT:${__LLVM_TARGET_FILT}} -__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .else -__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG +__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL .endif .endfor