dragonfly.git
7 years agolibcrypt - Internalize additional symbols
Matthew Dillon [Mon, 24 Oct 2016 06:38:34 +0000 (23:38 -0700)]
libcrypt - Internalize additional symbols

* Internalize additional symbols which conflict with libssl or libressl.
  This works around the apache https issue we had by avoiding a buggy
  error path that will be fixed upstream.  This also fixes a bogus fetch
  failures we were having while testing https.

* Make the *_Init() API for MD5, SHA*, etc in libmd compatible with libssl
  and libressl.

* Note that libmd is inheritently incompatible with lib[re]ssl, so look
  for an upcoming fix for that (maybe we can remove it entirely).

7 years agoif_iwm - Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better
Imre Vadász [Sat, 22 Oct 2016 19:41:00 +0000 (21:41 +0200)]
if_iwm - Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better

* Tear down the relevant firmware state (i.e. the station, the vif binding)
  in these transition cases.

* Before this case would leave the firmware state lying around, resulting
  in errors and firmware panics in the subsequent association attempts.

7 years agoif_iwm - Factor out firmware station handling into if_iwm_sta.c.
Imre Vadász [Sun, 23 Oct 2016 21:10:29 +0000 (23:10 +0200)]
if_iwm - Factor out firmware station handling into if_iwm_sta.c.

* This adds iwm_mvm_rm_sta(), which will be used to tear down firmware
  state for better/cleaner iwm_newstate() handling.

* Makes iwm_enable_txq() and iwm_mvm_flush_tx_path() non-static, add
  the declarations to if_iwm_util.h for now.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Deduplicate code in iwm_auth() from an if condition.
Imre Vadász [Sun, 23 Oct 2016 15:25:51 +0000 (17:25 +0200)]
if_iwm - Deduplicate code in iwm_auth() from an if condition.

7 years agoif_iwm - No need for iwm_assoc() in AUTH->ASSOC transition.
Imre Vadász [Sun, 23 Oct 2016 21:08:47 +0000 (23:08 +0200)]
if_iwm - No need for iwm_assoc() in AUTH->ASSOC transition.

* Hence no need to keep stuff in separate iwm_assoc() function, just
  inline the stuff into iwm_newstate().

7 years agoif_iwm - Properly implement iwm_wme_update callback function.
Imre Vadász [Sun, 23 Oct 2016 19:34:08 +0000 (21:34 +0200)]
if_iwm - Properly implement iwm_wme_update callback function.

* Inspired by iwn(4) and Linux iwlwifi.

* Read wme parameters into a buffer within struct iwm_vap in
  iwm_wme_update().

* If we aren't associated yet, the new settings will soon be sent
  by iwm_mvm_mac_ctxt_changed() during association.

* If we are already associated, explicitly call iwm_mvm_mac_ctxt_changed()
  from iwm_wme_update() to send the new settings to the firmware.

* Change iwm_mvm_ac_to_tx_fifo mapping, to fit the freebsd net80211
  WME stream class numbering, instead of Linux's enum ieee80211_ac_numbers.

7 years agokernel - Minor documentation adjustment for arc4random
Matthew Dillon [Fri, 21 Oct 2016 21:36:25 +0000 (14:36 -0700)]
kernel - Minor documentation adjustment for arc4random

* Minor documentation adjustment for arc4random

7 years agokernel - Fix directory scanning bug in msdosfs
Matthew Dillon [Fri, 21 Oct 2016 20:37:07 +0000 (13:37 -0700)]
kernel - Fix directory scanning bug in msdosfs

* Fix a directory scanning bug in msdosfs where an incorrect d_namlen
  was being returned.

Reported-by: htse, t_dfbsd, tuxillo
7 years agogdb: Trim sources that create empty objects.
zrj [Wed, 12 Oct 2016 13:14:49 +0000 (16:14 +0300)]
gdb: Trim sources that create empty objects.

Shouldn't wctype-h.c produce symbols?

7 years agodiffutils: Trim sources that create empty objects.
zrj [Wed, 12 Oct 2016 13:08:14 +0000 (16:08 +0300)]
diffutils: Trim sources that create empty objects.

There are several things that need to be addressed here.
Should (like in grep(1)) wctype-h.c produce symbols?

7 years agolibrpcsvc: Trim sources that create empty objects.
zrj [Wed, 12 Oct 2016 12:49:50 +0000 (15:49 +0300)]
librpcsvc: Trim sources that create empty objects.

Here I'm not sure why this was compiled at all or why it has no symbols.

7 years agolvm2: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 10:29:43 +0000 (13:29 +0300)]
lvm2: Trim sources that create empty objects.

Source is empty, not implemented.

7 years agolibstdcxx5: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 10:23:29 +0000 (13:23 +0300)]
libstdcxx5: Trim sources that create empty objects.

Only when targetting ARM.

7 years agolibgomp5: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 10:19:18 +0000 (13:19 +0300)]
libgomp5: Trim sources that create empty objects.

Source files are stub ones, implemented in headers.

7 years agogroff: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 07:53:03 +0000 (10:53 +0300)]
groff: Trim sources that create empty objects.

7 years agolibusbhid: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 07:33:23 +0000 (10:33 +0300)]
libusbhid: Trim sources that create empty objects.

7 years agoncurses: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 07:28:51 +0000 (10:28 +0300)]
ncurses: Trim sources that create empty objects.

7 years agolibssh: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 07:27:24 +0000 (10:27 +0300)]
libssh: Trim sources that create empty objects.

7 years agolibpam: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 07:16:31 +0000 (10:16 +0300)]
libpam: Trim sources that create empty objects.

7 years agolibmagic: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 07:13:12 +0000 (10:13 +0300)]
libmagic: Trim sources that create empty objects.

7 years agolibedit: Trim sources that create empty objects.
zrj [Tue, 11 Oct 2016 06:22:10 +0000 (09:22 +0300)]
libedit: Trim sources that create empty objects.

7 years agogcc50: Trim sources that create empty objects.
zrj [Wed, 5 Oct 2016 11:32:04 +0000 (14:32 +0300)]
gcc50: Trim sources that create empty objects.

 * Disable gen source of HAVE_peephole, only applies for gcc <= 5.x.
 * Exclude {hw,loop}-doloop.c, protected by HAVE_doloop_end guard (gcc < 6).

7 years agolibmgmp: Trim sources that create empty objects.
zrj [Wed, 5 Oct 2016 08:21:42 +0000 (11:21 +0300)]
libmgmp: Trim sources that create empty objects.

7 years agolibmpfr: Trim sources that create empty objects.
zrj [Wed, 5 Oct 2016 08:21:00 +0000 (11:21 +0300)]
libmpfr: Trim sources that create empty objects.

7 years agogrep(1): Trim sources that create empty objects.
zrj [Wed, 5 Oct 2016 07:57:11 +0000 (10:57 +0300)]
grep(1): Trim sources that create empty objects.

There are several things that need to be addressed here.

7 years agosys/boot: Remove empty source.
zrj [Fri, 21 Oct 2016 06:05:26 +0000 (09:05 +0300)]
sys/boot: Remove empty source.

7 years agobootstrap: Add workaround for chflagsat() from 4.0.
zrj [Fri, 21 Oct 2016 10:35:12 +0000 (13:35 +0300)]
bootstrap: Add workaround for chflagsat() from 4.0.

Avoid failing syscalls during installworld while updating from DragonFly 4.0.
Add special private version of chflagsat() to aid while performing migration.
Add triple protection for this private implementation variant.
Hopefully chflags-compat.h would never need any newer additions.

Since there are other issues that require both installkernel and installworld,
standard installkernel, reboot and installworld is not possible while updating
to recent DragonFly releases. chflags(1) must be handled with care.

Tested-on: kern.osreldate == 400000 updating straight to master (4.7).
  installworld step fail only on single non fatal chflags: invalid flag: xlink
  For make upgrade to work sendmail must be removed from /etc/mail/mailer.conf
  reboot(8) must be used cause shutdown is only functional only on new kernel.

Submitted-by: dillon@
7 years agobootstrap: Fix old boostrapping issue once and for all part 2.
zrj [Fri, 21 Oct 2016 10:20:13 +0000 (13:20 +0300)]
bootstrap: Fix old boostrapping issue once and for all part 2.

In f08f1baa605ef8f4a93a42e1d790a9fcfb44df35 I forgot to git add -p the line to
export WORLD_VERSION variable to make it constant through buildworld process.
This time add it close so it would not get lost again, fail window was 1 month.
make buildworld WORLD_VERSION=400300 still have worked.

While there, add bootstrap workaround to bootstrap from 4.0-RELEASE too.
chflags(1) issue with chflagsat() is a bit more subtle, will be pushed later.

Tested-on: dfly-x86_64-4.0.6_REL.img updating straight to 4.7-DEVELOPMENT.
  Not bad considering DragonFly 4.0 had gcc44 + gcc47 and was still able to
  bootstrap the DragonFly 4.7 having gcc v5.0 as main compiler.

Reported-by: dillon@
7 years ago<wchar.h>: Add support for compilers -fshort-wchar.
zrj [Thu, 20 Oct 2016 09:50:58 +0000 (12:50 +0300)]
<wchar.h>: Add support for compilers -fshort-wchar.

Both clang and gcc need to be able to override wchar_t type.

7 years agoinstaller: Init payload to NULL.
zrj [Fri, 14 Oct 2016 13:41:31 +0000 (16:41 +0300)]
installer: Init payload to NULL.

Code checks for payload if it is allocated or not, so technically
this is a case where this pointer is used not initialized.

7 years agoppp: Avoid gcc warnings.
zrj [Wed, 12 Oct 2016 05:19:49 +0000 (08:19 +0300)]
ppp: Avoid gcc warnings.

ncprange_getip4mask() will not initialize mask for cases other than AF_INET
so give default value of INADDR_ANY (0x0) even if compiler misses that
ncprange_getip4mask() called only for AF_INET case in main function.

7 years agosetkey(8): Fix m_len type to match real one.
zrj [Tue, 11 Oct 2016 14:55:47 +0000 (17:55 +0300)]
setkey(8): Fix m_len type to match real one.

Given that it is used in places for sizeof() etc it should be unsigned.

7 years agomlxcontrol(8): Provide defaults to few variables.
zrj [Tue, 11 Oct 2016 14:47:17 +0000 (17:47 +0300)]
mlxcontrol(8): Provide defaults to few variables.

GCC is right here, mlxd_find_ctrlr() will not initiallize these on failure.

7 years agotelnet(1): Fix line definition to match extern one.
zrj [Tue, 11 Oct 2016 14:26:19 +0000 (17:26 +0300)]
telnet(1): Fix line definition to match extern one.

In telnetd it is extern char[16] so just use that.

7 years agowall(1): Avoid gcc warning.
zrj [Tue, 11 Oct 2016 14:19:39 +0000 (17:19 +0300)]
wall(1): Avoid gcc warning.

7 years agousers(1): Avoid gcc warning.
zrj [Tue, 11 Oct 2016 14:16:11 +0000 (17:16 +0300)]
users(1): Avoid gcc warning.

7 years agosystat(1): Fix curscale type to match other one.
zrj [Tue, 11 Oct 2016 14:07:08 +0000 (17:07 +0300)]
systat(1): Fix curscale type to match other one.

Also avoid triggering the the warning for ep.

7 years agousr.bin/rfcomm_sppd: Avoid gcc warnings.
zrj [Tue, 11 Oct 2016 14:00:58 +0000 (17:00 +0300)]
usr.bin/rfcomm_sppd: Avoid gcc warnings.

7 years agocal(1): Avoid gcc warnings.
zrj [Tue, 11 Oct 2016 13:25:33 +0000 (16:25 +0300)]
cal(1): Avoid gcc warnings.

Looks like here the compiler is right.

7 years agosbin/quotacheck: Rename maxino to remove globals conflict.
zrj [Tue, 11 Oct 2016 09:44:26 +0000 (12:44 +0300)]
sbin/quotacheck: Rename maxino to remove globals conflict.

fsck/fsck.h has it as ufs1_ino_t so to avoid type mismatches rename it.

7 years agoadventure(6): Fix type to match public one.
zrj [Mon, 10 Oct 2016 10:00:29 +0000 (13:00 +0300)]
adventure(6): Fix type to match public one.

7 years agodm(8): Avoid warning on gcc with -flto.
zrj [Mon, 10 Oct 2016 09:59:58 +0000 (12:59 +0300)]
dm(8): Avoid warning on gcc with -flto.

7 years agotalkd(8): Avoid warning on gcc with -flto.
zrj [Mon, 10 Oct 2016 07:52:29 +0000 (10:52 +0300)]
talkd(8): Avoid warning on gcc with -flto.

7 years agoless(1): Fix type mismatches in different objects.
zrj [Tue, 11 Oct 2016 13:38:42 +0000 (16:38 +0300)]
less(1): Fix type mismatches in different objects.

Not sure which one is better int or long. For now downgrade to int,
cause it is less changes in contrib code.

7 years agocvs: Use mempcpy() from libc.
zrj [Tue, 11 Oct 2016 11:13:51 +0000 (14:13 +0300)]
cvs: Use mempcpy() from libc.

Helps with LTO builds.

7 years agodevd(8): Make it possible to compile with LTO.
zrj [Tue, 11 Oct 2016 09:20:51 +0000 (12:20 +0300)]
devd(8): Make it possible to compile with LTO.

