svn commit: r277556 - in projects/building-blocks: . bin/freebsd-version cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensolaris/lib/libzpool/common/sys contrib/elftoolchain/common cont...

Garrett Cooper ngie at FreeBSD.org
Fri Jan 23 01:39:14 UTC 2015


Author: ngie
Date: Fri Jan 23 01:39:04 2015
New Revision: 277556
URL: https://svnweb.freebsd.org/changeset/base/277556

Log:
  MFhead @ r277555

Added:
  projects/building-blocks/etc/newsyslog.conf.d/
     - copied from r277555, head/etc/newsyslog.conf.d/
  projects/building-blocks/lib/libthr/arch/common/
     - copied from r277555, head/lib/libthr/arch/common/
  projects/building-blocks/lib/libthr/thread/thr_ctrdtr.c
     - copied unchanged from r277555, head/lib/libthr/thread/thr_ctrdtr.c
  projects/building-blocks/release/Makefile.vm
     - copied unchanged from r277555, head/release/Makefile.vm
  projects/building-blocks/release/scripts/mk-vmimage.sh
     - copied unchanged from r277555, head/release/scripts/mk-vmimage.sh
  projects/building-blocks/release/tools/gce.conf
     - copied unchanged from r277555, head/release/tools/gce.conf
  projects/building-blocks/release/tools/openstack.conf
     - copied unchanged from r277555, head/release/tools/openstack.conf
  projects/building-blocks/release/tools/vmimage.subr
     - copied unchanged from r277555, head/release/tools/vmimage.subr
  projects/building-blocks/sys/arm/arm/bus_space_base.c
     - copied unchanged from r277555, head/sys/arm/arm/bus_space_base.c
  projects/building-blocks/sys/dev/drm2/i915/i915_gem_stolen.c
     - copied unchanged from r277555, head/sys/dev/drm2/i915/i915_gem_stolen.c
  projects/building-blocks/sys/dev/drm2/i915/intel_ddi.c
     - copied unchanged from r277555, head/sys/dev/drm2/i915/intel_ddi.c
  projects/building-blocks/sys/dev/drm2/i915/intel_pm.c
     - copied unchanged from r277555, head/sys/dev/drm2/i915/intel_pm.c
Deleted:
  projects/building-blocks/lib/libthr/arch/amd64/amd64/pthread_md.c
  projects/building-blocks/lib/libthr/arch/arm/Makefile.inc
  projects/building-blocks/lib/libthr/arch/arm/arm/
  projects/building-blocks/lib/libthr/arch/i386/i386/pthread_md.c
  projects/building-blocks/lib/libthr/arch/mips/Makefile.inc
  projects/building-blocks/lib/libthr/arch/mips/mips/
  projects/building-blocks/lib/libthr/arch/powerpc/Makefile.inc
  projects/building-blocks/lib/libthr/arch/powerpc/powerpc/
  projects/building-blocks/lib/libthr/arch/sparc64/sparc64/pthread_md.c
  projects/building-blocks/release/amd64/mk-azure.sh
  projects/building-blocks/release/amd64/mk-vmimage.sh
  projects/building-blocks/release/i386/mk-azure.sh
  projects/building-blocks/release/i386/mk-vmimage.sh
  projects/building-blocks/sys/arm/arm/bus_space-v6.c
  projects/building-blocks/sys/arm/lpc/lpc_space.c
  projects/building-blocks/sys/arm/mv/bus_space.c
  projects/building-blocks/sys/arm/samsung/s3c2xx0/s3c2xx0_space.c
  projects/building-blocks/sys/arm/versatile/bus_space.c
  projects/building-blocks/sys/arm/versatile/versatile_pci_bus_space.c
  projects/building-blocks/sys/arm/versatile/versatile_pci_bus_space.h
  projects/building-blocks/sys/arm/xilinx/zy7_bus_space.c
  projects/building-blocks/sys/arm/xscale/i80321/obio_space.c
  projects/building-blocks/sys/arm/xscale/i8134x/obio_space.c
