Commit Graph

6455 Commits

Author SHA1 Message Date
Andrew Turner
53ee135632 Copy new attribute types when linking. bfd will copy attributes as needed,
however it will fail to output them if the type is not set correctly. This
can happen when it finds an attribute it hasn't seen before, for example
when building shared objects it will use the attributes from crti.o, hwever
this file has no attributes set.

Differential Revision:	https://reviews.freebsd.org/D2413
Reviewed by:	imp
2015-05-05 10:35:29 +00:00
Brooks Davis
5743dcb3c2 Remove "capability mode sandbox enabled" messages.
These messages serve little purpose and break some consumers.

PR:		199855
Differential Revision:	https://reviews.freebsd.org/D2440
Reviewed by:	rwatson
Approved by:	pjd
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2015-05-04 21:44:51 +00:00
Glen Barber
d7149f4e51 MFV r225523, r282431:
r225523 (hrs):
  Import openresolv-3.4.4.

 r282431:
  Import openresolv-3.7.0.

PR:		199854
Submitted by:	yuri@rawbw.com
MFC after:	1 week
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2015-05-04 21:07:20 +00:00
Cy Schubert
a25439b686 MFV ntp 4.2.8p2 (r281348)
Reviewed by:    delphij (suggested MFC)
Approved by:	roberto
Security:       CVE-2015-1798, CVE-2015-1799
Security:       VuXML ebd84c96-dd7e-11e4-854e-3c970e169bc2
MFC after:	1 month
2015-05-04 04:45:59 +00:00
Warner Losh
729a1e1dec For eabi 5 (what FreeBSD uses), be sure to tag all executables and
shared libraries as either SOFT or HARD float to comply with the EABI
standard.

Differential Revision: https://reviews.freebsd.org/D2401
2015-05-03 22:51:42 +00:00
Warner Losh
f321ea7845 When merging the floating point type attribute, and reporting an error
when things don't match, report which file has them and which one
doesn't correctly.

Differential Revision: https://reviews.freebsd.org/D2400
2015-05-03 22:51:29 +00:00
Baptiste Daroussin
dde01df167 Import sqlite3 3.8.9 2015-05-01 21:59:32 +00:00
Baptiste Daroussin
5fa137c326 libc now has reallocarray 2015-05-01 18:34:29 +00:00
Pedro F. Giffuni
33ef4de95f libgomp: bring initial BSD support from upstream.
Initial support for FreeBSD specific routines related to counting
online processors and dynamic load balancing.

Fix "detection" of the <sys/sysctl> header which upstream seems to have
done wrong.

Obtained from:	GCC pre-4.4 branch (rev. 140497; LGPLv2.1+)
2015-04-28 21:32:27 +00:00
Pedro F. Giffuni
5fabece0f9 MFV r282150
libgomp: Update to version 4.3.5.

This is a partial revert of r282115, to bring the fromal upstream
libgomp from GCC 4.3.5 Release under LGPLv2.1+.

This is only brought to ease the ongoing development of the CPU
affinity support.

This shall not be MFC'd.
2015-04-28 16:47:56 +00:00
Marcel Moolenaar
3865ad3fcf Fix build breakage with GCC.
Pointed out by: bz@
2015-04-27 21:58:41 +00:00
Pedro F. Giffuni
70364ab4ff libgomp: bring early CPU affinity support from FSF GCC-4_3 branch.
This is not likely to make it into a release and is basically disabled
but should still be useful for testing.

Obtained from: GCC pre-4.3 (rev. 123494, 125542; LGPLv2.1+)
2015-04-27 21:27:51 +00:00
Marcel Moolenaar
788ca347b8 Upgrade libxo to 0.3.2.
Obtained from:  https://github.com/Juniper/libxo/tree/0.3.2
Requested by: Phil Shafer <phil@juniper.net>

This import incorporates local change 279966.
Local change 276260 has been merged-in.
2015-04-27 17:23:19 +00:00
Dag-Erling Smørgrav
6480faa8a2 Upgrade Unbound to 1.5.3. 2015-04-27 12:06:13 +00:00
Dag-Erling Smørgrav
22889169f8 Add a script that runs configure for both ldns and drill.
Run configure for drill (I forgot to do it when I imported 1.6.17, but the
omission was harmless).  Note that running configure --with-drill at the
top level doesn't quite work for us since it is geared toward the slightly
weird upstream Makefiles, which we don't use.
2015-04-27 12:02:16 +00:00
Dag-Erling Smørgrav
d98cb77670 Restore packaging subdir to enable running unmodified configure script. 2015-04-27 11:45:48 +00:00
Enji Cooper
66eb8885a0 The fmodl compat shims on arm/mips/powerpc aren't complete
Disable the test code for now on those architectures

MFC after: 1 week
PR: 199422
2015-04-27 06:46:33 +00:00
Dag-Erling Smørgrav
d3348d437f import unbound 1.5.2 2015-04-26 11:23:26 +00:00
Enji Cooper
49a26c1f93 Add #include sys/types.h for register_t for mips
MFC after: 3 days
2015-04-25 04:30:01 +00:00
Brooks Davis
04c5335197 Merge from CheriBSD: 1065cf515a7c2062598009c1318055aacbb39e80
Convert the pfsync dissector to use the netdissect framework.