Make -Wodr warning (internal to c++ headers) under -flto non fatal.
Also give initial value, pidfile_open() has too many return points.

7 years agobackgammon(6): Prevent LTO seeing details for now.
zrj [Mon, 10 Oct 2016 09:43:25 +0000 (12:43 +0300)]
backgammon(6): Prevent LTO seeing details for now.

init.c should contain "back.h" for types (TBI later).
-flto gives lots of error: type of 'args' does not match original declaration [-Werror]

/usr/src/games/backgammon/backgammon/../common_source/back.h
 extern char *args[16]; /* args passed to teachgammon and back */
/usr/src/games/backgammon/backgammon/../common_source/init.c
 char args[100];

/usr/src/games/backgammon/backgammon/../common_source/back.h
 extern int  old; /* original tty status */
/usr/src/games/backgammon/backgammon/../common_source/init.c
 struct termios tty, old, noech, raw;

/usr/src/games/backgammon/backgammon/../common_source/back.h
 extern int  raw; /* raw tty status, no echo */
/usr/src/games/backgammon/backgammon/../common_source/init.c
 struct termios tty, old, noech, raw;

/usr/src/games/backgammon/backgammon/../common_source/back.h
 extern int  noech; /* original tty status without echo */
/usr/src/games/backgammon/backgammon/../common_source/init.c
 struct termios tty, old, noech, raw;
lto1: all warnings being treated as errors

7 years agocsh(1): Allow to bootstrap with -flto.
zrj [Wed, 5 Oct 2016 11:35:30 +0000 (14:35 +0300)]
csh(1): Allow to bootstrap with -flto.

tcsh(1) replaces malloc, thus with LTO sees multiple symbols.

7 years agoinstall(1): Silence false gcc warnings.
zrj [Tue, 4 Oct 2016 05:16:34 +0000 (08:16 +0300)]
install(1): Silence false gcc warnings.

Happens on LTO builds.

7 years agoif_iwm - Process multiple frames per RX buffer.
Imre Vadász [Sun, 4 Sep 2016 08:51:11 +0000 (10:51 +0200)]
if_iwm - Process multiple frames per RX buffer.

* Factor out iwm_handle_rxb() function from iwm_notif_intr().

* Removing the IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK flag allows
  the device to put multiple frames (both command responses and 80211
  frames) into a single RX buffer.

* Uses m_copym() to split up the receive buffers when multiple 80211
  frames are received in one RX buffer. The effect is basically the same
  as when using m_split(), but we want to keep the original mbuf around
  when calling iwm_mvm_rx_rx_mpdu() to make error handling a bit easier
  for now.

* Contains a small optimization to avoid the m_copym() when only a single
  80211 frame is received in one RX buffer (i.e. matching the existing
  behaviour).

Taken-From and Inspired-By: Linux iwlwifi

7 years agoRemove dead /usr/include/compat symlink, too.
Sascha Wildner [Tue, 18 Oct 2016 21:13:17 +0000 (23:13 +0200)]
Remove dead /usr/include/compat symlink, too.

Followup commit to 6737a4ffb92.

7 years agokernel: Remove the COMPAT_43 kernel option along with all related code.
Sascha Wildner [Tue, 18 Oct 2016 20:50:13 +0000 (22:50 +0200)]
kernel: Remove the COMPAT_43 kernel option along with all related code.

It is commented out in our default kernel config files for almost five
years now, since 9466f37df5258f3bc3d99ae43627a71c1c085e7d.

Approved-by: dillon
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2946>

7 years agobsd-family-tree: Sync with FreeBSD (FreeBSD 11.0).
Sascha Wildner [Tue, 18 Oct 2016 19:34:03 +0000 (21:34 +0200)]
bsd-family-tree: Sync with FreeBSD (FreeBSD 11.0).

7 years agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 18 Oct 2016 19:32:52 +0000 (21:32 +0200)]
Update the pciconf(8) database.

October 13, 2016 snapshot from http://pciids.sourceforge.net/

7 years ago<sys/types.h>: Add definitions of bool, true and false for the kernel.
Sascha Wildner [Tue, 18 Oct 2016 19:27:32 +0000 (21:27 +0200)]
<sys/types.h>: Add definitions of bool, true and false for the kernel.

Remove some local definitions in drivers and also switch boolean_t
over to _Bool (if available).

This is similar to how FreeBSD does it.

7 years agotcpdchk(8): Honor global CFLAGS.
zrj [Tue, 18 Oct 2016 15:37:21 +0000 (18:37 +0300)]
tcpdchk(8): Honor global CFLAGS.

Forgot to include in 8d378610e3b5687c707bc8aad4e11a3a96bea2fc for tcpdmatch(8).

7 years agobinutils225: Honor global CFLAGS.
zrj [Tue, 18 Oct 2016 13:07:16 +0000 (16:07 +0300)]
binutils225: Honor global CFLAGS.

Make CFLAGS partially overridable so to preserve global CFLAGS.
block2/ld has its own config.h but still requires bfd.h.
Ensure that private config.h takes precedence over general bulibs one.

While testing noticed that block2/gas ignores its config.h, so fix that too.
block2/libgold is fine, since it uses block3/Makefile.gld.

7 years agoroute: addroute may change rt->rt_ifa; keep the local copy in sync.
Sepherosa Ziehau [Tue, 18 Oct 2016 13:23:12 +0000 (21:23 +0800)]
route: addroute may change rt->rt_ifa; keep the local copy in sync.

Reported-by: pecan
7 years agox86_64: Work around AMD erratum 793 for family 16h, models 00h-0Fh
Sepherosa Ziehau [Fri, 9 Sep 2016 00:55:48 +0000 (08:55 +0800)]
x86_64: Work around AMD erratum 793 for family 16h, models 00h-0Fh

Obtained-from: FreeBSD r305539

7 years agotcpdmatch(8): Honor global CFLAGS.
zrj [Tue, 18 Oct 2016 11:51:38 +0000 (14:51 +0300)]
tcpdmatch(8): Honor global CFLAGS.

It does not look like override was on purpose.

7 years agorestore(8): Remove (void *) casts.
zrj [Tue, 18 Oct 2016 11:38:54 +0000 (14:38 +0300)]
restore(8): Remove (void *) casts.

Mainly to unbreak gcc47 buildworld.

Reported-by: swildner
7 years agorestore(8): Fix extern type mismatch.
zrj [Wed, 12 Oct 2016 08:24:28 +0000 (11:24 +0300)]
restore(8): Fix extern type mismatch.

Noticed while playing with LTO.

While there, add volatile to prevent clobbering @ WORLD_CCOPTLEVEL=g

7 years agorestore(8): Fix and enable WARNS.
zrj [Tue, 18 Oct 2016 09:01:17 +0000 (12:01 +0300)]
restore(8): Fix and enable WARNS.

 * Add most cases were const char * should have been used.
 * In few cases use __DECONST(), should be fine for these.
 * Suffix variables with 'g' and 'l' to prevent shadowing.
 * Mark unused parameters.
 * Convert swabst() to take const char * instead of u_char *.

No functional change intended, utility still works.
(dump -af dumpas /dev/da1s1 && restore -if dumpas) restores files.

7 years agorestore(8): Use size_t were appropriate.
zrj [Tue, 18 Oct 2016 08:35:17 +0000 (11:35 +0300)]
restore(8): Use size_t were appropriate.

Mostly WARNS=3 cleanup.
Also add vlatile to prevent clobbering.

7 years agorestore(8): Fix formats in prints.
zrj [Tue, 18 Oct 2016 08:06:59 +0000 (11:06 +0300)]
restore(8): Fix formats in prints.

Also, exlude two prints if NAME_MAX >= 255.

Taken-from: FreeBSD

7 years agorestore(8): General cleanup.
zrj [Tue, 18 Oct 2016 07:24:33 +0000 (10:24 +0300)]
restore(8): General cleanup.

 * Fix include order.
 * Add missing va_end().

7 years agoif_iwm - Change UCODE_TLV_API #define-s from bitmasks to indexes.
Imre Vadász [Mon, 17 Oct 2016 22:20:29 +0000 (00:20 +0200)]
if_iwm - Change UCODE_TLV_API #define-s from bitmasks to indexes.

* Fixes oversight from commit 757eecf0e6c92745aa2eee95811e573c8300850e.
  fw_has_api now uses the isset macro instead of a simple logical-and.

7 years agoif_iwm - Sync iwm_read_firmware()'s loop to iwlwifi's code.
Imre Vadász [Fri, 16 Sep 2016 21:43:51 +0000 (23:43 +0200)]
if_iwm - Sync iwm_read_firmware()'s loop to iwlwifi's code.

Taken-From: Linux iwlwifi

7 years agoif_iwm - change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK.
Imre Vadász [Tue, 6 Sep 2016 19:45:07 +0000 (21:45 +0200)]
if_iwm - change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK.

Taken-From: Linux iwlwifi (git 837c4da98481d4e504b2aba077c8528fee1b6d13)