Modified:
  projects/building-blocks/Makefile.inc1
  projects/building-blocks/bin/freebsd-version/Makefile
  projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  projects/building-blocks/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
  projects/building-blocks/contrib/elftoolchain/common/elfdefinitions.h
  projects/building-blocks/contrib/elftoolchain/readelf/readelf.c
  projects/building-blocks/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
  projects/building-blocks/etc/Makefile
  projects/building-blocks/lib/libelftc/elftc_version.c
  projects/building-blocks/lib/libthr/Makefile
  projects/building-blocks/lib/libthr/arch/amd64/Makefile.inc
  projects/building-blocks/lib/libthr/arch/amd64/include/pthread_md.h
  projects/building-blocks/lib/libthr/arch/arm/include/pthread_md.h
  projects/building-blocks/lib/libthr/arch/i386/Makefile.inc
  projects/building-blocks/lib/libthr/arch/i386/include/pthread_md.h
  projects/building-blocks/lib/libthr/arch/mips/include/pthread_md.h
  projects/building-blocks/lib/libthr/arch/powerpc/include/pthread_md.h
  projects/building-blocks/lib/libthr/arch/sparc64/Makefile.inc
  projects/building-blocks/lib/libthr/arch/sparc64/include/pthread_md.h
  projects/building-blocks/lib/libthr/thread/Makefile.inc
  projects/building-blocks/lib/libthr/thread/thr_private.h
  projects/building-blocks/lib/libthr/thread/thr_sig.c
  projects/building-blocks/release/Makefile
  projects/building-blocks/release/release.conf.sample
  projects/building-blocks/release/release.sh
  projects/building-blocks/release/tools/azure.conf
  projects/building-blocks/share/man/man7/release.7
  projects/building-blocks/share/man/man9/Makefile
  projects/building-blocks/share/man/man9/device_get_softc.9
  projects/building-blocks/share/man/man9/timeout.9
  projects/building-blocks/share/misc/committers-ports.dot
  projects/building-blocks/sys/arm/allwinner/a20/files.a20
  projects/building-blocks/sys/arm/allwinner/files.a10
  projects/building-blocks/sys/arm/altera/socfpga/files.socfpga
  projects/building-blocks/sys/arm/arm/bus_space_asm_generic.S
  projects/building-blocks/sys/arm/arm/bus_space_generic.c
  projects/building-blocks/sys/arm/arm/locore-v4.S
  projects/building-blocks/sys/arm/arm/physmem.c
  projects/building-blocks/sys/arm/arm/trap-v6.c
  projects/building-blocks/sys/arm/at91/at91.c
  projects/building-blocks/sys/arm/at91/files.at91
  projects/building-blocks/sys/arm/broadcom/bcm2835/files.bcm2835
  projects/building-blocks/sys/arm/cavium/cns11xx/econa.c
  projects/building-blocks/sys/arm/cavium/cns11xx/files.econa
  projects/building-blocks/sys/arm/conf/RK3188
  projects/building-blocks/sys/arm/freescale/imx/files.imx51
  projects/building-blocks/sys/arm/freescale/imx/files.imx53
  projects/building-blocks/sys/arm/freescale/imx/files.imx6
  projects/building-blocks/sys/arm/freescale/imx/imx6_ccm.c
  projects/building-blocks/sys/arm/freescale/vybrid/files.vybrid
  projects/building-blocks/sys/arm/include/bus.h
  projects/building-blocks/sys/arm/include/cpu-v6.h
  projects/building-blocks/sys/arm/include/md_var.h
  projects/building-blocks/sys/arm/lpc/files.lpc
  projects/building-blocks/sys/arm/mv/files.mv
  projects/building-blocks/sys/arm/rockchip/files.rk30xx
  projects/building-blocks/sys/arm/samsung/exynos/files.exynos5
  projects/building-blocks/sys/arm/samsung/s3c2xx0/files.s3c2xx0
  projects/building-blocks/sys/arm/samsung/s3c2xx0/s3c24x0.c
  projects/building-blocks/sys/arm/samsung/s3c2xx0/s3c2xx0var.h
  projects/building-blocks/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c
  projects/building-blocks/sys/arm/ti/am335x/am335x_lcd.c
  projects/building-blocks/sys/arm/ti/files.ti
  projects/building-blocks/sys/arm/ti/ti_mbox.c
  projects/building-blocks/sys/arm/ti/ti_pruss.c
  projects/building-blocks/sys/arm/versatile/files.versatile
  projects/building-blocks/sys/arm/versatile/versatile_pci.c
  projects/building-blocks/sys/arm/xilinx/files.zynq7
  projects/building-blocks/sys/arm/xscale/i80321/ep80219_machdep.c
  projects/building-blocks/sys/arm/xscale/i80321/files.ep80219
  projects/building-blocks/sys/arm/xscale/i80321/files.i80219
  projects/building-blocks/sys/arm/xscale/i80321/files.i80321
  projects/building-blocks/sys/arm/xscale/i80321/files.iq31244
  projects/building-blocks/sys/arm/xscale/i80321/i80321_space.c
  projects/building-blocks/sys/arm/xscale/i80321/iq31244_machdep.c
  projects/building-blocks/sys/arm/xscale/i80321/obio.c
  projects/building-blocks/sys/arm/xscale/i80321/obiovar.h
  projects/building-blocks/sys/arm/xscale/i80321/uart_cpu_i80321.c
  projects/building-blocks/sys/arm/xscale/i8134x/crb_machdep.c
  projects/building-blocks/sys/arm/xscale/i8134x/files.i81342
  projects/building-blocks/sys/arm/xscale/i8134x/i81342_space.c
  projects/building-blocks/sys/arm/xscale/i8134x/obio.c
  projects/building-blocks/sys/arm/xscale/i8134x/obiovar.h
  projects/building-blocks/sys/arm/xscale/i8134x/uart_cpu_i81342.c
  projects/building-blocks/sys/arm/xscale/ixp425/avila_ata.c
  projects/building-blocks/sys/arm/xscale/ixp425/cambria_exp_space.c
  projects/building-blocks/sys/arm/xscale/ixp425/ixp425_a4x_space.c
  projects/building-blocks/sys/arm/xscale/ixp425/ixp425_pci_space.c
  projects/building-blocks/sys/arm/xscale/ixp425/ixp425_space.c
  projects/building-blocks/sys/arm/xscale/pxa/pxa_space.c
  projects/building-blocks/sys/boot/fdt/dts/arm/rk3188-radxa-lite.dts
  projects/building-blocks/sys/boot/fdt/dts/arm/rk3188-radxa.dts
  projects/building-blocks/sys/boot/fdt/dts/arm/rk3188.dtsi
  projects/building-blocks/sys/boot/i386/libi386/bootinfo64.c
  projects/building-blocks/sys/cam/cam_xpt.c
  projects/building-blocks/sys/cam/ctl/ctl.c
  projects/building-blocks/sys/cddl/compat/opensolaris/sys/sunddi.h
  projects/building-blocks/sys/cddl/compat/opensolaris/sys/time.h
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c
  projects/building-blocks/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  projects/building-blocks/sys/dev/dcons/dcons.c
  projects/building-blocks/sys/dev/dcons/dcons_crom.c
  projects/building-blocks/sys/dev/dcons/dcons_os.h
  projects/building-blocks/sys/dev/drm2/drm.h
  projects/building-blocks/sys/dev/drm2/drmP.h
  projects/building-blocks/sys/dev/drm2/drm_crtc.c
  projects/building-blocks/sys/dev/drm2/drm_crtc.h
  projects/building-blocks/sys/dev/drm2/drm_crtc_helper.c
  projects/building-blocks/sys/dev/drm2/drm_crtc_helper.h
  projects/building-blocks/sys/dev/drm2/drm_drv.c
  projects/building-blocks/sys/dev/drm2/drm_edid.c
  projects/building-blocks/sys/dev/drm2/drm_edid.h
  projects/building-blocks/sys/dev/drm2/drm_edid_modes.h
  projects/building-blocks/sys/dev/drm2/drm_fb_helper.c
  projects/building-blocks/sys/dev/drm2/drm_ioctl.c
  projects/building-blocks/sys/dev/drm2/drm_irq.c
  projects/building-blocks/sys/dev/drm2/drm_memory.c
  projects/building-blocks/sys/dev/drm2/drm_mode.h
  projects/building-blocks/sys/dev/drm2/drm_pciids.h
  projects/building-blocks/sys/dev/drm2/drm_stub.c
  projects/building-blocks/sys/dev/drm2/i915/i915_debug.c
  projects/building-blocks/sys/dev/drm2/i915/i915_dma.c
  projects/building-blocks/sys/dev/drm2/i915/i915_drm.h
  projects/building-blocks/sys/dev/drm2/i915/i915_drv.c
  projects/building-blocks/sys/dev/drm2/i915/i915_drv.h
  projects/building-blocks/sys/dev/drm2/i915/i915_gem.c
  projects/building-blocks/sys/dev/drm2/i915/i915_gem_context.c
  projects/building-blocks/sys/dev/drm2/i915/i915_gem_evict.c
  projects/building-blocks/sys/dev/drm2/i915/i915_gem_execbuffer.c
  projects/building-blocks/sys/dev/drm2/i915/i915_gem_gtt.c
  projects/building-blocks/sys/dev/drm2/i915/i915_gem_tiling.c
  projects/building-blocks/sys/dev/drm2/i915/i915_irq.c
  projects/building-blocks/sys/dev/drm2/i915/i915_reg.h
  projects/building-blocks/sys/dev/drm2/i915/i915_suspend.c
  projects/building-blocks/sys/dev/drm2/i915/intel_bios.c
  projects/building-blocks/sys/dev/drm2/i915/intel_crt.c
  projects/building-blocks/sys/dev/drm2/i915/intel_display.c
  projects/building-blocks/sys/dev/drm2/i915/intel_dp.c
  projects/building-blocks/sys/dev/drm2/i915/intel_drv.h
  projects/building-blocks/sys/dev/drm2/i915/intel_fb.c
  projects/building-blocks/sys/dev/drm2/i915/intel_hdmi.c
  projects/building-blocks/sys/dev/drm2/i915/intel_iic.c
  projects/building-blocks/sys/dev/drm2/i915/intel_lvds.c
  projects/building-blocks/sys/dev/drm2/i915/intel_modes.c
  projects/building-blocks/sys/dev/drm2/i915/intel_overlay.c
  projects/building-blocks/sys/dev/drm2/i915/intel_panel.c
  projects/building-blocks/sys/dev/drm2/i915/intel_ringbuffer.c
  projects/building-blocks/sys/dev/drm2/i915/intel_ringbuffer.h
  projects/building-blocks/sys/dev/drm2/i915/intel_sdvo.c
  projects/building-blocks/sys/dev/drm2/i915/intel_sprite.c
  projects/building-blocks/sys/dev/drm2/i915/intel_tv.c
  projects/building-blocks/sys/dev/drm2/radeon/atombios_encoders.c
  projects/building-blocks/sys/dev/drm2/radeon/radeon_legacy_encoders.c
  projects/building-blocks/sys/dev/firewire/firewire.c
  projects/building-blocks/sys/dev/firewire/fwmem.c
  projects/building-blocks/sys/dev/firewire/fwohci.c
  projects/building-blocks/sys/dev/hwpmc/hwpmc_core.c
  projects/building-blocks/sys/dev/hwpmc/pmc_events.h
  projects/building-blocks/sys/dev/isp/isp.c
  projects/building-blocks/sys/dev/isp/isp_freebsd.c
  projects/building-blocks/sys/dev/mii/mii.c
  projects/building-blocks/sys/dev/mmc/host/dwmmc.c
  projects/building-blocks/sys/dev/mmc/host/dwmmc.h
  projects/building-blocks/sys/dev/ofw/ofw_cpu.c
  projects/building-blocks/sys/dev/usb/controller/ehci_ixp4xx.c
  projects/building-blocks/sys/dev/usb/net/if_cdce.c
  projects/building-blocks/sys/dev/usb/usb_generic.c
  projects/building-blocks/sys/kern/init_main.c
  projects/building-blocks/sys/kern/kern_condvar.c
  projects/building-blocks/sys/kern/kern_descrip.c
  projects/building-blocks/sys/kern/kern_lock.c
  projects/building-blocks/sys/kern/kern_switch.c
  projects/building-blocks/sys/kern/kern_synch.c
  projects/building-blocks/sys/kern/kern_tc.c
  projects/building-blocks/sys/kern/kern_thread.c
  projects/building-blocks/sys/kern/kern_timeout.c
  projects/building-blocks/sys/kern/subr_dummy_vdso_tc.c
  projects/building-blocks/sys/kern/subr_sleepqueue.c
  projects/building-blocks/sys/kern/sys_pipe.c
  projects/building-blocks/sys/mips/include/cache_mipsNN.h
  projects/building-blocks/sys/mips/mips/cache.c
  projects/building-blocks/sys/mips/mips/cache_mipsNN.c
  projects/building-blocks/sys/modules/drm2/i915kms/Makefile
  projects/building-blocks/sys/net/ieee8023ad_lacp.c
  projects/building-blocks/sys/net/if_lagg.c
  projects/building-blocks/sys/net/pfvar.h
  projects/building-blocks/sys/netinet/ip_carp.c
  projects/building-blocks/sys/netinet/sctp_sysctl.c
  projects/building-blocks/sys/netpfil/pf/pf.c
  projects/building-blocks/sys/netpfil/pf/pf_if.c
  projects/building-blocks/sys/netpfil/pf/pf_ioctl.c
  projects/building-blocks/sys/netpfil/pf/pf_norm.c
  projects/building-blocks/sys/netpfil/pf/pf_table.c
  projects/building-blocks/sys/ofed/include/linux/completion.h
  projects/building-blocks/sys/powerpc/aim/locore64.S
  projects/building-blocks/sys/powerpc/aim/machdep.c
  projects/building-blocks/sys/powerpc/aim/mp_cpudep.c
  projects/building-blocks/sys/powerpc/aim/trap_subr64.S
  projects/building-blocks/sys/powerpc/include/trap.h
  projects/building-blocks/sys/powerpc/ofw/ofw_machdep.c
  projects/building-blocks/sys/powerpc/ofw/rtas.c
  projects/building-blocks/sys/powerpc/powerpc/elf64_machdep.c
  projects/building-blocks/sys/powerpc/powerpc/mem.c
  projects/building-blocks/sys/sys/_callout.h
  projects/building-blocks/sys/sys/callout.h
  projects/building-blocks/sys/sys/elf_common.h
  projects/building-blocks/sys/sys/param.h
  projects/building-blocks/sys/sys/pmc.h
  projects/building-blocks/sys/sys/proc.h
  projects/building-blocks/sys/sys/vdso.h
  projects/building-blocks/sys/x86/x86/tsc.c
  projects/building-blocks/sys/x86/xen/pv.c
  projects/building-blocks/tools/regression/file/flock/flock.c
  projects/building-blocks/tools/tools/nanobsd/nanobsd.sh   (contents, props changed)
  projects/building-blocks/usr.bin/grep/file.c
  projects/building-blocks/usr.sbin/pmcstudy/pmcstudy.c
