Changeset View
Changeset View
Standalone View
Standalone View
share/mk/src.opts.mk
Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
# All supported backends for LLVM_TARGET_XXX | # All supported backends for LLVM_TARGET_XXX | ||||
__LLVM_TARGETS= \ | __LLVM_TARGETS= \ | ||||
aarch64 \ | aarch64 \ | ||||
arm \ | arm \ | ||||
mips \ | mips \ | ||||
powerpc \ | powerpc \ | ||||
riscv \ | |||||
sparc \ | sparc \ | ||||
x86 | x86 | ||||
__LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ | __LLVM_TARGET_FILT= C/(amd64|i386)/x86/:S/sparc64/sparc/:S/arm64/aarch64/:S/powerpc64/powerpc/ | ||||
.for __llt in ${__LLVM_TARGETS} | .for __llt in ${__LLVM_TARGETS} | ||||
# Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. | # Default the given TARGET's LLVM_TARGET support to the value of MK_CLANG. | ||||
.if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} | .if ${__TT:${__LLVM_TARGET_FILT}} == ${__llt} | ||||
__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG | __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/CLANG | ||||
# Disable other targets for arm and armv6, to work around "relocation truncated | # Disable other targets for arm and armv6, to work around "relocation truncated | ||||
# to fit" errors with BFD ld, since libllvm.a will get too large to link. | # to fit" errors with BFD ld, since libllvm.a will get too large to link. | ||||
.elif ${__T} == "arm" || ${__T} == "armv6" | .elif ${__T} == "arm" || ${__T} == "armv6" | ||||
__DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} | __DEFAULT_NO_OPTIONS+=LLVM_TARGET_${__llt:tu} | ||||
# aarch64 needs arm for -m32 support. | # aarch64 needs arm for -m32 support. | ||||
.elif ${__TT} == "arm64" && ${__llt} == "arm" | .elif ${__TT} == "arm64" && ${__llt} == "arm" | ||||
__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 | __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_ARM/LLVM_TARGET_AARCH64 | ||||
# Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL | # Default the rest of the LLVM_TARGETs to the value of MK_LLVM_TARGET_ALL | ||||
# which is based on MK_CLANG. | # which is based on MK_CLANG. | ||||
.else | .else | ||||
__DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL | __DEFAULT_DEPENDENT_OPTIONS+= LLVM_TARGET_${__llt:${__LLVM_TARGET_FILT}:tu}/LLVM_TARGET_ALL | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
__DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF | __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF | ||||
__DEFAULT_NO_OPTIONS+=LLVM_TARGET_RISCV | |||||
.include <bsd.compiler.mk> | .include <bsd.compiler.mk> | ||||
# If the compiler is not C++11 capable, disable Clang and use GCC instead. | # If the compiler is not C++11 capable, disable Clang and use GCC instead. | ||||
# This means that architectures that have GCC 4.2 as default can not | # This means that architectures that have GCC 4.2 as default can not | ||||
# build Clang without using an external compiler. | # build Clang without using an external compiler. | ||||
.if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ | .if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \ | ||||
${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") | ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") | ||||
# Clang is enabled, and will be installed as the default /usr/bin/cc. | # Clang is enabled, and will be installed as the default /usr/bin/cc. | ||||
__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD | __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD | ||||
__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC | __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC | ||||
.elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mriscv*} == "" && ${__T} != "sparc64" | .elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mriscv*} == "" && ${__T} != "sparc64" | ||||
emaste: We should also take riscv out of here at the same time (if it's not moving to the first block… | |||||
jhbAuthorUnsubmitted Done Inline ActionsIt can't move to the first block due to the hard-float issue, but we could take it out of here, yes. jhb: It can't move to the first block due to the hard-float issue, but we could take it out of here… | |||||
# If an external compiler that supports C++11 is used as ${CC} and Clang | # If an external compiler that supports C++11 is used as ${CC} and Clang | ||||
# supports the target, then Clang is enabled but GCC is installed as the | # supports the target, then Clang is enabled but GCC is installed as the | ||||
# default /usr/bin/cc. | # default /usr/bin/cc. | ||||
__DEFAULT_YES_OPTIONS+=CLANG GCC GCC_BOOTSTRAP GNUCXX GPL_DTC LLD | __DEFAULT_YES_OPTIONS+=CLANG GCC GCC_BOOTSTRAP GNUCXX GPL_DTC LLD | ||||
__DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC | __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC | ||||
.else | .else | ||||
# Everything else disables Clang, and uses GCC instead. | # Everything else disables Clang, and uses GCC instead. | ||||
__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC | __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC | ||||
▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines |
We should also take riscv out of here at the same time (if it's not moving to the first block right away) - so that independent of the bootstrap compiler question we have a target Clang.