Differential Revision:	https://reviews.freebsd.org/D2359
Reviewed by:	glebius
Sponsored by:	DARPA, AFRL
2015-04-24 16:11:22 +00:00
Simon J. Gerraty
db29cad815 Merge bmake-20150418
PR: 199486
2015-04-21 04:40:38 +00:00
Rui Paulo
5b9c547c07 Merge wpa_supplicant/hostapd 2.4.
Major changes are: SAE, Suite B, RFC 7268, EAP-PKE, ACS, and tons of
bug fixes.

Relnotes:	yes
2015-04-21 01:45:11 +00:00
Dimitry Andric
867073d7fb Add llvm patch corresponding to r281775. 2015-04-20 17:37:37 +00:00
Dimitry Andric
98095a5dd2 Pull in r229911 from upstream llvm trunk (by Benjamin Kramer):
MC: Allow multiple comma-separated expressions on the .uleb128 directive.

  For compatiblity with GNU as. Binutils documents this as
  '.uleb128 expressions'. Subtle, isn't it?

Reported by:	sbruno
PR:		199554
MFC after:	3 days
2015-04-20 17:36:35 +00:00
Enji Cooper
f95c930e67 Fix race when testing for ETXTBSY writing to ${n0} (process image) by making
sure the process has been started beforehand with pgrep

pkill the process afterwards to make sure it's dead when the unlink is run
(not strictly required, but I was being conservative)

MFC after: 1 week
Reviewed by: Darius O'Conner, mjohnston
Sponsored by: EMC / Isilon Storage Division
2015-04-16 03:35:47 +00:00
Tijl Coosemans
1243a98e38 Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

PR:		199099
Exp-run by:	antoine
MFC after:	2 weeks
2015-04-15 09:09:20 +00:00
Baptiste Daroussin
c271fa9295 Update nvi to 2.1.3 which fixes the data corruption when locale conversion
failed
2015-04-10 17:50:28 +00:00
Xin LI
342bcb1232 MFV r281278:
- Update xz to 5.2.1, where the most visible change is that it
   fixed a compression-ratio regression in fast mode LZMA1 and
   LZMA2 and used cpuset_getaffinity() for CPU cores detection.
 - Make liblzma use the base system SHA256 implementation instead of
   the bundled one.
 - Additional annotation in config.h for FreeBSD specific tweaks.
 - Refresh symbols in XZprivate_1.0 to reflect reality.

Relnotes:	yes
MFC after:	1 month (TBD)
2015-04-09 18:03:27 +00:00
Ed Maste
6853d12d4f compiler-rt: add floatditf and floatunditf
These are long integer (di_int/du_int) to quad precision floating point
conversions. They may be reworked based on upstream discussion. These
versions are here to support arm64 world builds.

Reviewed by:	ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2174
2015-04-07 19:31:29 +00:00
Ed Maste
13553dc6bd compiler-rt: Implement multc3 - quad-precision complex multiplication
This may be reworked based on upstream discussion. This version is here
to support arm64 world builds.

Reviewed by:	ed
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2173
2015-04-07 19:28:53 +00:00
Gleb Smirnoff
56d5e0967c Stop including if_var.h from userland.
Sponsored by:	Nginx, Inc.
2015-04-06 09:42:23 +00:00
Dimitry Andric
ebfc641e4e Update FREEBSD-Xlist for llvm. 2015-04-03 19:49:39 +00:00
Dimitry Andric
fe2efc8c43 Add the llvm-cov and llvm-profdata tools, when WITH_CLANG_EXTRAS is
defined.  These help with processing coverage and profile data.
2015-04-03 19:43:39 +00:00
Andrew Turner
ef25e82143 More ARM EABI object attributes in binutils. This adds support to binutils
to include the Unaligned Access and Floating-point Half-precision
attributes. the former marks ELF objects that may access ARMv6 style
unaligned data, the latter that the binary uses the VFPv3/Advanced SIMD
half-precision extension.

These may be emmitted by clang so it's best to print a warning when the
linker hits one of them.

Differential Revision:	http://reviews.freebsd.org/D2194
Submitted by:	Michal Meloun <meloun@miracle.cz>
MFC after:	1 week
2015-04-03 19:33:26 +00:00
Dimitry Andric
1f26983742 Add clang patch corresponding to r281046. 2015-04-03 18:42:38 +00:00
Dimitry Andric
de460a4881 Pull in r227115 from upstream clang trunk (by Ben Langmuir):
Fix assert instantiating string init of static variable

  ... when the variable's type is a typedef of a ConstantArrayType. Just
  look through the typedef (and any other sugar).  We only use the
  constant array type here to get the element count.

This fixes an assertion failure when building the games/redeclipse port.