7 years agoif_iwm - Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c.
Imre Vadász [Mon, 17 Oct 2016 21:17:06 +0000 (23:17 +0200)]
if_iwm - Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c.

* This avoids panicing in some broken vap state handling cases.

7 years agoif_iwm - Get rid of another usage of the IWM_DEFAULT_MACID/_COLOR constant.
Imre Vadász [Sun, 16 Oct 2016 19:36:15 +0000 (21:36 +0200)]
if_iwm - Get rid of another usage of the IWM_DEFAULT_MACID/_COLOR constant.

7 years agokernel - Fix panic/crash in vm_object_page_remove()
Matthew Dillon [Mon, 17 Oct 2016 19:15:57 +0000 (12:15 -0700)]
kernel - Fix panic/crash in vm_object_page_remove()

* When vm_object_page_remove() is called with one page, the caller is allowed
  to hold a spinlock (typically on that page).  The callback is not supposed
  to call user_yield in that situation.

* Fix missing initialization of info.count which could result in the callback
  issuing a yield when it was not supposed to.

Reported-by: htse
7 years agosys/boot: Annotate LTO issue in pxe.c
zrj [Wed, 12 Oct 2016 13:31:32 +0000 (16:31 +0300)]
sys/boot: Annotate LTO issue in pxe.c

This needs to be addressed for proper use of LTO.

7 years agobinutils225: Make plugin dir overridable at compile time.
zrj [Fri, 30 Sep 2016 11:23:13 +0000 (14:23 +0300)]
binutils225: Make plugin dir overridable at compile time.

This will help to avoid touching mtree BSD.usr.dist outside libexec,
will simplify LTO plugins(liblto_plugin.so, LLVMgold.so)
installing(symlinking) and auto loading in ar, nm, ranlib.

7 years agoMerge branch 'vendor/BINUTILS225'
zrj [Mon, 17 Oct 2016 07:44:39 +0000 (10:44 +0300)]
Merge branch 'vendor/BINUTILS225'

7 years agoImport missing source needed to enable plugin support in utilities. vendor/BINUTILS225
zrj [Fri, 30 Sep 2016 10:07:50 +0000 (13:07 +0300)]
Import missing source needed to enable plugin support in utilities.

7 years agoRemove profiled version of libraries too.
zrj [Mon, 17 Oct 2016 06:18:11 +0000 (09:18 +0300)]
Remove profiled version of libraries too.

 * Expand OpenSSL removal list to include profiled versions.
 * Remove libprivate_panel ones after 19ba4072a64db34c2a861d48aa5ffe33155826ef.

7 years agoStep 1/2 of OpenSSL remove: Suppress building
John Marino [Sun, 16 Oct 2016 22:34:39 +0000 (17:34 -0500)]
Step 1/2 of OpenSSL remove: Suppress building

As of now, the NO_OPENSSL directive has been replaced with an undocumented
FORCE_OPENSSL directive.  Unless FORCE_OPENSSL is defined in make.conf,
the OpenSSL libraries, headers, and man pages will no longer be built and
installed.

Existing OpenSSL files will remain installed unless REMOVE_OPENSSL_FILES
is defined for the upgrade command, e.g.
> make upgrade REMOVE_OPENSSL_FILES=yes

It is recommended that all remaining programs and libraries linked to the
base OpenSSL libraries be rebuilt to use one of the DPorts SSL libraries.
The DPorts packages have been built with DPorts LibreSSL for a few weeks
now, so ensuring all installed packages are reinstalled or rebuilt will be
sufficient for most users, but don't forget about software built outside
of DPorts.

The OpenSSL sources and makefiles will be removed within a month (step 2),
but FORCE_OPENSSL will work in the meantime to continue building OpenSSL
although it will receive no further updates.

7 years agokernel - Modestly reduce default maxvnodes calculation
Matthew Dillon [Sun, 16 Oct 2016 21:36:10 +0000 (14:36 -0700)]
kernel - Modestly reduce default maxvnodes calculation

* Change the multipliers to modestly reduce the default kern.maxvnodes
  calculation.  For example, maxvnodes on a machine with 8GB of ram will
  be reduced from 598103 to 478483.

* Primarily targetted to hammer filesystems which can wind up using an
  unnecessarily huge amount of kernel memory caching vnode-related
  structures.

7 years agokernel - Reduce excessive inode hash table allocations
Matthew Dillon [Sun, 16 Oct 2016 21:31:40 +0000 (14:31 -0700)]
kernel - Reduce excessive inode hash table allocations

