Use clang and lld as the default toolchain for RISCV.

- Enable clang and lld as system toolchains.
- Don't use external GCC for universe by default.
- Re-enable riscv64sf since it builds fine with clang + lld.

Reviewed by:	emaste, mhorne
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D23089
This commit is contained in:
John Baldwin 2020-01-08 17:25:59 +00:00
parent f8091e2c8f
commit e48503fffd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356499
3 changed files with 7 additions and 11 deletions

View file

@ -495,23 +495,20 @@ TARGET_ARCHES_arm64?= aarch64
TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf
# powerpcspe excluded until clang fixed
TARGET_ARCHES_powerpc?= powerpc powerpc64
# riscv64sf excluded due to PR 232085
TARGET_ARCHES_riscv?= riscv64
TARGET_ARCHES_riscv?= riscv64 riscv64sf
.for target in ${TARGETS}
TARGET_ARCHES_${target}?= ${target}
.endfor
MAKE_PARAMS_riscv?= CROSS_TOOLCHAIN=riscv64-gcc
MAKE_PARAMS_mips?= CROSS_TOOLCHAIN=mips-gcc6
MAKE_PARAMS_sparc64?= CROSS_TOOLCHAIN=sparc64-gcc6
TOOLCHAINS_mips= mips-gcc6
TOOLCHAINS_riscv= riscv64-gcc
TOOLCHAINS_sparc64= sparc64-gcc6
# Remove architectures only supported by external toolchain from
# universe if required toolchain packages are missing.
.for target in mips riscv sparc64
.for target in mips sparc64
.if ${_UNIVERSE_TARGETS:M${target}}
.for toolchain in ${TOOLCHAINS_${target}}
.if !exists(/usr/local/share/toolchains/${toolchain}.mk)

View file

@ -26,7 +26,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd January 5, 2020
.Dd January 8, 2020
.Dt ARCH 7
.Os
.Sh NAME
@ -319,8 +319,8 @@ This table shows the default tool chain for each architecture.
.It powerpc Ta Clang Ta GNU ld 2.17.50
.It powerpcspe Ta Clang Ta GNU ld 2.17.50
.It powerpc64 Ta Clang Ta lld
.It riscv64 Ta GCC(1) Ta GNU ld(1)
.It riscv64sf Ta GCC(1) Ta GNU ld(1)
.It riscv64 Ta Clang Ta lld
.It riscv64sf Ta Clang Ta lld
.It sparc64 Ta GCC(1) Ta GNU ld(1)
.El
.Pp

View file

@ -295,8 +295,7 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF
# If the compiler is not C++11 capable, disable Clang. External toolchain will
# be required.
.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && \
${__TT} != "riscv" && ${__TT} != "sparc64")
.if ${COMPILER_FEATURES:Mc++11} && (${__TT} != "mips" && ${__TT} != "sparc64")
# Clang is enabled, and will be installed as the default /usr/bin/cc.
__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD
.elif ${COMPILER_FEATURES:Mc++11} && ${__T} != "sparc64"
@ -323,7 +322,7 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND
__DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
.endif
.if ${__TT} != "mips" && ${__T} != "powerpc" && ${__T} != "powerpcspe" && \
${__TT} != "riscv" && ${__T} != "sparc64"
${__T} != "sparc64"
__DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
.else
__DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD