Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Oct 2017 03:34:17 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r325005 - in projects/runtime-coverage: . cddl/contrib/opensolaris/lib/libzfs/common contrib/jemalloc/include/jemalloc/internal etc/defaults etc/rc.d lib lib/clang lib/libc/sys lib/libp...
Message-ID:  <201710260334.v9Q3YHEG023905@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Thu Oct 26 03:34:17 2017
New Revision: 325005
URL: https://svnweb.freebsd.org/changeset/base/325005

Log:
  MFhead@r325004

Added:
  projects/runtime-coverage/lib/libpmcstat/
     - copied from r325004, head/lib/libpmcstat/
  projects/runtime-coverage/sys/boot/efi/loader/framebuffer.c
     - copied unchanged from r325004, head/sys/boot/efi/loader/framebuffer.c
  projects/runtime-coverage/sys/boot/efi/loader/framebuffer.h
     - copied unchanged from r325004, head/sys/boot/efi/loader/framebuffer.h
Deleted:
  projects/runtime-coverage/sys/boot/arm/at91/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/Makefile.inc
  projects/runtime-coverage/sys/boot/arm/at91/boot0/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/boot0/README
  projects/runtime-coverage/sys/boot/arm/at91/boot0/linker.cfg
  projects/runtime-coverage/sys/boot/arm/at91/boot0/main.c
  projects/runtime-coverage/sys/boot/arm/at91/boot0iic/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/boot0iic/main.c
  projects/runtime-coverage/sys/boot/arm/at91/boot0spi/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/boot0spi/main.c
  projects/runtime-coverage/sys/boot/arm/at91/boot2/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/boot2/board.h
  projects/runtime-coverage/sys/boot/arm/at91/boot2/boot2.c
  projects/runtime-coverage/sys/boot/arm/at91/boot2/bwct_board.c
  projects/runtime-coverage/sys/boot/arm/at91/boot2/centipad_board.c
  projects/runtime-coverage/sys/boot/arm/at91/boot2/kb920x_board.c
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/README
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/env_vars.c
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/env_vars.h
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/loader_prompt.c
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/loader_prompt.h
  projects/runtime-coverage/sys/boot/arm/at91/bootiic/main.c
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/README
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/ee.c
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/ee.h
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/env_vars.c
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/env_vars.h
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/loader_prompt.c
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/loader_prompt.h
  projects/runtime-coverage/sys/boot/arm/at91/bootspi/main.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/Makefile
  projects/runtime-coverage/sys/boot/arm/at91/libat91/arm_init.S
  projects/runtime-coverage/sys/boot/arm/at91/libat91/at91rm9200.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/delay.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/eeprom.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/emac.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/emac.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/emac_init.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/getc.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/lib.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/lib_AT91RM9200.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/mci_device.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/memcmp.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/memcpy.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/memset.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/p_string.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/printf.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/putchar.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/reset.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/sd-card.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/sd-card.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/spi_flash.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/spi_flash.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/strcmp.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/strcpy.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/strcvt.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/strlen.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/tag_list.c
  projects/runtime-coverage/sys/boot/arm/at91/libat91/tag_list.h
  projects/runtime-coverage/sys/boot/arm/at91/libat91/xmodem.c
  projects/runtime-coverage/sys/boot/arm/at91/linker.cfg
  projects/runtime-coverage/sys/boot/arm/ixp425/Makefile.inc
  projects/runtime-coverage/sys/boot/arm/ixp425/boot2/Makefile
  projects/runtime-coverage/sys/boot/arm/ixp425/boot2/arm_init.S
  projects/runtime-coverage/sys/boot/arm/ixp425/boot2/boot2.c
  projects/runtime-coverage/sys/boot/arm/ixp425/boot2/cf_ata.h
  projects/runtime-coverage/sys/boot/arm/ixp425/boot2/ixp425_board.c
  projects/runtime-coverage/sys/boot/arm/ixp425/boot2/lib.h
  projects/runtime-coverage/sys/boot/efi/loader/arch/amd64/framebuffer.c
  projects/runtime-coverage/sys/boot/efi/loader/arch/amd64/framebuffer.h
Modified:
  projects/runtime-coverage/Makefile.inc1
  projects/runtime-coverage/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  projects/runtime-coverage/contrib/jemalloc/include/jemalloc/internal/tsd.h
  projects/runtime-coverage/etc/defaults/rc.conf
  projects/runtime-coverage/etc/rc.d/dumpon
  projects/runtime-coverage/lib/Makefile
  projects/runtime-coverage/lib/clang/llvm.build.mk
  projects/runtime-coverage/lib/libc/sys/aio_suspend.2
  projects/runtime-coverage/lib/libc/sys/lio_listio.2
  projects/runtime-coverage/lib/libc/sys/reboot.2
  projects/runtime-coverage/lib/libsysdecode/flags.c
  projects/runtime-coverage/lib/libugidfw/Makefile
  projects/runtime-coverage/lib/libugidfw/ugidfw.c
  projects/runtime-coverage/libexec/rtld-elf/libmap.c
  projects/runtime-coverage/libexec/rtld-elf/rtld.c
  projects/runtime-coverage/sbin/dumpon/dumpon.8
  projects/runtime-coverage/sbin/dumpon/dumpon.c
  projects/runtime-coverage/sbin/init/init.8
  projects/runtime-coverage/sbin/init/init.c
  projects/runtime-coverage/sbin/nvmecontrol/logpage.c
  projects/runtime-coverage/sbin/reboot/reboot.8
  projects/runtime-coverage/sbin/reboot/reboot.c
  projects/runtime-coverage/sbin/savecore/savecore.8
  projects/runtime-coverage/sbin/savecore/savecore.c
  projects/runtime-coverage/sbin/shutdown/shutdown.8
  projects/runtime-coverage/sbin/shutdown/shutdown.c
  projects/runtime-coverage/share/man/man4/ipmi.4
  projects/runtime-coverage/share/man/man5/rc.conf.5
  projects/runtime-coverage/share/man/man8/uefi.8
  projects/runtime-coverage/share/man/man9/atomic.9
  projects/runtime-coverage/share/mk/src.libnames.mk
  projects/runtime-coverage/sys/amd64/amd64/pmap.c
  projects/runtime-coverage/sys/arm/arm/pmap-v6.c
  projects/runtime-coverage/sys/arm64/arm64/pmap.c
  projects/runtime-coverage/sys/arm64/include/metadata.h
  projects/runtime-coverage/sys/boot/arm/uboot/Makefile
  projects/runtime-coverage/sys/boot/defs.mk
  projects/runtime-coverage/sys/boot/efi/Makefile.inc
  projects/runtime-coverage/sys/boot/efi/loader/Makefile
  projects/runtime-coverage/sys/boot/efi/loader/arch/amd64/Makefile.inc
  projects/runtime-coverage/sys/boot/efi/loader/bootinfo.c
  projects/runtime-coverage/sys/boot/i386/Makefile.inc
  projects/runtime-coverage/sys/boot/mips/beri/Makefile.inc
  projects/runtime-coverage/sys/boot/mips/beri/boot2/Makefile
  projects/runtime-coverage/sys/boot/mips/uboot/Makefile
  projects/runtime-coverage/sys/boot/powerpc/boot1.chrp/Makefile
  projects/runtime-coverage/sys/boot/powerpc/kboot/Makefile
  projects/runtime-coverage/sys/boot/powerpc/ofw/Makefile
  projects/runtime-coverage/sys/boot/powerpc/ps3/Makefile
  projects/runtime-coverage/sys/boot/powerpc/uboot/Makefile
  projects/runtime-coverage/sys/boot/sparc64/Makefile.inc
  projects/runtime-coverage/sys/cam/ata/ata_da.c
  projects/runtime-coverage/sys/cam/cam_iosched.c
  projects/runtime-coverage/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
  projects/runtime-coverage/sys/dev/bnxt/bnxt.h
  projects/runtime-coverage/sys/dev/bnxt/bnxt_hwrm.c
  projects/runtime-coverage/sys/dev/bnxt/bnxt_hwrm.h
  projects/runtime-coverage/sys/dev/bnxt/bnxt_sysctl.c
  projects/runtime-coverage/sys/dev/bnxt/bnxt_sysctl.h
  projects/runtime-coverage/sys/dev/bnxt/if_bnxt.c
  projects/runtime-coverage/sys/dev/cxgbe/adapter.h
  projects/runtime-coverage/sys/dev/cxgbe/common/common.h
  projects/runtime-coverage/sys/dev/cxgbe/common/t4_hw.c
  projects/runtime-coverage/sys/dev/cxgbe/t4_main.c
  projects/runtime-coverage/sys/dev/cxgbe/t4_sge.c
  projects/runtime-coverage/sys/dev/ipmi/ipmi.c
  projects/runtime-coverage/sys/dev/ipmi/ipmivars.h
  projects/runtime-coverage/sys/dev/iscsi/iscsi.c
  projects/runtime-coverage/sys/dev/liquidio/base/cn23xx_pf_device.c
  projects/runtime-coverage/sys/dev/liquidio/base/lio_device.c
  projects/runtime-coverage/sys/dev/liquidio/base/lio_device.h
  projects/runtime-coverage/sys/dev/liquidio/base/lio_droq.c
  projects/runtime-coverage/sys/dev/liquidio/base/lio_mem_ops.c
  projects/runtime-coverage/sys/dev/liquidio/base/lio_request_manager.c
  projects/runtime-coverage/sys/dev/liquidio/lio_main.c
  projects/runtime-coverage/sys/dev/liquidio/lio_main.h
  projects/runtime-coverage/sys/dev/liquidio/lio_rxtx.c
  projects/runtime-coverage/sys/dev/liquidio/lio_sysctl.c
  projects/runtime-coverage/sys/dev/null/null.c
  projects/runtime-coverage/sys/fs/ext2fs/ext2_alloc.c
  projects/runtime-coverage/sys/fs/ext2fs/ext2_extents.c
  projects/runtime-coverage/sys/fs/ext2fs/ext2_extern.h
  projects/runtime-coverage/sys/fs/ext2fs/ext2_inode.c
  projects/runtime-coverage/sys/fs/ext2fs/ext2_subr.c
  projects/runtime-coverage/sys/fs/tmpfs/tmpfs_vfsops.c
  projects/runtime-coverage/sys/geom/geom_dev.c
  projects/runtime-coverage/sys/i386/i386/pmap.c
  projects/runtime-coverage/sys/kern/kern_gzio.c
  projects/runtime-coverage/sys/kern/kern_shutdown.c
  projects/runtime-coverage/sys/kern/vfs_aio.c
  projects/runtime-coverage/sys/modules/Makefile
  projects/runtime-coverage/sys/net/iflib.c
  projects/runtime-coverage/sys/netinet/sctp_auth.c
  projects/runtime-coverage/sys/netinet/sctp_input.c
  projects/runtime-coverage/sys/netinet6/ip6_fastfwd.c
  projects/runtime-coverage/sys/netpfil/ipfw/ip_fw2.c
  projects/runtime-coverage/sys/sys/bus.h
  projects/runtime-coverage/sys/sys/conf.h
  projects/runtime-coverage/sys/sys/disk.h
  projects/runtime-coverage/sys/sys/gzio.h
  projects/runtime-coverage/sys/sys/ipmi.h
  projects/runtime-coverage/sys/sys/kerneldump.h
  projects/runtime-coverage/sys/sys/reboot.h
  projects/runtime-coverage/sys/ufs/ffs/ffs_softdep.c
  projects/runtime-coverage/sys/vm/vm_page.c
  projects/runtime-coverage/tests/sys/kern/ptrace_test.c
  projects/runtime-coverage/tools/boot/universe.sh
  projects/runtime-coverage/tools/tools/nanobsd/defaults.sh
  projects/runtime-coverage/usr.bin/top/machine.c
  projects/runtime-coverage/usr.sbin/pmcstat/Makefile
  projects/runtime-coverage/usr.sbin/pmcstat/pmcpl_callgraph.c
  projects/runtime-coverage/usr.sbin/pmcstat/pmcpl_callgraph.h
  projects/runtime-coverage/usr.sbin/pmcstat/pmcpl_calltree.c
  projects/runtime-coverage/usr.sbin/pmcstat/pmcpl_calltree.h
  projects/runtime-coverage/usr.sbin/pmcstat/pmcpl_gprof.c
  projects/runtime-coverage/usr.sbin/pmcstat/pmcstat.c
  projects/runtime-coverage/usr.sbin/pmcstat/pmcstat.h
  projects/runtime-coverage/usr.sbin/pmcstat/pmcstat_log.c
  projects/runtime-coverage/usr.sbin/pmcstat/pmcstat_log.h
Directory Properties:
  projects/runtime-coverage/   (props changed)
  projects/runtime-coverage/cddl/   (props changed)
  projects/runtime-coverage/cddl/contrib/opensolaris/   (props changed)
  projects/runtime-coverage/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  projects/runtime-coverage/sys/cddl/contrib/opensolaris/   (props changed)

Modified: projects/runtime-coverage/Makefile.inc1
==============================================================================
--- projects/runtime-coverage/Makefile.inc1	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/Makefile.inc1	Thu Oct 26 03:34:17 2017	(r325005)
@@ -638,6 +638,8 @@ XCXXFLAGS+=	-isystem ${WORLDTMP}/usr/include/c++/v1 -s
 .endif
 .elif ${WANT_COMPILER_TYPE} == clang || \
     (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang)
+MACHINE_ABI?=	unknown
+MACHINE_TRIPLE?=${MACHINE_ARCH:C/amd64/x86_64/}-${MACHINE_ABI}-freebsd12.0
 TARGET_ABI?=	unknown
 TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd12.0
 XCFLAGS+=	-target ${TARGET_TRIPLE}
@@ -672,7 +674,7 @@ META_MODE_BAD_ABI_VERS+=	1200031
 OBJDIR_HOST_OSRELDATE!=	\
     awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
     ${OBJTREE}${.CURDIR}/host-osreldate.h
-.else
+.elif exists(${WORLDTMP}/usr/include/osreldate.h)
 OBJDIR_HOST_OSRELDATE=	0
 .endif
 .export OBJDIR_HOST_OSRELDATE
@@ -681,6 +683,7 @@ OBJDIR_HOST_OSRELDATE=	0
 # Note that this logic is the opposite of normal BOOTSTRAP handling.  We want
 # to compare the WORLDTMP's OSRELDATE to the host's OSRELDATE.  If the WORLDTMP
 # is older than the ABI-breakage OSRELDATE of the HOST then we rebuild.
+.if defined(OBJDIR_HOST_OSRELDATE)
 .for _ver in ${META_MODE_BAD_ABI_VERS}
 .if ${OSRELDATE} >= ${_ver} && ${OBJDIR_HOST_OSRELDATE} < ${_ver}
 _meta_mode_need_rebuild=	${_ver}
@@ -690,8 +693,9 @@ _meta_mode_need_rebuild=	${_ver}
 .info META_MODE: Rebuilding host tools due to ABI breakage in __FreeBSD_version ${_meta_mode_need_rebuild}.
 NO_META_IGNORE_HOST_HEADERS=	1
 .export NO_META_IGNORE_HOST_HEADERS
-.endif
-.endif
+.endif	# defined(_meta_mode_need_rebuild)
+.endif	# defined(OBJDIR_HOST_OSRELDATE)
+.endif	# ${MK_META_MODE} == "yes" && defined(NO_CLEAN) ...
 # This is only used for META_MODE+filemon to track what the oldest
 # __FreeBSD_version is in WORLDTMP.  This purposely does NOT have
 # a make dependency on /usr/include/osreldate.h as the file should
@@ -1850,7 +1854,6 @@ _vtfontcvt=	usr.bin/vtfontcvt
 .endif
 
 .if ${BOOTSTRAPPING} < 1000033
-_libopenbsd=	lib/libopenbsd
 _m4=		usr.bin/m4
 _lex=		usr.bin/lex
 
@@ -1936,9 +1939,6 @@ _kerberos5_bootstrap_tools= \
 .ORDER: ${_kerberos5_bootstrap_tools:C/^/${_bt}-/g}
 .endif
 
