Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 May 2020 17:14:59 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r360850 - in stable/12: . share/man/man7 share/mk
Message-ID:  <202005091714.049HExs1000811@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Sat May  9 17:14:59 2020
New Revision: 360850
URL: https://svnweb.freebsd.org/changeset/base/360850

Log:
  MFC 356499: 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.
  
  Sponsored by:	DARPA

Modified:
  stable/12/Makefile
  stable/12/share/man/man7/arch.7
  stable/12/share/mk/src.opts.mk
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/Makefile
==============================================================================
--- stable/12/Makefile	Sat May  9 15:56:02 2020	(r360849)
+++ stable/12/Makefile	Sat May  9 17:14:59 2020	(r360850)
@@ -487,29 +487,9 @@ TARGET_ARCHES_arm?=	arm armv6 armv7
 TARGET_ARCHES_arm64?=	aarch64
 TARGET_ARCHES_mips?=	mipsel mips mips64el mips64 mipsn32 mipselhf mipshf mips64elhf mips64hf
 TARGET_ARCHES_powerpc?=	powerpc powerpc64 powerpcspe
-# 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
-
-# XXX Remove architectures only supported by external toolchain from universe
-# if required toolchain packages are missing.
-TOOLCHAINS_riscv=	riscv64
-.for target in riscv
-.if ${_UNIVERSE_TARGETS:M${target}}
-.for toolchain in ${TOOLCHAINS_${target}}
-.if !exists(/usr/local/share/toolchains/${toolchain}-gcc.mk)
-_UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:N${target}}
-universe: universe_${toolchain}_skip .PHONY
-universe_epilogue: universe_${toolchain}_skip .PHONY
-universe_${toolchain}_skip: universe_prologue .PHONY
-	@echo ">> ${target} skipped - install ${toolchain}-xtoolchain-gcc port or package to build"
-.endif
-.endfor
-.endif
 .endfor
 
 .if defined(UNIVERSE_TARGET)

Modified: stable/12/share/man/man7/arch.7
==============================================================================
--- stable/12/share/man/man7/arch.7	Sat May  9 15:56:02 2020	(r360849)
+++ stable/12/share/man/man7/arch.7	Sat May  9 17:14:59 2020	(r360850)
@@ -26,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 14, 2019
+.Dd January 8, 2020
 .Dt ARCH 7
 .Os
 .Sh NAME
@@ -325,12 +325,10 @@ This table shows the default tool chain for each archi
 .It powerpc     Ta GCC 4.2.1 Ta GNU ld 2.17.50
 .It powerpcspe  Ta GCC 4.2.1 Ta GNU ld 2.17.50
 .It powerpc64   Ta GCC 4.2.1 Ta GNU ld 2.17.50
-.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 4.2.1 Ta GNU ld 2.17.50
 .El
-.Pp
-(1) External toolchain provided by ports/packages.
 .Pp
 Note that GCC 4.2.1 is deprecated, and scheduled for removal on 2020-03-31.
 Any CPU architectures not migrated by then

Modified: stable/12/share/mk/src.opts.mk
==============================================================================
--- stable/12/share/mk/src.opts.mk	Sat May  9 15:56:02 2020	(r360849)
+++ stable/12/share/mk/src.opts.mk	Sat May  9 17:14:59 2020	(r360850)
@@ -296,7 +296,8 @@ __DEFAULT_NO_OPTIONS+=LLVM_TARGET_BPF
 # build Clang without using an external compiler.
 
 .if ${COMPILER_FEATURES:Mc++11} && (${__T} == "aarch64" || \
-    ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386")
+    ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386" || \
+    ${__TT} == "riscv")
 # Clang is enabled, and will be installed as the default /usr/bin/cc.
 __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_IS_CC LLD
 __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC
@@ -325,7 +326,7 @@ __DEFAULT_YES_OPTIONS+=LLVM_LIBUNWIND
 __DEFAULT_NO_OPTIONS+=LLVM_LIBUNWIND
 .endif
 .if ${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "armv7" || \
-    ${__T} == "i386"
+    ${__T} == "i386" || ${__TT} == "riscv"
 __DEFAULT_YES_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD
 .else
 __DEFAULT_NO_OPTIONS+=LLD_BOOTSTRAP LLD_IS_LD



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005091714.049HExs1000811>