Reported by:	amdmi3
2015-04-03 18:38:37 +00:00
Cy Schubert
21c09643ff Fix merge error.
Submitted by:	jkim
2015-04-03 10:20:59 +00:00
Cy Schubert
00cbf6c295 Remove rednandt file.
Submitted by:	jkim
2015-04-03 10:17:36 +00:00
Gleb Smirnoff
6d947416cc o Use new function ip_fillid() in all places throughout the kernel,
where we want to create a new IP datagram.
o Add support for RFC6864, which allows to set IP ID for atomic IP
  datagrams to any value, to improve performance. The behaviour is
  controlled by net.inet.ip.rfc6864 sysctl knob, which is enabled by
  default.
o In case if we generate IP ID, use counter(9) to improve performance.
o Gather all code related to IP ID into ip_id.c.

Differential Revision:		https://reviews.freebsd.org/D2177
Reviewed by:			adrian, cy, rpaulo
Tested by:			Emeric POUPON <emeric.poupon stormshield.eu>
Sponsored by:			Netflix
Sponsored by:			Nginx, Inc.
Relnotes:			yes
2015-04-01 22:26:39 +00:00
Ed Maste
67d97fe724 Update elftoolchain to upstream revision 3179
Some notable changes:
- libdwarf: Fixed DWARF4 line section
- elfcopy: Implement --localize-hidden
- nm: handle object name referenced by DW_AT_specification
- elfcopy: Add --strip-dwo and --extract-dwo options for split DWARF
- readelf: add remaining arm64 dynamic relocation names
- nm: Avoid integer overflow in value comparison

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2015-04-01 01:08:01 +00:00
Cy Schubert
8e4f77ede8 Fix build. 2015-03-31 19:35:32 +00:00
Ed Maste
640cba97d8 unwind-d2 build workaround for arm64
The __builtin_init_dwarf_reg_size_table function is unimplemented in
clang 3.6 for AArch64. Comment it out for now and replace it with
a message and abort.

Tracked in upstream LLVM PR 22997
https://llvm.org/bugs/show_bug.cgi?id=22997

Submitted by:	andrew
2015-03-31 13:37:32 +00:00
Bryan Drewery
eb828e1bb5 Fix --one-file-system to include the directory encountered rather than
excluding it.  This was broken in 3.0.4 (r238856).

Obtained from:	https://github.com/libarchive/libarchive/commit/fa9e61
MFC after:	3 days
Sponsored by:	EMC / Isilon Storage Division
2015-03-31 00:00:47 +00:00
Dimitry Andric
830e9b84d8 Add llvm patch corresponding to r280865. 2015-03-30 20:23:06 +00:00
Ed Maste
e93a7dab19 llvm: Backport upstream r229195 to fix arm64 TLS relocations
As is described at http://llvm.org/bugs/show_bug.cgi?id=22408, the GNU
  linkers ld.bfd and ld.gold currently only support a subset of the
  whole range of AArch64 ELF TLS relocations. Furthermore, they assume
  that some of the code sequences to access thread-local variables are
  produced in a very specific sequence.  When the sequence is not as the
  linker expects, it can silently mis-relaxe/mis-optimize the
  instructions.
  Even if that wouldn't be the case, it's good to produce the exact
  sequence, as that ensures that linkers can perform optimizing
  relaxations.

  This patch:

  * implements support for 16MiB TLS area size instead of 4GiB TLS area
    size. Ideally clang would grow an -mtls-size option to allow support
    for both, but that's not part of this patch.
  * by default doesn't produce local dynamic access patterns, as even
    modern ld.bfd and ld.gold linkers do not support the associated
    relocations. An option (-aarch64-elf-ldtls-generation) is added to
    enable generation of local dynamic code sequence, but is off by
    default.
  * makes sure that the exact expected code sequence for local dynamic
    and general dynamic accesses is produced, by making use of a new
    pseudo instruction. The patch also removes two
    (AArch64ISD::TLSDESC_BLR, AArch64ISD::TLSDESC_CALL) pre-existing
    AArch64-specific pseudo SDNode instructions that are superseded by
    the new one (TLSDESC_CALLSEQ).

Submitted by:	Kristof Beyls
Differential Revision:	https://reviews.freebsd.org/D2175
2015-03-30 20:01:41 +00:00
Dimitry Andric
b770021fdb Pull in r233552 from upstream libc++ trunk (by Eric Fiselier):
[libcxx] Fix PR22771 - Support access control SFINAE in the library
  version of is_convertible.

  Summary:
  Currently the conversion check does not take place in a context where
  access control SFINAE is applied. This patch changes the context of
  the test expression so that SFINAE occurs if access control does not
  permit the conversion.

  Related bug: https://llvm.org/bugs/show_bug.cgi?id=22771

  Reviewers: mclow.lists, rsmith, dim

  Reviewed By: dim

  Subscribers: dim, rodrigc, emaste, cfe-commits

  Differential Revision: http://reviews.llvm.org/D8461

This fixes building clang, and other programs using libc++, with newer
versions of gcc (specifically, gcc 4.8 and higher).

Reported by:	rodrigc
MFC after:	1 week
2015-03-30 19:36:33 +00:00
Cy Schubert
2b15cb3d09 MFV ntp 4.2.8p1 (r258945, r275970, r276091, r276092, r276093, r278284)
Thanks to roberto for providing pointers to wedge this into HEAD.