-# r283777 makewhatis(1) replaced with mandoc version which builds a database.
-_libopenbsd?=	lib/libopenbsd
-_makewhatis=	usr.bin/mandoc
 ${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
 
 bootstrap-tools: .PHONY
@@ -1955,8 +1955,8 @@ bootstrap-tools: .PHONY
     ${_cat} \
     ${_kbdcontrol} \
     usr.bin/lorder \
-    ${_libopenbsd} \
-    ${_makewhatis} \
+    lib/libopenbsd \
+    usr.bin/mandoc \
     usr.bin/rpcgen \
     ${_yacc} \
     ${_m4} \
@@ -2114,47 +2114,20 @@ cross-tools: .MAKE .PHONY
 		${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
 .endfor
 
-NXBDESTDIR=	${OBJTREE}/nxb-bin
-NXBENV=		MAKEOBJDIRPREFIX=${OBJTREE}/nxb \
-		TOOLS_PREFIX= \
-		INSTALL="sh ${.CURDIR}/tools/install.sh" \
-		PATH=${PATH}:${OBJTREE}/gperf_for_gcc/usr/bin
-NXBMAKE=	${NXBENV} ${MAKE} \
-		LLVM_TBLGEN=${NXBDESTDIR}/usr/bin/llvm-tblgen \
-		CLANG_TBLGEN=${NXBDESTDIR}/usr/bin/clang-tblgen \
-		MACHINE=${TARGET} MACHINE_ARCH=${TARGET_ARCH} \
-		MK_GDB=no MK_TESTS=no \
-		SSP_CFLAGS= \
-		MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \
-		-DNO_PIC MK_PROFILE=no -DNO_SHARED \
-		-DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \
-		MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \
-		MK_LLDB=no MK_DEBUG_FILES=no
-
+#
 # native-xtools is the current target for qemu-user cross builds of ports
 # via poudriere and the imgact_binmisc kernel module.
-# For non-clang enabled targets that are still using the in tree gcc
-# we must build a gperf binary for one instance of its Makefiles.  On
-# clang-enabled systems, the gperf binary is obsolete.
-native-xtools: .PHONY
-.if ${MK_GCC_BOOTSTRAP} != "no"
-	mkdir -p ${OBJTREE}/gperf_for_gcc/usr/bin
-	${_+_}@${ECHODIR} "===> ${_gperf} (obj,all,install)"; \
-	cd ${.CURDIR}/${_gperf}; \
-	if [ -z "${NO_OBJ}" ]; then ${NXBMAKE} DIRPRFX=${_gperf}/ obj; fi; \
-	${NXBMAKE} DIRPRFX=${_gperf}/ all; \
-	${NXBMAKE} DIRPRFX=${_gperf}/ DESTDIR=${OBJTREE}/gperf_for_gcc install
-.endif
-	mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
-	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
-	    -p ${NXBDESTDIR}/usr >/dev/null
-	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-	    -p ${NXBDESTDIR}/usr/include >/dev/null
-.if ${MK_DEBUG_FILES} != "no"
-	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-	    -p ${NXBDESTDIR}/usr/lib >/dev/null
-.endif
-.for _tool in \
+# This target merely builds a toolchan/sysroot, then builds the tools it wants
+# with the options it wants in a special MAKEOBJDIRPREFIX, using the toolchain
+# already built.  It then installs the static tools to NXBDESTDIR for Poudriere
+# to pickup.
+#
+NXBOBJDIR=	${MAKEOBJDIRPREFIX}/nxb/${TARGET}.${TARGET_ARCH}
+NXBDESTDIR=	${NXBOBJDIR}${.CURDIR}/nxb-bin
+
+# This is the list of tools to be built/installed as static and where
+# appropriate to build for the given TARGET.TARGET_ARCH.
+NXBDIRS+= \
     bin/cat \
     bin/chmod \
     bin/cp \
@@ -2172,24 +2145,18 @@ native-xtools: .PHONY
     bin/rmdir \
     bin/sh \
     bin/sleep \
-    ${_clang_tblgen} \
-    usr.bin/ar \
-    ${_binutils} \
-    ${_elftctools} \
-    ${_gcc} \
-    ${_gcc_tools} \
-    ${_clang_libs} \
-    ${_clang} \
-    ${_lld} \
     sbin/md5 \
     sbin/sysctl \
-    usr.bin/diff \
+    usr.bin/addr2line \
+    usr.bin/ar \
     usr.bin/awk \
     usr.bin/basename \
     usr.bin/bmake \
     usr.bin/bzip2 \
     usr.bin/cmp \
+    usr.bin/diff \
     usr.bin/dirname \
+    usr.bin/elfcopy \
     usr.bin/env \
     usr.bin/fetch \
     usr.bin/find \
@@ -2199,14 +2166,16 @@ native-xtools: .PHONY
     usr.bin/lex \
     usr.bin/limits \
     usr.bin/lorder \
-    ${_libopenbsd} \
-    ${_makewhatis} \
+    usr.bin/mandoc \
     usr.bin/mktemp \
     usr.bin/mt \
+    usr.bin/nm \
     usr.bin/patch \
     usr.bin/readelf \
     usr.bin/sed \
+    usr.bin/size \
     usr.bin/sort \
+    usr.bin/strings \
     usr.bin/tar \
     usr.bin/touch \
     usr.bin/tr \
@@ -2218,12 +2187,81 @@ native-xtools: .PHONY
     usr.bin/xz \
     usr.bin/yacc \
     usr.sbin/chown
-	${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
-		cd ${.CURDIR}/${_tool}; \
-		if [ -z "${NO_OBJ}" ]; then ${NXBMAKE} DIRPRFX=${_tool}/ obj; fi; \
-		${NXBMAKE} DIRPRFX=${_tool}/ all; \
-		${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${NXBDESTDIR} install
-.endfor
+
+.if ${MK_CLANG} != "no"
+NXBDIRS+=	lib/clang
+SUBDIR_DEPEND_usr.bin/clang=	lib/clang
+NXBDIRS+=	usr.bin/clang
+.elif ${MK_GCC} != "no"
+NXBDIRS+=	gnu/usr.bin/cc
+.endif
+.if ${MK_BINUTILS} != "no"
+NXBDIRS+=	gnu/usr.bin/binutils
+.endif
+
+NXBMAKEENV+= \
+	MAKEOBJDIRPREFIX=${NXBOBJDIR:Q}
+
+NXBMAKEARGS+= \
+	OBJTREE=${NXBOBJDIR:Q} \
+	-DNO_SHARED \
+	-DNO_CPU_CFLAGS \
+	-DNO_PIC \
+	SSP_CFLAGS= \
+	MK_CLANG_EXTRAS=no \
+	MK_CLANG_FULL=no \
+	MK_CTF=no \
+	MK_DEBUG_FILES=no \
+	MK_GDB=no \
+	MK_HTML=no \
+	MK_LLDB=no \
+	MK_MAN=no \
+	MK_MAN_UTILS=yes \
+	MK_OFED=no \
+	MK_OPENSSH=no \
+	MK_PROFILE=no \
+	MK_SENDMAIL=no \
+	MK_SVNLITE=no \
+	MK_TESTS=no \
+	MK_WARNS=no \
+	MK_ZFS=no
+
+
+# For 'toolchain' we want to produce native binaries that themselves generate
+# native binaries.
+NXBTMAKE=	${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS:N-DNO_PIC:N-DNO_SHARED} \
+		TARGET=${MACHINE} TARGET_ARCH=${MACHINE_ARCH}
+# For 'everything' we want to produce native binaries (hence -target to
+# be MACHINE) that themselves generate TARGET.TARGET_ARCH binaries.
+# TARGET/TARGET_ARCH are still passed along from user.
+NXBMAKE=	${NXBMAKEENV} ${MAKE} ${NXBMAKEARGS} \
+		TARGET_TRIPLE=${MACHINE_TRIPLE:Q}
+native-xtools: .PHONY
+	# Build the bootstrap/host/cross tools that produce native binaries
+	${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain
+	# Populate includes/libraries sysroot that produce native binaries.
+	# This is split out from 'toolchain' above mostly so that target LLVM
+	# libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without
+	# polluting the cross-compiler build.  The LLVM/GCC libs are skipped
+	# here to avoid the problem but are kept in 'toolchain' so that
+	# needed build tools are built.
+	${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no MK_GCC=no
+	${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no MK_GCC=no
+.if !defined(NO_OBJ)
+	${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" _obj
+.endif
+	${_+_}cd ${.CURDIR}; ${NXBMAKE} SUBDIR_OVERRIDE="${NXBDIRS:M*}" \
+	    everything
+	mkdir -p ${NXBDESTDIR}/bin ${NXBDESTDIR}/sbin ${NXBDESTDIR}/usr
+	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
+	    -p ${NXBDESTDIR}/usr >/dev/null
+	mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
+	    -p ${NXBDESTDIR}/usr/include >/dev/null
+	${_+_}cd ${.CURDIR}; ${NXBMAKE} -f Makefile.inc1 \
+	    DESTDIR=${NXBDESTDIR} \
+	    SUBDIR_OVERRIDE="${NXBDIRS:M*}" \
+	    -DNO_ROOT \
+	    install
 
 #
 # hierarchy - ensure that all the needed directories are present

Modified: projects/runtime-coverage/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==============================================================================
--- projects/runtime-coverage/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Thu Oct 26 03:34:17 2017	(r325005)
@@ -930,7 +930,7 @@ zpool_read_all_labels(int fd, nvlist_t **config)
 	struct aiocb aiocbs[VDEV_LABELS];
 	struct aiocb *aiocbps[VDEV_LABELS];
 	int l;
-	vdev_label_t *labels;
+	vdev_phys_t *labels;
 	uint64_t state, txg, size;
 	int nlabels = 0;
 
@@ -940,15 +940,15 @@ zpool_read_all_labels(int fd, nvlist_t **config)
 		return (0);
 	size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
 
-	if ((labels = calloc(VDEV_LABELS, sizeof (vdev_label_t))) == NULL)
+	if ((labels = calloc(VDEV_LABELS, sizeof (vdev_phys_t))) == NULL)
 		return (0);
 
 	memset(aiocbs, 0, sizeof(aiocbs));
 	for (l = 0; l < VDEV_LABELS; l++) {
 		aiocbs[l].aio_fildes = fd;
-		aiocbs[l].aio_offset = label_offset(size, l);
+		aiocbs[l].aio_offset = label_offset(size, l) + VDEV_SKIP_SIZE;
 		aiocbs[l].aio_buf = &labels[l];
-		aiocbs[l].aio_nbytes = sizeof(vdev_label_t);
+		aiocbs[l].aio_nbytes = sizeof(vdev_phys_t);
 		aiocbs[l].aio_lio_opcode = LIO_READ;
 		aiocbps[l] = &aiocbs[l];
 	}
@@ -962,17 +962,18 @@ zpool_read_all_labels(int fd, nvlist_t **config)
 					(void)aio_return(&aiocbs[l]);
 			}
 		}
+		free(labels);
 		return (0);
 	}
 
 	for (l = 0; l < VDEV_LABELS; l++) {
 		nvlist_t *temp = NULL;
 
-		if (aio_return(&aiocbs[l]) != sizeof(vdev_label_t))
+		if (aio_return(&aiocbs[l]) != sizeof(vdev_phys_t))
 			continue;
 
-		if (nvlist_unpack(labels[l].vl_vdev_phys.vp_nvlist,
-		    sizeof (labels[l].vl_vdev_phys.vp_nvlist), &temp, 0) != 0)
+		if (nvlist_unpack(labels[l].vp_nvlist,
+		    sizeof (labels[l].vp_nvlist), &temp, 0) != 0)
 			continue;
 
 		if (nvlist_lookup_uint64(temp, ZPOOL_CONFIG_POOL_STATE,

Modified: projects/runtime-coverage/contrib/jemalloc/include/jemalloc/internal/tsd.h
==============================================================================
--- projects/runtime-coverage/contrib/jemalloc/include/jemalloc/internal/tsd.h	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/contrib/jemalloc/include/jemalloc/internal/tsd.h	Thu Oct 26 03:34:17 2017	(r325005)
@@ -120,7 +120,8 @@ struct tsd_s {
 	t use_a_getter_or_setter_instead_##n;
 MALLOC_TSD
 #undef O
-};
+/* AddressSanitizer requires TLS data to be aligned to at least 8 bytes. */
+} JEMALLOC_ALIGNED(16);
 
 /*
  * Wrapper around tsd_t that makes it possible to avoid implicit conversion

Modified: projects/runtime-coverage/etc/defaults/rc.conf
==============================================================================
--- projects/runtime-coverage/etc/defaults/rc.conf	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/etc/defaults/rc.conf	Thu Oct 26 03:34:17 2017	(r325005)
@@ -596,9 +596,8 @@ nscd_enable="NO"	# Run the nsswitch caching daemon.
 chkprintcap_enable="NO"	# Run chkprintcap(8) before running lpd.
 chkprintcap_flags="-d"	# Create missing directories by default.
 dumpdev="AUTO"		# Device to crashdump to (device name, AUTO, or NO).
+dumpon_flags=""		# Options to pass to dumpon(8), followed by dumpdev.
 dumpdir="/var/crash"	# Directory where crash dumps are to be stored
-dumppubkey=""		# Public key for encrypted kernel crash dumps.
-			# See dumpon(8) for more details.
 savecore_enable="YES"	# Extract core from dump devices if any
 savecore_flags="-m 10"	# Used if dumpdev is enabled above, and present.
 			# By default, only the 10 most recent kernel dumps

Modified: projects/runtime-coverage/etc/rc.d/dumpon
==============================================================================
--- projects/runtime-coverage/etc/rc.d/dumpon	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/etc/rc.d/dumpon	Thu Oct 26 03:34:17 2017	(r325005)
@@ -16,11 +16,14 @@ stop_cmd="dumpon_stop"
 
 dumpon_try()
 {
+	local flags
+
+	flags=${dumpon_flags}
 	if [ -n "${dumppubkey}" ]; then
-		/sbin/dumpon -k "${dumppubkey}" "${1}"
-	else
-		/sbin/dumpon "${1}"
+		warn "The dumppubkey variable is deprecated.  Use dumpon_flags."
+		flags="${flags} -k ${dumppubkey}"
 	fi
+	/sbin/dumpon ${flags} "${1}"
 	if [ $? -eq 0 ]; then
 		# Make a symlink in devfs for savecore
 		ln -fs "${1}" /dev/dumpdev

Modified: projects/runtime-coverage/lib/Makefile
==============================================================================
--- projects/runtime-coverage/lib/Makefile	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/Makefile	Thu Oct 26 03:34:17 2017	(r325005)
@@ -186,7 +186,7 @@ _libdl=		libdl
 .endif
 
 SUBDIR.${MK_OPENSSL}+=	libmp
-SUBDIR.${MK_PMC}+=	libpmc
+SUBDIR.${MK_PMC}+=	libpmc libpmcstat
 SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius
 SUBDIR.${MK_SENDMAIL}+=	libmilter libsm libsmdb libsmutil
 SUBDIR.${MK_TELNET}+=	libtelnet

Modified: projects/runtime-coverage/lib/clang/llvm.build.mk
==============================================================================
--- projects/runtime-coverage/lib/clang/llvm.build.mk	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/clang/llvm.build.mk	Thu Oct 26 03:34:17 2017	(r325005)
@@ -33,11 +33,11 @@ TARGET_ABI=
 VENDOR=		unknown
 OS_VERSION=	freebsd12.0
 
-TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI}
-BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}
+LLVM_TARGET_TRIPLE?=	${TARGET_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}${TARGET_ABI}
+LLVM_BUILD_TRIPLE?=	${BUILD_ARCH:C/amd64/x86_64/:C/arm64/aarch64/}-${VENDOR}-${OS_VERSION}
 
-CFLAGS+=	-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\"
-CFLAGS+=	-DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\"
+CFLAGS+=	-DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\"
+CFLAGS+=	-DLLVM_HOST_TRIPLE=\"${LLVM_BUILD_TRIPLE}\"
 CFLAGS+=	-DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\"
 
 CFLAGS+=	-ffunction-sections

Modified: projects/runtime-coverage/lib/libc/sys/aio_suspend.2
==============================================================================
--- projects/runtime-coverage/lib/libc/sys/aio_suspend.2	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/libc/sys/aio_suspend.2	Thu Oct 26 03:34:17 2017	(r325005)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd June 2, 1999
+.Dd Oct 23, 2017
 .Dt AIO_SUSPEND 2
 .Os
 .Sh NAME
@@ -85,10 +85,10 @@ expired before any I/O requests completed.
 The
 .Fa iocbs
 argument
-contains more than
-.Dv AIO_LISTIO_MAX
-asynchronous I/O requests, or at least one of the requests is not
-valid.
+contains more asynchronous I/O requests than the
+.Va vfs.aio.max_aio_queue_per_proc
+.Xr sysctl 8
+variable, or at least one of the requests is not valid.
 .It Bq Er EINTR
 the suspend was interrupted by a signal.
 .El

Modified: projects/runtime-coverage/lib/libc/sys/lio_listio.2
==============================================================================
--- projects/runtime-coverage/lib/libc/sys/lio_listio.2	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/libc/sys/lio_listio.2	Thu Oct 26 03:34:17 2017	(r325005)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 15, 2016
+.Dd Oct 23, 2017
 .Dt LIO_LISTIO 2
 .Os
 .Sh NAME
@@ -161,7 +161,7 @@ function will fail if:
 There are not enough resources to enqueue the requests.
 .It Bq Er EAGAIN
 The request would cause the system-wide limit
-.Dv AIO_MAX
+.Dv {AIO_MAX}
 to be exceeded.
 .It Bq Er EINVAL
 The
@@ -173,7 +173,7 @@ nor
 or
 .Fa nent
 is greater than
-.Dv AIO_LISTIO_MAX .
+.Dv {AIO_LISTIO_MAX} .
 .It Bq Er EINVAL
 The asynchronous notification method in
 .Fa sig->sigev_notify

Modified: projects/runtime-coverage/lib/libc/sys/reboot.2
==============================================================================
--- projects/runtime-coverage/lib/libc/sys/reboot.2	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/libc/sys/reboot.2	Thu Oct 26 03:34:17 2017	(r325005)
@@ -28,7 +28,7 @@
 .\"     @(#)reboot.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd September 18, 2015
+.Dd October 24, 2017
 .Dt REBOOT 2
 .Os
 .Sh NAME
@@ -84,6 +84,14 @@ for more information.
 .It Dv RB_HALT
 The processor is simply halted; no reboot takes place.
 This option should be used with caution.
+.It Dv RB_POWERCYCLE
+After halting, the shutdown code will do what it can to turn
+off the power and then turn the power back on.
+This requires hardware support, usually an auxiliary microprocessor
+that can sequence the power supply.
+At present only the
+.Xr ipmi 4
+driver implements this feature.
 .It Dv RB_POWEROFF
 After halting, the shutdown code will do what it can to turn
 off the power.

Modified: projects/runtime-coverage/lib/libsysdecode/flags.c
==============================================================================
--- projects/runtime-coverage/lib/libsysdecode/flags.c	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/libsysdecode/flags.c	Thu Oct 26 03:34:17 2017	(r325005)
@@ -647,9 +647,9 @@ sysdecode_reboot_howto(FILE *fp, int howto, int *rem)
 	/*
 	 * RB_AUTOBOOT is special in that its value is zero, but it is
 	 * also an implied argument if a different operation is not
-	 * requested via RB_HALT, RB_POWEROFF, or RB_REROOT.
+	 * requested via RB_HALT, RB_POWERCYCLE, RB_POWEROFF, or RB_REROOT.
 	 */
-	if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT)) == 0) {
+	if (howto != 0 && (howto & (RB_HALT | RB_POWEROFF | RB_REROOT | RB_POWERCYCLE)) == 0) {
 		fputs("RB_AUTOBOOT|", fp);
 		printed = true;
 	} else

Modified: projects/runtime-coverage/lib/libugidfw/Makefile
==============================================================================
--- projects/runtime-coverage/lib/libugidfw/Makefile	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/libugidfw/Makefile	Thu Oct 26 03:34:17 2017	(r325005)
@@ -2,7 +2,7 @@
 
 PACKAGE=lib${LIB}
 LIB=		ugidfw
-SHLIB_MAJOR=	5	
+SHLIB_MAJOR=	5
 SRCS=		ugidfw.c
 INCS=		ugidfw.h
 

Modified: projects/runtime-coverage/lib/libugidfw/ugidfw.c
==============================================================================
--- projects/runtime-coverage/lib/libugidfw/ugidfw.c	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/lib/libugidfw/ugidfw.c	Thu Oct 26 03:34:17 2017	(r325005)
@@ -194,7 +194,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule,
 			cur += len;
 		}
 		if (rule->mbr_subject.mbs_flags & MBS_PRISON_DEFINED) {
-			len = snprintf(cur, left, "jailid %d ", 
+			len = snprintf(cur, left, "jailid %d ",
 			    rule->mbr_subject.mbs_prison);
 			if (len < 0 || len > left)
 				goto truncated;
@@ -334,7 +334,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule,
 				    &(mntbuf[i].f_fsid),
 				    sizeof(mntbuf[i].f_fsid)) == 0)
 					break;
-			len = snprintf(cur, left, "filesys %s ", 
+			len = snprintf(cur, left, "filesys %s ",
 			    i == numfs ? "???" : mntbuf[i].f_mntonname);
 			if (len < 0 || len > left)
 				goto truncated;
@@ -512,7 +512,6 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max
 	uid_t uid1, uid2;
 	char *spec1, *spec2, *endp;
 	unsigned long value;
-	size_t len;
 
 	spec2 = spec;
 	spec1 = strsep(&spec2, ":");
@@ -523,8 +522,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max
 	else {
 		value = strtoul(spec1, &endp, 10);
 		if (*endp != '\0') {
-			len = snprintf(errstr, buflen,
-			    "invalid uid: '%s'", spec1);
+			snprintf(errstr, buflen, "invalid uid: '%s'", spec1);
 			return (-1);
 		}
 		uid1 = value;
@@ -541,8 +539,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max
 	else {
 		value = strtoul(spec2, &endp, 10);
 		if (*endp != '\0') {
-			len = snprintf(errstr, buflen,
-			    "invalid uid: '%s'", spec2);
+			snprintf(errstr, buflen, "invalid uid: '%s'", spec2);
 			return (-1);
 		}
 		uid2 = value;
@@ -561,7 +558,6 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max
 	gid_t gid1, gid2;
 	char *spec1, *spec2, *endp;
 	unsigned long value;
-	size_t len;
 
 	spec2 = spec;
 	spec1 = strsep(&spec2, ":");
@@ -572,8 +568,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max
 	else {
 		value = strtoul(spec1, &endp, 10);
 		if (*endp != '\0') {
-			len = snprintf(errstr, buflen,
-			    "invalid gid: '%s'", spec1);
+			snprintf(errstr, buflen, "invalid gid: '%s'", spec1);
 			return (-1);
 		}
 		gid1 = value;
@@ -590,8 +585,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max
 	else {
 		value = strtoul(spec2, &endp, 10);
 		if (*endp != '\0') {
-			len = snprintf(errstr, buflen,
-			    "invalid gid: '%s'", spec2);
+			snprintf(errstr, buflen, "invalid gid: '%s'", spec2);
 			return (-1);
 		}
 		gid2 = value;
@@ -613,7 +607,6 @@ bsde_parse_subject(int argc, char *argv[],
 	uid_t uid_min, uid_max;
 	gid_t gid_min, gid_max;
 	int jid = 0;
-	size_t len;
 	long value;
 
 	current = 0;
@@ -630,11 +623,11 @@ bsde_parse_subject(int argc, char *argv[],
 	while (current < argc) {
 		if (strcmp(argv[current], "uid") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "uid short");
+				snprintf(errstr, buflen, "uid short");
 				return (-1);
 			}
 			if (flags & MBS_UID_DEFINED) {
-				len = snprintf(errstr, buflen, "one uid only");
+				snprintf(errstr, buflen, "one uid only");
 				return (-1);
 			}
 			if (bsde_parse_uidrange(argv[current+1],
@@ -648,11 +641,11 @@ bsde_parse_subject(int argc, char *argv[],
 			current += 2;
 		} else if (strcmp(argv[current], "gid") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "gid short");
+				snprintf(errstr, buflen, "gid short");
 				return (-1);
 			}
 			if (flags & MBS_GID_DEFINED) {
-				len = snprintf(errstr, buflen, "one gid only");
+				snprintf(errstr, buflen, "one gid only");
 				return (-1);
 			}
 			if (bsde_parse_gidrange(argv[current+1],
@@ -666,17 +659,17 @@ bsde_parse_subject(int argc, char *argv[],
 			current += 2;
 		} else if (strcmp(argv[current], "jailid") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "prison short");
+				snprintf(errstr, buflen, "prison short");
 				return (-1);
 			}
 			if (flags & MBS_PRISON_DEFINED) {
-				len = snprintf(errstr, buflen, "one jail only");
+				snprintf(errstr, buflen, "one jail only");
 				return (-1);
 			}
 			value = strtol(argv[current+1], &endp, 10);
 			if (*endp != '\0') {
-				len = snprintf(errstr, buflen,
-				    "invalid jid: '%s'", argv[current+1]);
+				snprintf(errstr, buflen, "invalid jid: '%s'",
+				    argv[current+1]);
 				return (-1);
 			}
 			jid = value;
@@ -688,14 +681,13 @@ bsde_parse_subject(int argc, char *argv[],
 			current += 2;
 		} else if (strcmp(argv[current], "!") == 0) {
 			if (nextnot) {
-				len = snprintf(errstr, buflen,
-				    "double negative");
+				snprintf(errstr, buflen, "double negative");
 				return (-1);
 			}
 			nextnot = 1;
 			current += 1;
 		} else {
-			len = snprintf(errstr, buflen, "'%s' not expected",
+			snprintf(errstr, buflen, "'%s' not expected",
 			    argv[current]);
 			return (-1);
 		}
@@ -723,7 +715,6 @@ bsde_parse_subject(int argc, char *argv[],
 static int
 bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
 {
-	size_t len;
 	int i;
 
 	*type = 0;
@@ -755,10 +746,10 @@ bsde_parse_type(char *spec, int *type, size_t buflen, 
 			*type |= MBO_ALL_TYPE;
 			break;
 		default:
-			len = snprintf(errstr, buflen, "Unknown type code: %c",
+			snprintf(errstr, buflen, "Unknown type code: %c",
 			    spec[i]);
 			return (-1);
-		} 
+		}
 	}
 
 	return (0);
@@ -767,11 +758,10 @@ bsde_parse_type(char *spec, int *type, size_t buflen, 
 static int
 bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
 {
-	size_t len;
 	struct statfs buf;
 
 	if (statfs(spec, &buf) < 0) {
-		len = snprintf(errstr, buflen, "Unable to get id for %s: %s",
+		snprintf(errstr, buflen, "Unable to get id for %s: %s",
 		    spec, strerror(errno));
 		return (-1);
 	}
@@ -791,7 +781,6 @@ bsde_parse_object(int argc, char *argv[],
 	uid_t uid_min, uid_max;
 	gid_t gid_min, gid_max;
 	struct fsid fsid;
-	size_t len;
 
 	current = 0;
 	flags = 0;
@@ -808,11 +797,11 @@ bsde_parse_object(int argc, char *argv[],
 	while (current < argc) {
 		if (strcmp(argv[current], "uid") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "uid short");
+				snprintf(errstr, buflen, "uid short");
 				return (-1);
 			}
 			if (flags & MBO_UID_DEFINED) {
-				len = snprintf(errstr, buflen, "one uid only");
+				snprintf(errstr, buflen, "one uid only");
 				return (-1);
 			}
 			if (bsde_parse_uidrange(argv[current+1],
@@ -826,11 +815,11 @@ bsde_parse_object(int argc, char *argv[],
 			current += 2;
 		} else if (strcmp(argv[current], "gid") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "gid short");
+				snprintf(errstr, buflen, "gid short");
 				return (-1);
 			}
 			if (flags & MBO_GID_DEFINED) {
-				len = snprintf(errstr, buflen, "one gid only");
+				snprintf(errstr, buflen, "one gid only");
 				return (-1);
 			}
 			if (bsde_parse_gidrange(argv[current+1],
@@ -844,11 +833,11 @@ bsde_parse_object(int argc, char *argv[],
 			current += 2;
 		} else if (strcmp(argv[current], "filesys") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "filesys short");
+				snprintf(errstr, buflen, "filesys short");
 				return (-1);
 			}
 			if (flags & MBO_FSID_DEFINED) {
-				len = snprintf(errstr, buflen, "one fsid only");
+				snprintf(errstr, buflen, "one fsid only");
 				return (-1);
 			}
 			if (bsde_parse_fsid(argv[current+1], &fsid,
@@ -890,11 +879,11 @@ bsde_parse_object(int argc, char *argv[],
 			current += 1;
 		} else if (strcmp(argv[current], "type") == 0) {
 			if (current + 2 > argc) {
-				len = snprintf(errstr, buflen, "type short");
+				snprintf(errstr, buflen, "type short");
 				return (-1);
 			}
 			if (flags & MBO_TYPE_DEFINED) {
-				len = snprintf(errstr, buflen, "one type only");
+				snprintf(errstr, buflen, "one type only");
 				return (-1);
 			}
 			if (bsde_parse_type(argv[current+1], &type,
@@ -908,14 +897,14 @@ bsde_parse_object(int argc, char *argv[],
 			current += 2;
 		} else if (strcmp(argv[current], "!") == 0) {
 			if (nextnot) {
-				len = snprintf(errstr, buflen,
+				snprintf(errstr, buflen,
 				    "double negative'");
 				return (-1);
 			}
 			nextnot = 1;
 			current += 1;
 		} else {
-			len = snprintf(errstr, buflen, "'%s' not expected",
+			snprintf(errstr, buflen, "'%s' not expected",
 			    argv[current]);
 			return (-1);
 		}
@@ -946,16 +935,15 @@ int
 bsde_parse_mode(int argc, char *argv[], mode_t *mode, size_t buflen,
     char *errstr)
 {
-	size_t len;
 	int i;
 
 	if (argc == 0) {
-		len = snprintf(errstr, buflen, "mode expects mode value");
+		snprintf(errstr, buflen, "mode expects mode value");
 		return (-1);
 	}
 
 	if (argc != 1) {
-		len = snprintf(errstr, buflen, "'%s' unexpected", argv[1]);
+		snprintf(errstr, buflen, "'%s' unexpected", argv[1]);
 		return (-1);
 	}
 
@@ -981,10 +969,10 @@ bsde_parse_mode(int argc, char *argv[], mode_t *mode, 
 			/* ignore */
 			break;
 		default:
-			len = snprintf(errstr, buflen, "Unknown mode letter: %c",
+			snprintf(errstr, buflen, "Unknown mode letter: %c",
 			    argv[0][i]);
 			return (-1);
-		} 
+		}
 	}
 
 	return (0);
@@ -998,17 +986,16 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd
 	int object, object_elements, object_elements_length;
 	int mode, mode_elements, mode_elements_length;
 	int error, i;
-	size_t len;
 
 	bzero(rule, sizeof(*rule));
 
 	if (argc < 1) {
-		len = snprintf(errstr, buflen, "Rule must begin with subject");
+		snprintf(errstr, buflen, "Rule must begin with subject");
 		return (-1);
 	}
 
 	if (strcmp(argv[0], "subject") != 0) {
-		len = snprintf(errstr, buflen, "Rule must begin with subject");
+		snprintf(errstr, buflen, "Rule must begin with subject");
 		return (-1);
 	}
 	subject = 0;
@@ -1022,7 +1009,7 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd
 			object = i;
 
 	if (object == -1) {
-		len = snprintf(errstr, buflen, "Rule must contain an object");
+		snprintf(errstr, buflen, "Rule must contain an object");
 		return (-1);
 	}
 
@@ -1033,7 +1020,7 @@ bsde_parse_rule(int argc, char *argv[], struct mac_bsd
 			mode = i;
 
 	if (mode == -1) {
-		len = snprintf(errstr, buflen, "Rule must contain mode");
+		snprintf(errstr, buflen, "Rule must contain mode");
 		return (-1);
 	}
 
@@ -1112,12 +1099,12 @@ bsde_check_version(size_t buflen, char *errstr)
 	len = sizeof(version);
 	error = sysctlbyname(MIB ".rule_version", &version, &len, NULL, 0);
 	if (error) {
-		len = snprintf(errstr, buflen, "version check failed: %s",
+		snprintf(errstr, buflen, "version check failed: %s",
 		    strerror(errno));
 		return (-1);
 	}
 	if (version != MB_VERSION) {
-		len = snprintf(errstr, buflen, "module v%d != library v%d",
+		snprintf(errstr, buflen, "module v%d != library v%d",
 		    version, MB_VERSION);
 		return (-1);
 	}
@@ -1134,11 +1121,11 @@ bsde_get_rule_count(size_t buflen, char *errstr)
 	len = sizeof(rule_count);
 	error = sysctlbyname(MIB ".rule_count", &rule_count, &len, NULL, 0);
 	if (error) {
-		len = snprintf(errstr, buflen, "%s", strerror(errno));
+		snprintf(errstr, buflen, "%s", strerror(errno));
 		return (-1);
 	}
 	if (len != sizeof(rule_count)) {
-		len = snprintf(errstr, buflen, "Data error in %s.rule_count",
+		snprintf(errstr, buflen, "Data error in %s.rule_count",
 		    MIB);
 		return (-1);
 	}
@@ -1156,12 +1143,11 @@ bsde_get_rule_slots(size_t buflen, char *errstr)
 	len = sizeof(rule_slots);
 	error = sysctlbyname(MIB ".rule_slots", &rule_slots, &len, NULL, 0);
 	if (error) {
-		len = snprintf(errstr, buflen, "%s", strerror(errno));
+		snprintf(errstr, buflen, "%s", strerror(errno));
 		return (-1);
 	}
 	if (len != sizeof(rule_slots)) {
-		len = snprintf(errstr, buflen, "Data error in %s.rule_slots",
-		    MIB);
+		snprintf(errstr, buflen, "Data error in %s.rule_slots", MIB);
 		return (-1);
 	}
 
@@ -1187,7 +1173,7 @@ bsde_get_rule(int rulenum, struct mac_bsdextended_rule
 	len = 10;
 	error = bsde_get_mib(MIB ".rules", name, &len);
 	if (error) {
-		len = snprintf(errstr, errlen, "%s: %s", MIB ".rules",
+		snprintf(errstr, errlen, "%s: %s", MIB ".rules",
 		    strerror(errno));
 		return (-1);
 	}
@@ -1199,11 +1185,11 @@ bsde_get_rule(int rulenum, struct mac_bsdextended_rule
 	if (error  == -1 && errno == ENOENT)
 		return (-2);
 	if (error) {
-		len = snprintf(errstr, errlen, "%s.%d: %s", MIB ".rules",
+		snprintf(errstr, errlen, "%s.%d: %s", MIB ".rules",
 		    rulenum, strerror(errno));
 		return (-1);
 	} else if (size != sizeof(*rule)) {
-		len = snprintf(errstr, errlen, "Data error in %s.%d: %s",
+		snprintf(errstr, errlen, "Data error in %s.%d: %s",
 		    MIB ".rules", rulenum, strerror(errno));
 		return (-1);
 	}
@@ -1225,7 +1211,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *err
 	len = 10;
 	error = bsde_get_mib(MIB ".rules", name, &len);
 	if (error) {
-		len = snprintf(errstr, buflen, "%s: %s", MIB ".rules",
+		snprintf(errstr, buflen, "%s: %s", MIB ".rules",
 		    strerror(errno));
 		return (-1);
 	}
@@ -1235,7 +1221,7 @@ bsde_delete_rule(int rulenum, size_t buflen, char *err
 
 	error = sysctl(name, len, NULL, NULL, &rule, 0);
 	if (error) {
-		len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
+		snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
 		    rulenum, strerror(errno));
 		return (-1);
 	}
@@ -1257,7 +1243,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule
 	len = 10;
 	error = bsde_get_mib(MIB ".rules", name, &len);
 	if (error) {
-		len = snprintf(errstr, buflen, "%s: %s", MIB ".rules",
+		snprintf(errstr, buflen, "%s: %s", MIB ".rules",
 		    strerror(errno));
 		return (-1);
 	}
@@ -1267,7 +1253,7 @@ bsde_set_rule(int rulenum, struct mac_bsdextended_rule
 
 	error = sysctl(name, len, NULL, NULL, rule, sizeof(*rule));
 	if (error) {
-		len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
+		snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
 		    rulenum, strerror(errno));
 		return (-1);
 	}
@@ -1290,14 +1276,14 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rul
 	len = 10;
 	error = bsde_get_mib(MIB ".rules", name, &len);
 	if (error) {
-		len = snprintf(errstr, buflen, "%s: %s", MIB ".rules",
+		snprintf(errstr, buflen, "%s: %s", MIB ".rules",
 		    strerror(errno));
 		return (-1);
 	}
 
 	rule_slots = bsde_get_rule_slots(BUFSIZ, charstr);
 	if (rule_slots == -1) {
-		len = snprintf(errstr, buflen, "unable to get rule slots: %s",
+		snprintf(errstr, buflen, "unable to get rule slots: %s",
 		    strerror(errno));
 		return (-1);
 	}
@@ -1307,7 +1293,7 @@ bsde_add_rule(int *rulenum, struct mac_bsdextended_rul
 
 	error = sysctl(name, len, NULL, NULL, rule, sizeof(*rule));
 	if (error) {
-		len = snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
+		snprintf(errstr, buflen, "%s.%d: %s", MIB ".rules",
 		    rule_slots, strerror(errno));
 		return (-1);
 	}

Modified: projects/runtime-coverage/libexec/rtld-elf/libmap.c
==============================================================================
--- projects/runtime-coverage/libexec/rtld-elf/libmap.c	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/libexec/rtld-elf/libmap.c	Thu Oct 26 03:34:17 2017	(r325005)
@@ -100,6 +100,7 @@ lmc_parse_file(char *path)
 {
 	struct lmc *p;
 	struct stat st;
+	ssize_t retval;
 	int fd;
 	char *lm_map;
 
@@ -128,10 +129,11 @@ lmc_parse_file(char *path)
 		}
 	}
 
-	lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
-	if (lm_map == (const char *)MAP_FAILED) {
+	lm_map = xmalloc(st.st_size);
+	retval = read(fd, lm_map, st.st_size);
+	if (retval != st.st_size) {
 		close(fd);
-		dbg("lm_parse_file: mmap(\"%s\") failed, %s", path,
+		dbg("lm_parse_file: read(\"%s\") failed, %s", path,
 		    rtld_strerror(errno));
 		return;
 	}
@@ -142,7 +144,7 @@ lmc_parse_file(char *path)
 	p->ino = st.st_ino;
 	TAILQ_INSERT_HEAD(&lmc_head, p, next);
 	lmc_parse(lm_map, st.st_size);
-	munmap(lm_map, st.st_size);
+	free(lm_map);
 }
 
 static void

Modified: projects/runtime-coverage/libexec/rtld-elf/rtld.c
==============================================================================
--- projects/runtime-coverage/libexec/rtld-elf/rtld.c	Wed Oct 25 23:24:30 2017	(r325004)
+++ projects/runtime-coverage/libexec/rtld-elf/rtld.c	Thu Oct 26 03:34:17 2017	(r325005)
@@ -138,7 +138,7 @@ static int rtld_dirname(const char *, char *);
 static int rtld_dirname_abs(const char *, char *);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



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