Directory Properties:
  projects/building-blocks/   (props changed)
  projects/building-blocks/cddl/   (props changed)
  projects/building-blocks/cddl/contrib/opensolaris/   (props changed)
  projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  projects/building-blocks/contrib/elftoolchain/   (props changed)
  projects/building-blocks/contrib/llvm/   (props changed)
  projects/building-blocks/contrib/llvm/tools/clang/   (props changed)
  projects/building-blocks/etc/   (props changed)
  projects/building-blocks/share/   (props changed)
  projects/building-blocks/sys/   (props changed)
  projects/building-blocks/sys/boot/   (props changed)
  projects/building-blocks/sys/cddl/contrib/opensolaris/   (props changed)

Modified: projects/building-blocks/Makefile.inc1
==============================================================================
--- projects/building-blocks/Makefile.inc1	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/Makefile.inc1	Fri Jan 23 01:39:04 2015	(r277556)
@@ -1308,12 +1308,16 @@ ${_bt}-usr.bin/clang/clang-tblgen: ${_bt
 ${_bt}-usr.bin/clang/tblgen: ${_bt}-lib/clang/libllvmtablegen ${_bt}-lib/clang/libllvmsupport
 .endif
 
+# ELF Tool Chain libraries are needed for ELF tools and dtrace tools.
 # dtrace tools are required for older bootstrap env and cross-build
 # pre libdwarf
-.if ${MK_CDDL} != "no" && (${BOOTSTRAPPING} < 1100006 \
-      || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}))
-_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
-    lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
+.if ${BOOTSTRAPPING} < 1100006 || (${MACHINE} != ${TARGET} || \
+    ${MACHINE_ARCH} != ${TARGET_ARCH})
+_elftoolchain_libs= lib/libelf lib/libdwarf 
+.if ${MK_CDDL} != "no"
+_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf cddl/usr.bin/ctfconvert \
+    cddl/usr.bin/ctfmerge
+.endif
 .endif
 
 # Default to building the GPL DTC, but build the BSDL one if users explicitly
@@ -1344,6 +1348,7 @@ bootstrap-tools: .PHONY
 .for _tool in \
     ${_clang_tblgen} \
     ${_kerberos5_bootstrap_tools} \
+    ${_elftoolchain_libs} \
     ${_dtrace_tools} \
     ${_strfile} \
     ${_gperf} \
@@ -1451,7 +1456,6 @@ _binutils=	gnu/usr.bin/binutils
 .endif
 .if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
 _elftctools=	lib/libelftc \
-		usr.bin/addr2line \
 		usr.bin/elfcopy \
 		usr.bin/nm \
 		usr.bin/size \

Modified: projects/building-blocks/bin/freebsd-version/Makefile
==============================================================================
--- projects/building-blocks/bin/freebsd-version/Makefile	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/bin/freebsd-version/Makefile	Fri Jan 23 01:39:04 2015	(r277556)
@@ -11,7 +11,7 @@ freebsd-version.sh: ${.CURDIR}/freebsd-v
 			s/@@TYPE@@/$${TYPE}/g; \
 			s/@@REVISION@@/$${REVISION}/g; \
 			s/@@BRANCH@@/$${BRANCH}/g; \