Approved by:	roberto
2015-03-30 13:30:15 +00:00
Ed Maste
e3327e3942 Import lldb r233478: Fix build failure on Freebsd with gcc 4.9.
llvm.org/pr23051

Submitted by:	rodrigc
2015-03-28 18:29:13 +00:00
Ed Maste
acf33b5c74 lldb: Move debug register output into __amd64__
This debug register diagnostic is really only applicable to amd64 at
present.

Sponsored by:	The FreeBSD Foundation
2015-03-27 19:42:38 +00:00
Andrew Turner
305d71de6e Also define DWARF_FRAME_REGISTERS. This is used to size arrays, without
this exceptions could write over the stack.

Sponsored by:	The FreeBSD Foundation
2015-03-26 18:25:53 +00:00
Andrew Turner
6dd9f5b375 Adda minimal gcc config. This is just enough to build the bits of csu we
get from gcc, and libgcc_eh.

Sponsored by:	The FreeBSD Foundation
2015-03-24 14:22:58 +00:00
Edwin Groothuis
74d26aa76b MFV of 280411,tzdata{2015b}
Release 2015b - 2015-03-19 23:28:11 -0700

  Changes affecting future time stamps

    Mongolia will start observing DST again this year, from the last
    Saturday in March at 02:00 to the last Saturday in September at 00:00.
    (Thanks to Ganbold Tsagaankhuu.)

    Palestine will start DST on March 28, not March 27.  Also,
    correct the fall 2014 transition from September 26 to October 24.
    Adjust future predictions accordingly.  (Thanks to Steffen Thorsen.)

  Changes affecting past time stamps

    The 1982 zone shift in Pacific/Easter has been corrected, fixing a 2015a
    regression.  (Thanks to Stuart Bishop for reporting the problem.)

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: America/Antigua, America/Cayman,
    Pacific/Midway, and Pacific/Saipan.

  Changes affecting time zone abbreviations

    Correct the 1992-2010 DST abbreviation in Volgograd from "MSK" to "MSD".
    (Thanks to Hank W.)
2015-03-24 05:52:28 +00:00
Dimitry Andric
24db767d81 Add llvm patch corresponding to r280400. 2015-03-23 21:15:07 +00:00
Dimitry Andric
c738625756 Pull in r230348 from upstream llvm trunk (by Tim Northover):
ARM: treat [N x i32] and [N x i64] as AAPCS composite types

  The logic is almost there already, with our special homogeneous
  aggregate handling. Tweaking it like this allows front-ends to emit
  AAPCS compliant code without ever having to count registers or add
  discarded padding arguments.

  Only arrays of i32 and i64 are needed to model AAPCS rules, but I
  decided to apply the logic to all integer arrays for more consistency.

This fixes a possible "Unexpected member type for HA" error when
compiling lib/msun/bsdsrc/b_tgamma.c for armv6.

Reported by:	Jakub Palider <jpa@semihalf.com>
2015-03-23 21:13:29 +00:00
Dimitry Andric
be01698709 Add FREEBSD-Xlist files for llvm, clang and lldb.
These are generated, and not "optimized" in any way, since I am not
entirely sure of the syntax or format of this type of file.  Feel free
to suggest ways of shortening these lists.

The general idea is the same for all three files, though:
* Get rid of upstream build infrastructure (CMakeLists, Makefiles, etc)
* Delete tests, tools and utilities we don't want or use (including
  samples)
* Remove various bits of upstream metadata files that we don't want or
  use (.arcconfig, .gitignore, etc)
2015-03-22 17:56:49 +00:00
Dimitry Andric
7d0fba4fd9 Pull in r231972 from upstream compiler-rt trunk (by Jörg Sonnenberger):
Always include stddef.h to make sure size_t exists.

  From Alexander Esilevich.

Requested by:	andrew
2015-03-21 21:49:25 +00:00
Hans Petter Selasky
ec0e626baf Define BINDIR for some test utilities.
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2015-03-19 15:55:02 +00:00
Ed Maste
d470ab05ff Import compiler-rt r232125 by Joerg Sonnenberger
We want single precision here.
2015-03-17 15:48:19 +00:00
Gregory Neil Shapiro
0232255f90 Default to turning off OpenSSL SSL_OP_TLSEXT_PADDING as it breaks
compatibility with some sites

This change comes from 8.15 but is being backported to FreeBSD releases
not yet using 8.15.

MFC after:	3 days
Noted by:	julian@
2015-03-16 20:24:37 +00:00
Dimitry Andric
df6508c726 Merge ^/head r279995 through r280029. 2015-03-15 11:58:52 +00:00
Baptiste Daroussin
e509c88862 Import mdocml 1.13.3 2015-03-15 11:35:39 +00:00
Dimitry Andric
fa77b333f3 For now, disable the __clear_cache implementation for mips in
compiler-rt, since we do not yet have the required syscall.
2015-03-14 18:38:07 +00:00
Dimitry Andric
e0125cfdd1 Merge ^/head r279893 through r279984. 2015-03-14 13:08:00 +00:00
Dimitry Andric
25e141edd2 Pull in r231965 from upstream compiler-rt trunk (by Jörg Sonnenberger):
Refactor float to integer conversion to share the same code.
  80bit Intel/PPC long double is excluded due to lacking support
  for the abstraction. Consistently provide saturation logic.
  Extend to long double on 128bit IEEE extended platforms.

  Initial patch with test cases from GuanHong Liu.
  Reviewed by Steve Canon.

  Differential Revision: http://reviews.llvm.org/D2804