* Reduce excessive inode hash table allocations in various filesystems
  (primarily ufs).  Introduce vfs_inodehashsize() to calculate a reasonable
  hash table size instead of using 'maxvnodes'.

* The new formula is to generally use maxvnodes / 2 (2 x stacking for the
  chained hash table).  When maxvnodes is large we use maxvnodes / 4, and
  if maxvnodes is very large (> 1M vnodes) we use maxvnodes / 8.  This
  significantly reduces the amount of kernel memory used when mounting
  ufs, ext2fs, hpfs, isofs, msdosfs, nfs, ntfs, and smbfs filesystems.

7 years agotmpfs - Fix mount_tmpfs -C
Matthew Dillon [Sun, 16 Oct 2016 21:23:44 +0000 (14:23 -0700)]
tmpfs - Fix mount_tmpfs -C

* Fix mount_tmpfs -C.  FSCopy requires the contents of the pointer
  whos address is passed into it to be properly initialized (to NULL
  in this case).

* Fixes -O2 compilation of rtld & mount_tmpfs which were not problems
  with -O2 itself but instead changed the uninitialized garbage of the
  local variable we fixed above.

reported-by: zrj

7 years agokernel - Rename desiredvnodes to maxvnodes, fix deadlock
Matthew Dillon [Sun, 16 Oct 2016 21:13:39 +0000 (14:13 -0700)]
kernel - Rename desiredvnodes to maxvnodes, fix deadlock

* Rename the kernel variable 'desiredvnodes' to 'maxvnodes' to match
  the sysctl name (which has always been 'maxvnodes'), and to make the
  code more readable.

* Probable fix to a rare mount/umount deadlock which can occur in two
  situations (1) When a large number of mounts and unmounts are running
  concurrently, and (2) During a umount -a, shutdown, or reboot.

* Considered minor, normal use cases will not reproduce this bug.  Only
  synth or poudriere can generate the mount/umount traffic necessary to
  reproduce this bug.

* Also fixes a minor kernel memory leak of the mount structure which can
  occur when a 'df' or filesystem sync races a umount.  Also minor.

Reported-by: marino (mount race)
7 years agoif_iwm - Partly sync if_iwm_binding.c to Linux iwlwifi code.
Imre Vadász [Sun, 16 Oct 2016 18:55:13 +0000 (20:55 +0200)]
if_iwm - Partly sync if_iwm_binding.c to Linux iwlwifi code.

* Store macid and color values in struct iwm_vap, to avoid hardcoded
  constants a bit.

* Add iwm_mvm_binding_remove_vif() function (will be used in disconnecting
  from an access point without resetting the whole device).

* Not adding code from Linux iwlwifi yet, to handle one PHY context to
  be bound to several VAPs/virtual-interfaces, it's definitely not needed
  in the near future.

Taken-From: Linux iwlwifi

7 years agoif_iwm - Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap.
Imre Vadász [Sun, 16 Oct 2016 10:23:44 +0000 (12:23 +0200)]
if_iwm - Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap.

* This better matches how things are organized in Linux's iwlwifi.

7 years agosbin/mount_hammer: Add missing switch case from bab16452
Tomohiro Kusumi [Sun, 16 Oct 2016 04:01:54 +0000 (13:01 +0900)]
sbin/mount_hammer: Add missing switch case from bab16452

The previous commit bab16452 needed 1..15 case for expected values,
so as not to show an irrelevant message via default case.

7 years agosbin/mount_hammer: Fix warning messages
Tomohiro Kusumi [Sun, 16 Oct 2016 03:07:51 +0000 (12:07 +0900)]
sbin/mount_hammer: Fix warning messages

Add warning messages for -1 and non-0-15 for master_id.

-1 and 0-15 inclusive are the only supoprted values,
so remove probably from the existing warning message.

7 years agosbin/hammer: Mention bug in hammer recover command
Tomohiro Kusumi [Sat, 15 Oct 2016 14:46:57 +0000 (23:46 +0900)]
sbin/hammer: Mention bug in hammer recover command

newfs_hammer overwrites layer1/2, but doesn't overwrite data in
blockmap beyond layer1/2, so old data is still there if the volume
has been re-formatted until the new fs overwrites old fs by using
more disk space than the old fs.

This is usually not a problem because the new fs doesn't have a
pointer to data in old fs, but hammer recover just iterates zone-2
offset till it hits end of the disk space which may include data
from the old fs. As mentioned in the comment, it's likely to hit
assertion if the old data located near the end of the volume is
B-Tree nodes depending on situation of the old fs.