-		" ${.ALLSRC} >${.TARGET} ; then \
+		" ${.CURDIR}/freebsd-version.sh.in >${.TARGET} ; then \
 		rm -f ${.TARGET} ; \
 		exit 1 ; \
 	fi

Modified: projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==============================================================================
--- projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Fri Jan 23 01:39:04 2015	(r277556)
@@ -18,10 +18,11 @@
  *
  * CDDL HEADER END
  */
+
 /*
+ * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright (c) 2013 by Delphix. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  */
 
 /*
@@ -198,8 +199,10 @@ fix_paths(nvlist_t *nv, name_entry_t *na
 	if ((devid = get_devid(best->ne_name)) == NULL) {
 		(void) nvlist_remove_all(nv, ZPOOL_CONFIG_DEVID);
 	} else {
-		if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0)
+		if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0) {
+			devid_str_free(devid);
 			return (-1);
+		}
 		devid_str_free(devid);
 	}
 
@@ -665,8 +668,10 @@ get_configs(libzfs_handle_t *hdl, pool_l
 				    nvlist_add_uint64(holey,
 				    ZPOOL_CONFIG_ID, c) != 0 ||
 				    nvlist_add_uint64(holey,
-				    ZPOOL_CONFIG_GUID, 0ULL) != 0)
+				    ZPOOL_CONFIG_GUID, 0ULL) != 0) {
+					nvlist_free(holey);
 					goto nomem;
+				}
 				child[c] = holey;
 			}
 		}
@@ -1118,8 +1123,10 @@ zpool_clear_label(int fd)
 
 	for (l = 0; l < VDEV_LABELS; l++) {
 		if (pwrite64(fd, label, sizeof (vdev_label_t),
-		    label_offset(size, l)) != sizeof (vdev_label_t))
+		    label_offset(size, l)) != sizeof (vdev_label_t)) {
+			free(label);
 			return (-1);
+		}
 	}
 
 	free(label);
@@ -1137,7 +1144,6 @@ static nvlist_t *
 zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
 {
 	int i, dirs = iarg->paths;
-	DIR *dirp = NULL;
 	struct dirent64 *dp;
 	char path[MAXPATHLEN];
 	char *end, **dir = iarg->path;
@@ -1167,6 +1173,8 @@ zpool_find_import_impl(libzfs_handle_t *
 		tpool_t *t;
 		char *rdsk;
 		int dfd;
+		boolean_t config_failed = B_FALSE;
+		DIR *dirp;
 
 		/* use realpath to normalize the path */
 		if (realpath(dir[i], path) == 0) {
@@ -1191,6 +1199,8 @@ zpool_find_import_impl(libzfs_handle_t *
 
 		if ((dfd = open64(rdsk, O_RDONLY)) < 0 ||
 		    (dirp = fdopendir(dfd)) == NULL) {
+			if (dfd >= 0)
+				(void) close(dfd);
 			zfs_error_aux(hdl, strerror(errno));
 			(void) zfs_error_fmt(hdl, EZFS_BADPATH,
 			    dgettext(TEXT_DOMAIN, "cannot open '%s'"),
@@ -1272,7 +1282,7 @@ skipdir:
 		cookie = NULL;
 		while ((slice = avl_destroy_nodes(&slice_cache,
 		    &cookie)) != NULL) {
-			if (slice->rn_config != NULL) {
+			if (slice->rn_config != NULL && !config_failed) {
 				nvlist_t *config = slice->rn_config;
 				boolean_t matched = B_TRUE;
 
@@ -1293,13 +1303,16 @@ skipdir:
 				}
 				if (!matched) {
 					nvlist_free(config);
-					config = NULL;
-					continue;
+				} else {
+					/*
+					 * use the non-raw path for the config
+					 */
+					(void) strlcpy(end, slice->rn_name,
+					    pathleft);
+					if (add_config(hdl, &pools, path,
+					    config) != 0)
+						config_failed = B_TRUE;
 				}
-				/* use the non-raw path for the config */
-				(void) strlcpy(end, slice->rn_name, pathleft);
-				if (add_config(hdl, &pools, path, config) != 0)
-					goto error;
 			}
 			free(slice->rn_name);
 			free(slice);
@@ -1307,7 +1320,9 @@ skipdir:
 		avl_destroy(&slice_cache);
 
 		(void) closedir(dirp);
-		dirp = NULL;
+
+		if (config_failed)
+			goto error;
 	}
 
 	ret = get_configs(hdl, &pools, iarg->can_be_active);
@@ -1330,14 +1345,10 @@ error:
 
 	for (ne = pools.names; ne != NULL; ne = nenext) {
 		nenext = ne->ne_next;
-		if (ne->ne_name)
-			free(ne->ne_name);
+		free(ne->ne_name);
 		free(ne);
 	}
 
-	if (dirp)
-		(void) closedir(dirp);
-
 	return (ret);
 }
 
@@ -1695,9 +1706,9 @@ zpool_in_use(libzfs_handle_t *hdl, int f
 		cb.cb_type = ZPOOL_CONFIG_SPARES;
 		if (zpool_iter(hdl, find_aux, &cb) == 1) {
 			name = (char *)zpool_get_name(cb.cb_zhp);
-			ret = TRUE;
+			ret = B_TRUE;
 		} else {
-			ret = FALSE;
+			ret = B_FALSE;
 		}
 		break;
 
@@ -1711,9 +1722,9 @@ zpool_in_use(libzfs_handle_t *hdl, int f
 		cb.cb_type = ZPOOL_CONFIG_L2CACHE;
 		if (zpool_iter(hdl, find_aux, &cb) == 1) {
 			name = (char *)zpool_get_name(cb.cb_zhp);
-			ret = TRUE;
+			ret = B_TRUE;
 		} else {
-			ret = FALSE;
+			ret = B_FALSE;
 		}
 		break;
 

Modified: projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Fri Jan 23 01:39:04 2015	(r277556)
@@ -20,8 +20,8 @@
  */
 
 /*
+ * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
  * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
  * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  */
@@ -1715,7 +1715,7 @@ zpool_import_props(libzfs_handle_t *hdl,
 		thename = origname;
 	}
 
-	if (props) {
+	if (props != NULL) {
 		uint64_t version;
 		prop_flags_t flags = { .create = B_FALSE, .import = B_TRUE };
 
@@ -1723,12 +1723,13 @@ zpool_import_props(libzfs_handle_t *hdl,
 		    &version) == 0);
 
 		if ((props = zpool_valid_proplist(hdl, origname,
-		    props, version, flags, errbuf)) == NULL) {
+		    props, version, flags, errbuf)) == NULL)
 			return (-1);
-		} else if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
+		if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
 			nvlist_free(props);
 			return (-1);
 		}
+		nvlist_free(props);
 	}
 
 	(void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name));
@@ -1737,11 +1738,11 @@ zpool_import_props(libzfs_handle_t *hdl,
 	    &zc.zc_guid) == 0);
 
 	if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) {
-		nvlist_free(props);
+		zcmd_free_nvlists(&zc);
 		return (-1);
 	}
 	if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) {
-		nvlist_free(props);
+		zcmd_free_nvlists(&zc);
 		return (-1);
 	}
 