Pull in r232107 from upstream compiler-rt trunk (by Ed Maste):

  Use signed int implementation for __fixint

Requested by:	emaste
2015-03-14 12:40:19 +00:00
Edward Tomasz Napierala
a52c3ec43c Mark xo_err(3), xo_errx(3), and xo_errc(3) as __dead2.
Differential Revision:	https://reviews.freebsd.org/D2059
Reviewed by:	marcel@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-03-13 20:14:55 +00:00
Simon J. Gerraty
bedf67ae99 Make sure that -- filemon is at start of a line, so that
it is found as expected.
2015-03-13 02:54:46 +00:00
Ed Maste
552f44af8b Add aarch64 (arm64) #define for jemalloc
Sponsored by:	The FreeBSD Foundation
2015-03-12 08:52:00 +00:00
Dimitry Andric
08122893fe Update README for the 3.6.0 release. 2015-03-09 21:31:37 +00:00
Dimitry Andric
6404f697a0 Merging ^/head r279596 through r279758. 2015-03-07 23:01:27 +00:00
Dimitry Andric
6add1c59bf Fix another -Wunused-local-typedef warning in libc++, in include/__tree.
MFC after:	3 days
2015-03-07 22:55:31 +00:00
Dimitry Andric
90ea30d3f0 Pull in r228344 from upstream libc++ trunk (by Eric Fiselier):
Get tests running with warnings. Fix warnings in headers and tests

This fixes a number of -Wunused-local-typedef warnings in libc++ headers.

MFC after:	3 days
2015-03-07 22:53:15 +00:00
Edwin Groothuis
2627f31ff0 MFV of 279704,tzdata{2015a}
Release 2015a - 2015-01-29

Changes affecting future time stamps

    The Mexican state of Quintana Roo, represented by America/Cancun,
    will shift from Central Time with DST to Eastern Time without DST
    on 2015-02-01 at 02:00.  (Thanks to Steffen Thorsen and Gwillim Law.)

    Chile will not change clocks in April or thereafter; its new standard time
    will be its old daylight saving time.  This affects America/Santiago,
    Pacific/Easter, and Antarctica/Palmer.  (Thanks to Juan Correa.)

    New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
    (Thanks to Tim Parenti.)

  Changes affecting past time stamps

    Iceland observed DST in 1919 and 1921, and its 1939 fallback
    transition was Oct. 29, not Nov. 29.  Remove incorrect data from
    Shanks about time in Iceland between 1837 and 1908.

    Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    Their old contents have been moved to the 'backzone' file.
    The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
    and Asia/Muscat.
2015-03-06 21:45:35 +00:00
Dimitry Andric
ca65be80fd Merge ^/head r279313 through r279595. 2015-03-04 19:47:33 +00:00
Baptiste Daroussin
8e3b1ab2b5 Update libucl to git version 8d3b186 2015-03-02 21:41:09 +00:00
Baptiste Daroussin
1d0f6813ac Remove pregenerated text version of the texinfo documentation 2015-03-02 17:25:03 +00:00
Baptiste Daroussin
7bb36fb551 Generate manpage out of the texinfo files using texi2mdoc 2015-03-02 17:20:34 +00:00
Baptiste Daroussin
849684b013 Update mandoc to cvs snaphot from 20150302
Use the new unsupp warning level to detect the unsupported manpages in man(1)
2015-03-02 16:58:57 +00:00
Baptiste Daroussin
2fd5d19071 Convert texinfo to mdoc(7) using texi2mdoc 2015-03-02 11:48:00 +00:00
Jilles Tjoelker
c317cb51b2 nice(): Put back old return value, keeping [EPERM] error.
Commit r279154 changed the API and ABI significantly, and {NZERO} is still
wrong.

Also, preserve errno on success instead of setting it to 0.

PR:		189821
Reported by:	bde
Relnotes:	yes
2015-02-28 18:22:10 +00:00
Dimitry Andric
d0f6710d5a Merge ^/head r279309 through r279312. 2015-02-26 07:51:43 +00:00
Dimitry Andric
fb48e1d39c Since newer versions of compiler-rt require unwind.h, and we want to use
the copy in libcxxrt for it, fix the arm-specific header to define the
_Unwind_Action type.

Submitted by:	andrew
MFC after:	3 days
2015-02-26 07:42:16 +00:00
Dimitry Andric
0d56a8cba1 Merge ^/head r279163 through r279308. 2015-02-26 07:26:56 +00:00
Dimitry Andric
a0f4b91bed Make libcxxrt's parsing of DWARF exception handling tables work on
architectures with strict alignment, by using memcpy() instead of
directly reading fields.

