Peter Avalos [Sun, 5 Feb 2012 20:43:12 +0000 (12:43 -0800)]
sh: Test EXIT trap with multiple statements in it
Obtained-from: FreeBSD 230211
Peter Avalos [Sun, 5 Feb 2012 20:38:57 +0000 (12:38 -0800)]
sh: Add testcases that should not be broken by future optimizations.
Obtained-from: FreeBSD 230121
Peter Avalos [Sun, 5 Feb 2012 20:36:00 +0000 (12:36 -0800)]
sh: Avoid possible echo options in a testcase.
Obtained-from: FreeBSD 229742
Peter Avalos [Sun, 5 Feb 2012 20:26:01 +0000 (12:26 -0800)]
sh: Fix swapped INTON/INTOFF.
A possible consequence of this bug was a memory leak if SIGINT arrived
during a 'set' command (listing variables).
Obtained-from: FreeBSD 231001
Peter Avalos [Sun, 5 Feb 2012 20:21:25 +0000 (12:21 -0800)]
sh: Use vfork in a few common cases.
This uses vfork() for simple commands and command substitutions containing a
single simple command, invoking an external program under certain conditions
(no redirections or variable assignments, non-interactive shell, no job
control). These restrictions limit the amount of code executed in a vforked
child.
There is a large speedup (for example 35%) in microbenchmarks. The
difference in buildkernel is smaller (for example 0.5%) but still
statistically significant. See
http://lists.freebsd.org/pipermail/freebsd-hackers/2012-January/037581.html
for some numbers.
The use of vfork() can be disabled by setting a variable named
SH_DISABLE_VFORK.
Obtained-from: FreeBSD 230998
Peter Avalos [Sun, 5 Feb 2012 20:12:44 +0000 (12:12 -0800)]
sh: Fix $? in the first command of a 'for'.
In the first command of a 'for', $? should be the exit status of the last
pipeline (command substitution in the word list or command before 'for'),
not always 0.
Obtained-from: FreeBSD 230463
Peter Avalos [Sun, 5 Feb 2012 20:10:27 +0000 (12:10 -0800)]
sh: Remove "kill" example function, which is superseded by the kill
builtin
Obtained-from: FreeBSD 230437
Peter Avalos [Sun, 5 Feb 2012 20:07:56 +0000 (12:07 -0800)]
sh: Fix execution of multiple statements in a trap when evalskip is set
Before this fix, only the first statement of the trap was executed if
evalskip was set. This is for example the case when:
o "-e" is set for this shell
o a trap is set on EXIT
o a function returns 1 and causes the script to abort
Obtained-from: FreeBSD 230212
Peter Avalos [Sun, 5 Feb 2012 20:04:53 +0000 (12:04 -0800)]
sh: Fix some bugs with exit status from case containing ;&.
Also, rework evalcase() to not evaluate any tree. Instead, return the
NCLISTFALLTHRU node and handle it in evaltree().
Fixed bugs:
* If a ;& list with non-zero exit status is followed by an empty ;; or final
list, the exit status of the case command should be equal to the exit
status of the ;& list, not 0.
* An empty ;& case should not reset $?.
Obtained-from: FreeBSD 230161
Peter Avalos [Sun, 5 Feb 2012 20:02:44 +0000 (12:02 -0800)]
sh: Fix two bugs with case and exit status:
* If no pattern is matched, POSIX says the exit status shall be 0 (even if
there are command substitutions).
* If a pattern is matched and there are no command substitutions, the first
command should see the $? from before the case command, not always 0.
Obtained-from: FreeBSD 230154
Peter Avalos [Sun, 5 Feb 2012 20:00:29 +0000 (12:00 -0800)]
sh: Change input buffer size from 1023 to 1024.
Apparently this improves performance on slower platforms.
Obtained-from: FreeBSD 230118
Peter Avalos [Sun, 5 Feb 2012 19:52:44 +0000 (11:52 -0800)]
sh: Fix out of bounds array access when trap is used with an invalid
signal.
Obtained-from: FreeBSD 230117
Peter Avalos [Sun, 5 Feb 2012 19:44:29 +0000 (11:44 -0800)]
sh: Properly show "Not a directory" error in cd builtin.
The errno message display added in
72cbf4010 did not take attempting to
cd to a non-directory or something that cannot be stat()ed into account.
Obtained-from: FreeBSD 230095
Peter Avalos [Sun, 5 Feb 2012 19:42:22 +0000 (11:42 -0800)]
sh: Make various functions static.
Obtained-from: FreeBSD 229220
Peter Avalos [Sun, 5 Feb 2012 19:30:56 +0000 (11:30 -0800)]
sh: Remove unused function scopyn().
Obtained-from: FreeBSD 229219
Peter Avalos [Sun, 5 Feb 2012 19:28:08 +0000 (11:28 -0800)]
sh: Make patmatch() non-recursive.
Obtained-from: FreeBSD 229201
Peter Avalos [Sun, 5 Feb 2012 19:23:10 +0000 (11:23 -0800)]
sh: Allow quoting ^ and ] in bracket expressions.
Obtained-from: FreeBSD 228943
Peter Avalos [Sun, 5 Feb 2012 19:20:09 +0000 (11:20 -0800)]
sh: Use dirent.d_type in pathname generation.
This improves performance for globs where a slash or another component
follows a component with metacharacters by eliminating unnecessary
attempts to open directories that are not.
Obtained-from: FreeBSD 228942
Peter Avalos [Sun, 5 Feb 2012 19:16:08 +0000 (11:16 -0800)]
sh: Cache de->d_namlen in a local variable.
Obtained-from: FreeBSD 228941
Peter Avalos [Sun, 5 Feb 2012 19:11:06 +0000 (11:11 -0800)]
sh: Don't force special builtins non-special in optimized command subst.
This is not necessary: errors are already caught in evalbackcmd() and
forcelocal handles changes to variables.
Obtained-from: FreeBSD 228937
John Marino [Sun, 5 Feb 2012 16:21:27 +0000 (17:21 +0100)]
Support exception handling on statically-linked binaries
The real-time dynamic linker handles exceptions on dynamically-linked
binaries through the dl_iterate_phdr function. The RTLD isn't invoked
on statically-built executables so thrown exceptions weren't getting
handled. There was a dummy dl_iterate_phdr function in libc with a
weak symbol that gets looked at when the rtld version isn't present.
This function was populated and gets called when the statically-linked
executable throws an exception.
It requires the GNU_EH_FRAME program header to be present. The base
gcc 4.4 spec file was modified to emit this header for statically-built
binaries in addition to the dynamically lined ones.
John Marino [Sun, 5 Feb 2012 16:14:25 +0000 (17:14 +0100)]
cdefs: Rework and augment visibility attributes
One macro based on GCC visibility functions was already defined,
__exported. However, it was marked as available for all GCC versions
when it fact it was introduced with gcc 4.0.
There was no macro for hidden visibility attributes, so the macros
__dso_hidden and __dso_public were borrowed from NetBSD. __dso_public
is an alias for __exported. The definition for all three macros were
made on the condition that the gcc version used is 4.0 or later.
Venkatesh Srinivas [Sun, 5 Feb 2012 15:04:57 +0000 (10:04 -0500)]
kernel -- linprocfs: linprocfs_allocvp should return a locked vnode.
Fixes a panic where VFS_ROOT returned an unlocked vnode and led to
a lockmgr panic from vput in the namecache.
Reported-by: phma
Bug: 2298
Sascha Wildner [Sun, 5 Feb 2012 13:30:14 +0000 (14:30 +0100)]
Revert "librefuse: Remove from Makefile; it breaks world"
This reverts commit
7e1d2825717ccf4a77edc0de7cf1ae109928db1f.
Sascha Wildner [Sun, 5 Feb 2012 13:28:41 +0000 (14:28 +0100)]
libpuffs: Fix a path that was assuming source is in /usr/src.
John Marino [Sun, 5 Feb 2012 10:28:50 +0000 (11:28 +0100)]
boot2: slim it down about 300 bytes
The boot2_32.ld loader file needs to come in at 7680 bytes or less, while
boot2_64.ld can be a little bigger with a 14848 byte threshold. The
32-bit version has the least memory margin. Using the base gcc 4.4
compiler, it only has 396 bytes to spare.
Using updates from FreeBSD buys 292 additional bytes when built by the
base compiler. This additional space may be useful for building world
with clang which may have slightly larger executables.
List of changes from FreeBSD
==========================
SVN 151382 (16 OCT 2005)
SHRINK: Convert load() ep and es arrays to static variables
SVN 180145 (01 JUL 2008)
BUG: parse function off by one
change "if (dsk.slice > NDOSPART)" to "if (dsk.slice > NDOSPART + 1)"
SVN 214210 (22 OCT 2010)
SHRINK: Avoid using memcpy() for copying 32bit chunks.
SVN 218713 (15 FEB 2011)
SHRINK: Change autoboot type from int to uint8_t
SVN 218745 (16 FEB 2011)
SHRINK: Remove reading of symbols from a.out loaded files. This
functionality was left over from the early FreeBSD 3.x days to
support kernels in a.out format which never applied to DragonFly.
Removing it saves around 100 bytes. bootinfo.bi_esymtab was also
relocated to the ELF section rather than aways being set.
SVN 219186 (02 MAR 2011)
SHRINK: Change the tick overflow computation.
Remove bi_basemem, bi_extmem, bi_memsizes_valid (unused).
Switch kname to a pointer from an array to avoid using memcpy() twice.
Remove memsize function (unused)
SVN 219452 (10 MAR 2011)
SHRINK: Convert to uint8_t: dsk.slice, dsk.part, sl.
Remove fmt variable in load() used in redundant condition ladder.
Set buffer as static in printf() to save space.
SVN 220392 (06 APR 2011)
BUG: Move getc() before xgetc() so gcc does not emit a warning about
function having no body.
Minor changes from John Marino
==============================
Created RBF_NOINTR and RBF_PROBEKBD macros for consist style.
Removed "#if 0" sections to clean up.
returned "static" back to drvread body (was still in prototype).
Changed xputc() to return the char rather than void (matches FreeBSD),
John Marino [Sun, 5 Feb 2012 07:00:44 +0000 (08:00 +0100)]
CCVER=gcc46: Now builds world and kernel cleanly
Starting with gcc 4.5, sbin/restore would break on interactive.c with
the complaint that the designated length of the storage array within
the adirent union structure was not constant. After three previous
proposals on the best way to fix it, this is the one requiring the
least code change. (Don't count the spelling correction!)
This was the last place the breaks using WORLD_CCVER=gcc46. The
kernel builds cleanly. Both the gcc46-built world and kernel load
and function normally.
suggested-by: vsrinivas
John Marino [Sun, 5 Feb 2012 07:52:26 +0000 (08:52 +0100)]
librefuse: Remove from Makefile; it breaks world
The refuse library fails during a clean build (presumably on test machines
/usr/include/fuse_opt.h existed and the build defaulted to that one).
/usr/src/lib/librefuse/fuse.h:191:22: fatal error: fuse_opt.h:
No such file or directory
compilation terminated.
Sascha Wildner [Sun, 5 Feb 2012 01:29:51 +0000 (02:29 +0100)]
Bring in the "Port PUFFS from NetBSD/FreeBSD" GSoC 2011 project results.
With some additional stuff done by me (properly hooking into the build,
add some manpages, and other missing bits here and there, nothing
functional).
What we get:
* puffs(3) and refuse(3) libraries
* puffs(4) and putter(9) kernel parts
* mount_psshfs(8) utility
Note that it still might crash or stop working, so it's still
experimental. We're bringing it anyway because several people showed
interest in continuing to work on it and so it doesn't rot outside
our tree, gets at least built with world/kernel, etc.
Submitted-by: Nick Prokharau <nickprok@gmail.com>
John Marino [Sat, 4 Feb 2012 18:27:10 +0000 (19:27 +0100)]
CCVER=gcc46: Separate LDFLAGS meant for gcc and ld
The same LDFLAGS variable was being applied to gcc and ld. Apparently
gcc 4.4 and below recognized and accepted the -m switch and passed it
on to the linker, but gcc 4.6 wasn't handling it.
A new variable COMPILER_LDFLAGS has been created alongside LDFLAGS. The
former is meant to be passed to gcc and the latter is passed to ld.
John Marino [Sat, 4 Feb 2012 17:27:41 +0000 (18:27 +0100)]
CCVER=gcc46: Adjust Makefile so boot2 remains < 7.5kb
A big sticking point with getting gcc46 to successfully buildworld was
getting boot2 to come in at 7680 bytes or less. Unmodified it was
weighing in 784 bytes too much. Every applying several byte-reducing
changes to it from FreeBSD only knocked off about 380 bytes.
Comparing the assembly dumps between versions built by the base
compiler and gcc46 didn't reveal that much, but using the readelf
utility on both did. GCC 4.6 was embedding the .eh_frame section
to the object file generated from boot2.c which was adding over 1900
bytes to it.
After adding three command line switches to the makefile, the
exception handler section is prohibited from building. There are
4968 bytes still available, down from 4988 bytes seen with the base
compiler. The updates from FreeBSD can be applied later to free up
more memory but for now it's not required.
John Marino [Sat, 28 Jan 2012 17:19:55 +0000 (18:19 +0100)]
CCVER=gcc46: Minor tweaks for buildworld
Currently WORLD_CCVER=gcc46 will break on gcc4.1, include/rpcsvc, and is
not recognized by libc. This commit will fix that. The nis.x fix is the
least understood as the gnatcpp seems not to like multiline macros when
used with rpcgen.
John Marino [Sat, 4 Feb 2012 10:37:42 +0000 (11:37 +0100)]
custom cc script: Use gcc46's c++ library instead of base
There will be a slight performance hit with having to make two calls to
gnatc++ before every real call in order to use gnat-aux's c++ library
rather than the base systems gcc 4.4 c++ library. The alternative is
hardcoding these values as a function of arch which is less appealing.
Sascha Wildner [Fri, 3 Feb 2012 13:13:20 +0000 (14:13 +0100)]
kernel: Remove the no longer functional APIC_IO option.
Matthew Dillon [Thu, 2 Feb 2012 23:17:44 +0000 (15:17 -0800)]
vkernel - Fix semi-random SIGILL crashes under heavy network loads
* SIGIO was being installed with SA_NODEFER, resulting in situations
under heavy network loads where multiple SIGIOs could stack and cause
a stack overflow. This often resulted in the sendsig code in the kernel
generating a SIGILL to the process after being unable to push a new
signal context.
* Removing SA_NODEFER appears to solve the problem.
Reported-by: tuxillo
Antonio Huete Jimenez [Thu, 2 Feb 2012 16:53:18 +0000 (17:53 +0100)]
rconfig - Fix getopt options
Sascha Wildner [Thu, 2 Feb 2012 11:00:10 +0000 (12:00 +0100)]
LINT*: Add DEBUG_LOCKS_LATENCY.
Sascha Wildner [Thu, 2 Feb 2012 10:44:47 +0000 (11:44 +0100)]
kernel: Remove the obsolete SHMALL, SHMMAX and SHMMAXPGS options.
In
6e2ab4bff5412f15d11ea4f8fb4a157de12432a8 we switched to autosizing
maximum shm pages along with a tunable to override.
Matthew Dillon [Thu, 2 Feb 2012 03:43:26 +0000 (19:43 -0800)]
kernel - Fix lockmgr lock mismatch panics when iwn used without wlan
* If if_iwn is ifconfig'd without going through wlan the wlan_serializer
is not held during the firmware load stage, resulting in a panic.
Acquire the serializer for this case.
* Note: iwn worked fine with wlan, but this fixes an annoying panic when
people try to mess with it without wlan.
Reported-by: fxr (irc)
Sascha Wildner [Thu, 2 Feb 2012 02:23:54 +0000 (03:23 +0100)]
uname(1): Bring back CVS IDs except ours.
Antonio Huete Jimenez [Wed, 1 Feb 2012 23:00:46 +0000 (00:00 +0100)]
rconfig - LVM stripe script
It uses lvm(8) facilities to install a DragonFly system in a
logical volume made of as many disk as you specify in the disk
list. It creates a swap partition and a /boot UFS filesystem
as it is required for proper operation.
Sascha Wildner [Wed, 1 Feb 2012 22:36:39 +0000 (23:36 +0100)]
sym(4): Sync with FreeBSD.
This fixes disk detection issues in QEMU, among other things. It is also
available as a module now.
Tested-by: tuxillo
Sascha Wildner [Wed, 1 Feb 2012 22:39:30 +0000 (23:39 +0100)]
LINT*: Fix some wrong paths in the comments.
Matthew Dillon [Wed, 1 Feb 2012 21:40:19 +0000 (13:40 -0800)]
kernel - Add missing DRM_LOCK()
* Add missing DRM_LOCK() in the i915 X11 ioctl path
Reported-by: Pierre Abbat
Dump-by: Magliano Andrea
Sepherosa Ziehau [Mon, 23 Jan 2012 15:00:11 +0000 (23:00 +0800)]
route utils: Recognize IFT_CARP link layer address
Sepherosa Ziehau [Mon, 23 Jan 2012 08:19:06 +0000 (16:19 +0800)]
carp: Make carp interfaces work like ethernet interfaces
- Use ether_ifattach() instead of if_attach() to attach carp and carp's
ioctl methed will fallback to ether_ioctl().
- VHID changes will be reflected into the carp's ethernet address.
- Reimplement carp output path.
* carp uses the parent's if_output() i.e. ether_output(), but passes
the carp interface's ifp.
* The ether_output() is adjusted to detect the carp interface and
switch to the carp's parent interface just before performing the
real output.
* ARP resolve will use carp instead of its parent interface, thus
the ARP output's source ethernet address and the sender hardware
address are consistent and loopback on the carp will work as
expected.
- Reimplement carp input path>
* Input interface will be changed to carp if the packet is destined
to the carp's ethernet address.
* If the received packet is broadcast or multicast, all of the carps
on the receiving interface will receive a copy of the packet.
- Fix up gratuitous ARP.
* No gratuitous ARP will be sent for carp upon IP address changes.
* Gratuitous ARP sent by carp use itself as interface not carp's
parent interface.
- Fix up ARP input path. Since ARP request is broadcast packet, parent
interface of the carp will also receive the packet and will reply the
ARP request. If carp and its parent interface have same IP address,
the parent's ARP reply will confuse the ARP requester: the ethernet
address of the IP is no longer carp's ethernet address.
- Rework carp's prefix route addition and deletion.
* Add IP addresses to carp will not add prefix routes
* Bring carp interface up will not add prefix routes for carp's
existing IP addresses
* Carp IP addresses prefix route will be added when carp is master,
and the parent's corresponding IP addresses prefix route will be
deleted.
* Carp IP addresses prefix route will be deleted when carp is no
longer master and the parent's corresponding IP addresses prefix
route will be added back.
- Handle carp parent interface's up/down events.
* When carp's parent is down, we fake up a parent IP address deletion
event for carp.
* When carp's parent is up, we fake up a parent IP address addition
event for carp.
- Stringent checks on CARP proto input path.
- Nullfy ifnet's serialier; carp is protected by global carp token.
- Mark CARP protocol MPSAFE
Idea-from: OpenBSD
Matthew Dillon [Wed, 1 Feb 2012 04:52:46 +0000 (20:52 -0800)]
kernel - Improve pageout daemon & memory pressure detection w/tmpfs
* PG_NEED_COMMIT pages are unwired from the buffer cache they are now
unconditionally placed on the active queue, even if 'activate' is not
set.
* This results in non-freeable tmpfs pages remaining in the active queue
most of the time. They will be cycled into the inactive queue and flushed
out if swap is present as per normal pageout daemon operation,
When swap is not present or is full, these pages are reactivated
unconditionally.
Matthew Dillon [Wed, 1 Feb 2012 04:46:01 +0000 (20:46 -0800)]
kernel - Adjust tmpfs to use the new PG_NEED_COMMIT flag
* Adjust tmpfs to use vm_page_need_commit() instead of redirtying VM
pages in its strategy code.
* The new mechanism also allows the pageout daemon to act more naturally
when flushing clean pages with PG_NEED_COMMIT set.
* May fix some tmpfs corruption issues
Reported-by: tuxillo
Matthew Dillon [Wed, 1 Feb 2012 04:41:57 +0000 (20:41 -0800)]
kernel - Add vm_page_need_commit() and vm_page_clear_commit()
* Add vm_page_need_commit() and vm_page_clear_commit(). This controls the
PG_NEED_COMMIT flag on individual VM pages.
When set a clean VM page cannot be reused and is still subject to
flushing by the pageout daemon.
* Refactor buwrite() to use the new mechanism instead of dirtying the
pages underlying the buffer.
* This allows the normal page and buffer flushing mechanism to operate
even in situations where the VM page is also the nominal backing store
for the data (as in tmpfs).
* Will be used by tmpfs.
Matthew Dillon [Tue, 31 Jan 2012 22:18:36 +0000 (14:18 -0800)]
kernel - Fix incorrect assertion during udp auto-binding
* When sendto() is used and the UDP socket is not bound the binding
operation is done by the netisr thread and causes an assertion due
to not being a process.
* The assertion is incorrect, remove it. This only occured when lport has
not been assigned and the cred check is only needed when it has.
Reported-by: Pierre Abbat
Antonio Huete Jimenez [Mon, 30 Jan 2012 13:29:56 +0000 (14:29 +0100)]
kern - Skip rlimit check when caller is a kernel thread.
Pointed-out-by: vsrinivas
Sascha Wildner [Tue, 31 Jan 2012 11:15:13 +0000 (12:15 +0100)]
kernel/cryptodev: Remove useless zlib dependency.
Sascha Wildner [Tue, 31 Jan 2012 11:10:20 +0000 (12:10 +0100)]
kernel: Allow zlib to build as a module.
Submitted-by: CosmicDJ
Sascha Wildner [Tue, 31 Jan 2012 10:17:27 +0000 (11:17 +0100)]
crypto.ko: Add a missing file.
Submitted-by: CosmicDJ
Markus Pfeiffer [Fri, 27 Jan 2012 21:59:06 +0000 (21:59 +0000)]
libc: correct copyright notice in makecontext.c
Sascha Wildner [Tue, 31 Jan 2012 09:29:20 +0000 (10:29 +0100)]
<sys/param.h>: Oops, actually bump the version.
Sascha Wildner [Tue, 31 Jan 2012 09:27:57 +0000 (10:27 +0100)]
<sys/param.h>: Bump the version for i4b removal (had public headers).
Sascha Wildner [Tue, 31 Jan 2012 09:22:49 +0000 (10:22 +0100)]
Cleanup ISDN remains via 'make upgrade'.
Venkatesh Srinivas [Tue, 31 Jan 2012 05:18:17 +0000 (00:18 -0500)]
Merge branch 'master' of ssh://crater.dragonflybsd.org/repository/git/dragonfly
Venkatesh Srinivas [Tue, 31 Jan 2012 05:15:24 +0000 (00:15 -0500)]
tmpfs: Support NFS export of tmpfs filesystems.
* Implement vop_mountctl and MOUNTCTL_SET_EXPORT interfaces to allow mountd
to export a tmpfs filesystem.
* Implement vfs_checkexp to allow NFS to function.
Closes: Bug 2277
Samuel J. Greear [Tue, 31 Jan 2012 01:02:41 +0000 (18:02 -0700)]
crypt(3)/blowfish - Return NULL on error
* According to http://www.openwall.com/lists/oss-security/2011/11/15/3
crypt(3) should probably not return ":" on error.
* Make crypt_blowfish() return NULL on error as per the crypt(3) manpage.
Submitted-by: Loganaden Velvindron <loganaden@gmail.com>
Sascha Wildner [Mon, 30 Jan 2012 18:42:51 +0000 (19:42 +0100)]
token.9: Put sections into conventional order.
Sascha Wildner [Mon, 30 Jan 2012 18:40:31 +0000 (19:40 +0100)]
token.9: Start sentences on a new line and remove trailing whitespace.
Sascha Wildner [Mon, 30 Jan 2012 18:39:55 +0000 (19:39 +0100)]
token.9: Add an MLINK for lwkt_gettoken_shared(9).
Sascha Wildner [Mon, 30 Jan 2012 18:35:06 +0000 (19:35 +0100)]
libthread_xu: Unbreak the build.
Venkatesh Srinivas [Mon, 30 Jan 2012 13:04:53 +0000 (08:04 -0500)]
libthread_xu: Implement stub sem_open/sem_close/sem_unlink.
The stub sem_open/sem_close/sem_unlink routines return ENOSYS; this is an
improvement over the default implementation, which returned 0 without doing
any work. libc_r already provided the stubs.
Closes: Bug #2285
Venkatesh Srinivas [Mon, 30 Jan 2012 13:00:19 +0000 (08:00 -0500)]
Document shared tokens in token(9).
Sascha Wildner [Mon, 30 Jan 2012 11:35:22 +0000 (12:35 +0100)]
Remove ISDN support. Tools, kernel code, manpages, examples, everything.
We were the last to keep it (FreeBSD disconnected it in 2007 and removed
it in 2008).
Makefile_upgrade.inc will be updated later.
Sascha Wildner [Mon, 30 Jan 2012 11:19:49 +0000 (12:19 +0100)]
binutils/ld: Don't add /usr/lib to the library search path twice.
The various toolchains we build during buildworld need different
search paths for various stages. The ${USRDATA_PREFIX} variable,
which has different values depending on the stage, is used as a
prefix so that the compilers we use to build our world can search
their includes and libraries in /usr/obj. For the compiler that
ultimately gets installed upon installworld, the prefix is empty.
In ld's Makefile, the correct path prefixed with ${USRDATA_PREFIX}
is already added to the default path a few lines above, so all is
good. This commit removes the extra /usr/lib that was unconditionally
added after the prefixed one (which is wrong).
John Marino [Mon, 30 Jan 2012 07:48:20 +0000 (08:48 +0100)]
custom cc script: Fix "Unterminated quoted string" error
When updating gcc46 to handle c++ by default, the old quotation mark
was accidently left in place, causing a world build breakage at
include/rpc.
Sascha Wildner [Sun, 29 Jan 2012 21:39:58 +0000 (22:39 +0100)]
kernel: Add some missing headers to the Makefiles of cryptodev and tun.
Reported-by: CosmicDJ on #dragonflybsd
Sascha Wildner [Sun, 29 Jan 2012 21:15:31 +0000 (22:15 +0100)]
texinfo: Add /usr/pkg/info to the list of directories searched by info(1).
Sascha Wildner [Sun, 29 Jan 2012 15:13:13 +0000 (16:13 +0100)]
asr(4): Sync with FreeBSD.
Updates us to V1.10 which is mostly cleanup:
* Massive cleanup of the driver to remove dead code and non-conformant
style.
* Removed most i386-specific code to make it more portable.
* Converted to the bus_space API.
Tested with an old ASR-2110S.
Francois Tigeot [Sun, 29 Jan 2012 08:42:38 +0000 (09:42 +0100)]
kernel - properly initialize vnode->v_pfsmp
* add and rewrite comments to document it better
John Marino [Sat, 28 Jan 2012 16:34:57 +0000 (17:34 +0100)]
custom cc script: add c++ support for gcc46 compiler
John Marino [Sat, 28 Jan 2012 15:36:28 +0000 (16:36 +0100)]
compilers.conf: Update default CXX path for gcc46
lang/gnat-aux builds the languages c, c++, obj-c, fortran, and Ada
by default. Its now reasonable to have the default CXX value for
gcc46 point to gnatc++.
Venkatesh Srinivas [Sat, 28 Jan 2012 03:47:08 +0000 (19:47 -0800)]
Merge branch 'master' of /repository/git/dragonfly
Thomas Nikolajsen [Sat, 28 Jan 2012 01:04:27 +0000 (02:04 +0100)]
Revert "sys/config: Readd COMPAT_43 to i386 kernels: COMPAT_LINUX needs it"
This reverts commit
dbcbcaa29ebe161b19b6cec288c1a8559aebc0a0.
Thomas Nikolajsen [Sat, 28 Jan 2012 00:59:37 +0000 (01:59 +0100)]
COMPAT_LINUX: Remove need for COMPAT_43
Implement linux_sethostname and linux_ostat natively to
stop using implementation from COMPAT_43.
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2289>
Submitted-by: Samuel J. Greear and Matt Dillon
Venkatesh Srinivas [Fri, 27 Jan 2012 10:55:15 +0000 (02:55 -0800)]
kernel -- nata: Use ATA_DEFAULT_TIMEOUT (10) rather than 1 for ATA controlcmds.
A one-second timeout for control commands was inappropriate for
SET TRANSFER MODE/ENABLE RCACHE/ENABLE WCACHE on spun-down WD Caviar Greens,
among others.
Sascha Wildner [Fri, 27 Jan 2012 09:55:09 +0000 (10:55 +0100)]
last(1)/sort(1): Remove __RCSID().
Thomas Nikolajsen [Thu, 26 Jan 2012 22:58:05 +0000 (23:58 +0100)]
sys/config: Readd COMPAT_DF12 to i386 kernels, to run FreeBSD 4 binaries
Commit
ce6b2144 made this change to GENERIC,
do the same for the other i386 kernels.
Thomas Nikolajsen [Thu, 26 Jan 2012 22:52:53 +0000 (23:52 +0100)]
sys/config: Readd COMPAT_43 to i386 kernels: COMPAT_LINUX needs it
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue2289>
Markus Pfeiffer [Wed, 25 Jan 2012 13:11:23 +0000 (13:11 +0000)]
libc: add getcontext, setcontext, makecontext and swapcontext on x86_64
The *context functions are not part of the POSIX standard anymore, but
are still used by quite some packages.
Samuel J. Greear [Thu, 26 Jan 2012 04:39:34 +0000 (21:39 -0700)]
drm - Add PCI ID for Radeon HD 4250 (AMD 880 onboard video)
Sascha Wildner [Wed, 25 Jan 2012 18:35:25 +0000 (19:35 +0100)]
Revert "Remove mergemaster(8)."
This reverts commit
650094e10aa76969d99d60b3e506b55e4e2bf5fc.
It is still being used by people.
I thought mergemaster was only useful in conjunction with maintained
CVS IDs. Should have known about its -s option.
Requested-by: pavalos
Sascha Wildner [Wed, 25 Jan 2012 18:05:05 +0000 (19:05 +0100)]
Remove mergemaster(8).
Sascha Wildner [Wed, 25 Jan 2012 09:24:08 +0000 (10:24 +0100)]
kget.8: Rewrite it a bit and fix some mdoc stuff.
Sascha Wildner [Wed, 25 Jan 2012 08:05:46 +0000 (09:05 +0100)]
Revert "nataraid(4): Add devstat support."
This reverts commit
3e184884618d66845f8b90e6dae483155da6dce6.
Oops, it was a bit too untested and causes nasty messages on the
console. Will investigate and commit a proper fix.
Reported-by: Joerg Anslik <joerg@anslik.de>
Matthew Dillon [Mon, 23 Jan 2012 20:55:33 +0000 (12:55 -0800)]
kernel - Fix SILI callout timer race
* Do similar fix for SILI that we did for AHCI.
* callout_stop_sync() can block. If this occurs a race can cause a
CCB to be processed for completion twice.
* Add a serial number to detect this situation.
* If the serial number does not match after the timeout is stopped
we don't want to mess with the xa at all.
Tested-by: lentferj
Sascha Wildner [Mon, 23 Jan 2012 13:20:14 +0000 (14:20 +0100)]
kernel: Use bioq_takefirst() in a few more places.
John Marino [Sun, 22 Jan 2012 19:09:11 +0000 (20:09 +0100)]
ldscript.*: sync with FreeBSD
John Marino [Mon, 23 Jan 2012 00:21:15 +0000 (01:21 +0100)]
csu: Add .note.ABI-tag and .note.GNU-stack
For all arches except sparc, gcc emits the section directive for the
following struct with a PROGBITS type. However, newer versions of binutils
(after 2.16.90) require the section to be of NOTE type, to guarantee that
the .note.ABI-tag section correctly ends up in the first page of the final
executable.
Unfortunately, there is no clean way to tell gcc to use another section
type, so this C file (or the C file that includes it) must be compiled in
multiple steps:
- Compile the .c file to a .s file.
- Edit the .s file to change the 'progbits' type to 'note', for the section
directive that defines the .note.ABI-tag section.
- Compile the .s file to an object file.
These steps are done in the invididual Makefiles for each applicable arch.
Taken-from: FreeBSD SVN 217375 (13 JAN 2011)
On i386 crtn.S:
Keep the stack aligned to a 16 byte boundary when calling init functions
so that we don't cause a bus error if they start storing SSE math stuff
on the stack.
Taken-from: FreeBSD SVN 146369 (19 MAY 2005)
John Marino [Sat, 21 Jan 2012 19:48:38 +0000 (20:48 +0100)]
elf: Add translation function between vm_prot_t and p_flags
No functionality added, just refactors code. This will be useful if
stack protection is implemented in the future.
John Marino [Sat, 21 Jan 2012 22:28:57 +0000 (23:28 +0100)]
man rtld: add -fPIC flag to _rtld_functrace example
John Marino [Sat, 21 Jan 2012 23:00:15 +0000 (00:00 +0100)]
rtld: Add STT_GNU_IFUNC and R_MACHINE_IRELATIVE_GNU support
Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to
rtld. This adds runtime bits neccessary for the use of the dispatch
functions from the dynamically-linked executables and shared libraries.
To allow use of external references from the dispatch function, resolution
of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT entries
for PLT are prepared, and normal resolution of the GOT entries is finished.
Similar to how it is done by GNU, IRELATIVE relocations are resolved in
advance, instead of normal lazy handling for PLT.
Taken-from:
FreeBSD SVN 228435 (12 DEC 2011)
FreeBSD SVN 228503 (14 DEC 2011)
FreeBSD SVN 229508 (04 JAN 2012)
John Marino [Sat, 21 Jan 2012 21:35:24 +0000 (22:35 +0100)]
rtld: Use DAGS for symbol lookup; adjust weak symbol logic
get_program_var_addr() must prefer the strong symbol to the weak one.
Search global objects, together with main object and dependencies for the
requested symbol.
Move the common code from symlook_default() into new helper
symlook_global(), and use it both in symlook_global() and
get_program_var_addr(). Supply lock state to get_program_var_addr().
Taken-from: FreeBSD SVN 217223 (10 JAN 2011)
Eliminate the use of symlook_needed function in favor of DAGS. Place
elements on DAG lists in breadth-first order. This allows us to walk
pre-built list in all cases where breadth-first dependency chain
enumeration is required.
Fix dlsym on special handle obtained by dlopen(NULL, ...) to do what
comment claims it does. Take advantage of recently added symlook_global
function to iterate over main objects and global DAGs lists properly in
search of a symbol. Since rtld itself provides part of the global
namespace, search rtld_obj too.
Remove recursion from init_dag and symlook_needed functions. Use
symlook_needed for ELF filtee processing only and change lookup order
used in the function to match the order used by Solaris runtime linker
under same circumstances. While there, fix weak symbol handling in the
loop so that we return the first weak symbol definition if no strong one
was found, instead of the last one.
Taken-from: FreeBSD SVN 218051 (28 JAN 2011)
John Marino [Sat, 21 Jan 2012 20:53:12 +0000 (21:53 +0100)]
rtld: Add stubs to support PT_GNU_STACK
This functionality requires kernel support to determine the initial stack
access mode. This is how it's supposed to work:
If the loaded DSO requires an executable stack as specified by the PF_X
bit or p_flags on PT_GNU_STACK phdr, yet the current stack protection does
not permit execution: The map_stacks_exec function should change the
stack protection mode of all thread stacks.
The PT_GNU_STACK phdr parser has been implemented as well as a private
interface to _rtld_get_stack_prot() in order to export the stack access
mode calculated by rtld.
Left to do:
1) Implement stack protection in the kernel
2) Add PT_GNU_STACK functionality in the kernel
3) Add a method to change stack protection mode in libc or libthread
4) Implement map_stacks_exec function in rtld.
John Marino [Sat, 21 Jan 2012 17:31:30 +0000 (18:31 +0100)]
rtld: Implement ELF filters (DT_FILTER and DT_AUXILIARY)
Filtrees are loaded on demand unless LD_LOADFLTR environment variable is
set or -z loadfltr was specified during the linking. This forces rtld
to upgrade read-locked rtld_bind_lock to write lock when it encounters an
object with filter during symbol lookup.
Consolidate common arguments of the symbol lookup functions in the SymLook
structure.
Taken-from: FreeBSD SVN 216728 (27 DEC 2010)
John Marino [Sat, 21 Jan 2012 21:02:15 +0000 (22:02 +0100)]
rtld: Remove useless arch Makefiles
The ability to build an executable dynamic linker was previously removed
from the main makefile, so uncommenting LDSCRIPT in the arch Makefile
would no longer work even if the elf_rtld.x files were put in the arch
directory. To avoid confusion, these optional Makefiles have been
completely removed.