From 13500839f2f74f939590564263f2b02410ee8b39 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 15 Jun 2015 10:48:48 +0000 Subject: [PATCH 01/33] Fix circular dependency between libzfs and libzfs_core libzfs_core is the wrapper around kernel ioctls, the ioctl compat code belongs to it --- cddl/lib/libzfs/Makefile | 1 - cddl/lib/libzfs_core/Makefile | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile index b2f4352bf915..19a3f2e1b1b5 100644 --- a/cddl/lib/libzfs/Makefile +++ b/cddl/lib/libzfs/Makefile @@ -37,7 +37,6 @@ SRCS+= libzfs_changelist.c \ zfs_comutil.c \ zfs_deleg.c \ zfs_fletcher.c \ - zfs_ioctl_compat.c \ zfs_namecheck.c \ zfs_prop.c \ zpool_prop.c \ diff --git a/cddl/lib/libzfs_core/Makefile b/cddl/lib/libzfs_core/Makefile index a470fbc25fb1..99ab34d90403 100644 --- a/cddl/lib/libzfs_core/Makefile +++ b/cddl/lib/libzfs_core/Makefile @@ -11,7 +11,8 @@ DPADD= ${LIBNVPAIR} LDADD= -lnvpair SRCS= libzfs_core.c \ - libzfs_core_compat.c + libzfs_core_compat.c \ + zfs_ioctl_compat.c SRCS+= libzfs_compat.c From 2f1653808a72224693d36d82e415f2f7bbbed547 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Mon, 15 Jun 2015 13:43:23 +0000 Subject: [PATCH 02/33] ttm_vm_page_alloc: use vm_page_alloc for pages without dma32 restriction This change re-organizes code a little bit to extract common pieces of ttm_alloc_new_pages() and ttm_get_pages() into dedicated functions. Also, for requests without address restrictions regular vm_page_alloc() is used. Lastly, when vm_page_alloc_contig() fails we call VM_WAIT before calling vm_pageout_grow_cache() to ensure that there is enough free pages at all. Reviewed by: kib MFC after: 15 days --- sys/dev/drm2/ttm/ttm_page_alloc.c | 109 ++++++++++++++++++------------ 1 file changed, 64 insertions(+), 45 deletions(-) diff --git a/sys/dev/drm2/ttm/ttm_page_alloc.c b/sys/dev/drm2/ttm/ttm_page_alloc.c index 246afdf98945..75abd10cc872 100644 --- a/sys/dev/drm2/ttm/ttm_page_alloc.c +++ b/sys/dev/drm2/ttm/ttm_page_alloc.c @@ -155,6 +155,66 @@ ttm_caching_state_to_vm(enum ttm_caching_state cstate) panic("caching state %d\n", cstate); } +static vm_page_t +ttm_vm_page_alloc_dma32(int req, vm_memattr_t memattr) +{ + vm_page_t p; + int tries; + + for (tries = 0; ; tries++) { + p = vm_page_alloc_contig(NULL, 0, req, 1, 0, 0xffffffff, + PAGE_SIZE, 0, memattr); + if (p != NULL || tries > 2) + return (p); + + /* + * Before growing the cache see if this is just a normal + * memory shortage. + */ + VM_WAIT; + vm_pageout_grow_cache(tries, 0, 0xffffffff); + } +} + +static vm_page_t +ttm_vm_page_alloc_any(int req, vm_memattr_t memattr) +{ + vm_page_t p; + + while (1) { + p = vm_page_alloc(NULL, 0, req); + if (p != NULL) + break; + VM_WAIT; + } + pmap_page_set_memattr(p, memattr); + return (p); +} + +static vm_page_t +ttm_vm_page_alloc(int flags, enum ttm_caching_state cstate) +{ + vm_page_t p; + vm_memattr_t memattr; + int req; + + memattr = ttm_caching_state_to_vm(cstate); + req = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ; + if ((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0) + req |= VM_ALLOC_ZERO; + + if ((flags & TTM_PAGE_FLAG_DMA32) != 0) + p = ttm_vm_page_alloc_dma32(req, memattr); + else + p = ttm_vm_page_alloc_any(req, memattr); + + if (p != NULL) { + p->oflags &= ~VPO_UNMANAGED; + p->flags |= PG_FICTITIOUS; + } + return (p); +} + static void ttm_pool_kobj_release(struct ttm_pool_manager *m) { @@ -461,14 +521,6 @@ static void ttm_handle_caching_state_failure(struct pglist *pages, } } -static vm_paddr_t -ttm_alloc_high_bound(int ttm_alloc_flags) -{ - - return ((ttm_alloc_flags & TTM_PAGE_FLAG_DMA32) ? 0xffffffff : - VM_MAX_ADDRESS); -} - /** * Allocate new pages with correct caching. * @@ -481,32 +533,17 @@ static int ttm_alloc_new_pages(struct pglist *pages, int ttm_alloc_flags, vm_page_t *caching_array; vm_page_t p; int r = 0; - unsigned i, cpages, aflags; + unsigned i, cpages; unsigned max_cpages = min(count, (unsigned)(PAGE_SIZE/sizeof(vm_page_t))); - int tries; - aflags = VM_ALLOC_NORMAL | VM_ALLOC_WIRED | VM_ALLOC_NOOBJ | - ((ttm_alloc_flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ? - VM_ALLOC_ZERO : 0); - /* allocate array for page caching change */ caching_array = malloc(max_cpages * sizeof(vm_page_t), M_TEMP, M_WAITOK | M_ZERO); for (i = 0, cpages = 0; i < count; ++i) { - tries = 0; -retry: - p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0, - ttm_alloc_high_bound(ttm_alloc_flags), - PAGE_SIZE, 0, ttm_caching_state_to_vm(cstate)); + p = ttm_vm_page_alloc(ttm_alloc_flags, cstate); if (!p) { - if (tries < 3) { - vm_pageout_grow_cache(tries, 0, - ttm_alloc_high_bound(ttm_alloc_flags)); - tries++; - goto retry; - } printf("[TTM] Unable to get page %u\n", i); /* store already allocated pages in the pool after @@ -522,8 +559,6 @@ static int ttm_alloc_new_pages(struct pglist *pages, int ttm_alloc_flags, r = -ENOMEM; goto out; } - p->oflags &= ~VPO_UNMANAGED; - p->flags |= PG_FICTITIOUS; #ifdef CONFIG_HIGHMEM /* KIB: nop */ /* gfp flags of highmem page should never be dma32 so we @@ -705,34 +740,18 @@ static int ttm_get_pages(vm_page_t *pages, unsigned npages, int flags, struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); struct pglist plist; vm_page_t p = NULL; - int gfp_flags, aflags; + int gfp_flags; unsigned count; int r; - int tries; - - aflags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED | - ((flags & TTM_PAGE_FLAG_ZERO_ALLOC) != 0 ? VM_ALLOC_ZERO : 0); /* No pool for cached pages */ if (pool == NULL) { for (r = 0; r < npages; ++r) { - tries = 0; -retry: - p = vm_page_alloc_contig(NULL, 0, aflags, 1, 0, - ttm_alloc_high_bound(flags), PAGE_SIZE, - 0, ttm_caching_state_to_vm(cstate)); + p = ttm_vm_page_alloc(flags, cstate); if (!p) { - if (tries < 3) { - vm_pageout_grow_cache(tries, 0, - ttm_alloc_high_bound(flags)); - tries++; - goto retry; - } printf("[TTM] Unable to allocate page\n"); return -ENOMEM; } - p->oflags &= ~VPO_UNMANAGED; - p->flags |= PG_FICTITIOUS; pages[r] = p; } return 0; From 4232f826683298e85d469c0ef17259cecd13b2c7 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 15 Jun 2015 15:34:20 +0000 Subject: [PATCH 03/33] Enforce overwritting SHLIBDIR Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere. This makes /lib being populated again. Reported by: many --- cddl/lib/Makefile.inc | 2 +- gnu/lib/libgcc/Makefile | 2 +- gnu/lib/libssp/Makefile | 2 +- lib/libalias/libalias/Makefile | 2 +- lib/libalias/modules/Makefile.inc | 2 +- lib/libbegemot/Makefile | 2 +- lib/libc/Makefile | 2 +- lib/libcam/Makefile | 2 +- lib/libcapsicum/Makefile | 2 +- lib/libcasper/Makefile | 2 +- lib/libcrypt/Makefile | 2 +- lib/libcxxrt/Makefile | 2 +- lib/libedit/Makefile | 2 +- lib/libexpat/Makefile | 2 +- lib/libgeom/Makefile | 2 +- lib/libipsec/Makefile | 2 +- lib/libjail/Makefile | 2 +- lib/libkiconv/Makefile | 2 +- lib/libkvm/Makefile | 2 +- lib/libmd/Makefile | 2 +- lib/libmt/Makefile | 2 +- lib/libnv/Makefile | 2 +- lib/libpcap/Makefile | 2 +- lib/libpjdlog/Makefile | 2 +- lib/libsbuf/Makefile | 2 +- lib/libthr/Makefile | 2 +- lib/libufs/Makefile | 2 +- lib/libulog/Makefile | 2 +- lib/libutil/Makefile | 2 +- lib/libxo/Makefile | 2 +- lib/libz/Makefile | 2 +- lib/msun/Makefile | 2 +- lib/ncurses/ncurses/Makefile | 2 +- sbin/geom/class/Makefile.inc | 2 +- secure/lib/libcrypto/Makefile | 2 +- 35 files changed, 35 insertions(+), 35 deletions(-) diff --git a/cddl/lib/Makefile.inc b/cddl/lib/Makefile.inc index 8f9af1d17e9d..d8f6c20f1649 100644 --- a/cddl/lib/Makefile.inc +++ b/cddl/lib/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR?= 2 .include "../Makefile.inc" diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index f0efff476dc2..13c15851f702 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -4,7 +4,7 @@ GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs SHLIB_NAME= libgcc_s.so.1 -SHLIBDIR?= /lib +SHLIBDIR= /lib .include # diff --git a/gnu/lib/libssp/Makefile b/gnu/lib/libssp/Makefile index 5a41298360ea..20cec0414678 100644 --- a/gnu/lib/libssp/Makefile +++ b/gnu/lib/libssp/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib MK_PROFILE= no MK_SSP= no diff --git a/lib/libalias/libalias/Makefile b/lib/libalias/libalias/Makefile index 00b4ed8fe20a..f098e744d848 100644 --- a/lib/libalias/libalias/Makefile +++ b/lib/libalias/libalias/Makefile @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../sys/netinet/libalias LIB= alias -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 7 MAN= libalias.3 SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_mod.c diff --git a/lib/libalias/modules/Makefile.inc b/lib/libalias/modules/Makefile.inc index 23df02da7db7..18bdd64229ce 100644 --- a/lib/libalias/modules/Makefile.inc +++ b/lib/libalias/modules/Makefile.inc @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../../../sys/netinet/libalias -SHLIBDIR?= /lib +SHLIBDIR= /lib LIB?= alias_${NAME} SHLIB_NAME?=libalias_${NAME}.so WARNS?= 1 diff --git a/lib/libbegemot/Makefile b/lib/libbegemot/Makefile index 27baf563cff6..ed22586b6f6a 100644 --- a/lib/libbegemot/Makefile +++ b/lib/libbegemot/Makefile @@ -6,7 +6,7 @@ LIBBEGEMOT_DIR=${.CURDIR}/../../contrib/libbegemot LIB= begemot SHLIB_MAJOR= 4 -SHLIBDIR?= /lib +SHLIBDIR= /lib CFLAGS+= -DUSE_SELECT -DQUADFMT='"ll"' SRCS= rpoll.c diff --git a/lib/libc/Makefile b/lib/libc/Makefile index b6d3f9f96a3b..e8035f076f49 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile index c44836947d51..2ba4080d119a 100644 --- a/lib/libcam/Makefile +++ b/lib/libcam/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= cam -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ ata_all.c smp_all.c INCS= camlib.h diff --git a/lib/libcapsicum/Makefile b/lib/libcapsicum/Makefile index 6ee5bb83eada..15ee299c5df8 100644 --- a/lib/libcapsicum/Makefile +++ b/lib/libcapsicum/Makefile @@ -3,7 +3,7 @@ LIB= capsicum SHLIB_MAJOR= 0 -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= libcapsicum.c SRCS+= libcapsicum_dns.c diff --git a/lib/libcasper/Makefile b/lib/libcasper/Makefile index e57accdf94a3..711d233f3e0f 100644 --- a/lib/libcasper/Makefile +++ b/lib/libcasper/Makefile @@ -3,7 +3,7 @@ LIB= casper SHLIB_MAJOR= 0 -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= libcasper.c INCS= libcasper.h diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile index 85bf94804fca..59991379ac0e 100644 --- a/lib/libcrypt/Makefile +++ b/lib/libcrypt/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ # -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile index d197361a9a66..812b773671c9 100644 --- a/lib/libcxxrt/Makefile +++ b/lib/libcxxrt/Makefile @@ -3,7 +3,7 @@ SRCDIR= ${.CURDIR}/../../contrib/libcxxrt SHLIB_MAJOR= 1 -SHLIBDIR?= /lib +SHLIBDIR= /lib .PATH: ${SRCDIR} diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index 8a97ce0f341b..d957d3c8e832 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -4,7 +4,7 @@ LIB= edit SHLIB_MAJOR= 7 -SHLIBDIR?= /lib +SHLIBDIR= /lib OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile index 0d4bef55e2f3..c3449032a1d3 100644 --- a/lib/libexpat/Makefile +++ b/lib/libexpat/Makefile @@ -3,7 +3,7 @@ EXPAT= ${.CURDIR}/../../contrib/expat LIB= bsdxml -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 4 SRCS= xmlparse.c xmlrole.c xmltok.c INCS= bsdxml.h bsdxml_external.h diff --git a/lib/libgeom/Makefile b/lib/libgeom/Makefile index 20b7a4c7c3b8..6785099225d1 100644 --- a/lib/libgeom/Makefile +++ b/lib/libgeom/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= geom -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS+= geom_getxml.c SRCS+= geom_stats.c SRCS+= geom_xml2tree.c diff --git a/lib/libipsec/Makefile b/lib/libipsec/Makefile index 7d3e94a7db5a..1d70bc51b96c 100644 --- a/lib/libipsec/Makefile +++ b/lib/libipsec/Makefile @@ -27,7 +27,7 @@ # # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libjail/Makefile b/lib/libjail/Makefile index 442274ae35dd..3525ed689029 100644 --- a/lib/libjail/Makefile +++ b/lib/libjail/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= jail -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 1 SRCS= jail.c jail_getid.c INCS= jail.h diff --git a/lib/libkiconv/Makefile b/lib/libkiconv/Makefile index c7b2179c1943..df29a5d6c238 100644 --- a/lib/libkiconv/Makefile +++ b/lib/libkiconv/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile index 4608254b497e..f9bda385f180 100644 --- a/lib/libkvm/Makefile +++ b/lib/libkvm/Makefile @@ -16,7 +16,7 @@ CFLAGS+=-DCROSS_LIBKVM LIB= kvm .endif -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 6 CFLAGS+=-DLIBC_SCCS -I${.CURDIR} diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index 61bea29c96b1..79c828c94cb8 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -2,7 +2,7 @@ LIB= md SHLIB_MAJOR= 6 -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= md4c.c md5c.c md4hl.c md5hl.c \ rmd160c.c rmd160hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ diff --git a/lib/libmt/Makefile b/lib/libmt/Makefile index 6fe59201a87f..695e95351314 100644 --- a/lib/libmt/Makefile +++ b/lib/libmt/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= mt -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= mtlib.c INCS= mtlib.h diff --git a/lib/libnv/Makefile b/lib/libnv/Makefile index 8b2fc7821d7a..717c3d681b79 100644 --- a/lib/libnv/Makefile +++ b/lib/libnv/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile index c36b3efed2da..db7d39fc68d1 100644 --- a/lib/libpcap/Makefile +++ b/lib/libpcap/Makefile @@ -1,7 +1,7 @@ # Makefile for libpcap # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libpjdlog/Makefile b/lib/libpjdlog/Makefile index e44f53b489fa..dc2b435bdf23 100644 --- a/lib/libpjdlog/Makefile +++ b/lib/libpjdlog/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ # -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libsbuf/Makefile b/lib/libsbuf/Makefile index 98ceeb6b373d..9abe78068ee4 100644 --- a/lib/libsbuf/Makefile +++ b/lib/libsbuf/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= sbuf -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= subr_prf.c subr_sbuf.c SHLIB_MAJOR = 6 diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index 17176729b2e5..4ad37cc1241c 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -8,7 +8,7 @@ # (for system call stubs) to CFLAGS below. -DSYSLIBC_SCCS affects just the # system call stubs. -SHLIBDIR?= /lib +SHLIBDIR= /lib .include MK_SSP= no diff --git a/lib/libufs/Makefile b/lib/libufs/Makefile index 24efd0ccc5fa..a04afaaf9b72 100644 --- a/lib/libufs/Makefile +++ b/lib/libufs/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= ufs -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 6 SRCS= block.c cgroup.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c diff --git a/lib/libulog/Makefile b/lib/libulog/Makefile index fedd114efb9e..10b831274e4a 100644 --- a/lib/libulog/Makefile +++ b/lib/libulog/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?=/lib +SHLIBDIR=/lib .include diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 35d146af720f..7b20e30520c0 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .include diff --git a/lib/libxo/Makefile b/lib/libxo/Makefile index 62fface44dfa..04558a3d6e9c 100644 --- a/lib/libxo/Makefile +++ b/lib/libxo/Makefile @@ -7,7 +7,7 @@ LIBXO= ${.CURDIR:H:H}/contrib/libxo LIB= xo SHLIB_MAJOR=0 -SHLIBDIR?= /lib +SHLIBDIR= /lib SRCS= libxo.c diff --git a/lib/libz/Makefile b/lib/libz/Makefile index 1f9bb72bc527..3f13988becec 100644 --- a/lib/libz/Makefile +++ b/lib/libz/Makefile @@ -3,7 +3,7 @@ # LIB= z -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 094fcba15682..389ed74efa22 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -42,7 +42,7 @@ CFLAGS+= -I${.CURDIR}/${ARCH_SUBDIR} .PATH: ${.CURDIR}/man LIB= m -SHLIBDIR?= /lib +SHLIBDIR= /lib SHLIB_MAJOR= 5 WARNS?= 1 IGNORE_PRAGMA= diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 31c68cdb782e..f02cfc70ebd7 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib .if !defined(ENABLE_WIDEC) # Override any MAN= setting below.. diff --git a/sbin/geom/class/Makefile.inc b/sbin/geom/class/Makefile.inc index 06b733f3c79c..0082f9203280 100644 --- a/sbin/geom/class/Makefile.inc +++ b/sbin/geom/class/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?=${GEOM_CLASS_DIR} +SHLIBDIR=${GEOM_CLASS_DIR} SHLIB_NAME?=geom_${GEOM_CLASS}.so LINKS= ${BINDIR}/geom ${BINDIR}/g${GEOM_CLASS} MAN= g${GEOM_CLASS}.8 diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index dbe2157ec0b4..a1671731bd87 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR?= /lib +SHLIBDIR= /lib SUBDIR= engines .include From 8cf80600ef66c9f5debf1e22463dc0c537674c97 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 15 Jun 2015 18:43:32 +0000 Subject: [PATCH 04/33] Don't use ${.OBJDIR}/ to qualify target that isn't specified that way --- sys/conf/kmod.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk index 28b95c5ccc18..284fe3f745be 100644 --- a/sys/conf/kmod.mk +++ b/sys/conf/kmod.mk @@ -239,7 +239,7 @@ beforedepend: ${_ILINKS} # causes all the modules to be rebuilt when the directory pointed to changes. .for _link in ${_ILINKS} .if !exists(${.OBJDIR}/${_link}) -${OBJS}: ${.OBJDIR}/${_link} +${OBJS}: ${_link} .endif .endfor From c1cb0d799b592988c0cf030fe8d35ef9ef0d7c84 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 15 Jun 2015 19:23:47 +0000 Subject: [PATCH 05/33] do not include src.opts.mk from here --- share/mk/local.init.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk index 9298bd59e4f2..cf95063c952a 100644 --- a/share/mk/local.init.mk +++ b/share/mk/local.init.mk @@ -1,7 +1,5 @@ # $FreeBSD$ -.include "src.opts.mk" - .if ${.MAKE.MODE:Unormal:Mmeta*} != "" .if !empty(SUBDIR) && !defined(LIB) && !defined(PROG) && ${.MAKE.MAKEFILES:M*bsd.prog.mk} == "" .if ${.MAKE.MODE:Mleaf*} != "" From 18b2ee82db77066fdb18c8183e02e02f79499328 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 15 Jun 2015 19:28:07 +0000 Subject: [PATCH 06/33] Revert r284417 it is not necessary anymore --- Makefile.inc1 | 2 ++ cddl/lib/Makefile.inc | 2 +- gnu/lib/libgcc/Makefile | 2 +- gnu/lib/libssp/Makefile | 2 +- lib/libalias/libalias/Makefile | 2 +- lib/libalias/modules/Makefile.inc | 2 +- lib/libbegemot/Makefile | 2 +- lib/libc/Makefile | 2 +- lib/libcam/Makefile | 2 +- lib/libcapsicum/Makefile | 2 +- lib/libcasper/Makefile | 2 +- lib/libcrypt/Makefile | 2 +- lib/libcxxrt/Makefile | 2 +- lib/libedit/Makefile | 2 +- lib/libexpat/Makefile | 2 +- lib/libgeom/Makefile | 2 +- lib/libipsec/Makefile | 2 +- lib/libjail/Makefile | 2 +- lib/libkiconv/Makefile | 2 +- lib/libkvm/Makefile | 2 +- lib/libmd/Makefile | 2 +- lib/libmt/Makefile | 2 +- lib/libnv/Makefile | 2 +- lib/libpcap/Makefile | 2 +- lib/libpjdlog/Makefile | 2 +- lib/libsbuf/Makefile | 2 +- lib/libthr/Makefile | 2 +- lib/libufs/Makefile | 2 +- lib/libulog/Makefile | 2 +- lib/libutil/Makefile | 2 +- lib/libxo/Makefile | 2 +- lib/libz/Makefile | 2 +- lib/msun/Makefile | 2 +- lib/ncurses/ncurses/Makefile | 2 +- sbin/geom/class/Makefile.inc | 2 +- secure/lib/libcrypto/Makefile | 2 +- 36 files changed, 37 insertions(+), 35 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 167940449323..edbda984d5d2 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -451,6 +451,8 @@ LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \ LIB32WMAKEFLAGS+= CC="${XCC} ${LIB32FLAGS}" \ CXX="${XCXX} ${LIB32FLAGS}" \ DESTDIR=${LIB32TMP} \ + SHLIBDIR=/usr/lib32 \ + LIBDIR=/usr/lib32 \ -DCOMPAT_32BIT \ -DLIBRARIES_ONLY \ -DNO_CPU_CFLAGS \ diff --git a/cddl/lib/Makefile.inc b/cddl/lib/Makefile.inc index d8f6c20f1649..8f9af1d17e9d 100644 --- a/cddl/lib/Makefile.inc +++ b/cddl/lib/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR?= 2 .include "../Makefile.inc" diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile index 13c15851f702..f0efff476dc2 100644 --- a/gnu/lib/libgcc/Makefile +++ b/gnu/lib/libgcc/Makefile @@ -4,7 +4,7 @@ GCCDIR= ${.CURDIR}/../../../contrib/gcc GCCLIB= ${.CURDIR}/../../../contrib/gcclibs SHLIB_NAME= libgcc_s.so.1 -SHLIBDIR= /lib +SHLIBDIR?= /lib .include # diff --git a/gnu/lib/libssp/Makefile b/gnu/lib/libssp/Makefile index 20cec0414678..5a41298360ea 100644 --- a/gnu/lib/libssp/Makefile +++ b/gnu/lib/libssp/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib MK_PROFILE= no MK_SSP= no diff --git a/lib/libalias/libalias/Makefile b/lib/libalias/libalias/Makefile index f098e744d848..00b4ed8fe20a 100644 --- a/lib/libalias/libalias/Makefile +++ b/lib/libalias/libalias/Makefile @@ -3,7 +3,7 @@ .PATH: ${.CURDIR}/../../../sys/netinet/libalias LIB= alias -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 7 MAN= libalias.3 SRCS= alias.c alias_db.c alias_proxy.c alias_util.c alias_mod.c diff --git a/lib/libalias/modules/Makefile.inc b/lib/libalias/modules/Makefile.inc index 18bdd64229ce..23df02da7db7 100644 --- a/lib/libalias/modules/Makefile.inc +++ b/lib/libalias/modules/Makefile.inc @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../../../../sys/netinet/libalias -SHLIBDIR= /lib +SHLIBDIR?= /lib LIB?= alias_${NAME} SHLIB_NAME?=libalias_${NAME}.so WARNS?= 1 diff --git a/lib/libbegemot/Makefile b/lib/libbegemot/Makefile index ed22586b6f6a..27baf563cff6 100644 --- a/lib/libbegemot/Makefile +++ b/lib/libbegemot/Makefile @@ -6,7 +6,7 @@ LIBBEGEMOT_DIR=${.CURDIR}/../../contrib/libbegemot LIB= begemot SHLIB_MAJOR= 4 -SHLIBDIR= /lib +SHLIBDIR?= /lib CFLAGS+= -DUSE_SELECT -DQUADFMT='"ll"' SRCS= rpoll.c diff --git a/lib/libc/Makefile b/lib/libc/Makefile index e8035f076f49..b6d3f9f96a3b 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libcam/Makefile b/lib/libcam/Makefile index 2ba4080d119a..c44836947d51 100644 --- a/lib/libcam/Makefile +++ b/lib/libcam/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= cam -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c \ ata_all.c smp_all.c INCS= camlib.h diff --git a/lib/libcapsicum/Makefile b/lib/libcapsicum/Makefile index 15ee299c5df8..6ee5bb83eada 100644 --- a/lib/libcapsicum/Makefile +++ b/lib/libcapsicum/Makefile @@ -3,7 +3,7 @@ LIB= capsicum SHLIB_MAJOR= 0 -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= libcapsicum.c SRCS+= libcapsicum_dns.c diff --git a/lib/libcasper/Makefile b/lib/libcasper/Makefile index 711d233f3e0f..e57accdf94a3 100644 --- a/lib/libcasper/Makefile +++ b/lib/libcasper/Makefile @@ -3,7 +3,7 @@ LIB= casper SHLIB_MAJOR= 0 -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= libcasper.c INCS= libcasper.h diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile index 59991379ac0e..85bf94804fca 100644 --- a/lib/libcrypt/Makefile +++ b/lib/libcrypt/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ # -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libcxxrt/Makefile b/lib/libcxxrt/Makefile index 812b773671c9..d197361a9a66 100644 --- a/lib/libcxxrt/Makefile +++ b/lib/libcxxrt/Makefile @@ -3,7 +3,7 @@ SRCDIR= ${.CURDIR}/../../contrib/libcxxrt SHLIB_MAJOR= 1 -SHLIBDIR= /lib +SHLIBDIR?= /lib .PATH: ${SRCDIR} diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index d957d3c8e832..8a97ce0f341b 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -4,7 +4,7 @@ LIB= edit SHLIB_MAJOR= 7 -SHLIBDIR= /lib +SHLIBDIR?= /lib OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ diff --git a/lib/libexpat/Makefile b/lib/libexpat/Makefile index c3449032a1d3..0d4bef55e2f3 100644 --- a/lib/libexpat/Makefile +++ b/lib/libexpat/Makefile @@ -3,7 +3,7 @@ EXPAT= ${.CURDIR}/../../contrib/expat LIB= bsdxml -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 4 SRCS= xmlparse.c xmlrole.c xmltok.c INCS= bsdxml.h bsdxml_external.h diff --git a/lib/libgeom/Makefile b/lib/libgeom/Makefile index 6785099225d1..20b7a4c7c3b8 100644 --- a/lib/libgeom/Makefile +++ b/lib/libgeom/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= geom -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS+= geom_getxml.c SRCS+= geom_stats.c SRCS+= geom_xml2tree.c diff --git a/lib/libipsec/Makefile b/lib/libipsec/Makefile index 1d70bc51b96c..7d3e94a7db5a 100644 --- a/lib/libipsec/Makefile +++ b/lib/libipsec/Makefile @@ -27,7 +27,7 @@ # # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libjail/Makefile b/lib/libjail/Makefile index 3525ed689029..442274ae35dd 100644 --- a/lib/libjail/Makefile +++ b/lib/libjail/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= jail -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 1 SRCS= jail.c jail_getid.c INCS= jail.h diff --git a/lib/libkiconv/Makefile b/lib/libkiconv/Makefile index df29a5d6c238..c7b2179c1943 100644 --- a/lib/libkiconv/Makefile +++ b/lib/libkiconv/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libkvm/Makefile b/lib/libkvm/Makefile index f9bda385f180..4608254b497e 100644 --- a/lib/libkvm/Makefile +++ b/lib/libkvm/Makefile @@ -16,7 +16,7 @@ CFLAGS+=-DCROSS_LIBKVM LIB= kvm .endif -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 6 CFLAGS+=-DLIBC_SCCS -I${.CURDIR} diff --git a/lib/libmd/Makefile b/lib/libmd/Makefile index 79c828c94cb8..61bea29c96b1 100644 --- a/lib/libmd/Makefile +++ b/lib/libmd/Makefile @@ -2,7 +2,7 @@ LIB= md SHLIB_MAJOR= 6 -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= md4c.c md5c.c md4hl.c md5hl.c \ rmd160c.c rmd160hl.c \ sha0c.c sha0hl.c sha1c.c sha1hl.c \ diff --git a/lib/libmt/Makefile b/lib/libmt/Makefile index 695e95351314..6fe59201a87f 100644 --- a/lib/libmt/Makefile +++ b/lib/libmt/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= mt -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= mtlib.c INCS= mtlib.h diff --git a/lib/libnv/Makefile b/lib/libnv/Makefile index 717c3d681b79..8b2fc7821d7a 100644 --- a/lib/libnv/Makefile +++ b/lib/libnv/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile index db7d39fc68d1..c36b3efed2da 100644 --- a/lib/libpcap/Makefile +++ b/lib/libpcap/Makefile @@ -1,7 +1,7 @@ # Makefile for libpcap # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libpjdlog/Makefile b/lib/libpjdlog/Makefile index dc2b435bdf23..e44f53b489fa 100644 --- a/lib/libpjdlog/Makefile +++ b/lib/libpjdlog/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ # -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libsbuf/Makefile b/lib/libsbuf/Makefile index 9abe78068ee4..98ceeb6b373d 100644 --- a/lib/libsbuf/Makefile +++ b/lib/libsbuf/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= sbuf -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= subr_prf.c subr_sbuf.c SHLIB_MAJOR = 6 diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile index 4ad37cc1241c..17176729b2e5 100644 --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -8,7 +8,7 @@ # (for system call stubs) to CFLAGS below. -DSYSLIBC_SCCS affects just the # system call stubs. -SHLIBDIR= /lib +SHLIBDIR?= /lib .include MK_SSP= no diff --git a/lib/libufs/Makefile b/lib/libufs/Makefile index a04afaaf9b72..24efd0ccc5fa 100644 --- a/lib/libufs/Makefile +++ b/lib/libufs/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ LIB= ufs -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 6 SRCS= block.c cgroup.c inode.c sblock.c type.c ffs_subr.c ffs_tables.c diff --git a/lib/libulog/Makefile b/lib/libulog/Makefile index 10b831274e4a..fedd114efb9e 100644 --- a/lib/libulog/Makefile +++ b/lib/libulog/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR=/lib +SHLIBDIR?=/lib .include diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 7b20e30520c0..35d146af720f 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .include diff --git a/lib/libxo/Makefile b/lib/libxo/Makefile index 04558a3d6e9c..62fface44dfa 100644 --- a/lib/libxo/Makefile +++ b/lib/libxo/Makefile @@ -7,7 +7,7 @@ LIBXO= ${.CURDIR:H:H}/contrib/libxo LIB= xo SHLIB_MAJOR=0 -SHLIBDIR= /lib +SHLIBDIR?= /lib SRCS= libxo.c diff --git a/lib/libz/Makefile b/lib/libz/Makefile index 3f13988becec..1f9bb72bc527 100644 --- a/lib/libz/Makefile +++ b/lib/libz/Makefile @@ -3,7 +3,7 @@ # LIB= z -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 6 MAN= zlib.3 zopen.3 diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 389ed74efa22..094fcba15682 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -42,7 +42,7 @@ CFLAGS+= -I${.CURDIR}/${ARCH_SUBDIR} .PATH: ${.CURDIR}/man LIB= m -SHLIBDIR= /lib +SHLIBDIR?= /lib SHLIB_MAJOR= 5 WARNS?= 1 IGNORE_PRAGMA= diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index f02cfc70ebd7..31c68cdb782e 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib .if !defined(ENABLE_WIDEC) # Override any MAN= setting below.. diff --git a/sbin/geom/class/Makefile.inc b/sbin/geom/class/Makefile.inc index 0082f9203280..06b733f3c79c 100644 --- a/sbin/geom/class/Makefile.inc +++ b/sbin/geom/class/Makefile.inc @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR=${GEOM_CLASS_DIR} +SHLIBDIR?=${GEOM_CLASS_DIR} SHLIB_NAME?=geom_${GEOM_CLASS}.so LINKS= ${BINDIR}/geom ${BINDIR}/g${GEOM_CLASS} MAN= g${GEOM_CLASS}.8 diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile index a1671731bd87..dbe2157ec0b4 100644 --- a/secure/lib/libcrypto/Makefile +++ b/secure/lib/libcrypto/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -SHLIBDIR= /lib +SHLIBDIR?= /lib SUBDIR= engines .include From 19e58304b3e132316391a892026927b472a61d78 Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Mon, 15 Jun 2015 19:48:28 +0000 Subject: [PATCH 07/33] Change -Wl,-r back to -r so gcc doesn't pass --relax to the linker on some architectures. PR: 200881 --- usr.sbin/crunch/crunchgen/crunchgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 076fe9032f99..79b240f39704 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -1110,7 +1110,7 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, " $(%s_LIBS)", p->ident); fprintf(outmk, "\n"); - fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -Wl,-r -o %s.lo %s_stub.o $(%s_OBJPATHS)", + fprintf(outmk, "\t$(CC) -nostdlib -Wl,-dc -r -o %s.lo %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) fprintf(outmk, " $(%s_LIBS)", p->ident); From db7548d0401f19d18fd4fed7b60894a7f3eed4a4 Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Mon, 15 Jun 2015 20:11:06 +0000 Subject: [PATCH 08/33] Fix some exceptional cases where the sign of the result is unspecified but must still satisfy ccosh(conj(z)) == conj(ccosh(z)) and ccosh(-z) == ccosh(z). In collaboration with: bde --- lib/msun/src/s_ccosh.c | 41 +++++++++++++++++++++-------------------- lib/msun/src/s_ccoshf.c | 25 +++++++++++-------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/lib/msun/src/s_ccosh.c b/lib/msun/src/s_ccosh.c index fbe15fc9c873..2843198c3571 100644 --- a/lib/msun/src/s_ccosh.c +++ b/lib/msun/src/s_ccosh.c @@ -32,6 +32,8 @@ * * Exceptional values are noted in the comments within the source code. * These values and the return value were taken from n1124.pdf. + * The sign of the result for some exceptional values is unspecified but + * must satisfy both cosh(conj(z)) == conj(cosh(z)) and cosh(-z) == cosh(z). */ #include @@ -63,7 +65,7 @@ ccosh(double complex z) if (ix < 0x7ff00000 && iy < 0x7ff00000) { if ((iy | ly) == 0) return (CMPLX(cosh(x), x * y)); - if (ix < 0x40360000) /* small x: normal case */ + if (ix < 0x40360000) /* |x| < 22: normal case */ return (CMPLX(cosh(x) * cos(y), sinh(x) * sin(y))); /* |x| >= 22, so cosh(x) ~= exp(|x|) */ @@ -83,28 +85,27 @@ ccosh(double complex z) } /* - * cosh(+-0 +- I Inf) = dNaN + I sign(d(+-0, dNaN))0. - * The sign of 0 in the result is unspecified. Choice = normally - * the same as dNaN. Raise the invalid floating-point exception. + * cosh(+-0 +- I Inf) = dNaN + I (+-)(+-)0. + * The sign of 0 in the result is unspecified. Choice = product + * of the signs of the argument. Raise the invalid floating-point + * exception. * - * cosh(+-0 +- I NaN) = d(NaN) + I sign(d(+-0, NaN))0. - * The sign of 0 in the result is unspecified. Choice = normally - * the same as d(NaN). + * cosh(+-0 +- I NaN) = d(NaN) + I (+-)(+-)0. + * The sign of 0 in the result is unspecified. Choice = product + * of the signs of the argument. */ - if ((ix | lx) == 0 && iy >= 0x7ff00000) - return (CMPLX(y - y, copysign(0, x * (y - y)))); + if ((ix | lx) == 0) /* && iy >= 0x7ff00000 */ + return (CMPLX(y - y, x * copysign(0, y))); /* * cosh(+-Inf +- I 0) = +Inf + I (+-)(+-)0. * - * cosh(NaN +- I 0) = d(NaN) + I sign(d(NaN, +-0))0. - * The sign of 0 in the result is unspecified. + * cosh(NaN +- I 0) = d(NaN) + I (+-)(+-)0. + * The sign of 0 in the result is unspecified. Choice = product + * of the signs of the argument. */ - if ((iy | ly) == 0 && ix >= 0x7ff00000) { - if (((hx & 0xfffff) | lx) == 0) - return (CMPLX(x * x, copysign(0, x) * y)); - return (CMPLX(x * x, copysign(0, (x + x) * y))); - } + if ((iy | ly) == 0) /* && ix >= 0x7ff00000 */ + return (CMPLX(x * x, copysign(0, x) * y)); /* * cosh(x +- I Inf) = dNaN + I dNaN. @@ -114,7 +115,7 @@ ccosh(double complex z) * Optionally raises the invalid floating-point exception for finite * nonzero x. Choice = don't raise (except for signaling NaNs). */ - if (ix < 0x7ff00000 && iy >= 0x7ff00000) + if (ix < 0x7ff00000) /* && iy >= 0x7ff00000 */ return (CMPLX(y - y, x * (y - y))); /* @@ -126,10 +127,10 @@ ccosh(double complex z) * * cosh(+-Inf + I y) = +Inf cos(y) +- I Inf sin(y) */ - if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) { + if (ix == 0x7ff00000 && lx == 0) { if (iy >= 0x7ff00000) - return (CMPLX(x * x, x * (y - y))); - return (CMPLX((x * x) * cos(y), x * sin(y))); + return (CMPLX(INFINITY, x * (y - y))); + return (CMPLX(INFINITY * cos(y), x * sin(y))); } /* diff --git a/lib/msun/src/s_ccoshf.c b/lib/msun/src/s_ccoshf.c index fe8cf89c4159..eeed92f8cf46 100644 --- a/lib/msun/src/s_ccoshf.c +++ b/lib/msun/src/s_ccoshf.c @@ -25,7 +25,7 @@ */ /* - * Hyperbolic cosine of a complex argument. See s_ccosh.c for details. + * Float version of ccosh(). See s_ccosh.c for details. */ #include @@ -56,13 +56,13 @@ ccoshf(float complex z) if (ix < 0x7f800000 && iy < 0x7f800000) { if (iy == 0) return (CMPLXF(coshf(x), x * y)); - if (ix < 0x41100000) /* small x: normal case */ + if (ix < 0x41100000) /* |x| < 9: normal case */ return (CMPLXF(coshf(x) * cosf(y), sinhf(x) * sinf(y))); /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if (ix < 0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = expf(fabsf(x)) * 0.5f; + h = expf(fabsf(x)) * 0.5F; return (CMPLXF(h * cosf(y), copysignf(h, x) * sinf(y))); } else if (ix < 0x4340b1e7) { /* x < 192.7: scale to avoid overflow */ @@ -75,22 +75,19 @@ ccoshf(float complex z) } } - if (ix == 0 && iy >= 0x7f800000) - return (CMPLXF(y - y, copysignf(0, x * (y - y)))); + if (ix == 0) /* && iy >= 0x7f800000 */ + return (CMPLXF(y - y, x * copysignf(0, y))); - if (iy == 0 && ix >= 0x7f800000) { - if ((hx & 0x7fffff) == 0) - return (CMPLXF(x * x, copysignf(0, x) * y)); - return (CMPLXF(x * x, copysignf(0, (x + x) * y))); - } + if (iy == 0) /* && ix >= 0x7f800000 */ + return (CMPLXF(x * x, copysignf(0, x) * y)); - if (ix < 0x7f800000 && iy >= 0x7f800000) + if (ix < 0x7f800000) /* && iy >= 0x7f800000 */ return (CMPLXF(y - y, x * (y - y))); - if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) { + if (ix == 0x7f800000) { if (iy >= 0x7f800000) - return (CMPLXF(x * x, x * (y - y))); - return (CMPLXF((x * x) * cosf(y), x * sinf(y))); + return (CMPLXF(INFINITY, x * (y - y))); + return (CMPLXF(INFINITY * cosf(y), x * sinf(y))); } return (CMPLXF((x * x) * (y - y), (x + x) * (y - y))); From cdea5d8c84d0e0714ed06a7b84d7253bae8f9f65 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 15 Jun 2015 20:11:15 +0000 Subject: [PATCH 09/33] Pay attention to MK_ELFTOOLCHAIN_TOOLS so we build the desired tools. --- lib/libelftc/Makefile.depend | 14 ++++++++++++ targets/pseudo/toolchain/Makefile.depend | 29 +++++++++++++++++++----- usr.bin/elfcopy/Makefile.depend | 25 ++++++++++++++++++++ 3 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 lib/libelftc/Makefile.depend create mode 100644 usr.bin/elfcopy/Makefile.depend diff --git a/lib/libelftc/Makefile.depend b/lib/libelftc/Makefile.depend new file mode 100644 index 000000000000..422dbea77a29 --- /dev/null +++ b/lib/libelftc/Makefile.depend @@ -0,0 +1,14 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + include \ + include/xlocale \ + lib/libelf \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif diff --git a/targets/pseudo/toolchain/Makefile.depend b/targets/pseudo/toolchain/Makefile.depend index b15598b87c21..92d1c88e842c 100644 --- a/targets/pseudo/toolchain/Makefile.depend +++ b/targets/pseudo/toolchain/Makefile.depend @@ -7,21 +7,38 @@ DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,} .if !defined(MK_CLANG) .include "${SRCTOP}/share/mk/src.opts.mk" .endif +DIRDEPS= + +.if ${MK_ELFTOOLCHAIN_TOOLS} == "yes" +DIRDEPS+= \ + usr.bin/addr2line \ + usr.bin/cxxflit \ + usr.bin/elfcopy \ + usr.bin/nm \ + usr.bin/readelf \ + usr.bin/size \ + usr.bin/strip \ + usr.bin/strings \ + +.else +DIRDEPS+= \ + gnu/usr.bin/binutils/addr2line \ + gnu/usr.bin/binutils/nm \ + gnu/usr.bin/binutils/readelf \ + gnu/usr.bin/binutils/size \ + gnu/usr.bin/binutils/strip \ + gnu/usr.bin/binutils/strings \ + +.endif DIRDEPS= \ usr.bin/xinstall \ - gnu/usr.bin/binutils/addr2line \ gnu/usr.bin/binutils/ar \ gnu/usr.bin/binutils/as \ gnu/usr.bin/binutils/ld \ - gnu/usr.bin/binutils/nm \ gnu/usr.bin/binutils/objcopy \ gnu/usr.bin/binutils/objdump \ gnu/usr.bin/binutils/ranlib \ - gnu/usr.bin/binutils/readelf \ - gnu/usr.bin/binutils/size \ - gnu/usr.bin/binutils/strings \ - gnu/usr.bin/binutils/strip \ .if ${MK_CLANG} == "yes" diff --git a/usr.bin/elfcopy/Makefile.depend b/usr.bin/elfcopy/Makefile.depend new file mode 100644 index 000000000000..72ff63550887 --- /dev/null +++ b/usr.bin/elfcopy/Makefile.depend @@ -0,0 +1,25 @@ +# $FreeBSD$ +# Autogenerated - do NOT edit! + +DIRDEPS = \ + gnu/lib/csu \ + gnu/lib/libgcc \ + lib/${CSU_DIR} \ + lib/libarchive \ + lib/libbz2 \ + lib/libc \ + lib/libcompiler_rt \ + lib/libelf \ + lib/libelftc \ + lib/libexpat \ + lib/liblzma \ + lib/libthr \ + lib/libz \ + secure/lib/libcrypto \ + + +.include + +.if ${DEP_RELDIR} == ${_DEP_RELDIR} +# local dependencies - needed for -jN in clean tree +.endif From 5a74378c7b0b679c34e9729233297773e9818dff Mon Sep 17 00:00:00 2001 From: Xin LI Date: Mon, 15 Jun 2015 20:12:15 +0000 Subject: [PATCH 10/33] Skip src component if /usr/src is empty. Differential Revision: https://reviews.freebsd.org/D2364 Submitted by: kczekirda Reviewed by: cperciva, delphij, nwhitehorn, allanjude MFC after: 2 weeks --- usr.sbin/freebsd-update/freebsd-update.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index fda1d9049db2..19d519881e79 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -216,7 +216,15 @@ config_KeepModifiedMetadata () { # Add to the list of components which should be kept updated. config_Components () { for C in $@; do - COMPONENTS="${COMPONENTS} ${C}" + if [ "$C" = "src" ]; then + if [ -e /usr/src/COPYRIGHT ]; then + COMPONENTS="${COMPONENTS} ${C}" + else + echo "src component not installed, skipped" + fi + else + COMPONENTS="${COMPONENTS} ${C}" + fi done } @@ -2642,10 +2650,10 @@ install_unschg () { while read F; do if ! [ -e ${BASEDIR}/${F} ]; then continue + else + echo ${BASEDIR}/${F} fi - - chflags noschg ${BASEDIR}/${F} || return 1 - done < filelist + done < filelist | xargs chflags noschg || return 1 # Clean up rm filelist From f0f050e0f9a4a839452ff822cec8c62735745e19 Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Mon, 15 Jun 2015 20:16:53 +0000 Subject: [PATCH 11/33] Fix some exceptional cases where the sign of the result is unspecified but must still satisfy csinh(conj(z)) == conj(csinh(z)) and csinh(-z) == -csinh(z). This allows eliminating two negations from csin(z). In collaboration with: bde --- lib/msun/src/s_csinh.c | 59 ++++++++++++++++++++--------------------- lib/msun/src/s_csinhf.c | 31 ++++++++++------------ 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/lib/msun/src/s_csinh.c b/lib/msun/src/s_csinh.c index 37f46da226dd..7af363454b58 100644 --- a/lib/msun/src/s_csinh.c +++ b/lib/msun/src/s_csinh.c @@ -32,6 +32,8 @@ * * Exceptional values are noted in the comments within the source code. * These values and the return value were taken from n1124.pdf. + * The sign of the result for some exceptional values is unspecified but + * must satisfy both sinh(conj(z)) == conj(sinh(z)) and sinh(-z) == -sinh(z). */ #include @@ -63,7 +65,7 @@ csinh(double complex z) if (ix < 0x7ff00000 && iy < 0x7ff00000) { if ((iy | ly) == 0) return (CMPLX(sinh(x), y)); - if (ix < 0x40360000) /* small x: normal case */ + if (ix < 0x40360000) /* |x| < 22: normal case */ return (CMPLX(sinh(x) * cos(y), cosh(x) * sin(y))); /* |x| >= 22, so cosh(x) ~= exp(|x|) */ @@ -83,27 +85,24 @@ csinh(double complex z) } /* - * sinh(+-0 +- I Inf) = sign(d(+-0, dNaN))0 + I dNaN. - * The sign of 0 in the result is unspecified. Choice = normally - * the same as dNaN. Raise the invalid floating-point exception. + * sinh(+-0 +- I Inf) = +-0 + I dNaN. + * The sign of 0 in the result is unspecified. Choice = same sign + * as the argument. Raise the invalid floating-point exception. * - * sinh(+-0 +- I NaN) = sign(d(+-0, NaN))0 + I d(NaN). - * The sign of 0 in the result is unspecified. Choice = normally - * the same as d(NaN). + * sinh(+-0 +- I NaN) = +-0 + I d(NaN). + * The sign of 0 in the result is unspecified. Choice = same sign + * as the argument. */ - if ((ix | lx) == 0 && iy >= 0x7ff00000) - return (CMPLX(copysign(0, x * (y - y)), y - y)); + if ((ix | lx) == 0) /* && iy >= 0x7ff00000 */ + return (CMPLX(x, y - y)); /* * sinh(+-Inf +- I 0) = +-Inf + I +-0. * * sinh(NaN +- I 0) = d(NaN) + I +-0. */ - if ((iy | ly) == 0 && ix >= 0x7ff00000) { - if (((hx & 0xfffff) | lx) == 0) - return (CMPLX(x, y)); - return (CMPLX(x, copysign(0, y))); - } + if ((iy | ly) == 0) /* && ix >= 0x7ff00000 */ + return (CMPLX(x + x, y)); /* * sinh(x +- I Inf) = dNaN + I dNaN. @@ -113,45 +112,45 @@ csinh(double complex z) * Optionally raises the invalid floating-point exception for finite * nonzero x. Choice = don't raise (except for signaling NaNs). */ - if (ix < 0x7ff00000 && iy >= 0x7ff00000) - return (CMPLX(y - y, x * (y - y))); + if (ix < 0x7ff00000) /* && iy >= 0x7ff00000 */ + return (CMPLX(y - y, y - y)); /* * sinh(+-Inf + I NaN) = +-Inf + I d(NaN). - * The sign of Inf in the result is unspecified. Choice = normally - * the same as d(NaN). + * The sign of Inf in the result is unspecified. Choice = same sign + * as the argument. * - * sinh(+-Inf +- I Inf) = +Inf + I dNaN. - * The sign of Inf in the result is unspecified. Choice = always +. - * Raise the invalid floating-point exception. + * sinh(+-Inf +- I Inf) = +-Inf + I dNaN. + * The sign of Inf in the result is unspecified. Choice = same sign + * as the argument. Raise the invalid floating-point exception. * * sinh(+-Inf + I y) = +-Inf cos(y) + I Inf sin(y) */ - if (ix >= 0x7ff00000 && ((hx & 0xfffff) | lx) == 0) { + if (ix == 0x7ff00000 && lx == 0) { if (iy >= 0x7ff00000) - return (CMPLX(x * x, x * (y - y))); + return (CMPLX(x, y - y)); return (CMPLX(x * cos(y), INFINITY * sin(y))); } /* - * sinh(NaN + I NaN) = d(NaN) + I d(NaN). + * sinh(NaN1 + I NaN2) = d(NaN1, NaN2) + I d(NaN1, NaN2). * - * sinh(NaN +- I Inf) = d(NaN) + I d(NaN). + * sinh(NaN +- I Inf) = d(NaN, dNaN) + I d(NaN, dNaN). * Optionally raises the invalid floating-point exception. * Choice = raise. * - * sinh(NaN + I y) = d(NaN) + I d(NaN). + * sinh(NaN + I y) = d(NaN) + I d(NaN). * Optionally raises the invalid floating-point exception for finite * nonzero y. Choice = don't raise (except for signaling NaNs). */ - return (CMPLX((x * x) * (y - y), (x + x) * (y - y))); + return (CMPLX((x + x) * (y - y), (x * x) * (y - y))); } double complex csin(double complex z) { - /* csin(z) = -I * csinh(I * z) */ - z = csinh(CMPLX(-cimag(z), creal(z))); - return (CMPLX(cimag(z), -creal(z))); + /* csin(z) = -I * csinh(I * z) = I * conj(csinh(I * conj(z))). */ + z = csinh(CMPLX(cimag(z), creal(z))); + return (CMPLX(cimag(z), creal(z))); } diff --git a/lib/msun/src/s_csinhf.c b/lib/msun/src/s_csinhf.c index 63482723ad9e..c9d9d3c911da 100644 --- a/lib/msun/src/s_csinhf.c +++ b/lib/msun/src/s_csinhf.c @@ -25,7 +25,7 @@ */ /* - * Hyperbolic sine of a complex argument z. See s_csinh.c for details. + * Float version of csinh(). See s_csinh.c for details. */ #include @@ -56,13 +56,13 @@ csinhf(float complex z) if (ix < 0x7f800000 && iy < 0x7f800000) { if (iy == 0) return (CMPLXF(sinhf(x), y)); - if (ix < 0x41100000) /* small x: normal case */ + if (ix < 0x41100000) /* |x| < 9: normal case */ return (CMPLXF(sinhf(x) * cosf(y), coshf(x) * sinf(y))); /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if (ix < 0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = expf(fabsf(x)) * 0.5f; + h = expf(fabsf(x)) * 0.5F; return (CMPLXF(copysignf(h, x) * cosf(y), h * sinf(y))); } else if (ix < 0x4340b1e7) { /* x < 192.7: scale to avoid overflow */ @@ -75,31 +75,28 @@ csinhf(float complex z) } } - if (ix == 0 && iy >= 0x7f800000) - return (CMPLXF(copysignf(0, x * (y - y)), y - y)); + if (ix == 0) /* && iy >= 0x7f800000 */ + return (CMPLXF(x, y - y)); - if (iy == 0 && ix >= 0x7f800000) { - if ((hx & 0x7fffff) == 0) - return (CMPLXF(x, y)); - return (CMPLXF(x, copysignf(0, y))); - } + if (iy == 0) /* && ix >= 0x7f800000 */ + return (CMPLXF(x + x, y)); - if (ix < 0x7f800000 && iy >= 0x7f800000) - return (CMPLXF(y - y, x * (y - y))); + if (ix < 0x7f800000) /* && iy >= 0x7f800000 */ + return (CMPLXF(y - y, y - y)); - if (ix >= 0x7f800000 && (hx & 0x7fffff) == 0) { + if (ix == 0x7f800000) { if (iy >= 0x7f800000) - return (CMPLXF(x * x, x * (y - y))); + return (CMPLXF(x, y - y)); return (CMPLXF(x * cosf(y), INFINITY * sinf(y))); } - return (CMPLXF((x * x) * (y - y), (x + x) * (y - y))); + return (CMPLXF((x + x) * (y - y), (x * x) * (y - y))); } float complex csinf(float complex z) { - z = csinhf(CMPLXF(-cimagf(z), crealf(z))); - return (CMPLXF(cimagf(z), -crealf(z))); + z = csinhf(CMPLXF(cimagf(z), crealf(z))); + return (CMPLXF(cimagf(z), crealf(z))); } From 68b433d79070ca1cb0631725df3c4be825f58a15 Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Mon, 15 Jun 2015 20:40:44 +0000 Subject: [PATCH 12/33] - Change comments to be more consistent with s_ccosh.c and s_csinh.c. - Fix a case where NaNs were not mixed correctly and signalling NaNs were not converted to quiet NaNs. - Eliminate two negations from ctan(z). In collaboration with: bde --- lib/msun/src/s_ctanh.c | 35 ++++++++++++++++++----------------- lib/msun/src/s_ctanhf.c | 6 +++--- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/msun/src/s_ctanh.c b/lib/msun/src/s_ctanh.c index b15c81469544..f5b9bdd9d5f8 100644 --- a/lib/msun/src/s_ctanh.c +++ b/lib/msun/src/s_ctanh.c @@ -25,7 +25,7 @@ */ /* - * Hyperbolic tangent of a complex argument z = x + i y. + * Hyperbolic tangent of a complex argument z = x + I y. * * The algorithm is from: * @@ -44,15 +44,15 @@ * * tanh(z) = sinh(z) / cosh(z) * - * sinh(x) cos(y) + i cosh(x) sin(y) + * sinh(x) cos(y) + I cosh(x) sin(y) * = --------------------------------- - * cosh(x) cos(y) + i sinh(x) sin(y) + * cosh(x) cos(y) + I sinh(x) sin(y) * - * cosh(x) sinh(x) / cos^2(y) + i tan(y) + * cosh(x) sinh(x) / cos^2(y) + I tan(y) * = ------------------------------------- * 1 + sinh^2(x) / cos^2(y) * - * beta rho s + i t + * beta rho s + I t * = ---------------- * 1 + beta s^2 * @@ -85,16 +85,16 @@ ctanh(double complex z) ix = hx & 0x7fffffff; /* - * ctanh(NaN + i 0) = NaN + i 0 + * ctanh(NaN +- I 0) = d(NaN) +- I 0 * - * ctanh(NaN + i y) = NaN + i NaN for y != 0 + * ctanh(NaN + I y) = d(NaN,y) + I d(NaN,y) for y != 0 * * The imaginary part has the sign of x*sin(2*y), but there's no * special effort to get this right. * - * ctanh(+-Inf +- i Inf) = +-1 +- 0 + * ctanh(+-Inf +- I Inf) = +-1 +- I 0 * - * ctanh(+-Inf + i y) = +-1 + 0 sin(2y) for y finite + * ctanh(+-Inf + I y) = +-1 + I 0 sin(2y) for y finite * * The imaginary part of the sign is unspecified. This special * case is only needed to avoid a spurious invalid exception when @@ -102,24 +102,25 @@ ctanh(double complex z) */ if (ix >= 0x7ff00000) { if ((ix & 0xfffff) | lx) /* x is NaN */ - return (CMPLX(x, (y == 0 ? y : x * y))); + return (CMPLX((x + 0) * (y + 0), + y == 0 ? y : (x + 0) * (y + 0))); SET_HIGH_WORD(x, hx - 0x40000000); /* x = copysign(1, x) */ return (CMPLX(x, copysign(0, isinf(y) ? y : sin(y) * cos(y)))); } /* - * ctanh(x + i NAN) = NaN + i NaN - * ctanh(x +- i Inf) = NaN + i NaN + * ctanh(x + I NaN) = d(NaN) + I d(NaN) + * ctanh(x +- I Inf) = dNaN + I dNaN */ if (!isfinite(y)) return (CMPLX(y - y, y - y)); /* - * ctanh(+-huge + i +-y) ~= +-1 +- i 2sin(2y)/exp(2x), using the + * ctanh(+-huge +- I y) ~= +-1 +- I 2sin(2y)/exp(2x), using the * approximation sinh^2(huge) ~= exp(2*huge) / 4. * We use a modified formula to avoid spurious overflow. */ - if (ix >= 0x40360000) { /* x >= 22 */ + if (ix >= 0x40360000) { /* |x| >= 22 */ double exp_mx = exp(-fabs(x)); return (CMPLX(copysign(1, x), 4 * sin(y) * cos(y) * exp_mx * exp_mx)); @@ -138,7 +139,7 @@ double complex ctan(double complex z) { - /* ctan(z) = -I * ctanh(I * z) */ - z = ctanh(CMPLX(-cimag(z), creal(z))); - return (CMPLX(cimag(z), -creal(z))); + /* ctan(z) = -I * ctanh(I * z) = I * conj(ctanh(I * conj(z))) */ + z = ctanh(CMPLX(cimag(z), creal(z))); + return (CMPLX(cimag(z), creal(z))); } diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c index 9b0cda1600fa..6f3be9768c12 100644 --- a/lib/msun/src/s_ctanhf.c +++ b/lib/msun/src/s_ctanhf.c @@ -60,7 +60,7 @@ ctanhf(float complex z) if (!isfinite(y)) return (CMPLXF(y - y, y - y)); - if (ix >= 0x41300000) { /* x >= 11 */ + if (ix >= 0x41300000) { /* |x| >= 11 */ float exp_mx = expf(-fabsf(x)); return (CMPLXF(copysignf(1, x), 4 * sinf(y) * cosf(y) * exp_mx * exp_mx)); @@ -78,7 +78,7 @@ float complex ctanf(float complex z) { - z = ctanhf(CMPLXF(-cimagf(z), crealf(z))); - return (CMPLXF(cimagf(z), -crealf(z))); + z = ctanhf(CMPLXF(cimagf(z), crealf(z))); + return (CMPLXF(cimagf(z), crealf(z))); } From 65c323f2acb531fdc7a380af88f3ac0c8e435c02 Mon Sep 17 00:00:00 2001 From: Tijl Coosemans Date: Mon, 15 Jun 2015 20:47:26 +0000 Subject: [PATCH 13/33] Follow up to r284427: fix NaN mixing for ctanhf too. --- lib/msun/src/s_ctanhf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/msun/src/s_ctanhf.c b/lib/msun/src/s_ctanhf.c index 6f3be9768c12..520bf77d6d5c 100644 --- a/lib/msun/src/s_ctanhf.c +++ b/lib/msun/src/s_ctanhf.c @@ -51,7 +51,8 @@ ctanhf(float complex z) if (ix >= 0x7f800000) { if (ix & 0x7fffff) - return (CMPLXF(x, (y == 0 ? y : x * y))); + return (CMPLXF((x + 0) * (y + 0), + y == 0 ? y : (x + 0) * (y + 0))); SET_FLOAT_WORD(x, hx - 0x40000000); return (CMPLXF(x, copysignf(0, isinf(y) ? y : sinf(y) * cosf(y)))); From 31277fe3a0625f2ab59cb30ae406b750d0b07664 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 15 Jun 2015 21:09:18 +0000 Subject: [PATCH 14/33] Skip MAKE_PRINT_VAR_ON_ERROR unless we are doing META_MODE with all the recursion in normal build it is too much noise. --- share/mk/local.sys.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk index 424a9658dcab..87f945eac7d6 100644 --- a/share/mk/local.sys.mk +++ b/share/mk/local.sys.mk @@ -29,6 +29,7 @@ M_whence = ${M_type}:M/*:[1] # convert a path to a valid shell variable M_P2V = tu:C,[./-],_,g +.if ${MK_META_MODE} == "yes" MAKE_PRINT_VAR_ON_ERROR+= \ .CURDIR \ .MAKE \ @@ -48,6 +49,7 @@ MAKE_PRINT_VAR_ON_ERROR+= \ .if ${.MAKE.LEVEL} > 0 MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH .endif +.endif # these are handy # we can use this for a cheap timestamp at the start of a target's script, From c0b575998b90eaceb2fcd92eccca5d04a6166946 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 15 Jun 2015 21:20:21 +0000 Subject: [PATCH 15/33] Register libpanel into the available libraries --- share/mk/src.libnames.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index 549cc58c0f2a..4db46ab8da72 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -123,6 +123,8 @@ _LIBRARIES= \ nv \ opie \ pam \ + panel \ + panelw \ pcap \ pcsclite \ pjdlog \ From d9c8ae62f4716a6716e547516e1ade2129b5021d Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Mon, 15 Jun 2015 21:20:52 +0000 Subject: [PATCH 16/33] Convert to LIBADD --- usr.bin/clang/lldb/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/usr.bin/clang/lldb/Makefile b/usr.bin/clang/lldb/Makefile index 5102835808ae..127df911b0b9 100644 --- a/usr.bin/clang/lldb/Makefile +++ b/usr.bin/clang/lldb/Makefile @@ -16,8 +16,7 @@ SRCS= Driver.cpp \ lldb.1: ln -fs ${LLDB_SRCS}/docs/lldb.1 ${.TARGET} -DPADD= ${LIBEDIT} ${LIBNCURSESW} ${LIBEXECINFO} ${LIBPANEL} ${LIBZ} -LDADD= -ledit -lncursesw -lexecinfo -lpanel -lz +LIBADD= edit panel ncursesw execinfo z LLDB_LIBS=\ lldb \ From a35ae8de0afbc498d4658ef1a64b71c9f40d60f6 Mon Sep 17 00:00:00 2001 From: "Simon J. Gerraty" Date: Mon, 15 Jun 2015 22:04:29 +0000 Subject: [PATCH 17/33] Remove extra blank lines --- usr.bin/xlint/llib/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr.bin/xlint/llib/Makefile b/usr.bin/xlint/llib/Makefile index 8ee7e1787cd2..63b2b2b5c04e 100644 --- a/usr.bin/xlint/llib/Makefile +++ b/usr.bin/xlint/llib/Makefile @@ -8,8 +8,6 @@ FILESDIR= ${LINTLIBDIR} CLEANFILES+= ${LIBS} - - llib-lposix.ln: llib-lposix ${LINT} ${LINTFLAGS} -Cposix ${.ALLSRC} From ccc785556c58369c768fe6b6ca955f6d65d3dfb0 Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Mon, 15 Jun 2015 23:30:54 +0000 Subject: [PATCH 18/33] Deshallify. --- share/man/man9/ifnet.9 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9 index 0e55850beba3..b165e2b1cf27 100644 --- a/share/man/man9/ifnet.9 +++ b/share/man/man9/ifnet.9 @@ -1172,7 +1172,7 @@ structure to be the first element in that list. (A pointer to this address structure is saved in the .Vt ifnet -structure and shall be accessed by the +structure and is accessed by the .Fn ifaddr_byindex function.) The From d815a37dda60233738e9d7876f9e24fe89181c9e Mon Sep 17 00:00:00 2001 From: Gregory Neil Shapiro Date: Tue, 16 Jun 2015 02:58:50 +0000 Subject: [PATCH 19/33] The import of openssl to address the FreeBSD-SA-15:10.openssl security advisory includes a change which rejects handshakes with DH parameters below 768 bits. sendmail releases prior to 8.15.2 (not yet released), defaulted to a 512 bit DH parameter setting for client connections. This commit chages that default to 1024 bits. sendmail 8.15.2, when released well use a default of 2048 bits. MFC after: 1 day --- contrib/sendmail/src/tls.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/sendmail/src/tls.c b/contrib/sendmail/src/tls.c index 75207ee4a1f0..ca93ee8b730f 100644 --- a/contrib/sendmail/src/tls.c +++ b/contrib/sendmail/src/tls.c @@ -650,7 +650,7 @@ inittls(ctx, req, options, srv, certfile, keyfile, cacertpath, cacertfile, dhpar ** 1024 generate 1024 bit parameters ** 2048 generate 2048 bit parameters ** /file/name read parameters from /file/name - ** default is: 1024 for server, 512 for client (OK? XXX) + ** default is: 1024 */ if (bitset(TLS_I_TRY_DH, req)) @@ -676,8 +676,8 @@ inittls(ctx, req, options, srv, certfile, keyfile, cacertpath, cacertfile, dhpar } if (dhparam == NULL) { - dhparam = srv ? "1" : "5"; - req |= (srv ? TLS_I_DH1024 : TLS_I_DH512); + dhparam = "1"; + req |= TLS_I_DH1024; } else if (*dhparam == '/') { From 9c5682ed708587937557519126e59ac98926401f Mon Sep 17 00:00:00 2001 From: Gregory Neil Shapiro Date: Tue, 16 Jun 2015 03:03:26 +0000 Subject: [PATCH 20/33] The fix for the issue described in the 20150614 sendmail entry has been been committed in revision 284436. MFC after: 1 day --- UPDATING | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UPDATING b/UPDATING index 6ba4dc7c85aa..5472d97e7bc2 100644 --- a/UPDATING +++ b/UPDATING @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20150615: + The fix for the issue described in the 20150614 sendmail entry + below has been been committed in revision 284436. The work + around described in that entry is no longer needed unless the + default setting is overridden by a confDH_PARAMETERS configuration + setting of '5' or pointing to a 512 bit DH parameter file. + 20150614: ALLOW_DEPRECATED_ATF_TOOLS/ATFFILE support has been removed from atf.test.mk (included from bsd.test.mk). Please upgrade devel/atf From 80f3623f2f04f41dae3b5c9427dfd61bc68e98f9 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 16 Jun 2015 09:08:30 +0000 Subject: [PATCH 21/33] fd: don't unnecessary copy capabilities in _fget --- sys/kern/kern_descrip.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index bd7784609340..b2a1ebde4c8e 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2433,11 +2433,9 @@ _fget(struct thread *td, int fd, struct file **fpp, int flags, *fpp = NULL; fdp = td->td_proc->p_fd; - if (needrightsp != NULL) - needrights = *needrightsp; - else - cap_rights_init(&needrights); - error = fget_unlocked(fdp, fd, &needrights, &fp, seqp); + if (needrightsp == NULL) + needrightsp = cap_rights_init(&needrights); + error = fget_unlocked(fdp, fd, needrightsp, &fp, seqp); if (error != 0) return (error); if (fp->f_ops == &badfileops) { From 9ef8328d52b19fc91c0fc8052adfdf9599240f7a Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 16 Jun 2015 09:52:36 +0000 Subject: [PATCH 22/33] fd: make rights a mandatory argument to fget_unlocked --- sys/compat/svr4/svr4_misc.c | 3 ++- sys/kern/kern_descrip.c | 11 +++++------ sys/ofed/include/linux/file.h | 16 ++++++++++------ sys/security/audit/audit_arg.c | 4 +++- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 1b4a35eb77e4..9ad2a0936533 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -622,6 +622,7 @@ svr4_sys_fchroot(td, uap) struct thread *td; struct svr4_sys_fchroot_args *uap; { + cap_rights_t rights; struct filedesc *fdp = td->td_proc->p_fd; struct vnode *vp; struct file *fp; @@ -630,7 +631,7 @@ svr4_sys_fchroot(td, uap) if ((error = priv_check(td, PRIV_VFS_FCHROOT)) != 0) return error; /* XXX: we have the chroot priv... what cap might we need? all? */ - if ((error = getvnode(fdp, uap->fd, 0, &fp)) != 0) + if ((error = getvnode(fdp, uap->fd, cap_rights_init(&rights), &fp)) != 0) return error; vp = fp->f_vnode; VREF(vp); diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index b2a1ebde4c8e..82207869e092 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -746,7 +746,8 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) arg = arg ? 128 * 1024: 0; /* FALLTHROUGH */ case F_READAHEAD: - error = fget_unlocked(fdp, fd, NULL, &fp, NULL); + error = fget_unlocked(fdp, fd, + cap_rights_init(&rights), &fp, NULL); if (error != 0) break; if (fp->f_type != DTYPE_VNODE) { @@ -2368,11 +2369,9 @@ fget_unlocked(struct filedesc *fdp, int fd, cap_rights_t *needrightsp, if (fp == NULL) return (EBADF); #ifdef CAPABILITIES - if (needrightsp != NULL) { - error = cap_check(&haverights, needrightsp); - if (error != 0) - return (error); - } + error = cap_check(&haverights, needrightsp); + if (error != 0) + return (error); #endif retry: count = fp->f_count; diff --git a/sys/ofed/include/linux/file.h b/sys/ofed/include/linux/file.h index f1a73982d309..e2cebabfb97c 100644 --- a/sys/ofed/include/linux/file.h +++ b/sys/ofed/include/linux/file.h @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -46,10 +47,11 @@ extern struct fileops linuxfileops; static inline struct linux_file * linux_fget(unsigned int fd) { + cap_rights_t rights; struct file *file; - if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file, - NULL) != 0) { + if (fget_unlocked(curthread->td_proc->p_fd, fd, + cap_rights_init(&rights), &file, NULL) != 0) { return (NULL); } return (struct linux_file *)file->f_data; @@ -71,10 +73,11 @@ fput(struct linux_file *filp) static inline void put_unused_fd(unsigned int fd) { + cap_rights_t rights; struct file *file; - if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file, - NULL) != 0) { + if (fget_unlocked(curthread->td_proc->p_fd, fd, + cap_rights_init(&rights), &file, NULL) != 0) { return; } /* @@ -91,10 +94,11 @@ put_unused_fd(unsigned int fd) static inline void fd_install(unsigned int fd, struct linux_file *filp) { + cap_rights_t rights; struct file *file; - if (fget_unlocked(curthread->td_proc->p_fd, fd, NULL, &file, - NULL) != 0) { + if (fget_unlocked(curthread->td_proc->p_fd, fd, + cap_rights_init(&rights), &file, NULL) != 0) { file = NULL; } filp->_file = file; diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index 2e86842ba439..d17445f8d341 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -894,6 +895,7 @@ audit_arg_fcntl_rights(uint32_t fcntlrights) void audit_sysclose(struct thread *td, int fd) { + cap_rights_t rights; struct kaudit_record *ar; struct vnode *vp; struct file *fp; @@ -906,7 +908,7 @@ audit_sysclose(struct thread *td, int fd) audit_arg_fd(fd); - if (getvnode(td->td_proc->p_fd, fd, 0, &fp) != 0) + if (getvnode(td->td_proc->p_fd, fd, cap_rights_init(&rights), &fp) != 0) return; vp = fp->f_vnode; From 0e4cd4a2e0eb515cd0e3f0e935704388c46030f6 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Tue, 16 Jun 2015 12:36:29 +0000 Subject: [PATCH 23/33] cxgbe(4): Add the ability to dump mailbox commands and replies. It is enabled/disabled via bit 0 of adapter->debug_flags (which is available at dev.t5nex..debug_flags). MFC after: 1 week --- sys/dev/cxgbe/adapter.h | 22 ++++++++++++++++++++++ sys/dev/cxgbe/common/t4_hw.c | 4 ++++ sys/dev/cxgbe/t4_main.c | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 2655dae1c0f2..c1782971424b 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -206,6 +206,9 @@ enum { INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ INTR_NM_RXQ = (1 << 6), /* All netmap rxq's take interrupts */ INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ | INTR_NM_RXQ), + + /* adapter debug_flags */ + DF_DUMP_MBOX = (1 << 0), }; #define IS_DOOMED(pi) ((pi)->flags & DOOMED) @@ -762,6 +765,7 @@ struct adapter { int active_ulds; /* ULDs activated on this adapter */ #endif int flags; + int debug_flags; char ifp_lockname[16]; struct mtx ifp_lock; @@ -846,6 +850,24 @@ struct adapter { #define TXQ_LOCK_ASSERT_OWNED(txq) EQ_LOCK_ASSERT_OWNED(&(txq)->eq) #define TXQ_LOCK_ASSERT_NOTOWNED(txq) EQ_LOCK_ASSERT_NOTOWNED(&(txq)->eq) +#define CH_DUMP_MBOX(sc, mbox, data_reg) \ + do { \ + if (sc->debug_flags & DF_DUMP_MBOX) { \ + log(LOG_NOTICE, \ + "%s mbox %u: %016llx %016llx %016llx %016llx " \ + "%016llx %016llx %016llx %016llx\n", \ + device_get_nameunit(sc->dev), mbox, \ + (unsigned long long)t4_read_reg64(sc, data_reg), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 8), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 16), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 24), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 32), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 40), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 48), \ + (unsigned long long)t4_read_reg64(sc, data_reg + 56)); \ + } \ + } while (0) + #define for_each_txq(pi, iter, q) \ for (q = &pi->adapter->sge.txq[pi->first_txq], iter = 0; \ iter < pi->ntxq; ++iter, ++q) diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index e2efb782e703..d140276722c5 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -262,6 +262,8 @@ int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, for (i = 0; i < size; i += 8, p++) t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + CH_DUMP_MBOX(adap, mbox, data_reg); + t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); t4_read_reg(adap, ctl_reg); /* flush write */ @@ -287,6 +289,8 @@ int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, continue; } + CH_DUMP_MBOX(adap, mbox, data_reg); + res = t4_read_reg64(adap, data_reg); if (G_FW_CMD_OP(res >> 32) == FW_DEBUG_CMD) { fw_asrt(adap, data_reg); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index b164cce731e2..5c8805967f00 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -585,6 +585,9 @@ t4_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; +#ifdef INVARIANTS + sc->debug_flags = DF_DUMP_MBOX; +#endif pci_enable_busmaster(dev); if (pci_find_cap(dev, PCIY_EXPRESS, &i) == 0) { @@ -4603,6 +4606,9 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + &sc->debug_flags, 0, "flags to enable runtime debugging"); + #ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. From 4da8456f0aef1e189beee8bb09181ee510eeeee1 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Tue, 16 Jun 2015 13:09:18 +0000 Subject: [PATCH 24/33] Replace struct filedesc argument in getvnode with struct thread This is is a step towards removal of spurious arguments. --- sys/compat/linux/linux_file.c | 3 +-- sys/compat/svr4/svr4_misc.c | 9 +++------ sys/fs/fdescfs/fdesc_vnops.c | 2 +- sys/i386/ibcs2/ibcs2_misc.c | 6 ++---- sys/kern/vfs_acl.c | 8 ++++---- sys/kern/vfs_extattr.c | 8 ++++---- sys/kern/vfs_syscalls.c | 30 ++++++++++++------------------ sys/security/audit/audit_arg.c | 2 +- sys/sys/filedesc.h | 2 +- sys/ufs/ffs/ffs_alloc.c | 4 ++-- 10 files changed, 31 insertions(+), 43 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 9251a20abad1..1e5e37a2db76 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -348,8 +348,7 @@ getdents_common(struct thread *td, struct linux_getdents64_args *args, } else justone = 0; - error = getvnode(td->td_proc->p_fd, args->fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, args->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 9ad2a0936533..ec4504e7f96f 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -262,8 +262,7 @@ svr4_sys_getdents64(td, uap) DPRINTF(("svr4_sys_getdents64(%d, *, %d)\n", uap->fd, uap->nbytes)); - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); @@ -442,8 +441,7 @@ svr4_sys_getdents(td, uap) if (uap->nbytes < 0) return (EINVAL); - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); @@ -623,7 +621,6 @@ svr4_sys_fchroot(td, uap) struct svr4_sys_fchroot_args *uap; { cap_rights_t rights; - struct filedesc *fdp = td->td_proc->p_fd; struct vnode *vp; struct file *fp; int error; @@ -631,7 +628,7 @@ svr4_sys_fchroot(td, uap) if ((error = priv_check(td, PRIV_VFS_FCHROOT)) != 0) return error; /* XXX: we have the chroot priv... what cap might we need? all? */ - if ((error = getvnode(fdp, uap->fd, cap_rights_init(&rights), &fp)) != 0) + if ((error = getvnode(td, uap->fd, cap_rights_init(&rights), &fp)) != 0) return error; vp = fp->f_vnode; VREF(vp); diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 9c988326e7ba..15f3bd4a2a4a 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -482,7 +482,7 @@ fdesc_setattr(ap) /* * Allow setattr where there is an underlying vnode. */ - error = getvnode(td->td_proc->p_fd, fd, + error = getvnode(td, fd, cap_rights_init(&rights, CAP_EXTATTR_SET), &fp); if (error) { /* diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index c4dba2067cf0..ccf5190b0a71 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -342,8 +342,7 @@ ibcs2_getdents(td, uap) #define BSD_DIRENT(cp) ((struct dirent *)(cp)) #define IBCS2_RECLEN(reclen) (reclen + sizeof(u_short)) - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -498,8 +497,7 @@ ibcs2_read(td, uap) u_long *cookies = NULL, *cookiep; int ncookies; - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) { if (error == EINVAL) return sys_read(td, (struct read_args *)uap); diff --git a/sys/kern/vfs_acl.c b/sys/kern/vfs_acl.c index e9361e5726d0..56cc6c9eb13b 100644 --- a/sys/kern/vfs_acl.c +++ b/sys/kern/vfs_acl.c @@ -406,7 +406,7 @@ sys___acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap) cap_rights_t rights; int error; - error = getvnode(td->td_proc->p_fd, uap->filedes, + error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_GET), &fp); if (error == 0) { error = vacl_get_acl(td, fp->f_vnode, uap->type, uap->aclp); @@ -425,7 +425,7 @@ sys___acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap) cap_rights_t rights; int error; - error = getvnode(td->td_proc->p_fd, uap->filedes, + error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_SET), &fp); if (error == 0) { error = vacl_set_acl(td, fp->f_vnode, uap->type, uap->aclp); @@ -480,7 +480,7 @@ sys___acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap) cap_rights_t rights; int error; - error = getvnode(td->td_proc->p_fd, uap->filedes, + error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_DELETE), &fp); if (error == 0) { error = vacl_delete(td, fp->f_vnode, uap->type); @@ -535,7 +535,7 @@ sys___acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap) cap_rights_t rights; int error; - error = getvnode(td->td_proc->p_fd, uap->filedes, + error = getvnode(td, uap->filedes, cap_rights_init(&rights, CAP_ACL_CHECK), &fp); if (error == 0) { error = vacl_aclcheck(td, fp->f_vnode, uap->type, uap->aclp); diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 24935ceae605..0f82c2b1e49f 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -226,7 +226,7 @@ sys_extattr_set_fd(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - error = getvnode(td->td_proc->p_fd, uap->fd, + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_EXTATTR_SET), &fp); if (error) return (error); @@ -401,7 +401,7 @@ sys_extattr_get_fd(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - error = getvnode(td->td_proc->p_fd, uap->fd, + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_EXTATTR_GET), &fp); if (error) return (error); @@ -545,7 +545,7 @@ sys_extattr_delete_fd(td, uap) return (error); AUDIT_ARG_TEXT(attrname); - error = getvnode(td->td_proc->p_fd, uap->fd, + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_EXTATTR_DELETE), &fp); if (error) return (error); @@ -697,7 +697,7 @@ sys_extattr_list_fd(td, uap) AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = getvnode(td->td_proc->p_fd, uap->fd, + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_EXTATTR_LIST), &fp); if (error) return (error); diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index d2f0df13fdb3..9088017af133 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -365,8 +365,7 @@ kern_fstatfs(struct thread *td, int fd, struct statfs *buf) int error; AUDIT_ARG_FD(fd); - error = getvnode(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_FSTATFS), &fp); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSTATFS), &fp); if (error != 0) return (error); vp = fp->f_vnode; @@ -737,7 +736,7 @@ sys_fchdir(td, uap) int error; AUDIT_ARG_FD(uap->fd); - error = getvnode(fdp, uap->fd, cap_rights_init(&rights, CAP_FCHDIR), + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FCHDIR), &fp); if (error != 0) return (error); @@ -2671,8 +2670,8 @@ sys_fchflags(td, uap) AUDIT_ARG_FD(uap->fd); AUDIT_ARG_FFLAGS(uap->flags); - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_FCHFLAGS), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FCHFLAGS), + &fp); if (error != 0) return (error); #ifdef AUDIT @@ -3239,8 +3238,7 @@ kern_futimes(struct thread *td, int fd, struct timeval *tptr, error = getutimes(tptr, tptrseg, ts); if (error != 0) return (error); - error = getvnode(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_FUTIMES), &fp); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FUTIMES), &fp); if (error != 0) return (error); #ifdef AUDIT @@ -3275,8 +3273,7 @@ kern_futimens(struct thread *td, int fd, struct timespec *tptr, return (error); if (flags & UTIMENS_EXIT) return (0); - error = getvnode(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_FUTIMES), &fp); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FUTIMES), &fp); if (error != 0) return (error); #ifdef AUDIT @@ -3470,8 +3467,7 @@ sys_fsync(td, uap) int error, lock_flags; AUDIT_ARG_FD(uap->fd); - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_FSYNC), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); if (error != 0) return (error); vp = fp->f_vnode; @@ -3894,8 +3890,7 @@ kern_ogetdirentries(struct thread *td, struct ogetdirentries_args *uap, /* XXX arbitrary sanity limit on `count'. */ if (uap->count > 64 * 1024) return (EINVAL); - error = getvnode(td->td_proc->p_fd, uap->fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -4058,8 +4053,7 @@ kern_getdirentries(struct thread *td, int fd, char *buf, u_int count, if (count > IOSIZE_MAX) return (EINVAL); auio.uio_resid = count; - error = getvnode(td->td_proc->p_fd, fd, - cap_rights_init(&rights, CAP_READ), &fp); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_READ), &fp); if (error != 0) return (error); if ((fp->f_flag & FREAD) == 0) { @@ -4225,12 +4219,12 @@ sys_revoke(td, uap) * entry is held upon returning. */ int -getvnode(struct filedesc *fdp, int fd, cap_rights_t *rightsp, struct file **fpp) +getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp) { struct file *fp; int error; - error = fget_unlocked(fdp, fd, rightsp, &fp, NULL); + error = fget_unlocked(td->td_proc->p_fd, fd, rightsp, &fp, NULL); if (error != 0) return (error); @@ -4247,7 +4241,7 @@ getvnode(struct filedesc *fdp, int fd, cap_rights_t *rightsp, struct file **fpp) * checking f_ops. */ if (fp->f_vnode == NULL || fp->f_ops == &badfileops) { - fdrop(fp, curthread); + fdrop(fp, td); return (EINVAL); } *fpp = fp; diff --git a/sys/security/audit/audit_arg.c b/sys/security/audit/audit_arg.c index d17445f8d341..c006b90f049d 100644 --- a/sys/security/audit/audit_arg.c +++ b/sys/security/audit/audit_arg.c @@ -908,7 +908,7 @@ audit_sysclose(struct thread *td, int fd) audit_arg_fd(fd); - if (getvnode(td->td_proc->p_fd, fd, cap_rights_init(&rights), &fp) != 0) + if (getvnode(td, fd, cap_rights_init(&rights), &fp) != 0) return; vp = fp->f_vnode; diff --git a/sys/sys/filedesc.h b/sys/sys/filedesc.h index da80ed95672b..fe95111a137d 100644 --- a/sys/sys/filedesc.h +++ b/sys/sys/filedesc.h @@ -165,7 +165,7 @@ struct filedesc *fdshare(struct filedesc *fdp); struct filedesc_to_leader * filedesc_to_leader_alloc(struct filedesc_to_leader *old, struct filedesc *fdp, struct proc *leader); -int getvnode(struct filedesc *fdp, int fd, cap_rights_t *rightsp, +int getvnode(struct thread *td, int fd, cap_rights_t *rightsp, struct file **fpp); void mountcheckdirs(struct vnode *olddp, struct vnode *newdp); diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index c384064befbb..2b9c334f1691 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -2766,7 +2766,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) return (error); if (cmd.version != FFS_CMD_VERSION) return (ERPCMISMATCH); - if ((error = getvnode(td->td_proc->p_fd, cmd.handle, + if ((error = getvnode(td, cmd.handle, cap_rights_init(&rights, CAP_FSCK), &fp)) != 0) return (error); vp = fp->f_data; @@ -3080,7 +3080,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) (intmax_t)cmd.value); } #endif /* DEBUG */ - if ((error = getvnode(td->td_proc->p_fd, cmd.value, + if ((error = getvnode(td, cmd.value, cap_rights_init(&rights, CAP_FSCK), &vfp)) != 0) break; if (vfp->f_vnode->v_type != VCHR) { From 01c6133b109f5e1896be91ea91ab3939dd7685e5 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Tue, 16 Jun 2015 13:27:06 +0000 Subject: [PATCH 25/33] Merge from NetBSD: o rev. 1.10: Nuke trailing whitespace. o rev. 1.15: Fix typo in comment. o rev. 1.16: Add the following registers from IEEE 802.3-2009 Clause 22: - PSE control register (0x0b) - PSE status register (0x0c) - MMD access control register (0x0d) - MMD access address data register (0x0e) o rev. 1.17 (comments only): The bit location of link ability is different between 1000Base-X and others (see Annex 28B.2 and 28D). o rev. 1.18: Nuke dupe word. Obtained from: NetBSD MFC after: 1 week Sponsored by: genua mbh --- sys/dev/mii/mii.h | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/sys/dev/mii/mii.h b/sys/dev/mii/mii.h index 668fb8fb8719..297ef21aad26 100644 --- a/sys/dev/mii/mii.h +++ b/sys/dev/mii/mii.h @@ -1,4 +1,4 @@ -/* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */ +/* $NetBSD: mii.h,v 1.18 2014/06/16 14:43:22 msaitoh Exp $ */ /*- * Copyright (c) 1997 Manuel Bouyer. All rights reserved. @@ -87,7 +87,7 @@ /* * Note that the EXTSTAT bit indicates that there is extended status * info available in register 15, but 802.3 section 22.2.4.3 also - * states that that all 1000 Mb/s capable PHYs will set this bit to 1. + * states that all 1000 Mb/s capable PHYs will set this bit to 1. */ #define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \ @@ -111,6 +111,7 @@ #define ANAR_NP 0x8000 /* Next page (ro) */ #define ANAR_ACK 0x4000 /* link partner abilities acknowledged (ro) */ #define ANAR_RF 0x2000 /* remote fault (ro) */ + /* Annex 28B.2 */ #define ANAR_FC 0x0400 /* local device supports PAUSE */ #define ANAR_T4 0x0200 /* local device supports 100bT4 */ #define ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */ @@ -123,6 +124,7 @@ #define ANAR_PAUSE_ASYM (2 << 10) #define ANAR_PAUSE_TOWARDS (3 << 10) + /* Annex 28D */ #define ANAR_X_FD 0x0020 /* local device supports 1000BASE-X FD */ #define ANAR_X_HD 0x0040 /* local device supports 1000BASE-X HD */ #define ANAR_X_PAUSE_NONE (0 << 7) @@ -184,12 +186,47 @@ #define GTSR_MAN_MS_FLT 0x8000 /* master/slave config fault */ #define GTSR_MS_RES 0x4000 /* result: 1 = master, 0 = slave */ #define GTSR_LRS 0x2000 /* local rx status, 1 = ok */ -#define GTSR_RRS 0x1000 /* remove rx status, 1 = ok */ +#define GTSR_RRS 0x1000 /* remote rx status, 1 = ok */ #define GTSR_LP_1000TFDX 0x0800 /* link partner 1000baseT FDX capable */ #define GTSR_LP_1000THDX 0x0400 /* link partner 1000baseT HDX capable */ #define GTSR_LP_ASM_DIR 0x0200 /* link partner asym. pause dir. capable */ #define GTSR_IDLE_ERR 0x00ff /* IDLE error count */ +#define MII_PSECR 0x0b /* PSE control register */ +#define PSECR_PACTLMASK 0x000c /* pair control mask */ +#define PSECR_PSEENMASK 0x0003 /* PSE enable mask */ +#define PSECR_PINOUTB 0x0008 /* PSE pinout Alternative B */ +#define PSECR_PINOUTA 0x0004 /* PSE pinout Alternative A */ +#define PSECR_FOPOWTST 0x0002 /* Force Power Test Mode */ +#define PSECR_PSEEN 0x0001 /* PSE Enabled */ +#define PSECR_PSEDIS 0x0000 /* PSE Disabled */ + +#define MII_PSESR 0x0c /* PSE status register */ +#define PSESR_PWRDENIED 0x1000 /* Power Denied */ +#define PSESR_VALSIG 0x0800 /* Valid PD signature detected */ +#define PSESR_INVALSIG 0x0400 /* Inalid PD signature detected */ +#define PSESR_SHORTCIRC 0x0200 /* Short circuit condition detected */ +#define PSESR_OVERLOAD 0x0100 /* Overload condition detected */ +#define PSESR_MPSABSENT 0x0080 /* MPS absent condition detected */ +#define PSESR_PDCLMASK 0x0070 /* PD Class mask */ +#define PSESR_STATMASK 0x000e /* PSE Status mask */ +#define PSESR_PAIRCTABL 0x0001 /* PAIR Control Ability */ +#define PSESR_PDCL_4 (4 << 4) /* Class 4 */ +#define PSESR_PDCL_3 (3 << 4) /* Class 3 */ +#define PSESR_PDCL_2 (2 << 4) /* Class 2 */ +#define PSESR_PDCL_1 (1 << 4) /* Class 1 */ +#define PSESR_PDCL_0 (0 << 4) /* Class 0 */ + +#define MII_MMDACR 0x0d /* MMD access control register */ +#define MMDACR_FUNCMASK 0xc000 /* function */ +#define MMDACR_DADDRMASK 0x001f /* device address */ +#define MMDACR_FN_ADDRESS (0 << 14) /* address */ +#define MMDACR_FN_DATANPI (1 << 14) /* data, no post increment */ +#define MMDACR_FN_DATAPIRW (2 << 14) /* data, post increment on r/w */ +#define MMDACR_FN_DATAPIW (3 << 14) /* data, post increment on wr only */ + +#define MII_MMDAADR 0x0e /* MMD access address data register */ + #define MII_EXTSR 0x0f /* Extended status register */ #define EXTSR_1000XFDX 0x8000 /* 1000X full-duplex capable */ #define EXTSR_1000XHDX 0x4000 /* 1000X half-duplex capable */ From 3d2550b5c4587e9dbdef0c5669c72dc352714622 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Tue, 16 Jun 2015 15:14:40 +0000 Subject: [PATCH 26/33] Trying to unbreak arm.LINT by properly putting the conditional include for dtrace further down in the include list where it belongs. Reviewed by: andrew --- sys/arm/arm/trap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/arm/arm/trap.c b/sys/arm/arm/trap.c index 56407aa0348a..52a5baae0dfc 100644 --- a/sys/arm/arm/trap.c +++ b/sys/arm/arm/trap.c @@ -78,10 +78,6 @@ * Created : 28/11/94 */ -#ifdef KDTRACE_HOOKS -#include -#endif - #include __FBSDID("$FreeBSD$"); @@ -109,6 +105,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef KDTRACE_HOOKS +#include +#endif + extern char fusubailout[]; #ifdef DEBUG From a57b51f99a82052f5c9c816b3f45ea911c3bcde4 Mon Sep 17 00:00:00 2001 From: Gleb Smirnoff Date: Tue, 16 Jun 2015 15:39:34 +0000 Subject: [PATCH 27/33] Fix miss from r284320. Coverity: 1018895 --- sys/dev/atkbdc/psm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/atkbdc/psm.c b/sys/dev/atkbdc/psm.c index 7ef32a4e58fe..a82a767cb7c7 100644 --- a/sys/dev/atkbdc/psm.c +++ b/sys/dev/atkbdc/psm.c @@ -5102,7 +5102,7 @@ enable_trackpoint(struct psm_softc *sc, enum probearg arg) id = read_aux_data(kbdc); if (id < 0x01) return (FALSE); - if (sc != NULL) + if (arg == PROBE) sc->tphw = id; if (!trackpoint_support) return (FALSE); From 9975c7a7ef0b2a0451d2e9a52669277e6fc87829 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 16 Jun 2015 16:40:25 +0000 Subject: [PATCH 28/33] Export the ARM __aeabi_mem* functions from libc, they are needed by the gcc from ports as it doesn't include these in the copy of libgcc it installs uses. Obtained from: ABT Systems Ltd --- lib/libc/arm/aeabi/Makefile.inc | 8 -------- lib/libc/arm/aeabi/Symbol.map | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/libc/arm/aeabi/Makefile.inc b/lib/libc/arm/aeabi/Makefile.inc index fa0ec8e9aee4..612e47fb9d3a 100644 --- a/lib/libc/arm/aeabi/Makefile.inc +++ b/lib/libc/arm/aeabi/Makefile.inc @@ -27,13 +27,5 @@ SRCS+= aeabi_memcmp.S \ aeabi_memmove.S \ aeabi_memset.S -# Mark the functions as hidden so they are not available outside of libc. -CFLAGS.aeabi_memcmp.S= -DVISIBILITY_HIDDEN -CFLAGS.aeabi_memcpy.S= -DVISIBILITY_HIDDEN -CFLAGS.aeabi_memmove.S= -DVISIBILITY_HIDDEN -CFLAGS.aeabi_memset.S= -DVISIBILITY_HIDDEN -CFLAGS+= ${CFLAGS.${.IMPSRC:T}} - - SYM_MAPS+=${LIBC_SRCTOP}/arm/aeabi/Symbol.map diff --git a/lib/libc/arm/aeabi/Symbol.map b/lib/libc/arm/aeabi/Symbol.map index 164d3e77f169..1aff92912434 100644 --- a/lib/libc/arm/aeabi/Symbol.map +++ b/lib/libc/arm/aeabi/Symbol.map @@ -52,4 +52,21 @@ FBSDprivate_1.0 { __aeabi_i2d; __aeabi_i2f; + + + __aeabi_memclr; + __aeabi_memclr4; + __aeabi_memclr8; + __aeabi_memcmp; + __aeabi_memcmp4; + __aeabi_memcmp8; + __aeabi_memcpy; + __aeabi_memcpy4; + __aeabi_memcpy8; + __aeabi_memmove; + __aeabi_memmove4; + __aeabi_memmove8; + __aeabi_memset; + __aeabi_memset4; + __aeabi_memset8; }; From e96da3ffbe7d08869196958c66f6108e051fe4db Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 16 Jun 2015 17:24:20 +0000 Subject: [PATCH 29/33] Write to the PRRR (Primary Region Remap Register) rather than reading from it during the early boot. Found By: Patrick Wildt Sponsored by: ABT Systems Ltd --- sys/arm/arm/locore-v6.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm/arm/locore-v6.S b/sys/arm/arm/locore-v6.S index 7d5ba9704ae7..cddcdab787cc 100644 --- a/sys/arm/arm/locore-v6.S +++ b/sys/arm/arm/locore-v6.S @@ -240,7 +240,7 @@ ASENTRY_NP(init_mmu) * - All is set to uncacheable memory */ ldr r0, =0xAAAAA - mrc CP15_PRRR(r0) + mcr CP15_PRRR(r0) mov r0, #0 mcr CP15_NMRR(r0) #endif From 6cdaf31e2a8d576df770020794290396d0f1b01a Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 16 Jun 2015 17:27:53 +0000 Subject: [PATCH 30/33] Add a comment to the end of the world and kernel cases in the universe target to help follow the make magic. Obtained from: ABT Systems Ltd --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 67e10845bfe1..be1ee45a4159 100644 --- a/Makefile +++ b/Makefile @@ -450,7 +450,8 @@ universe_${target}_${target_arch}: universe_${target}_prologue .MAKE ${MAKEFAIL})) @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} completed on `LC_ALL=C date`" .endfor -.endif +.endif # !MAKE_JUST_KERNELS + .if !defined(MAKE_JUST_WORLDS) # If we are building world and kernels wait for the required worlds to finish .if !defined(MAKE_JUST_KERNELS) @@ -468,7 +469,7 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE .endif @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels -.endif +.endif # !MAKE_JUST_WORLDS @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe_kernels: universe_kernconfs From 35c9a2a9a178157ba7f22db4f44d28f1f81db177 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 16 Jun 2015 17:55:20 +0000 Subject: [PATCH 31/33] A more compatible fix to MK_META_MODE not being defined. Also, encase bmake specific constructs not needed for make bootstrap so fmake doesn't see them. This works with fmake just well enough for us to build bmake to build the rest of the tree without fatal errors. Tested only with fmake package. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index be1ee45a4159..4287ac9cc6e9 100644 --- a/Makefile +++ b/Makefile @@ -99,7 +99,10 @@ # # For more information, see the build(7) manual page. # -.if ${MK_META_MODE:Uno} == "yes" + +# Note: we use this awkward construct to be compatible with FreeBSD's +# old make used in 10.0 and 9.2 and earlier. +.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" # targets/Makefile plays the role of top-level .include "targets/Makefile" .else @@ -522,6 +525,7 @@ universe_epilogue: buildLINT: ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT +.if defined(.PARSEDIR) # This makefile does not run in meta mode .MAKE.MODE= normal # Normally the things we run from here don't either. @@ -539,5 +543,6 @@ UPDATE_DEPENDFILE= NO MAKE_JOB_ERROR_TOKEN= no .export MAKE_JOB_ERROR_TOKEN .endif +.endif # bmake .endif # META_MODE From 149da95c87e41e09e81f77cb20d8753bf8c17233 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 16 Jun 2015 18:43:08 +0000 Subject: [PATCH 32/33] Add a universe_${target}_worlds target to simplify the logic to find when to start building kernels. Obtained from: ABT Systems Ltd --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 4287ac9cc6e9..8a487af984df 100644 --- a/Makefile +++ b/Makefile @@ -438,9 +438,12 @@ universe_epilogue: universe_${target} universe_${target}: universe_${target}_prologue universe_${target}_prologue: universe_prologue @echo ">> ${target} started on `LC_ALL=C date`" +universe_${target}_worlds: + .if !defined(MAKE_JUST_KERNELS) .for target_arch in ${TARGET_ARCHES_${target}} universe_${target}: universe_${target}_${target_arch} +universe_${target}_worlds: universe_${target}_${target_arch} universe_${target}_${target_arch}: universe_${target}_prologue .MAKE @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ @@ -456,13 +459,8 @@ universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .endif # !MAKE_JUST_KERNELS .if !defined(MAKE_JUST_WORLDS) -# If we are building world and kernels wait for the required worlds to finish -.if !defined(MAKE_JUST_KERNELS) -.for target_arch in ${TARGET_ARCHES_${target}} -universe_${target}_kernels: universe_${target}_${target_arch} -.endfor -.endif universe_${target}: universe_${target}_kernels +universe_${target}_kernels: universe_${target}_worlds universe_${target}_kernels: universe_${target}_prologue .MAKE .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ From 1272c4aad259a186aa9724f0f8e0d7fe7a4c5e85 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 16 Jun 2015 19:23:34 +0000 Subject: [PATCH 33/33] Add a new target universe_${target}_done to print the completion message. Without this we could print this message in the wrong place when building with MAKE_JUST_WORLDS is set. Obtained from: ABT Systems Ltd --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 8a487af984df..d49ed995509c 100644 --- a/Makefile +++ b/Makefile @@ -444,6 +444,7 @@ universe_${target}_worlds: .for target_arch in ${TARGET_ARCHES_${target}} universe_${target}: universe_${target}_${target_arch} universe_${target}_worlds: universe_${target}_${target_arch} +universe_${target}_done: universe_${target}_worlds universe_${target}_${target_arch}: universe_${target}_prologue .MAKE @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ @@ -460,6 +461,7 @@ universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .if !defined(MAKE_JUST_WORLDS) universe_${target}: universe_${target}_kernels +universe_${target}_done: universe_${target}_kernels universe_${target}_kernels: universe_${target}_worlds universe_${target}_kernels: universe_${target}_prologue .MAKE .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @@ -471,6 +473,10 @@ universe_${target}_kernels: universe_${target}_prologue .MAKE @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif # !MAKE_JUST_WORLDS + +# Tell the user the worlds and kernels have completed +universe_${target}: universe_${target}_done +universe_${target}_done: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor universe_kernels: universe_kernconfs