Reported by:	Daisuke Aoyama <aoyama@peach.ne.jp>
Reviewed by:	imp, bapt
Tested by:	bapt
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1967
2015-02-26 07:20:05 +00:00
Ed Maste
4b8807a4d3 GNU nm: Avoid NULL dereference
bfd_dwarf2_find_line() calls find_line() with NULL functionname_ptr,
which resulted in a crash on certain ELF objects.

This change was implemented independently from upstream binutils, but
I have checked that the crash does not happen there.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-02-25 22:12:37 +00:00
Ed Maste
0b93a0b462 nm: avoid crash in print_lineno if func->name is NULL
This can occur when DW_AT_specification is used to refer to another DIE
that provides the actual DW_AT_name string. For example:

< 3><0x00000086> DW_TAG_subprogram
                   DW_AT_name              PrettyStackTraceEntry
...
< 1><0x00002cf4> DW_TAG_subprogram
                   DW_AT_specification     <0x00000086>

We will need to add support for DW_AT_specification, but in the interim
we should not segfault.

Obtained from:	Elftoolchain (r3170)
Sponsored by:	The FreeBSD Foundation
2015-02-25 21:43:09 +00:00
Dimitry Andric
cef93a3d52 Merge llvm 3.6.0 final from ^/vendor/llvm/dist, merge clang 3.6.0 final
from ^/vendor/clang/dist, and resolve conflicts.
2015-02-25 18:50:24 +00:00
Kenneth D. Merry
43518607b2 Significant upgrades to sa(4) and mt(1).
The primary focus of these changes is to modernize FreeBSD's
tape infrastructure so that we can take advantage of some of the
features of modern tape drives and allow support for LTFS.

Significant changes and new features include:

 o sa(4) driver status and parameter information is now exported via an
   XML structure.  This will allow for changes and improvements later
   on that will not break userland applications.  The old MTIOCGET
   status ioctl remains, so applications using the existing interface
   will not break.

 o 'mt status' now reports drive-reported tape position information
   as well as the previously available calculated tape position
   information.  These numbers will be different at times, because
   the drive-reported block numbers are relative to BOP (Beginning
   of Partition), but the block numbers calculated previously via
   sa(4) (and still provided) are relative to the last filemark.
   Both numbers are now provided.  'mt status' now also shows the
   drive INQUIRY information, serial number and any position flags
   (BOP, EOT, etc.) provided with the tape position information.
   'mt status -v' adds information on the maximum possible I/O size,
   and the underlying values used to calculate it.

 o The extra sa(4) /dev entries (/dev/saN.[0-3]) have been removed.

   The extra devices were originally added as place holders for
   density-specific device nodes.  Some OSes (NetBSD, NetApp's OnTap
   and Solaris) have had device nodes that, when you write to them,
   will automatically select a given density for particular tape drives.

   This is a convenient way of switching densities, but it was never
   implemented in FreeBSD.  Only the device nodes were there, and that
   sometimes confused users.

   For modern tape devices, the density is generally not selectable
   (e.g. with LTO) or defaults to the highest availble density when
   the tape is rewritten from BOT (e.g. TS11X0).  So, for most users,
   density selection won't be necessary.  If they do need to select
   the density, it is easy enough to use 'mt density' to change it.

 o Protection information is now supported.  This is either a
   Reed-Solomon CRC or CRC32 that is included at the end of each block
   read and written.  On write, the tape drive verifies the CRC, and
   on read, the tape drive provides a CRC for the userland application
   to verify.

 o New, extensible tape driver parameter get/set interface.

 o Density reporting information.  For drives that support it,
   'mt getdensity' will show detailed information on what formats the
   tape drive supports, and what formats the tape drive supports.

 o Some mt(1) functionality moved into a new mt(3) library so that
   external applications can reuse the code.

 o The new mt(3) library includes helper routines to aid in parsing
   the XML output of the sa(4) driver, and build a tree of driver
   metadata.

 o Support for the MTLOAD (load a tape in the drive) and MTWEOFI
   (write filemark immediate) ioctls needed by IBM's LTFS
   implementation.

 o Improve device departure behavior for the sa(4) driver.  The previous
   implementation led to hangs when the device was open.

 o This has been tested on the following types of drives:
	IBM TS1150
	IBM TS1140
	IBM LTO-6
	IBM LTO-5
	HP LTO-2
	Seagate DDS-4
	Quantum DLT-4000
	Exabyte 8505
	Sony DDS-2

contrib/groff/tmac/doc-syms,
share/mk/bsd.libnames.mk,
lib/Makefile,
	Add libmt.

lib/libmt/Makefile,
lib/libmt/mt.3,
lib/libmt/mtlib.c,
lib/libmt/mtlib.h,
	New mt(3) library that contains functions moved from mt(1) and
	new functions needed to interact with the updated sa(4) driver.

	This includes XML parser helper functions that application writers
	can use when writing code to query tape parameters.

rescue/rescue/Makefile:
	Add -lmt to CRUNCH_LIBS.

src/share/man/man4/mtio.4
	Clarify this man page a bit, and since it contains what is
	essentially the mtio.h header file, add new ioctls and structure
	definitions from mtio.h.

