Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Oct 2019 20:59:10 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r353367 - head
Message-ID:  <201910092059.x99KxAiE036935@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Wed Oct  9 20:59:10 2019
New Revision: 353367
URL: https://svnweb.freebsd.org/changeset/base/353367

Log:
  Don't compile old gcc 4.2.1 archs by default in universe/tinderbox.
  
  Only compile clang supporting architectures of amd64, arm, arm64,
  i386, and riscv as part of universe. Compile the other architectures
  if MAKE_OBSOLETE_GCC is defined. In all cases, explicit lists of
  architectures in TARGETS= on the command line override.
  
  For mips, powerpc and sparc64, do the same thing we do for risvc when
  MAKE_OBSOLETE_GCC isn't defined and short-circuit their universe build
  with an echo saying to install the xtoolchain port or pkg.
  
  PR: 241134
  Discussed on: arch@ (https://lists.freebsd.org/pipermail/freebsd-arch/2019-August/019674.html)
  Differential Revision: https://reviews.freebsd.org/D21942

Modified:
  head/Makefile

Modified: head/Makefile
==============================================================================
--- head/Makefile	Wed Oct  9 20:16:40 2019	(r353366)
+++ head/Makefile	Wed Oct  9 20:59:10 2019	(r353367)
@@ -4,8 +4,11 @@
 # The user-driven targets are:
 #
 # universe            - *Really* build *everything* (buildworld and
-#                       all kernels on all architectures).  Define the
-#                       MAKE_JUST_KERNELS variable to only build kernels.
+#                       all kernels on all architectures).  Define
+#                       MAKE_JUST_KERNELS to only build kernels,
+#                       MAKE_JUST_WORLDS to only build userland, and/or
+#                       MAKE_OBSOLETE_GCC to build architectures unsupported
+#                       by clang.
 # tinderbox           - Same as universe, but presents a list of failed build
 #                       targets and exits with an error if there were any.
 # buildworld          - Rebuild *everything*, including glue to help do
@@ -81,7 +84,7 @@
 #  5.  `reboot'        (in single user mode: boot -s from the loader prompt).
 #  6.  `mergemaster -p'
 #  7.  `make installworld'
-#  8.  `mergemaster'		(you may wish to use -i, along with -U or -F).
+#  8.  `mergemaster'            (you may wish to use -i, along with -U or -F).
 #  9.  `make delete-old'
 # 10.  `reboot'
 # 11.  `make delete-old-libs' (in case no 3rd party program uses them anymore)
@@ -481,7 +484,16 @@ worlds: .PHONY
 #
 .if make(universe) || make(universe_kernels) || make(tinderbox) || \
     make(targets) || make(universe-toolchain)
-TARGETS?=amd64 arm arm64 i386 mips powerpc riscv sparc64
+#
+# By default, build only the known-good clang-supporting platforms.
+# If MAKE_OBSOLETE_GCC is defined, built all the old GCC architectures.
+# In all cases, if the user specifies TARGETS on the command line,
+# honor that most of all.
+#
+_DEFAULT_TARGETS=amd64 arm arm64 i386 riscv
+_OBSOLETE_GCC_TARGETS=mips powerpc sparc64
+_DEFAULT_TARGETS+=${_OBSOLETE_GCC_TARGETS}
+TARGETS?=${_DEFAULT_TARGETS}
 _UNIVERSE_TARGETS=	${TARGETS}
 TARGET_ARCHES_arm?=	arm armv6 armv7
 TARGET_ARCHES_arm64?=	aarch64
@@ -494,11 +506,23 @@ TARGET_ARCHES_${target}?= ${target}
 .endfor
 
 MAKE_PARAMS_riscv?=	CROSS_TOOLCHAIN=riscv64-gcc
+.if !defined(MAKE_OBSOLETE_GCC)
+OBSOLETE_GCC_TARGETS=${_OBSOLETE_GCC_TARGETS}
+MAKE_PARAMS_mips?=	CROSS_TOOLCHAIN=mips-gcc
+MAKE_PARAMS_powerpc?=	CROSS_TOOLCHAIN=powerpc-gcc
+MAKE_PARAMS_sparc64?=	CROSS_TOOLCHAIN=sparc64-gcc
+.endif
 
-# XXX Remove architectures only supported by external toolchain from universe
-# if required toolchain packages are missing.
+TOOLCHAINS_mips=	mips
+TOOLCHAINS_powerpc=	powerpc64
 TOOLCHAINS_riscv=	riscv64
-.for target in riscv
+TOOLCHAINS_sparc64=	sparc64
+
+# Remove architectures only supported by external toolchain from universe
+# if required toolchain packages are missing.
+# When MAKE_OBSOLETE_GCC is not defined, this effecitvely forces this for
+# the in-tree gcc 4.2.1 targets as well.
+.for target in riscv ${OBSOLETE_GCC_TARGETS}
 .if ${_UNIVERSE_TARGETS:M${target}}
 .for toolchain in ${TOOLCHAINS_${target}}
 .if !exists(/usr/local/share/toolchains/${toolchain}-gcc.mk)



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