Changeset View
Standalone View
Makefile.inc1
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
.else | .else | ||||
X${COMPILER}?= ${${COMPILER}} | X${COMPILER}?= ${${COMPILER}} | ||||
.endif | .endif | ||||
.endfor | .endfor | ||||
# If a full path to an external cross compiler is given, don't build | # If a full path to an external cross compiler is given, don't build | ||||
# a cross compiler. | # a cross compiler. | ||||
.if ${XCC:N${CCACHE_BIN}:M/*} | .if ${XCC:N${CCACHE_BIN}:M/*} | ||||
MK_CLANG_BOOTSTRAP= no | MK_CLANG_BOOTSTRAP= no | ||||
MK_GCC_BOOTSTRAP= no | |||||
.endif | .endif | ||||
# Pull in compiler metadata from buildworld/toolchain if possible to avoid | # Pull in compiler metadata from buildworld/toolchain if possible to avoid | ||||
# running CC from bsd.compiler.mk. | # running CC from bsd.compiler.mk. | ||||
.if make(installworld) || make(install) || make(distributeworld) || \ | .if make(installworld) || make(install) || make(distributeworld) || \ | ||||
make(stageworld) | make(stageworld) | ||||
.-include "${OBJTOP}/toolchain-metadata.mk" | .-include "${OBJTOP}/toolchain-metadata.mk" | ||||
.if !defined(_LOADED_TOOLCHAIN_METADATA) | .if !defined(_LOADED_TOOLCHAIN_METADATA) | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
# Handle external binutils. | # Handle external binutils. | ||||
.if defined(CROSS_TOOLCHAIN_PREFIX) | .if defined(CROSS_TOOLCHAIN_PREFIX) | ||||
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} | ||||
.endif | .endif | ||||
# If we do not have a bootstrap binutils (because the in-tree one does not | # If we do not have a bootstrap binutils (because the in-tree one does not | ||||
# support the target architecture), provide a default cross-binutils prefix. | # support the target architecture), provide a default cross-binutils prefix. | ||||
# This allows riscv64 builds, for example, to automatically use the | # This allows riscv64 builds, for example, to automatically use the | ||||
jhb: We should probably rm the bits to try to set CROSS_BINUTILS_PREFIX. aarch64 and riscv64 were… | |||||
# riscv64-binutils port or package. | # riscv64-binutils port or package. | ||||
.if !make(showconfig) && !defined(_NO_INCLUDE_COMPILERMK) | .if !make(showconfig) && !defined(_NO_INCLUDE_COMPILERMK) | ||||
.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ | .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ | ||||
${MK_LLD_BOOTSTRAP} == "no" && \ | ${MK_LLD_BOOTSTRAP} == "no" && \ | ||||
!defined(CROSS_BINUTILS_PREFIX) | !defined(CROSS_BINUTILS_PREFIX) | ||||
CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ | CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ | ||||
.if !exists(${CROSS_BINUTILS_PREFIX}) | .if !exists(${CROSS_BINUTILS_PREFIX}) | ||||
.if !empty(BROKEN_OPTIONS:MGCC_BOOTSTRAP) && ${MK_CLANG_BOOTSTRAP} == "no" | .if ${MK_CLANG_BOOTSTRAP} == "no" | ||||
.error In-tree toolchain does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-xtoolchain-gcc port or package or set CROSS_TOOLCHAIN_PREFIX. | .error In-tree toolchain does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-xtoolchain-gcc port or package or set CROSS_TOOLCHAIN_PREFIX. | ||||
.else | .else | ||||
.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. | .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.endif | .endif | ||||
XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS | XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS | ||||
Show All 19 Lines | |||||
# Begin WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD | # Begin WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD | ||||
# WITH_SYSTEM_COMPILER - Pull in needed values and make a decision. | # WITH_SYSTEM_COMPILER - Pull in needed values and make a decision. | ||||
# Check if there is a local compiler that can satisfy as an external compiler. | # Check if there is a local compiler that can satisfy as an external compiler. | ||||
# Which compiler is expected to be used? | # Which compiler is expected to be used? | ||||
.if ${MK_CLANG_BOOTSTRAP} == "yes" | .if ${MK_CLANG_BOOTSTRAP} == "yes" | ||||
WANT_COMPILER_TYPE= clang | WANT_COMPILER_TYPE= clang | ||||
.elif ${MK_GCC_BOOTSTRAP} == "yes" | |||||
WANT_COMPILER_TYPE= gcc | |||||
.else | .else | ||||
WANT_COMPILER_TYPE= | WANT_COMPILER_TYPE= | ||||
.endif | .endif | ||||
.if !defined(WANT_COMPILER_FREEBSD_VERSION) && !make(showconfig) && \ | .if !defined(WANT_COMPILER_FREEBSD_VERSION) && !make(showconfig) && \ | ||||
!make(test-system-linker) | !make(test-system-linker) | ||||
.if ${WANT_COMPILER_TYPE} == "clang" | .if ${WANT_COMPILER_TYPE} == "clang" | ||||
WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h | WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h | ||||
WANT_COMPILER_FREEBSD_VERSION!= \ | WANT_COMPILER_FREEBSD_VERSION!= \ | ||||
awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ | awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \ | ||||
${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown | ${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown | ||||
WANT_COMPILER_VERSION_FILE= lib/clang/include/clang/Basic/Version.inc | WANT_COMPILER_VERSION_FILE= lib/clang/include/clang/Basic/Version.inc | ||||
WANT_COMPILER_VERSION!= \ | WANT_COMPILER_VERSION!= \ | ||||
awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ | awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ | ||||
${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown | ${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown | ||||
.elif ${WANT_COMPILER_TYPE} == "gcc" | .elif ${WANT_COMPILER_TYPE} == "gcc" | ||||
WANT_COMPILER_FREEBSD_VERSION_FILE= gnu/usr.bin/cc/cc_tools/freebsd-native.h | .error GCC 4.2.1 has been removed | ||||
Not Done Inline ActionsI think this case can't even happen anymore since you just removed the WANT_COMPILER_TYPE=gcc above? That is, I think you can just remove the .elif and not bother adding this .error. jhb: I think this case can't even happen anymore since you just removed the WANT_COMPILER_TYPE=gcc… | |||||
Done Inline ActionsGood point, fixed locally and will be included in next upload. emaste: Good point, fixed locally and will be included in next upload.
(If no other changes I plan to… | |||||
WANT_COMPILER_FREEBSD_VERSION!= \ | |||||
awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \ | |||||
${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown | |||||
WANT_COMPILER_VERSION_FILE= contrib/gcc/BASE-VER | |||||
WANT_COMPILER_VERSION!= \ | |||||
awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \ | |||||
${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown | |||||
.endif | .endif | ||||
.export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION | .export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION | ||||
.endif # !defined(WANT_COMPILER_FREEBSD_VERSION) | .endif # !defined(WANT_COMPILER_FREEBSD_VERSION) | ||||
# It needs to be the same revision as we would build for the bootstrap. | # It needs to be the same revision as we would build for the bootstrap. | ||||
# If the expected vs CC is different then we can't skip. | # If the expected vs CC is different then we can't skip. | ||||
# GCC cannot be used for cross-arch yet. For clang we pass -target later if | # GCC cannot be used for cross-arch yet. For clang we pass -target later if | ||||
# TARGET_ARCH!=MACHINE_ARCH. | # TARGET_ARCH!=MACHINE_ARCH. | ||||
.if ${MK_SYSTEM_COMPILER} == "yes" && \ | .if ${MK_SYSTEM_COMPILER} == "yes" && \ | ||||
defined(WANT_COMPILER_FREEBSD_VERSION) && \ | defined(WANT_COMPILER_FREEBSD_VERSION) && \ | ||||
(${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ | ${MK_CLANG_BOOTSTRAP} == "yes" && \ | ||||
Not Done Inline ActionsCan drop parenthesis. brooks: Can drop parenthesis. | |||||
Done Inline ActionsWill do in next update. emaste: Will do in next update. | |||||
!make(xdev*) && \ | !make(xdev*) && \ | ||||
${X_COMPILER_TYPE} == ${WANT_COMPILER_TYPE} && \ | ${X_COMPILER_TYPE} == ${WANT_COMPILER_TYPE} && \ | ||||
(${X_COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ | (${X_COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ | ||||
${X_COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ | ${X_COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ | ||||
${X_COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION} | ${X_COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION} | ||||
# Everything matches, disable the bootstrap compiler. | # Everything matches, disable the bootstrap compiler. | ||||
MK_CLANG_BOOTSTRAP= no | MK_CLANG_BOOTSTRAP= no | ||||
MK_GCC_BOOTSTRAP= no | |||||
USING_SYSTEM_COMPILER= yes | USING_SYSTEM_COMPILER= yes | ||||
.endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} | .endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} | ||||
# WITH_SYSTEM_LD - Pull in needed values and make a decision. | # WITH_SYSTEM_LD - Pull in needed values and make a decision. | ||||
# Check if there is a local linker that can satisfy as an external linker. | # Check if there is a local linker that can satisfy as an external linker. | ||||
# Which linker is expected to be used? | # Which linker is expected to be used? | ||||
.if ${MK_LLD_BOOTSTRAP} == "yes" | .if ${MK_LLD_BOOTSTRAP} == "yes" | ||||
Show All 36 Lines | |||||
.endif # ${WANT_LINKER_TYPE} == ${LINKER_TYPE} | .endif # ${WANT_LINKER_TYPE} == ${LINKER_TYPE} | ||||
# WITH_SYSTEM_COMPILER / WITH_SYSTEM_LINKER - Handle defaults and debug. | # WITH_SYSTEM_COMPILER / WITH_SYSTEM_LINKER - Handle defaults and debug. | ||||
USING_SYSTEM_COMPILER?= no | USING_SYSTEM_COMPILER?= no | ||||
USING_SYSTEM_LINKER?= no | USING_SYSTEM_LINKER?= no | ||||
TEST_SYSTEM_COMPILER_VARS= \ | TEST_SYSTEM_COMPILER_VARS= \ | ||||
USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \ | USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \ | ||||
MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \ | MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP \ | ||||
WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \ | WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \ | ||||
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ | WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ | ||||
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ | CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ | ||||
COMPILER_FREEBSD_VERSION \ | COMPILER_FREEBSD_VERSION \ | ||||
XCC X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \ | XCC X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \ | ||||
X_COMPILER_FREEBSD_VERSION | X_COMPILER_FREEBSD_VERSION | ||||
TEST_SYSTEM_LINKER_VARS= \ | TEST_SYSTEM_LINKER_VARS= \ | ||||
USING_SYSTEM_LINKER MK_SYSTEM_LINKER \ | USING_SYSTEM_LINKER MK_SYSTEM_LINKER \ | ||||
▲ Show 20 Lines • Show All 1,797 Lines • ▼ Show 20 Lines | |||||
# Instead set BOOTSTRAPPING_OSRELDATE so that the value 0 is set ${BSARGS} | # Instead set BOOTSTRAPPING_OSRELDATE so that the value 0 is set ${BSARGS} | ||||
BOOTSTRAPPING_OSRELDATE:= 0 | BOOTSTRAPPING_OSRELDATE:= 0 | ||||
.endif | .endif | ||||
.if ${MK_GAMES} != "no" | .if ${MK_GAMES} != "no" | ||||
_strfile= usr.bin/fortune/strfile | _strfile= usr.bin/fortune/strfile | ||||
.endif | .endif | ||||
.if ${MK_GCC} != "no" && ${MK_CXX} != "no" | |||||
_gperf= gnu/usr.bin/gperf | |||||
.endif | |||||
.if ${MK_VT} != "no" | .if ${MK_VT} != "no" | ||||
_vtfontcvt= usr.bin/vtfontcvt | _vtfontcvt= usr.bin/vtfontcvt | ||||
.endif | .endif | ||||
# If we are not building the bootstrap because BOOTSTRAPPING is sufficient | # If we are not building the bootstrap because BOOTSTRAPPING is sufficient | ||||
# we symlink the host version to $WORLDTMP instead. By doing this we can also | # we symlink the host version to $WORLDTMP instead. By doing this we can also | ||||
# detect when a bootstrap tool is being used without the required MK_FOO. | # detect when a bootstrap tool is being used without the required MK_FOO. | ||||
# If you add a new bootstrap tool where we could also use the host version, | # If you add a new bootstrap tool where we could also use the host version, | ||||
▲ Show 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
# build-tools: Build special purpose build tools | # build-tools: Build special purpose build tools | ||||
# | # | ||||
.if !defined(NO_SHARE) && ${MK_SYSCONS} != "no" | .if !defined(NO_SHARE) && ${MK_SYSCONS} != "no" | ||||
_share= share/syscons/scrnmaps | _share= share/syscons/scrnmaps | ||||
.endif | .endif | ||||
.if ${MK_GCC} != "no" | |||||
_gcc_tools= gnu/usr.bin/cc/cc_tools | |||||
.endif | |||||
.if ${MK_RESCUE} != "no" | .if ${MK_RESCUE} != "no" | ||||
# rescue includes programs that have build-tools targets | # rescue includes programs that have build-tools targets | ||||
_rescue=rescue/rescue | _rescue=rescue/rescue | ||||
.endif | .endif | ||||
.if ${MK_TCSH} != "no" | .if ${MK_TCSH} != "no" | ||||
_tcsh=bin/csh | _tcsh=bin/csh | ||||
.endif | .endif | ||||
Show All 21 Lines | .for _tool in \ | ||||
lib/ncurses/ncurses \ | lib/ncurses/ncurses \ | ||||
lib/ncurses/ncursesw \ | lib/ncurses/ncursesw \ | ||||
${_rescue} \ | ${_rescue} \ | ||||
${_share} \ | ${_share} \ | ||||
usr.bin/awk \ | usr.bin/awk \ | ||||
${_libmagic} \ | ${_libmagic} \ | ||||
usr.bin/mkesdb_static \ | usr.bin/mkesdb_static \ | ||||
usr.bin/mkcsmapper_static \ | usr.bin/mkcsmapper_static \ | ||||
usr.bin/vi/catalog \ | usr.bin/vi/catalog | ||||
${_gcc_tools} | |||||
build-tools_${_tool}: .PHONY | build-tools_${_tool}: .PHONY | ||||
${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \ | if [ -n "${_bt_clean}" ]; then ${MAKE} DIRPRFX=${_tool}/ ${_bt_clean}; fi; \ | ||||
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ build-tools | ${MAKE} DIRPRFX=${_tool}/ build-tools | ||||
build-tools: build-tools_${_tool} | build-tools: build-tools_${_tool} | ||||
.endfor | .endfor | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
_clang= usr.bin/clang | _clang= usr.bin/clang | ||||
.endif | .endif | ||||
.if ${MK_LLD_BOOTSTRAP} != "no" | .if ${MK_LLD_BOOTSTRAP} != "no" | ||||
_lld= usr.bin/clang/lld | _lld= usr.bin/clang/lld | ||||
.endif | .endif | ||||
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no" | .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no" | ||||
_clang_libs= lib/clang | _clang_libs= lib/clang | ||||
.endif | .endif | ||||
.if ${MK_GCC_BOOTSTRAP} != "no" | |||||
_gcc= gnu/usr.bin/cc | |||||
.endif | |||||
.if ${MK_USB} != "no" | .if ${MK_USB} != "no" | ||||
_usb_tools= stand/usb/tools | _usb_tools= stand/usb/tools | ||||
.endif | .endif | ||||
.if ${BUILD_WITH_STRICT_TMPPATH} != 0 || defined(BOOTSTRAP_ALL_TOOLS) | .if ${BUILD_WITH_STRICT_TMPPATH} != 0 || defined(BOOTSTRAP_ALL_TOOLS) | ||||
_ar=usr.bin/ar | _ar=usr.bin/ar | ||||
.endif | .endif | ||||
cross-tools: .MAKE .PHONY | cross-tools: .MAKE .PHONY | ||||
.for _tool in \ | .for _tool in \ | ||||
${LOCAL_XTOOL_DIRS} \ | ${LOCAL_XTOOL_DIRS} \ | ||||
${_ar} \ | ${_ar} \ | ||||
${_clang_libs} \ | ${_clang_libs} \ | ||||
${_clang} \ | ${_clang} \ | ||||
${_lld} \ | ${_lld} \ | ||||
${_binutils} \ | ${_binutils} \ | ||||
${_elftctools} \ | ${_elftctools} \ | ||||
${_dtrace_tools} \ | ${_dtrace_tools} \ | ||||
${_gcc} \ | |||||
${_btxld} \ | ${_btxld} \ | ||||
${_usb_tools} | ${_usb_tools} | ||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJWALK}" ]; then ${MAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${MAKE} DIRPRFX=${_tool}/ all; \ | ${MAKE} DIRPRFX=${_tool}/ all; \ | ||||
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP} install | ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${WORLDTMP} install | ||||
.endfor | .endfor | ||||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | NXBDIRS+= \ | ||||
usr.bin/yacc \ | usr.bin/yacc \ | ||||
usr.sbin/chown | usr.sbin/chown | ||||
SUBDIR_DEPEND_usr.bin/clang= lib/clang | SUBDIR_DEPEND_usr.bin/clang= lib/clang | ||||
.if ${MK_CLANG} != "no" | .if ${MK_CLANG} != "no" | ||||
NXBDIRS+= lib/clang | NXBDIRS+= lib/clang | ||||
NXBDIRS+= usr.bin/clang | NXBDIRS+= usr.bin/clang | ||||
.endif | .endif | ||||
.if ${MK_GCC} != "no" | |||||
NXBDIRS+= gnu/usr.bin/cc | |||||
.endif | |||||
.if ${MK_BINUTILS} != "no" | .if ${MK_BINUTILS} != "no" | ||||
NXBDIRS+= gnu/usr.bin/binutils | NXBDIRS+= gnu/usr.bin/binutils | ||||
.endif | .endif | ||||
# XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs | # XXX: native-xtools passes along ${NXBDIRS} in SUBDIR_OVERRIDE that needs | ||||
# to be evaluated after NXBDIRS is set. | # to be evaluated after NXBDIRS is set. | ||||
.if make(install) && !empty(SUBDIR_OVERRIDE) | .if make(install) && !empty(SUBDIR_OVERRIDE) | ||||
SUBDIR= ${SUBDIR_OVERRIDE} | SUBDIR= ${SUBDIR_OVERRIDE} | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
NXBMAKE+= XCC="${NXBOBJTOP}/tmp/usr/bin/cc" \ | NXBMAKE+= XCC="${NXBOBJTOP}/tmp/usr/bin/cc" \ | ||||
XCXX="${NXBOBJTOP}/tmp/usr/bin/c++" \ | XCXX="${NXBOBJTOP}/tmp/usr/bin/c++" \ | ||||
XCPP="${NXBOBJTOP}/tmp/usr/bin/cpp" | XCPP="${NXBOBJTOP}/tmp/usr/bin/cpp" | ||||
.endif | .endif | ||||
NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \ | NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \ | ||||
TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \ | TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \ | ||||
TARGET_TRIPLE=${MACHINE_TRIPLE:Q} | TARGET_TRIPLE=${MACHINE_TRIPLE:Q} | ||||
# NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to | # NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to | ||||
# invoke a sub-make to reevaluate MK_GCC, etc, for NXBDIRS. | # invoke a sub-make to reevaluate MK_CLANG, etc, for NXBDIRS. | ||||
NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}' | NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}' | ||||
# Need to avoid the -isystem logic when using clang as an external toolchain | # Need to avoid the -isystem logic when using clang as an external toolchain | ||||
# even if the TARGET being built for wants GCC. | # even if the TARGET being built for wants GCC. | ||||
NXBMAKE+= WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}' | NXBMAKE+= WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}' | ||||
native-xtools: .PHONY | native-xtools: .PHONY | ||||
Not Done Inline Actionsas others have noted, we should revisit what we want to do with xtools/xdev targets once we have gcc out of the tree since clang may be able to do a lot of the heavy lifting more easily. Though it's complicated by the fact that we build libraries and such too... imp: as others have noted, we should revisit what we want to do with xtools/xdev targets once we… | |||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj MK_GCC=yes | ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj | ||||
# Build the bootstrap/host/cross tools that produce native binaries | # Build the bootstrap/host/cross tools that produce native binaries | ||||
# Pass along MK_GCC=yes to ensure GCC-needed build tools are built. | ${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain | ||||
# We don't quite know what the NXB_TARGET wants so just build it. | |||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain MK_GCC=yes | |||||
# Populate includes/libraries sysroot that produce native binaries. | # Populate includes/libraries sysroot that produce native binaries. | ||||
# This is split out from 'toolchain' above mostly so that target LLVM | # This is split out from 'toolchain' above mostly so that target LLVM | ||||
# libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without | # libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without | ||||
# polluting the cross-compiler build. The LLVM/GCC libs are skipped | # polluting the cross-compiler build. The LLVM/GCC libs are skipped | ||||
# here to avoid the problem but are kept in 'toolchain' so that | # here to avoid the problem but are kept in 'toolchain' so that | ||||
# needed build tools are built. | # needed build tools are built. | ||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no MK_GCC=no | ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no | ||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no MK_GCC=no | ${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no | ||||
# Clean out improper TARGET=MACHINE files | # Clean out improper TARGET=MACHINE files | ||||
${_+_}cd ${.CURDIR}/gnu/usr.bin/cc/cc_tools; ${NXBTMAKE} cleandir | ${_+_}cd ${.CURDIR}/gnu/usr.bin/cc/cc_tools; ${NXBTMAKE} cleandir | ||||
.if !defined(NO_OBJWALK) | .if !defined(NO_OBJWALK) | ||||
${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj | ${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj | ||||
.endif | .endif | ||||
${_+_}cd ${.CURDIR}; ${NXBMAKE} everything | ${_+_}cd ${.CURDIR}; ${NXBMAKE} everything | ||||
@echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR" | @echo ">> native-xtools done. Use 'make native-xtools-install' to install to a given DESTDIR" | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | _prebuild_libs= ${_kerberos5_lib_libasn1} \ | ||||
${_cddl_lib_libavl} \ | ${_cddl_lib_libavl} \ | ||||
${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \ | ${_cddl_lib_libzfs_core} ${_cddl_lib_libzfs} \ | ||||
${_cddl_lib_libctf} \ | ${_cddl_lib_libctf} \ | ||||
lib/libufs \ | lib/libufs \ | ||||
lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ | lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ | ||||
${_secure_lib_libcrypto} ${_secure_lib_libssl} \ | ${_secure_lib_libcrypto} ${_secure_lib_libssl} \ | ||||
${_lib_libldns} ${_secure_lib_libssh} | ${_lib_libldns} ${_secure_lib_libssh} | ||||
.if ${MK_GNUCXX} != "no" | |||||
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ | |||||
gnu/lib/libstdc++__L: lib/msun__L | |||||
gnu/lib/libsupc++__L: gnu/lib/libstdc++__L | |||||
.endif | |||||
.if ${MK_DIALOG} != "no" | .if ${MK_DIALOG} != "no" | ||||
_prebuild_libs+= gnu/lib/libdialog | _prebuild_libs+= gnu/lib/libdialog | ||||
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L | gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L | ||||
.endif | .endif | ||||
.if ${MK_LIBCPLUSPLUS} != "no" | .if ${MK_LIBCPLUSPLUS} != "no" | ||||
_prebuild_libs+= lib/libc++ | _prebuild_libs+= lib/libc++ | ||||
.endif | .endif | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
.endif | .endif | ||||
.if ${MK_OPENSSL} == "no" | .if ${MK_OPENSSL} == "no" | ||||
lib/libradius__L: lib/libmd__L | lib/libradius__L: lib/libmd__L | ||||
.endif | .endif | ||||
lib/libproc__L: \ | lib/libproc__L: \ | ||||
${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L | ${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L | ||||
.if ${MK_CXX} != "no" | .if ${MK_CXX} != "no" && ${MK_LIBCPLUSPLUS} != "no" | ||||
.if ${MK_LIBCPLUSPLUS} != "no" | |||||
lib/libproc__L: lib/libcxxrt__L | lib/libproc__L: lib/libcxxrt__L | ||||
.else # This implies MK_GNUCXX != "no"; see lib/libproc | |||||
lib/libproc__L: gnu/lib/libsupc++__L | |||||
.endif | .endif | ||||
.endif | |||||
Not Done Inline ActionsI'm confused what removed .if this aligns with. brooks: I'm confused what removed `.if` this aligns with. | |||||
Done Inline ActionsIt doesn't; seems it came from a mis-rebase. In the next update I'll combine the MK_CXX and MK_LIBCPLUSPLUS above. emaste: It doesn't; seems it came from a mis-rebase. In the next update I'll combine the `MK_CXX` and… | |||||
.for _lib in ${_prereq_libs} | .for _lib in ${_prereq_libs} | ||||
${_lib}__PL: .PHONY .MAKE | ${_lib}__PL: .PHONY .MAKE | ||||
.if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib}) | .if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib}) | ||||
${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ | ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ | ||||
cd ${.CURDIR}/${_lib}; \ | cd ${.CURDIR}/${_lib}; \ | ||||
if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \ | if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \ | ||||
${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ | ${MAKE} MK_TESTS=no MK_PROFILE=no -DNO_PIC \ | ||||
▲ Show 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | _xb-build-tools: .PHONY | ||||
${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools | ${CDBENV} ${MAKE} ${CDMAKEARGS} -f Makefile.inc1 ${NOFUN} build-tools | ||||
XDEVDIRS= \ | XDEVDIRS= \ | ||||
${_clang_libs} \ | ${_clang_libs} \ | ||||
${_lld} \ | ${_lld} \ | ||||
${_binutils} \ | ${_binutils} \ | ||||
${_elftctools} \ | ${_elftctools} \ | ||||
usr.bin/ar \ | usr.bin/ar \ | ||||
${_clang} \ | ${_clang} | ||||
Not Done Inline ActionsDoes XDEV make sense without a compiler? brooks: Does XDEV make sense without a compiler? | |||||
Done Inline Actionsremoving ${_gcc} is needed anyway; what do you suggest we do w/ XDEV if MK_CLANG==no? emaste: removing `${_gcc}` is needed anyway; what do you suggest we do w/ XDEV if MK_CLANG==no? | |||||
Not Done Inline ActionsIt makes no sense. It should fail in some way. Xdev is there to make the compiler and toolchain stuff. It was only a variable here since clang was introduced. It used to be unconditional gcc. imp: It makes no sense. It should fail in some way. Xdev is there to make the compiler and toolchain… | |||||
Done Inline ActionsThis issue predates my proposed change though; archs without either clang or gcc 4.2.1 (like riscv) would have had this problem already. emaste: This issue predates my proposed change though; archs without either clang or gcc 4.2.1 (like… | |||||
Not Done Inline ActionsIt's ok, I guess. It only makes sense for in tree toolchain... we can leave it likes this... imp: It's ok, I guess. It only makes sense for in tree toolchain... we can leave it likes this... | |||||
Done Inline ActionsI think we could/should still do something about it, but it can happen before or after this change. Probably if any of ${_clang_libs}, ${_lld}, ${_binutils}, ${_elftctools}, ${_clang} are empty it could be a .error. Well, empty ${_binutils} is OK depending on arch. emaste: I think we could/should still do something about it, but it can happen before or after this… | |||||
Not Done Inline ActionsI'd suggest having the whole 'rototil xdev' stuff be separate from this change. imp: I'd suggest having the whole 'rototil xdev' stuff be separate from this change. | |||||
${_gcc} | |||||
_xb-cross-tools: .PHONY | _xb-cross-tools: .PHONY | ||||
.for _tool in ${XDEVDIRS} | .for _tool in ${XDEVDIRS} | ||||
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \ | ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,all)"; \ | ||||
cd ${.CURDIR}/${_tool}; \ | cd ${.CURDIR}/${_tool}; \ | ||||
if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \ | if [ -z "${NO_OBJWALK}" ]; then ${CDMAKE} DIRPRFX=${_tool}/ obj; fi; \ | ||||
${CDMAKE} DIRPRFX=${_tool}/ all | ${CDMAKE} DIRPRFX=${_tool}/ all | ||||
.endfor | .endfor | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
We should probably rm the bits to try to set CROSS_BINUTILS_PREFIX. aarch64 and riscv64 were the users of this before and they both now use LLD. I think it won't conflict. I'll see if I can do that as a separate change sooner.
One thing we want to make sure of today is that right now 'make buildworld' for mips and sparc64 should be failing unless someone has manually set WITH_GCC to yes. Not sure where that needs to happen (either here or src.opts.mk)