@@ -1757,6 +1758,9 @@ zpool_import_props(libzfs_handle_t *hdl,
 		error = errno;
 
 	(void) zcmd_read_dst_nvlist(hdl, &zc, &nv);
+
+	zcmd_free_nvlists(&zc);
+
 	zpool_get_rewind_policy(config, &policy);
 
 	if (error) {
@@ -1862,9 +1866,6 @@ zpool_import_props(libzfs_handle_t *hdl,
 		return (0);
 	}
 
-	zcmd_free_nvlists(&zc);
-	nvlist_free(props);
-
 	return (ret);
 }
 
@@ -3332,8 +3333,10 @@ devid_to_path(char *devid_str)
 	if (ret != 0)
 		return (NULL);
 
-	if ((path = strdup(list[0].devname)) == NULL)
-		return (NULL);
+	/*
+	 * In a case the strdup() fails, we will just return NULL below.
+	 */
+	path = strdup(list[0].devname);
 
 	devid_free_nmlist(list);
 

Modified: projects/building-blocks/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
==============================================================================
--- projects/building-blocks/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -535,7 +535,7 @@ extern vnode_t *rootdir;
 extern void delay(clock_t ticks);
 
 #define	SEC_TO_TICK(sec)	((sec) * hz)
-#define	NSEC_TO_TICK(usec)	((usec) / (NANOSEC / hz))
+#define	NSEC_TO_TICK(nsec)	((nsec) / (NANOSEC / hz))
 
 #define	gethrestime_sec() time(NULL)
 #define	gethrestime(t) \

Modified: projects/building-blocks/contrib/elftoolchain/common/elfdefinitions.h
==============================================================================
--- projects/building-blocks/contrib/elftoolchain/common/elfdefinitions.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/contrib/elftoolchain/common/elfdefinitions.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -1948,11 +1948,17 @@ _ELF_DEFINE_RELOC(R_X86_64_TPOFF32,	23)	
 _ELF_DEFINE_RELOC(R_X86_64_PC64,	24)	\
 _ELF_DEFINE_RELOC(R_X86_64_GOTOFF64,	25)	\
 _ELF_DEFINE_RELOC(R_X86_64_GOTPC32,	26)	\
+_ELF_DEFINE_RELOC(R_X86_64_GOT64,	27)	\
+_ELF_DEFINE_RELOC(R_X86_64_GOTPCREL64,	28)	\
+_ELF_DEFINE_RELOC(R_X86_64_GOTPC64,	29)	\
+_ELF_DEFINE_RELOC(R_X86_64_GOTPLT64,	30)	\
+_ELF_DEFINE_RELOC(R_X86_64_PLTOFF64,	31)	\
 _ELF_DEFINE_RELOC(R_X86_64_SIZE32,	32)	\
 _ELF_DEFINE_RELOC(R_X86_64_SIZE64,	33)	\
 _ELF_DEFINE_RELOC(R_X86_64_GOTPC32_TLSDESC, 34)	\
 _ELF_DEFINE_RELOC(R_X86_64_TLSDESC_CALL, 35)	\
-_ELF_DEFINE_RELOC(R_X86_64_TLSDESC,	36)
+_ELF_DEFINE_RELOC(R_X86_64_TLSDESC,	36)	\
+_ELF_DEFINE_RELOC(R_X86_64_IRELATIVE,	37)
 
 #define	_ELF_DEFINE_RELOCATIONS()		\
 _ELF_DEFINE_386_RELOCATIONS()			\

Modified: projects/building-blocks/contrib/elftoolchain/readelf/readelf.c
==============================================================================
--- projects/building-blocks/contrib/elftoolchain/readelf/readelf.c	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/contrib/elftoolchain/readelf/readelf.c	Fri Jan 23 01:39:04 2015	(r277556)
@@ -1480,6 +1480,20 @@ r_type(unsigned int mach, unsigned int t
 		case 21: return "R_X86_64_DTPOFF32";
 		case 22: return "R_X86_64_GOTTPOFF";
 		case 23: return "R_X86_64_TPOFF32";
+		case 24: return "R_X86_64_PC64";
+		case 25: return "R_X86_64_GOTOFF64";
+		case 26: return "R_X86_64_GOTPC32";
+		case 27: return "R_X86_64_GOT64";
+		case 28: return "R_X86_64_GOTPCREL64";
+		case 29: return "R_X86_64_GOTPC64";
+		case 30: return "R_X86_64_GOTPLT64";
+		case 31: return "R_X86_64_PLTOFF64";
+		case 32: return "R_X86_64_SIZE32";
+		case 33: return "R_X86_64_SIZE64";
+		case 34: return "R_X86_64_GOTPC32_TLSDESC";
+		case 35: return "R_X86_64_TLSDESC_CALL";
+		case 36: return "R_X86_64_TLSDESC";
+		case 37: return "R_X86_64_IRELATIVE";
 		default: return "";
 		}
 	default: return "";

Modified: projects/building-blocks/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
==============================================================================
--- projects/building-blocks/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/contrib/llvm/tools/clang/lib/Driver/Tools.cpp	Fri Jan 23 01:39:04 2015	(r277556)
@@ -6587,6 +6587,17 @@ void freebsd::Link::ConstructJob(Compila
     CmdArgs.push_back("elf32ppc_fbsd");
   }
 
+  if (Arg *A = Args.getLastArg(options::OPT_G)) {
+    if (ToolChain.getArch() == llvm::Triple::mips ||
+      ToolChain.getArch() == llvm::Triple::mipsel ||
+      ToolChain.getArch() == llvm::Triple::mips64 ||
+      ToolChain.getArch() == llvm::Triple::mips64el) {
+      StringRef v = A->getValue();
+      CmdArgs.push_back(Args.MakeArgString("-G" + v));
+      A->claim();
+    }
+  }
+
   if (Output.isFilename()) {
     CmdArgs.push_back("-o");
     CmdArgs.push_back(Output.getFilename());

Modified: projects/building-blocks/etc/Makefile
==============================================================================
--- projects/building-blocks/etc/Makefile	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/etc/Makefile	Fri Jan 23 01:39:04 2015	(r277556)
@@ -3,8 +3,11 @@
 
 .include <src.opts.mk>
 
+SUBDIR=	\
+	newsyslog.conf.d
+
 .if ${MK_SENDMAIL} != "no"
-SUBDIR=	sendmail
+SUBDIR+=sendmail
 .endif
 
 .if ${MK_TESTS} != "no"

Modified: projects/building-blocks/lib/libelftc/elftc_version.c
==============================================================================
--- projects/building-blocks/lib/libelftc/elftc_version.c	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libelftc/elftc_version.c	Fri Jan 23 01:39:04 2015	(r277556)
@@ -6,5 +6,5 @@
 const char *
 elftc_version(void)
 {
-	return "libelftc r3130";
+	return "elftoolchain r3136M";
 }

Modified: projects/building-blocks/lib/libthr/Makefile
==============================================================================
--- projects/building-blocks/lib/libthr/Makefile	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/Makefile	Fri Jan 23 01:39:04 2015	(r277556)
@@ -45,7 +45,9 @@ PRECIOUSLIB=
 
 .PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
 
+.if exists(${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc)
 .include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
+.endif
 .include "${.CURDIR}/sys/Makefile.inc"
 .include "${.CURDIR}/thread/Makefile.inc"
 

Modified: projects/building-blocks/lib/libthr/arch/amd64/Makefile.inc
==============================================================================
--- projects/building-blocks/lib/libthr/arch/amd64/Makefile.inc	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/amd64/Makefile.inc	Fri Jan 23 01:39:04 2015	(r277556)
@@ -1,3 +1,3 @@
 #$FreeBSD$
 
-SRCS+=	pthread_md.c _umtx_op_err.S
+SRCS+=	_umtx_op_err.S

Modified: projects/building-blocks/lib/libthr/arch/amd64/include/pthread_md.h
==============================================================================
--- projects/building-blocks/lib/libthr/arch/amd64/include/pthread_md.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/amd64/include/pthread_md.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -77,9 +77,6 @@ struct tcb {
 	__result;						\
 })
 
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *tcb);
-
 static __inline void
 _tcb_set(struct tcb *tcb)
 {

Modified: projects/building-blocks/lib/libthr/arch/arm/include/pthread_md.h
==============================================================================
--- projects/building-blocks/lib/libthr/arch/arm/include/pthread_md.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/arm/include/pthread_md.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -47,12 +47,6 @@ struct tcb {
 	struct pthread		*tcb_thread;	/* our hook */
 };
 
-/*
- * The tcb constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-
 /* Called from the thread to set its private data. */
 static __inline void
 _tcb_set(struct tcb *tcb)

Modified: projects/building-blocks/lib/libthr/arch/i386/Makefile.inc
==============================================================================
--- projects/building-blocks/lib/libthr/arch/i386/Makefile.inc	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/i386/Makefile.inc	Fri Jan 23 01:39:04 2015	(r277556)
@@ -1,3 +1,3 @@
 # $FreeBSD$
 
-SRCS+=	pthread_md.c _umtx_op_err.S
+SRCS+=	_umtx_op_err.S

Modified: projects/building-blocks/lib/libthr/arch/i386/include/pthread_md.h
==============================================================================
--- projects/building-blocks/lib/libthr/arch/i386/include/pthread_md.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/i386/include/pthread_md.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -76,12 +76,6 @@ struct tcb {
 	__result;						\
 })
 
-/*
- * The constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *tcb);
-
 /* Called from the thread to set its private data. */
 static __inline void
 _tcb_set(struct tcb *tcb)

Modified: projects/building-blocks/lib/libthr/arch/mips/include/pthread_md.h
==============================================================================
--- projects/building-blocks/lib/libthr/arch/mips/include/pthread_md.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/mips/include/pthread_md.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -50,12 +50,6 @@ struct tcb {
 	struct pthread		*tcb_thread;
 };
 
-/*
- * The tcb constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-
 /* Called from the thread to set its private data. */
 static __inline void
 _tcb_set(struct tcb *tcb)

Modified: projects/building-blocks/lib/libthr/arch/powerpc/include/pthread_md.h
==============================================================================
--- projects/building-blocks/lib/libthr/arch/powerpc/include/pthread_md.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/powerpc/include/pthread_md.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -55,9 +55,6 @@ struct tcb {
 	struct pthread		*tcb_thread;
 };
 
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-
 static __inline void
 _tcb_set(struct tcb *tcb)
 {

Modified: projects/building-blocks/lib/libthr/arch/sparc64/Makefile.inc
==============================================================================
--- projects/building-blocks/lib/libthr/arch/sparc64/Makefile.inc	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/sparc64/Makefile.inc	Fri Jan 23 01:39:04 2015	(r277556)
@@ -1,3 +1,3 @@
 # $FreeBSD$
 
-SRCS+=	_umtx_op_err.S pthread_md.c
+SRCS+=	_umtx_op_err.S

Modified: projects/building-blocks/lib/libthr/arch/sparc64/include/pthread_md.h
==============================================================================
--- projects/building-blocks/lib/libthr/arch/sparc64/include/pthread_md.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/arch/sparc64/include/pthread_md.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -50,12 +50,6 @@ struct tcb {
 	void			*tcb_spare[1];
 };
 
-/*
- * The tcb constructors.
- */
-struct tcb	*_tcb_ctor(struct pthread *, int);
-void		_tcb_dtor(struct tcb *);
-
 /* Called from the thread to set its private data. */
 static __inline void
 _tcb_set(struct tcb *tcb)

Modified: projects/building-blocks/lib/libthr/thread/Makefile.inc
==============================================================================
--- projects/building-blocks/lib/libthr/thread/Makefile.inc	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/thread/Makefile.inc	Fri Jan 23 01:39:04 2015	(r277556)
@@ -14,6 +14,7 @@ SRCS+= \
 	thr_cond.c \
 	thr_condattr.c \
 	thr_create.c \
+	thr_ctrdtr.c \
 	thr_detach.c \
 	thr_equal.c \
 	thr_event.c \

Copied: projects/building-blocks/lib/libthr/thread/thr_ctrdtr.c (from r277555, head/lib/libthr/thread/thr_ctrdtr.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/building-blocks/lib/libthr/thread/thr_ctrdtr.c	Fri Jan 23 01:39:04 2015	(r277556, copy of r277555, head/lib/libthr/thread/thr_ctrdtr.c)
@@ -0,0 +1,56 @@
+/*-
+ * Copyright (C) 2003 Jake Burkholder <jake at freebsd.org>
+ * Copyright (C) 2003 David Xu <davidxu at freebsd.org>
+ * Copyright (c) 2001,2003 Daniel Eischen <deischen at freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Neither the name of the author nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <rtld_tls.h>
+
+#include "thr_private.h"
+
+struct tcb *
+_tcb_ctor(struct pthread *thread, int initial)
+{
+	struct tcb *tcb;
+
+	if (initial)
+		tcb = _tcb_get();
+	else
+		tcb = _rtld_allocate_tls(NULL, sizeof(struct tcb), 16);
+	if (tcb)
+		tcb->tcb_thread = thread;
+	return (tcb);
+}
+
+void
+_tcb_dtor(struct tcb *tcb)
+{
+
+	_rtld_free_tls(tcb, sizeof(struct tcb), 16);
+}

Modified: projects/building-blocks/lib/libthr/thread/thr_private.h
==============================================================================
--- projects/building-blocks/lib/libthr/thread/thr_private.h	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/thread/thr_private.h	Fri Jan 23 01:39:04 2015	(r277556)
@@ -928,6 +928,9 @@ int __thr_sigwait(const sigset_t *set, i
 int __thr_sigwaitinfo(const sigset_t *set, siginfo_t *info);
 int __thr_swapcontext(ucontext_t *oucp, const ucontext_t *ucp);
 
+struct tcb *_tcb_ctor(struct pthread *, int);
+void	_tcb_dtor(struct tcb *);
+
 __END_DECLS
 
 #endif  /* !_THR_PRIVATE_H */

Modified: projects/building-blocks/lib/libthr/thread/thr_sig.c
==============================================================================
--- projects/building-blocks/lib/libthr/thread/thr_sig.c	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/lib/libthr/thread/thr_sig.c	Fri Jan 23 01:39:04 2015	(r277556)
@@ -604,7 +604,8 @@ __weak_reference(_pthread_sigmask, pthre
 int
 _pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
 {
-	if (_sigprocmask(how, set, oset))
+
+	if (__thr_sigprocmask(how, set, oset))
 		return (errno);
 	return (0);
 }

Modified: projects/building-blocks/release/Makefile
==============================================================================
--- projects/building-blocks/release/Makefile	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/release/Makefile	Fri Jan 23 01:39:04 2015	(r277556)
@@ -8,8 +8,13 @@
 #  memstick: Builds memory stick image (memstick.img)
 #  mini-memstick: Builds minimal memory stick image (mini-memstick.img)
 #  ftp: Sets up FTP distribution area (ftp)
-#  release: Build all media and FTP distribution area
-#  install: Copies all release media into ${DESTDIR}
+#  release: Invokes real-release, vm-release, and cloudware-release targets
+#  real-release: Build all media and FTP distribution area
+#  vm-release: Build all virtual machine image targets
+#  cloudware-release: Build all cloud hosting provider targets
+#  install: Invokes the release-install and vm-install targets
+#  release-install: Copies all release installation media into ${DESTDIR}
+#  vm-install: Copies all virtual machine images into ${DESTDIR}
 #
 # Variables affecting the build process:
 #  WORLDDIR: location of src tree -- must have built world and default kernel
@@ -26,6 +31,7 @@
 #  WITH_VMIMAGES: if set, build virtual machine images with the release
 #  WITH_COMPRESSED_VMIMAGES: if set, compress virtual machine disk images
 #  		with xz(1) (extremely time consuming)
+#  WITH_CLOUDWARE: if set, build cloud hosting disk images with the release
 #  TARGET/TARGET_ARCH: architecture of built release
 #
 
@@ -103,12 +109,6 @@ IMAGES+=	memstick.img
 IMAGES+=	mini-memstick.img
 .endif
 
-VMTARGETS=	vm-base vm-image
-VMFORMATS?=	vhd vmdk qcow2 raw
-VMSIZE?=	20G
-VMBASE?=	vm
-AZURECONF?=	${.CURDIR}/tools/azure.conf
-
 CLEANFILES=	packagesystem *.txz MANIFEST system ${IMAGES}
 .if defined(WITH_COMPRESSED_IMAGES) && !empty(WITH_COMPRESSED_IMAGES)
 . for I in ${IMAGES}
@@ -118,22 +118,7 @@ CLEANFILES+=	${I}.xz
 .if defined(WITH_DVD) && !empty(WITH_DVD)
 CLEANFILES+=	pkg-stage
 .endif
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-CLEANFILES+=	${VMBASE}.img
-. for FORMAT in ${VMFORMATS}
-CLEANFILES+=	${VMBASE}.${FORMAT}
-. endfor
-.endif
 CLEANDIRS=	dist ftp release bootonly dvd
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-CLEANDIRS+=	${VMTARGETS}
-.endif
-.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
-CLEANFILES+=	${OSRELEASE}.vhd \
-		${OSRELEASE}.vhd.raw \
-		azure.img
-CLEANDIRS+=	vm-azure
-.endif
 beforeclean:
 	chflags -R noschg .
 .include <bsd.obj.mk>
@@ -293,14 +278,15 @@ ftp: packagesystem
 	mkdir -p ftp
 	cp *.txz MANIFEST ftp
 
-release:
+release:	real-release vm-release cloudware-release
+
+real-release:
 	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
 	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
-.endif
 
-install:
+install:	release-install vm-install
+
+release-install:
 .if defined(DESTDIR) && !empty(DESTDIR)
 	mkdir -p ${DESTDIR}
 .endif
@@ -313,52 +299,5 @@ install:
 .endfor
 	cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256
 	cd ${DESTDIR} && md5 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.MD5
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-	mkdir -p ${DESTDIR}/vmimages
-. for FORMAT in ${VMFORMATS}
-	cp -p ${VMBASE}.${FORMAT} \
-		${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
-. endfor
-. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
-# This is very time consuming, so defer it after the images are moved to
-# the DESTDIR.
-.  for FORMAT in ${VMFORMATS}
-	# Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
-	${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
-.  endfor
-. endif
-	cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
-		${DESTDIR}/vmimages/CHECKSUM.SHA256
-	cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \
-		${DESTDIR}/vmimages/CHECKSUM.MD5
-.endif
 
-vm-base:
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
-	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-		${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
-		${VMBASE}.img ${WORLDDIR} ${.OBJDIR}/${.TARGET} ${VMSIZE}
-. endif
-.endif
-	touch ${.TARGET}
-
-vm-image: vm-base
-.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
-. if exists(${.CURDIR}/${TARGET}/mk-vmimage.sh)
-.  for FORMAT in ${VMFORMATS}
-	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
-		${.CURDIR}/${TARGET}/mk-vmimage.sh ${.TARGET} \
-		${VMBASE}.img ${FORMAT} ${VMBASE}.${FORMAT}
-.  endfor
-. endif
-.endif
-	touch ${.TARGET}
-
-vm-azure:
-.if exists(${.CURDIR}/${TARGET}/mk-azure.sh)
-	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} AZURECONF=${AZURECONF} \
-		${.CURDIR}/${TARGET}/mk-azure.sh ${.TARGET} azure.img \
-		${WORLDDIR} ${.TARGET} ${VMSIZE} ${OSRELEASE}.vhd
-.endif
-	touch ${.TARGET}
+.include "${.CURDIR}/Makefile.vm"

Copied: projects/building-blocks/release/Makefile.vm (from r277555, head/release/Makefile.vm)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/building-blocks/release/Makefile.vm	Fri Jan 23 01:39:04 2015	(r277556, copy of r277555, head/release/Makefile.vm)
@@ -0,0 +1,121 @@
+#
+# $FreeBSD$
+#
+#
+# Makefile for building virtual machine and cloud provider disk images.
+#
+
+VMTARGETS=	vm-image
+VMFORMATS?=	vhd vmdk qcow2 raw
+VMSIZE?=	20G
+VMBASE?=	vm
+
+VHD_DESC=	Azure, VirtualPC, Hyper-V, Xen disk image
+VMDK_DESC=	VMWare, VirtualBox disk image
+QCOW2_DESC=	Qemu, KVM disk image
+RAW_DESC=	Unformatted raw disk image
+
+CLOUDWARE?=	AZURE \
+		GCE \
+		OPENSTACK
+AZURE_FORMAT=	vhdf
+AZURE_DESC=	Microsoft Azure platform image
+GCE_FORMAT=	raw
+GCE_DESC=	Google Compute Engine image
+OPENSTACK_FORMAT=qcow2
+OPENSTACK_DESC=	OpenStack platform image
+
+.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
+. for _CW in ${CLOUDWARE}
+CLOUDTARGETS+=	vm-${_CW:tl}
+CLEANDIRS+=	vm-${_CW:tl}
+CLEANFILES+=	${_CW:tl}.img \
+		${_CW:tl}.${${_CW:tu}_FORMAT} \
+		${_CW:tl}.${${_CW:tu}_FORMAT}.raw
+${_CW:tu}IMAGE=	${_CW:tl}.${${_CW:tu}_FORMAT}
+.  if exists(${.CURDIR}/tools/${_CW:tl}.conf) && !defined(${_CW:tu}CONF)
+${_CW:tu}CONF?=	${.CURDIR}/tools/${_CW:tl}.conf
+.  endif
+
+vm-${_CW:tl}:
+	mkdir -p ${.OBJDIR}/${.TARGET}
+	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+		${.CURDIR}/scripts/mk-vmimage.sh \
+		-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
+		-i ${.OBJDIR}/${_CW:tl}.img -s ${VMSIZE} -f ${${_CW}_FORMAT} \
+		-S ${WORLDDIR} -o ${.OBJDIR}/${${_CW}IMAGE} -c ${${_CW}CONF}
+	touch ${.TARGET}
+. endfor
+.endif
+
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+CLEANDIRS+=	${VMTARGETS}
+CLEANFILES+=	${VMBASE}.img
+. for FORMAT in ${VMFORMATS}
+CLEANFILES+=	${VMBASE}.${FORMAT}
+. endfor
+.endif
+
+vm-base:	vm-image
+
+vm-image:
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+. for FORMAT in ${VMFORMATS}
+	mkdir -p ${.OBJDIR}/${.TARGET}
+	env TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
+		${.CURDIR}/scripts/mk-vmimage.sh \
+		-C ${.CURDIR}/tools/vmimage.subr -d ${.OBJDIR}/${.TARGET} \
+		-i ${.OBJDIR}/${VMBASE}.img -s ${VMSIZE} -f ${FORMAT} \
+		-S ${WORLDDIR} -o ${.OBJDIR}/${VMBASE}.${FORMAT}
+. endfor
+.endif
+	touch ${.TARGET}
+
+vm-cloudware:	${CLOUDTARGETS}
+
+list-vmtargets:	list-cloudware
+	@${ECHO}
+	@${ECHO} "Supported virtual machine disk image formats:"
+.for FORMAT in ${VMFORMATS:tu}
+	@${ECHO} "  ${FORMAT:tl}: ${${FORMAT}_DESC}"
+.endfor
+
+list-cloudware:
+.if !empty(CLOUDWARE)
+	@${ECHO}
+	@${ECHO} "Supported cloud hosting provider images:"
+. for _CW in ${CLOUDWARE}
+	@${ECHO} "  ${_CW:tu}: ${${_CW:tu}_DESC}"
+. endfor
+.endif
+
+vm-install:
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+	mkdir -p ${DESTDIR}/vmimages
+. for FORMAT in ${VMFORMATS}
+	cp -p ${VMBASE}.${FORMAT} \
+		${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
+. endfor
+. if defined(WITH_COMPRESSED_VMIMAGES) && !empty(WITH_COMPRESSED_VMIMAGES)
+# This is very time consuming, so defer it after the images are moved to
+# the DESTDIR.
+.  for FORMAT in ${VMFORMATS}
+	# Don't keep the originals.  There is a copy in ${.OBJDIR} if needed.
+	${XZCMD} ${DESTDIR}/vmimages/${OSRELEASE}.${FORMAT}
+.  endfor
+. endif
+	cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
+		${DESTDIR}/vmimages/CHECKSUM.SHA256
+	cd ${DESTDIR}/vmimages && md5 ${OSRELEASE}* > \
+		${DESTDIR}/vmimages/CHECKSUM.MD5
+.endif
+
+vm-release:
+.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
+	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${VMTARGETS}
+.endif
+
+cloudware-release:
+.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
+	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDTARGETS}
+.endif

Modified: projects/building-blocks/release/release.conf.sample
==============================================================================
--- projects/building-blocks/release/release.conf.sample	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/release/release.conf.sample	Fri Jan 23 01:39:04 2015	(r277556)
@@ -98,3 +98,11 @@ PORTBRANCH="ports/head at rHEAD"
 ## image formats to create.  Valid values are listed in the mkimg(1)
 ## manual page, as well as 'mkimg --formats' output.
 #VMFORMATS="vhdf vmdk qcow2 raw"
+
+## Set to a non-empty value to build virtual machine images for various
+## cloud providers as part of the release build.
+#WITH_CLOUDWARE=
+
+## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers
+## to create disk images.
+#CLOUDWARE="AZURE OPENSTACK"

Modified: projects/building-blocks/release/release.sh
==============================================================================
--- projects/building-blocks/release/release.sh	Fri Jan 23 01:18:08 2015	(r277555)
+++ projects/building-blocks/release/release.sh	Fri Jan 23 01:39:04 2015	(r277556)
@@ -94,6 +94,10 @@ WITH_COMPRESSED_IMAGES=
 WITH_VMIMAGES=
 WITH_COMPRESSED_VMIMAGES=
 
+# Set to non-empty value to build virtual machine images for various
+# cloud providers as part of the release.
+WITH_CLOUDWARE=
+
 usage() {
 	echo "Usage: $0 [-c release.conf]"
 	exit 1
@@ -174,7 +178,8 @@ CHROOT_DMAKEFLAGS="${CONF_FILES}"
 RELEASE_WMAKEFLAGS="${MAKE_FLAGS} ${WORLD_FLAGS} ${ARCH_FLAGS} ${CONF_FILES}"
 RELEASE_KMAKEFLAGS="${MAKE_FLAGS} ${KERNEL_FLAGS} KERNCONF=\"${KERNEL}\" ${ARCH_FLAGS} ${CONF_FILES}"
 RELEASE_RMAKEFLAGS="${ARCH_FLAGS} KERNCONF=\"${KERNEL}\" ${CONF_FILES} \
-	${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES}"
+	${DOCPORTS} WITH_DVD=${WITH_DVD} WITH_VMIMAGES=${WITH_VMIMAGES} \
+	WITH_CLOUDWARE=${WITH_CLOUDWARE}"
 
 # Force src checkout if configured
 FORCE_SRC_KEY=

Copied: projects/building-blocks/release/scripts/mk-vmimage.sh (from r277555, head/release/scripts/mk-vmimage.sh)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/building-blocks/release/scripts/mk-vmimage.sh	Fri Jan 23 01:39:04 2015	(r277556, copy of r277555, head/release/scripts/mk-vmimage.sh)
@@ -0,0 +1,111 @@
+#!/bin/sh
+#-
+# Copyright (c) 2014 The FreeBSD Foundation
+# All rights reserved.
+#
+# This software was developed by Glen Barber under sponsorship
+# from the FreeBSD Foundation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# mk-vmimage.sh: Create virtual machine disk images in various formats.
+#
+# $FreeBSD$
+#
+
+usage() {
+	echo "${0} usage:"
+	echo "${@}"
+	return 1
+}
+
+main() {
+	local arg
+	while getopts "C:c:d:f:i:o:s:S:" arg; do
+		case "${arg}" in
+			C)
+				VMBUILDCONF="${OPTARG}"
+				;;
+			c)
+				VMCONFIG="${OPTARG}"
+				;;
+			d)
+				DESTDIR="${OPTARG}"
+				;;
+			f)
+				VMFORMAT="${OPTARG}"
+				;;
+			i)
+				VMBASE="${OPTARG}"
+				;;
+			o)
+				VMIMAGE="${OPTARG}"
+				;;
+			s)
+				VMSIZE="${OPTARG}"
+				;;
+			S)
+				WORLDDIR="${OPTARG}"
+				;;
+			*)
+				;;
+		esac
+	done
+	shift $(( ${OPTIND} - 1))
+
+	if [ -z "${VMBASE}" -o \
+		-z "${WORLDDIR}" -o \
+		-z "${DESTDIR}" -o \
+		-z "${VMSIZE}" -o \
+		-z "${VMIMAGE}" -o \
+		-z "${VMCONFIG}" ];
+	then
+		usage
+	fi
+
+	if [ -z "${VMBUILDCONF}" ] || [ ! -e "${VMBUILDCONF}" ]; then
+		echo "Must provide the path to vmimage.subr."
+		return 1
+	fi
+
+	. "${VMBUILDCONF}"
+
+	if [ ! -z "${VMCONFIG}" ] && [ -e "${VMCONFIG}" ]; then
+		. "${VMCONFIG}"
+	fi
+
+	vm_create_base

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


More information about the svn-src-projects mailing list