7 years agosbin/hammer: Add volume signature check on loading a volume
Tomohiro Kusumi [Sat, 15 Oct 2016 14:16:14 +0000 (23:16 +0900)]
sbin/hammer: Add volume signature check on loading a volume

7 years agosbin/hammer: Cleanup arguments of init_volume()
Tomohiro Kusumi [Sat, 15 Oct 2016 01:15:02 +0000 (10:15 +0900)]
sbin/hammer: Cleanup arguments of init_volume()

Change the order of arguments to make the i/f similar to open(2)
as well as load_volume().

This is only for newfs (and volume-add), nothing else gets affected.

7 years agosbin/hammer: Make hammer recover use hammer_parsedevs_noverify()
Tomohiro Kusumi [Fri, 14 Oct 2016 12:33:59 +0000 (21:33 +0900)]
sbin/hammer: Make hammer recover use hammer_parsedevs_noverify()

hammer recover command should be able to run the recovery code
even if volume header is broken (not just broken blockmap part)
to certain extent, since the purpose of this is to recover contents
of a broken filesystem.

By using 0 for verify argument of load_volume(), hammer recover
skips sanity checks for ondisk volume header.

Also see 173bd31c.

7 years agosbin/hammer: Add verify argument to load_volume()
Tomohiro Kusumi [Fri, 14 Oct 2016 12:27:09 +0000 (21:27 +0900)]
sbin/hammer: Add verify argument to load_volume()

Add an argument to select whether to verify volume header or not.
This is for the next commit.

7 years agokernel - Fix improper user-space access in sys___semctl()
Matthew Dillon [Fri, 14 Oct 2016 16:32:12 +0000 (09:32 -0700)]
kernel - Fix improper user-space access in sys___semctl()

* Fix an improper user-space access in sys__semctl()

* Fix an improper kernel-space access that was using
  a user-supplied pointer.

Reported-by: Mateusz Kocielski - LogicalTrust
7 years agodrm/linux: Add kmap_to_page()
François Tigeot [Fri, 14 Oct 2016 06:59:09 +0000 (08:59 +0200)]
drm/linux: Add kmap_to_page()

7 years agodrm/linux: Add get_nr_swap_pages()
François Tigeot [Thu, 13 Oct 2016 10:07:00 +0000 (12:07 +0200)]
drm/linux: Add get_nr_swap_pages()

7 years agoif_iwm - Allow listening on both chains/atennas to get diversity.
Imre Vadász [Wed, 12 Oct 2016 20:19:31 +0000 (22:19 +0200)]
if_iwm - Allow listening on both chains/atennas to get diversity.

* This might improve throughput slightly when far from the accesspoint,
  apparently by allowing the firmware to listen on either of the two
  antennas (if there are two, i.e. on 7260/7265/8260), whichever has
  a better reception.

Taken-From: Linux iwlwifi

7 years agosys/vfs/hammer: Use HAMMER_MAX_KEY for initial trunc_off values
Tomohiro Kusumi [Wed, 12 Oct 2016 12:57:37 +0000 (21:57 +0900)]
sys/vfs/hammer: Use HAMMER_MAX_KEY for initial trunc_off values

ip->trunc_off variants are to be compared with node elm's base.key,
so it should use HAMMER_MAX_KEY on initialization instead of
0x7FFFFFFFFFFFFFFFLL.

7 years agosys/vfs/hammer: Add HAMMER_MIN|MAX_ONDISK_LOCALIZATION
Tomohiro Kusumi [Tue, 11 Oct 2016 15:05:19 +0000 (00:05 +0900)]
sys/vfs/hammer: Add HAMMER_MIN|MAX_ONDISK_LOCALIZATION

Use | for HAMMER_MAX_ONDISK_LOCALIZATION, but not +.
Also see 7e52af60.

7 years agosys/vfs/hammer: Use MIN/MAX macros for B-Tree node's elm base
Tomohiro Kusumi [Tue, 11 Oct 2016 14:40:45 +0000 (23:40 +0900)]
sys/vfs/hammer: Use MIN/MAX macros for B-Tree node's elm base

Leave obj_type with 0 instead of using HAMMER_OBJTYPE_UNKNOWN,
since it's not intended to be unknown, but literally intended
to be a value of 0.

7 years agodrm/linux: Add sign_extend64()
François Tigeot [Tue, 11 Oct 2016 07:26:14 +0000 (09:26 +0200)]
drm/linux: Add sign_extend64()

7 years agodrm/linux: Add kasprintf and kvasprintf()
François Tigeot [Tue, 11 Oct 2016 07:04:25 +0000 (09:04 +0200)]
drm/linux: Add kasprintf and kvasprintf()