src/share/man/man4/sa.4
	Update BUGS and maintainer section.

sys/cam/scsi/scsi_all.c,
sys/cam/scsi/scsi_all.h:
	Add SCSI SECURITY PROTOCOL IN/OUT CDB definitions and CDB building
	functions.

sys/cam/scsi/scsi_sa.c
sys/cam/scsi/scsi_sa.h
	Many tape driver changes, largely outlined above.

	Increase the sa(4) driver read/write timeout from 4 to 32
	minutes.  This is based on the recommended values for IBM LTO
	5/6 drives.  This may also avoid timeouts for other tape
	hardware that can take a long time to do retries and error
	recovery.  Longer term, a better way to handle this is to ask
	the drive for recommended timeout values using the REPORT
	SUPPORTED OPCODES command.  Modern IBM and Oracle tape drives
	at least support that command, and it would allow for more
	accurate timeout values.

	Add XML status generation.  This is done with a series of
	macros to eliminate as much duplicate code as possible.  The
	new XML-based status values are reported through the new
	MTIOCEXTGET ioctl.

	Add XML driver parameter reporting, using the new MTIOCPARAMGET
	ioctl.

	Add a new driver parameter setting interface, using the new
	MTIOCPARAMSET and MTIOCSETLIST ioctls.

	Add a new MTIOCRBLIM ioctl to get block limits information.

	Add CCB/CDB building routines scsi_locate_16, scsi_locate_10,
	and scsi_read_position_10().

	scsi_locate_10 implements the LOCATE command, as does the
	existing scsi_set_position() command.  It just supports
	additional arguments and features.  If/when we figure out a
	good way to provide backward compatibility for older
	applications using the old function API, we can just revamp
	scsi_set_position().  The same goes for
	scsi_read_position_10() and the existing scsi_read_position()
	function.

	Revamp sasetpos() to take the new mtlocate structure as an
	argument.  It now will use either scsi_locate_10() or
	scsi_locate_16(), depending upon the arguments the user
	supplies.  As before, once we change position we don't have a
	clear idea of what the current logical position of the tape
	drive is.

	For tape drives that support long form position data, we
	read the current position and store that for later reporting
	after changing the position.  This should help applications
	like Bacula speed tape access under FreeBSD once they are
	modified to support the new ioctls.

	Add a new quirk, SA_QUIRK_NO_LONG_POS, that is set for all
	drives that report SCSI-2 or older, as well as drives that
	report an Illegal Request type error for READ POSITION with
	the long format.  So we should automatically detect drives
	that don't support the long form and stop asking for it after
	an initial try.

	Add a partition number to the sa(4) softc.

	Improve device departure handling. The previous implementation
	led to hangs when the device was open.

	If an application had the sa(4) driver open, and attempted to
	close it after it went away, the cam_periph_release() call in
	saclose() would cause the periph to get destroyed because that
	was the last reference to it.  Because destroy_dev() was
	called from the sa(4) driver's cleanup routine (sacleanup()),
	and would block waiting for the close to happen, a deadlock
	would result.

	So instead of calling destroy_dev() from the cleanup routine,
	call destroy_dev_sched_cb() from saoninvalidate() and wait for
	the callback.

	Acquire a reference for devfs in saregister(), and release it
	in the new sadevgonecb() routine when all devfs devices for
	the particular sa(4) driver instance are gone.

	Add a new function, sasetupdev(), to centralize setting
	per-instance devfs device parameters instead of repeating the
	code in saregister().

	Add an open count to the softc, so we know how many
	peripheral driver references are a result of open
       	sessions.

	Add the D_TRACKCLOSE flag to the cdevsw flags so
	that we get a 1:1 mapping of open to close calls
	instead of a N:1 mapping.

	This should be a no-op for everything except the
	control device, since we don't allow more than one
	open on non-control devices.

	However, since we do allow multiple opens on the
	control device, the combination of the open count
	and the D_TRACKCLOSE flag should result in an
	accurate peripheral driver reference count, and an
	accurate open count.

	The accurate open count allows us to release all
	peripheral driver references that are the result
	of open contexts once we get the callback from devfs.

sys/sys/mtio.h:
	Add a number of new mt(4) ioctls and the requisite data
	structures.  None of the existing interfaces been removed
	or changed.

	This includes definitions for the following new ioctls:

	MTIOCRBLIM      /* get block limits */
	MTIOCEXTLOCATE	/* seek to position */
	MTIOCEXTGET     /* get tape status */
	MTIOCPARAMGET	/* get tape params */
	MTIOCPARAMSET	/* set tape params */
	MTIOCSETLIST	/* set N params */

usr.bin/mt/Makefile:
	mt(1) now depends on libmt, libsbuf and libbsdxml.

usr.bin/mt/mt.1:
	Document new mt(1) features and subcommands.

usr.bin/mt/mt.c:
	Implement support for mt(1) subcommands that need to
	use getopt(3) for their arguments.

	Implement a new 'mt status' command to replace the old
	'mt status' command.  The old status command has been
	renamed 'ostatus'.

	The new status function uses the MTIOCEXTGET ioctl, and
	therefore parses the XML data to determine drive status.
	The -x argument to 'mt status' allows the user to dump out
	the raw XML reported by the kernel.

	The new status display is mostly the same as the old status
	display, except that it doesn't print the redundant density
	mode information, and it does print the current partition
	number and position flags.

	Add a new command, 'mt locate', that will supersede the
	old 'mt setspos' and 'mt sethpos' commands.  'mt locate'
	implements all of the functionality of the MTIOCEXTLOCATE
	ioctl, and allows the user to change the logical position
	of the tape drive in a number of ways.  (Partition,
	block number, file number, set mark number, end of data.)
	The immediate bit and the explicit address bits are
	implemented, but not documented in the man page.

	Add a new 'mt weofi' command to use the new MTWEOFI ioctl.
	This allows the user to ask the drive to write a filemark
	without waiting around for the operation to complete.

	Add a new 'mt getdensity' command that gets the XML-based
	tape drive density report from the sa(4) driver and displays
	it.  This uses the SCSI REPORT DENSITY SUPPORT command
	to get comprehensive information from the tape drive about
	what formats it is able to read and write.

	Add a new 'mt protect' command that allows getting and setting
	tape drive protection information.  The protection information
	is a CRC tacked on to the end of every read/write from and to
	the tape drive.

Sponsored by:	Spectra Logic
MFC after:	1 month
2015-02-23 21:59:30 +00:00
Dimitry Andric
abb48e0e14 Update compiler-rt to trunk r230183. This has some of our patches
imported, so we have just a few small diffs against upstream left.
2015-02-22 22:53:51 +00:00
Dimitry Andric
7ff616029d Update compiler-rt to trunk r228651. This enables using Address
Sanitizer and Undefined Behavior Sanitizer with clang 3.6.0.
2015-02-22 22:31:36 +00:00
Nathan Whitehorn
8a5843ad02 Add some opcodes for assembling forthcoming VSX (Vector-Scalar eXtension)
support in the kernel. Userspace programs are expected to rely on LLVM's
integrated assembler or newer binutils.
2015-02-22 20:52:29 +00:00
Dimitry Andric
79a79bd7c1 Belatedly add llvm patch corresponding to r278367. 2015-02-22 16:28:24 +00:00
Dimitry Andric
9b2a0d91b8 Merge ^/head r279023 through r279162. 2015-02-22 16:04:37 +00:00
Dimitry Andric
680ef382a2 Add llvm patch corresponding to r279161. 2015-02-22 15:56:16 +00:00
Dimitry Andric
a6d980a99e Pull in r230058 from upstream llvm trunk (by Benjamin Kramer):
LoopRotate: When reconstructing loop simplify form don't split edges
  from indirectbrs.

  Yet another chapter in the endless story. While this looks like we
  leave the loop in a non-canonical state this replicates the logic in
  LoopSimplify so it doesn't diverge from the canonical form in any way.

  http://llvm.org/PR21968

This fixes a "Cannot split critical edge from IndirectBrInst" assertion
failure when building the devel/radare2 port.

PR:		195480, 196987
MFC after:	3 days
2015-02-22 15:51:49 +00:00
Jilles Tjoelker
e220ce08ef nice(): Correct return value and [EPERM] error.
PR:		189821
Obtained from:	NetBSD
Relnotes:	yes
2015-02-22 13:36:44 +00:00
Gleb Smirnoff
b0af3a5363 The ipftest(1) is a program that emulates ipf(4) operation and tests packets
against rules.  It definitely doesn't need to know about kernel internals,
such as 'struct ifaddr'.  What it does with ifaddr, is that it only takes
ifa_addr member of it, and treats it as sockaddr, while it is only a pointer
to sockaddr.  Fortunately, sizeof(struct ifaddr) > sizeof(struct sockaddr_in6),
so no problems arise.

Fix that declaring a private struct ifaddr in ipftest(1) and stop including
if_var.h.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2015-02-19 23:14:35 +00:00
Dimitry Andric
b09980d164 Merge llvm 3.6.0rc4 from ^/vendor/llvm/dist, merge clang 3.6.0rc4 from
^/vendor/clang/dist, resolve conflicts, and update patches.
2015-02-19 22:20:19 +00:00
Dimitry Andric
714e3c812d Merge ^/head r278756 through r278915. 2015-02-17 19:53:41 +00:00
Ed Maste
b153f37ffc lldb: workaround to permit cross-arch core file debugging
FreeBSD core files have no section table and thus LLDB's OS and vendor
detection logic does not work. If we encounter such an ELF file, update
an unknown OS to match the host.

This is not really the correct way to handle this, but more extensive
rework of ObjectFileELF will be needed and this change restores cross-
arch core debugging until that can be completed.
2015-02-17 18:33:17 +00:00
Ed Maste
71a0c925ce Update elftoolchain to upstream revision 3163
Most of our changes have now been committed upstream, so this change is
largely bookkeeping.

Sponsored by:	The FreeBSD Foundation
2015-02-17 15:19:58 +00:00