Commit Graph

5898 Commits

Author SHA1 Message Date
Ed Maste
8584c88e4d Fix mismerge in r262121
A break statement was lost in the merge.  The error had no functional
impact, but restore it to reduce the diff against upstream.
2014-02-18 19:46:45 +00:00
Ed Maste
adacc0725e Update lldb for clang/llvm 3.4 import
This commit largely restores the lldb source to the upstream r196259
snapshot with the addition of threaded inferior support and a few bug
fixes.

Specific upstream lldb revisions restored include:
   SVN      git
  181387  779e6ac
  181703  7bef4e2
  182099  b31044e
  182650  f2dcf35
  182683  0d91b80
  183862  15c1774
  183929  99447a6
  184177  0b2934b
  184948  4dc3761
  184954  007e7bc
  186990  eebd175

Sponsored by:	DARPA, AFRL
2014-02-17 18:50:03 +00:00
Julio Merino
c9be23cfca Undefine HAVE_VSNPRINTF_IN_STD.
Should fix the build with g++/libstdc++.

This is what we used to do prior the import of atf 0.20 and the build worked
just fine with both libstdc++ and libc++.  Still investigating how to properly
fix this upstream so that we do not hit the same issue on the next import.
2014-02-16 21:53:33 +00:00
Dimitry Andric
f785676f2a Upgrade our copy of llvm/clang to 3.4 release. This version supports
all of the features in the current working draft of the upcoming C++
standard, provisionally named C++1y.

The code generator's performance is greatly increased, and the loop
auto-vectorizer is now enabled at -Os and -O2 in addition to -O3.  The
PowerPC backend has made several major improvements to code generation
quality and compile time, and the X86, SPARC, ARM32, Aarch64 and SystemZ
backends have all seen major feature work.

Release notes for llvm and clang can be found here:
<http://llvm.org/releases/3.4/docs/ReleaseNotes.html>
<http://llvm.org/releases/3.4/tools/clang/docs/ReleaseNotes.html>

MFC after:	1 month
2014-02-16 19:44:07 +00:00
Julio Merino
1a61beb054 MFV: Import atf-0.20. 2014-02-14 19:33:16 +00:00
Dimitry Andric
eed07a2ea1 An ABI incompatibility crept into the libc++ 3.4 import in r261283. It
was caused by upstream libc++ commit r194536, which aimed to make the
headers more standards-compliant, by making std::pair's copy constructor
trivial.  Unfortunately, this could cause certain C++ applications using
shared libraries built against the previous version of libc++ to crash.

Fix the ABI incompatibility by making std::pair's copy constructor
non-trivial again.

Please note: Any C++ applications or shared libraries built with libc++
between r261283 and this revision should be recompiled.

Reported by:	stefanf
MFC after:	3 weeks
X-MFC-With:	r261283
2014-02-12 18:14:49 +00:00
John-Mark Gurney
85e5839202 recognize the FreeBSD ARCH tag that is put on binaries like on armeb
EABI binaries...

MFC after:	1 week
2014-02-12 02:03:37 +00:00
Dimitry Andric
279c613d4d Pull in r200899 from upstream clang trunk:
Allow transformation of VariableArray to ConstantArray.

  In the following code:

     struct A { static const int sz; };
     template<class T> void f() { T arr[A::sz]; }

  the array 'arr' is represented as a variable size array in the template.
  If 'A::sz' gets value below in the translation unit, the array in
  instantiation can turn into constant size array.

  This change fixes PR18633.

  Differential Revision: http://llvm-reviews.chandlerc.com/D2688

This fixes "Assertion failed: (T::isKind(*this)), function castAs"
errors, which can occur when building the security/quantis port.

Reported by:	ale
MFC after:	3 days
2014-02-09 20:52:47 +00:00
Dimitry Andric
f18dc6922d Pull in upstream libcxxrt commit 8006101, which makes its cxxabi.h file
compilable just by itself.

PR:		kern/184019
MFC after:	3 days
2014-02-07 21:34:09 +00:00
Dimitry Andric
d45679747c Apply a cleaner solution for the sign warnings that can occur when
compiling libc++'s <locale> header with -Wsystem-headers on.

This has also been submitted upstream.

Reported by:	asomers
2014-02-07 21:17:20 +00:00
Eitan Adler
86a7dfc3e0 HEAD is not buildable for the past day. Commit a 'quick fix' in order to permit
buildworld to complete.

Reviewed by:	theraven
2014-02-07 18:10:34 +00:00
Baptiste Daroussin
968ba8fe77 Apply patch for CVE-2013-6393 [1] to fix heap-based buffer overflow when
parsing YAML tags.
Also apply a patch for hardenning the guards againt the issue

The only user in base in yaml is pkg(7) which uses the library a way that it is not affected

Submitted by:	delphij
Obtained from:	https://bugzilla.redhat.com/show_bug.cgi?id=1033990
MFC after:	3 days
Security:	CVE-2013-6393
2014-02-03 08:13:44 +00:00
Justin Hibbits
1d5f07dc97 Make gas accept any PowerPC instruction by default. This is a local change,
and will not be submitted upstream.

Discussed with:	nwhitehorn,rdivacky
MFC after:	1 month
2014-02-03 01:45:07 +00:00
Ulrich Spörlein
9837d07131 Merge mdocml v1.12.3 into head
MFC after:	2 weeks
2014-02-01 09:27:57 +00:00
Ulrich Spörlein
9e90c87023 Pull up vendor changes up to 2014-01-29
- move local overrides into mdoc.local
- syncs us with git commit 819839b66c80e8dabe6cb24ea6319c26c9a2be14

Discussed with: ru
MFC after: 2 weeks
2014-01-31 12:26:30 +00:00
Dimitry Andric
4f7ab58ee6 Import libc++ 3.4 release. This contains a lot of bugfixes, and some
preliminary support for C++1y.

MFC after:	3 weeks
2014-01-30 07:44:22 +00:00
Sergey Kandaurov
a24f107bb9 Ressurect the local change documenting
authpf's requirement for a mounted fdescfs(5).

PR:		docs/186250
MFC after:	1 week
2014-01-29 19:28:52 +00:00
Sergey Kandaurov
492a99a2fc Restore the Nx macro lost in transit.
This matches upstream.

PR:		186205
Submitted by:	naddy
MFC after:	3 days
2014-01-29 11:39:58 +00:00
Kai Wang
ca82a53f82 MFH@261240. 2014-01-28 19:12:31 +00:00
Warner Losh
0f39bd6aa0 Merge from vendor branch importing dtc git rev 6a15eb2350426d285130e4c9d84c0bdb6575547a 2014-01-27 19:37:35 +00:00
Simon J. Gerraty
0dede8b0ba Merge bmake-20140101 from vendor 2014-01-27 17:47:21 +00:00
Gregory Neil Shapiro
9d59bad1e4 Update for sendmail 8.14.8 import
MFC after:	5 days
2014-01-26 23:44:12 +00:00
Gregory Neil Shapiro
1689ae4380 Remove local FreeBSD workaround now that upstream project has a better fix.
MFC after:	5 days
2014-01-26 23:42:40 +00:00
Gregory Neil Shapiro
5dd76dd0cc Merge sendmail 8.14.8 to HEAD
MFC after:	5 days
2014-01-26 23:39:11 +00:00
Gregory Neil Shapiro
c1bfccf73e Import sendmail 8.14.8 2014-01-26 20:46:55 +00:00
Gregory Neil Shapiro
e2cd7d5314 Update link to vendor import instructions 2014-01-26 20:13:28 +00:00
Pedro F. Giffuni
321c39ba84 gcc: Add support for -Wmissing-prototypes in C++
Support for warnings about missing prototypes in C++ was added by Apple
GCC (Radar 6261539).  Most of the code crept into r260311 so it felt
natural to make use of it.

Obtained from:	Apple GCC - 5646
MFC after:	5 days
2014-01-26 02:36:06 +00:00
Pedro F. Giffuni
887bf737ad binutils: add support for Intel SMAP-related instructions
Add support for stac/clac instructions to manipulate the flag
that controls the behaviour of Intel's Supervisor Mode Access
Prevention (SMAP) feature.

Tested by:	dim
Obtained from:	OpenBSD
MFC after:	5 days
2014-01-26 00:37:21 +00:00
Dimitry Andric
43349674f1 Pull in r195679 from upstream llvm trunk:
Don't use nopl in cpus that don't support it.

  Patch by Mikulas Patocka. I added the test. I checked that for cpu names that
  gas knows about, it also doesn't generate nopl.

  The modified cpus:
  i686 - there are i686-class CPUs that don't have nopl: Via c3, Transmeta
         Crusoe, Microsoft VirtualBox - see
         https://bbs.archlinux.org/viewtopic.php?pid=775414
  k6, k6-2, k6-3, winchip-c6, winchip2 - these are 586-class CPUs
  via c3 c3-2 - see https://bugs.archlinux.org/task/19733 as a proof that
         Via c3 and c3-Nehemiah don't have nopl

PR:		bin/185777
MFC after:	3 days
2014-01-25 16:35:56 +00:00
Kai Wang
a36ae249b8 MFH@261151. 2014-01-25 14:02:02 +00:00
Kai Wang
ee3d625d72 Reapply r221569, r233401, r233524 and r255105: Add support for a few
ARM/MIPS ELF section types in _libelf_xlate_shtype().
2014-01-25 13:53:46 +00:00
Jason Evans
f921d10f48 Update jemalloc to version 3.5.0. 2014-01-23 02:47:36 +00:00
Kai Wang
2612af8d84 MFH@260988. 2014-01-21 20:48:02 +00:00
Kai Wang
2496d1b162 Remove trailing whitespace. 2014-01-21 20:17:10 +00:00
Hartmut Brandt
30b5118d51 Fix a problem with OBJECT IDENTIFIER encoding: need to check the
second subid to be less than 40, not the first when the first
subid is 0 or 1.
2014-01-21 16:49:54 +00:00
Kai Wang
945a2095f6 MFH@260917. 2014-01-20 19:38:44 +00:00
Kai Wang
bc5fce8d8f * Allow API dwarf_loclist_n() and dwarf_loclist() to be called with
attributes that have form DW_FORM_sec_offset.
* If the .debug_info section conforms to DWARF4, do not allow the value
  of attributes with form DW_FORM_data[48] to be used as section
  offset.
2014-01-19 13:42:49 +00:00
Kai Wang
255d921adc Add a sanity check: The provided offset for the desired location list
should not exceed the size of the .debug_loc section.
2014-01-19 13:38:40 +00:00
Kai Wang
9c016dc4b2 API dwarf_attrval_flag() should properly handle an attribute with
(DWARF4) form DW_FORM_flag_present which implicitly indicates the
presence of the attribute. Manual page is updated to reflect this
change.

Note that this was previously fixed in the old libdwarf.
2014-01-18 17:59:22 +00:00
Kai Wang
1201c6fd27 Fix typo: the public API dwarf_child() should return DW_DLV_NO_ENTRY
instead of DW_DLE_NO_ENTRY when a child DIE is not found.
2014-01-18 17:49:32 +00:00
Kai Wang
5371959e6f Fix a warning in libdwarf found by -Wmissing-variable-declarations. 2014-01-18 17:47:06 +00:00
Kai Wang
35b270102d Apply r241720 by ed:
Fix warnings found by -Wmising-variable-declarations.
2014-01-18 10:13:04 +00:00
Pedro F. Giffuni
3cb44b3f65 gcc: Drop useless objc change from r260311.
Among some of the objc changes from Apple that crept into r260311,
Radar 5355344 is incomplete and is not used since we don't carry
ObjC in the base system.

The dead code seems to have caused issues in some Tinderboxes so
get rid of it altogether.

Reported by:	luigi
MFC after:	9 days
2014-01-17 21:21:28 +00:00
Kai Wang
4e5c697507 Use FreeBSD's ELF headers instead of the elfdefinitions.h header which
comes with elftoolchain. This version of libelf doesn't need to be
portable; using FreeBSD's own ELF headers will avoid conflicts and
make integration easier.
2014-01-16 21:47:27 +00:00
Kai Wang
2de3b87a12 Copy libelf, libdwarf and common files from vendor/ to contrib/. 2014-01-15 22:30:48 +00:00
Xin LI
f3f38455ea Disable 'monitor' feature in ntpd by default.
Security:	FreeBSD-SA-14:02.ntpd
Approved by:	so
2014-01-14 18:59:00 +00:00
Xin LI
ecd241b619 Fix bsnmpd remote denial of service vulnerability.
Reported by:	dinoex
Submitted by:	harti
Security:	FreeBSD-SA-14:01.bsnmpd
Security:	CVE-2014-1452
2014-01-14 18:58:57 +00:00
Julio Merino
a62905a977 Add atf pkg-config files from the vendor branch.
These were originally deleted by mistake (because they were not yet being
installed) and are actually necessary.

This should have been part of r260576 but I missed committing this
directory.

MFC after:	5 days
2014-01-12 22:17:10 +00:00
Andrew Turner
0b55a5a4af Fix gcc with EABI on big-endian ARM by setting the endian correctly.
Without this gcc would generate byte loads for a little-endian core.

MFC after:	1 week
2014-01-12 15:35:03 +00:00
Julio Merino
b17b15d8ea Fix path to the process_helpers for the libatf-c++ tests.
Because we respect the FreeBSD src tree layout under /usr/tests, and because
the layout of the tests in the atf distfile does not match the former, the
tests for atf-c++ were not able to find the process_helper binary.

Fix this by explicitly hardcoding the right path in the FreeBSD test suite.

Obtained from:	atf (git 1f0e878f7f127741a3762883ef24aef317e239d5)
MFC after:	1 week
2014-01-10 23:41:01 +00:00
Julio Merino
6d732c66bc Use .cpp as the extension for temporary C++ files.
Using a .c extension for a C++ file raises the following warning, which
breaks our header file tests if the compiler is using -Werror as well:

c++: warning: treating 'c' input as 'c++' when in C++ mode, this
behavior is deprecated

Obtained from:	atf (git 3104010c2849330440cc0ce108ff341913433339)
MFC after:	3 days
2014-01-09 18:53:21 +00:00
Baptiste Daroussin
4b4a8fca31 Import byacc 20140101 which imports %token-table from bison allowing to build ntpd 2014-01-08 08:08:22 +00:00
Kevin Lo
5945b5f5ab Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
Pedro F. Giffuni
aacea395b4 gperf: reverse size_type patch from r258115.
Silencing the broken warning as done in r258139 renders the
code unreacheable. An option could've been to turn off the
warnings in gperf but given that the code is not being used
it is better to just revert the original change altogether.

This code was never MFC'd.
2014-01-07 01:40:49 +00:00
Pedro F. Giffuni
02f1bd6b8d Fix optimization bug.
GCC-PR rtl-optimization/34628
	* combine.c (try_combine): Stop and undo after the first combination
	if an autoincrement side-effect on the first insn has effectively
	been lost.

The issue was detected in OpenBSD but their fix was not very good. Huge
thanks to the upstream author, Eric Botcazou, for permitting the use of
this patch under GPLv2.

MFC after:	5 days
2014-01-06 00:52:39 +00:00
Warren Block
998db43a8d Fix a cut and paste error.
PR:		docs/184791
Submitted by:	Jamie Landeg Jones <jamie@dyslexicfish.net>
MFC after:	3 days
2014-01-05 23:28:03 +00:00
Pedro F. Giffuni
ab07951c0c gcc: backport some fixes from llvm-gcc
llvm-gcc backported some patches from gcc trunk:

http://gcc.gnu.org/ml/gcc-cvs/2007-05/msg00662.html
http://gcc.gnu.org/ml/gcc-cvs/2007-07/msg00019.html
http://gcc.gnu.org/ml/gcc-cvs/2007-08/msg00240.html
http://gcc.gnu.org/ml/gcc-cvs/2007-08/msg00493.html

The first two were always GPL2. The last two were
added after the GPL3 transition, but were written
by aaw@google.com and Rafael Espíndola got permission
to relicense them under the GPL2 for inclusion in
llvm-gcc.

This fixes GCC-PR c++/31749

Obtained from:	llvm-gcc (rev. 75463; GPLv2)
MFC after:	2 weeks
2014-01-05 20:33:44 +00:00
Pedro F. Giffuni
5bfc7db451 gcc: Add support for Apple's Block extension
Block objects [1] are a C-level syntactic and runtime feature. They
are similar to standard C functions, but in addition to executable
code they may also contain variable bindings to automatic (stack)
or managed (heap) memory. A block can therefore maintain a set of
state (data) that it can use to impact behavior when executed.

This port is based on Apple's GCC 5646 with some bugfixes from
Apple GCC 5666.3. It has some small differences with the support
in clang, which remains the recommended compiler.

Perhaps the most notable difference is that in GCC that __block
is not actually a keyword, but a macro. There will be workaround
for this issue in a near future. Other issues can be consulted in
the clang documentation [2]

For better compatiblity with Apple's GCC and llvm-gcc some related
fixes and features from Apple have been included. Support for the
non-standard nested functions in GCC is now off by default.

No effort was made to update the ObjC support since FreeBSD doesn't
carry ObjC in the base system, but some of the code crept in and
was more difficult to remove than to adjust.

Reference:
[1]
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html
[2]
http://clang.llvm.org/compatibility.html#block-variable-initialization

Obtained from:	Apple GCC 4.2
MFC after:	3 weeks
2014-01-05 00:43:28 +00:00
Pedro F. Giffuni
e1b3bb5380 libcpp: misc fixes from Apple's GCC.
Fixes some bugs detected by Apple:
#error with unmatched quotes
pragma mark

Obtained from:	Apple GCC 4.2 - 5553
MFC after:	1 week
2014-01-05 00:32:38 +00:00
Pedro F. Giffuni
d096f2f5a8 Revert r260073; small diff reduction wrt gcc43 and Apple GCC.
Unfortunately this causes ICE on powerpc and sparc64.

Reducing these differences against upstream is not important
anymore so hopefully I have finished breaking the compiler
occasionally.
2014-01-02 13:53:53 +00:00
Pedro F. Giffuni
1b9906c757 gcc: Fix issue with "unavailable" attribute.
While here, point where we dropped the support for objc from r260014.

MFC after:	3 weeks
2013-12-30 20:24:05 +00:00
Pedro F. Giffuni
fdcd8bc639 gcc: small diff reduction wrt gcc43 and Apple GCC.
Obtained from:	gcc 4.3 (rev. 121464, 122528, 124106; GPLv2)
MFC after:	3 weeks
2013-12-30 02:52:43 +00:00
Marcel Moolenaar
e153be43ae Fix cross-compilation of ia64 target code with clang. 2013-12-28 22:52:46 +00:00
Dimitry Andric
17c43f4276 In libc++'s type_traits header, avoid warnings (activated by our use of
-Wsystem-headers) about potential keyword compatibility problems, by
adding a __libcpp prefix to the applicable identifiers.

Upstream is still debating about this, but we need it now, to be able to
import clang 3.4.

MFC after:	3 days
2013-12-28 20:54:08 +00:00
Pedro F. Giffuni
2d278bb89e gcc: Add support for label attributes and "unavailable" attribute.
Apple GCC has extensions to support for both label attributes and
an "unavailable" attribute. These are critical for objc but are
also useful in regular C/C++.

Apparently at least the label attributes might have found their way to
upstream GCC but the code doesn't seem available on the GPLv2 tree so
we are taking the code directly from Apple. To make this clearer we
are preserving the annoying "APPLE LOCAL" tags and the ChangeLogs
when they are available.

Obtained from:	Apple GCC 4.2 - 5531
MFC after:	3 weeks
2013-12-28 20:30:31 +00:00
Pedro F. Giffuni
4707030025 gcc: merge small upstream change.
Backport from mainline:
2007-04-24  Hui-May Chang <hm.chang@apple.com>

* reload1.c (merge_assigned_reloads) : Do not merge a RELOAD_OTHER
instruction with a RELOAD_FOR_OPERAND_ADDRESS instruction.

Obtained from:	gcc 4.3 (rev. r124115: GPLv2)
MFC after:	1 week
2013-12-27 15:15:49 +00:00
Pedro F. Giffuni
99dee3f5ae gcc: Implement -Wmost for compatibility with clang.
This is equivalent to -Wall -Wno-parentheses.

Obtained from:	Apple GCC 4.2 - 5531
MFC after:	1 week
2013-12-26 18:09:16 +00:00
Dimitry Andric
f1e7930afc Pull in r183971 from upstream llvm trunk:
X86: cvtpi2ps is just an SSE instruction with MMX operands. It has no AVX
  equivalent.

  Give it the right register format so we can also emit it when AVX is enabled.

This should fix a "Cannot select: intrinsic %llvm.x86.sse.cvtpi2ps" fatal error
in clang while building the gnuradio port for amd64.

Reported by:	db
MFC after:	3 days
2013-12-25 20:58:02 +00:00
Pedro F. Giffuni
8adb8fac02 gcc: small enhancements for the arm support.
Very small updates: fixes GCC-PR target/31152

Tested by building the cross-compiler.

Obtained from:	gcc 4.3 (rev. r118461, 125973: GPLv2)
MFC after:	2 weeks
2013-12-25 16:01:48 +00:00
Pedro F. Giffuni
29c20022de gcc: Add ability to generate DWARF pubtypes section if
DEBUG_PUBTYPES_SECTION is defined.

Obtained from:	gcc 4.3 (rev. 118826; GPLv2)

MFC after:	2 weeks
2013-12-24 20:42:48 +00:00
Dimitry Andric
c807508f73 Get rid of register keyword usage in gperf, it is totally obsolete for
C++, and this allows gperf to be compiled for C++11 without a warning
about it.

MFC after:	3 days
2013-12-23 00:02:18 +00:00
Dimitry Andric
b71498e619 Apply upstream commit 33312fd828e59c78ae4ee30fd70d0ca109748cf0 (by
zoulasc) to contrib/file:

  don't write a char to a pointer.

MFC after:	3 days
2013-12-22 14:14:53 +00:00
Pedro F. Giffuni
860701960d gcc: warnings from -Wformat-security
Minor mismatch in r259666.

Obtained from:	Apple GCC 4.2 - 5646 (Radar 5764921)
MFC after:	1 week
2013-12-21 19:53:51 +00:00
Glen Barber
8c82632e0b Fix build with WITHOUT_CAPSICUM.
Submitted by:	dt71 gmx com
Sponsored by:	The FreeBSD Foundation
2013-12-21 12:45:35 +00:00
Pedro F. Giffuni
5c3c610835 gcc: clean some warnings from -Wformat-security
Obtained from:	Apple GCC 4.2 - 5646 (Radar 5764921)
MFC after:	1 week
2013-12-20 20:57:13 +00:00
Pedro F. Giffuni
b078889a6b Revert r259619:
Fixes GCC libstdc++/29286

The fix seems to work for amd64 but causes segfaults on powerpc.
At this time gcc is much more important on powerpc than on amd64.

Reported by:	andreast
2013-12-20 18:16:02 +00:00
Pedro F. Giffuni
cc1a345c65 gcc: revert Rvalue references.
They are very useful but at this time I prefer not to figure out
some  minor conflicts with the bigger Apple's blocks support
patch that is being worked on for current.
2013-12-20 18:09:34 +00:00
Pedro F. Giffuni
a5fd0716f8 gcc: merge upstream fix and new feature.
Fix for PR c++/29928

Add support for Rvalue references as described here:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html

Obtained from:	gcc 4.3 (rev. 124724, 125211; GPLv2)
MFC after:	2 weeks
2013-12-20 16:01:02 +00:00
Pedro F. Giffuni
62f78f3261 gcc: more diff reductions against Apple GCC.
Mostly cosmetical changes to aid further merges.

Obtained from:	gcc 4.3 (rev. 120611, 124839; GPLv2)
MFC after:	1 week
2013-12-20 14:56:52 +00:00
Edwin Groothuis
668615cd26 MFV of r259624, tzdata2013i
Removed support for solar-time-based time zones
Jordan stays at summer time this year.
Fix historical data for Cuba

Obtained from:  ftp://ftp.iana.org/tz/releases/
2013-12-19 20:19:57 +00:00
Pedro F. Giffuni
915b4b42ae gcc: backport upstream fix for issue with C++'s placement new
Fixes GCC libstdc++/29286

Obtained from:	gcc 4.3 (rev. 125603, 125653; GPLv2)
MFC after:	2 weeks
2013-12-19 18:27:32 +00:00
Pawel Jakub Dawidek
8ff3952b72 If we cannot connect to casperd we don't enter sandbox, but if we can connect
to casperd, but we cannot access the service we need we exit with an error.
This should not happen and just indicates some configuration error which
should be fixed, so we force the user to do it by failing.

Discussed with:	emaste
2013-12-19 00:51:48 +00:00
Pedro F. Giffuni
505ca70a65 gcc: add Apple compatible -Wnewline-eof
Fix document: "Apple compatible" suits better the origin.

MFC after:	1 week
2013-12-18 15:27:48 +00:00
Pedro F. Giffuni
cfbe5d01ee gcc: add Apple compatible -Wnewline-eof
GCC 4.2 and previous have always warned about
"No newline at end of file".

Upstream GCC removed the warning completely but
Apple made it an optional warning. Adopt it for
compatibility with older GCC and clang.

While here, add comment to complement r258712.

Obtained from:	Apple Inc. (Apple GCC 4.2 - 5531)
MFC after:	1 week
2013-12-18 14:53:36 +00:00
Pedro F. Giffuni
9596cafea0 gcc: point to our address for bug reports.
As recommended by the FSF in gcc/version.c :

"If you distribute a modified version of GCC, please change
this to refer to a document giving instructions for reporting
bugs to you, not us."

MFC after:	2 weeks
2013-12-18 00:10:30 +00:00
Pedro F. Giffuni
2dcaa2963d gcc: small merges from upstream
Solves GCC issues:
PR middle-end/32602
PR middle-end/32603

Updates the to documentation and processing
improvement.

Obtained from:	gcc 4.3 (rev. 119427, 126278, 126422; GPLv2)
MFC after:	2 weeks
2013-12-17 23:31:51 +00:00
Pedro F. Giffuni
5244c21dd0 gcc: fix ICE in rs600 when using -fno-trapping-math.
Solve build issue with previous change.

Obtained from:	gcc 4.3 (rev. 120902; GPLv2)
MFC after:	2 weeks
2013-12-17 21:39:40 +00:00
Pedro F. Giffuni
08fd2c8bd7 gcc: fix ICE in rs600 when using -fno-trapping-math.
Solves GCC-PR target/30485

Obtained from:	gcc 4.3 (rev. 120902; GPLv2)
MFC after:	2 weeks
2013-12-17 20:53:22 +00:00
Dimitry Andric
b177d064d7 Pull in r197399 from upstream clang trunk:
Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat.

MFC after:	3 days
2013-12-17 07:59:00 +00:00
Benjamin Kaduk
1871769f1f tzfile.5: catch up to r204333
The stdtime sources were moved from lib/libc to contrib/tzcode, and tzfile.h
is not an installed header, so the man page refers to its location in the
source tree.

The documentation could be more clear about the internal nature of the
header, but those changes should go through upstream tzcode.

PR:	docs/176864
Approved by:	hrs (mentor)
2013-12-16 01:58:12 +00:00
Pawel Jakub Dawidek
197731f68f Make use of casperd's system.dns service when running without the -n option.
Now tcpdump(8) is sandboxed even if DNS resolution is required.

Sponsored by:	The FreeBSD Foundation
2013-12-15 23:02:36 +00:00
Dimitry Andric
8b3d3bafec Use correct casts in gcc's emmintrin.h for the first arguments of the
following builtin functions:

* __builtin_ia32_pslldi128() takes __v4si instead of __v8hi
* __builtin_ia32_psllqi128() takes __v2di instead of __v8hi
* __builtin_ia32_psradi128() takes __v4si instead of __v8hi

This should fix the following errors when building the LINT kernel with
gcc:

sys/crypto/aesni/aesni_wrap.c:191: error: incompatible type for argument 1 of
'__builtin_ia32_psradi128'
sys/crypto/aesni/aesni_wrap.c:195: error: incompatible type for argument 1 of
'__builtin_ia32_pslldi128'

MFC after:	3 days
2013-12-08 23:24:32 +00:00
Dimitry Andric
0514e96282 Pull in r196658 from upstream clang trunk:
CodeGen: Don't emit linkage on thunks that aren't emitted because they're
  vararg.

  This can happen when we're trying to emit a thunk with available_externally
  linkage with optimization enabled but bail because it doesn't make sense for
  vararg functions.

  [LLVM] PR18098.

This should fix clang "Broken module found, compilation aborted" errors when
building the qt4-based dvbcut port.

Reported by:	se
MFC after:	3 days
2013-12-08 13:56:26 +00:00
Pedro F. Giffuni
5dab84a07c gcc: new fvisibility-ms-compat option
Obtained from:	gcc 4.3 (rev. 126088; GPLv2)
MFC after:	3 weeks
2013-12-08 03:02:44 +00:00
Peter Wemm
37d5a7cdf8 Vendor import nvi-2.1.2-c80f493b038 a multikey mapping fix
PR:		bin/182463
2013-12-08 00:08:03 +00:00
Dimitry Andric
914afe13c2 Pull in r196590 from upstream clang trunk (by rdivacky):
Move the body of GCCInstallationDetector ctor into an init() function
  and call it from its only user. The linux toolchain. This saves quite
  a lot of directory searching on other platforms.

See http://docs.freebsd.org/cgi/mid.cgi?51E6FAF5.3080802 for the
original discussion.  With this fix, the search for gcc installations is
completely eliminated on FreeBSD.

Reported by:	Kurt Lidl <lidl@pix.net>
MFC after:	3 days
2013-12-07 00:05:45 +00:00
Pedro F. Giffuni
36543c3739 gcc: Include types in error message for build_binary_op.
Mostly cosmetic change, again to reduce differences with Apple's gcc.

Obtained from:	gcc 4.3 (rev. 125239; GPLv2)
MFC after:	3 weeks
2013-12-06 02:19:58 +00:00
Pedro F. Giffuni
1aa997ff6a gcc: Add -flax-vector-conversions
Obtained from:	gcc 4.3 (rev. 120572, 120688; GPLv2)
2013-12-05 21:22:51 +00:00
Pedro F. Giffuni
0a56d1d88d gcc: On rs6000 update sp_offset depending only on size.
This fixes a nasty bug introduced in r258651.

Reported and tested by:	Justin Hibbits
Obtained from:		gcc pre-4.3 (rev. 125116; GPLv2)
MFC after:		2 weeks
2013-12-04 21:17:39 +00:00
Ed Maste
a4849615b2 Update LLDB to upstream r196322 snapshot
Upstream revisions of note:
r196298 - Fix use of std::lower_bound
r196322 - Fix log message for new invalidation checks

Sponsored by:	DARPA, AFRL
2013-12-03 22:26:38 +00:00
Ed Maste
04c171520d lldb: Threaded inferior support for FreeBSD
This is in the process of being submitted to the upstream LLDB
repository.  The thread list functionality is modelled in part on
GDBRemoteCommunicationClient.

LLDB bug pr16696 and code review D2267

Sponsored by:	DARPA, AFRL
2013-12-03 21:29:45 +00:00
Ed Maste
b952cd584f Update LLDB to upstream r196259 snapshot
Sponsored by:	DARPA, AFRL
2013-12-03 19:23:54 +00:00
Ed Maste
9151c81ccb Workaround lldb issue with main module base address
On FreeBSD lldb sometimes reloads the the main module's (executable's)
symbols at the wrong address.  Work around this for now by explicitly
reloading at base_address=0 when it happens.

A proper fix is needed but early testers have reported this issue so
this workaround should allow them to make further progress.

http://llvm.org/bugs/show_bug.cgi?id=17880
2013-12-03 18:12:51 +00:00
Pawel Jakub Dawidek
42a8595256 Please welcome casperd daemon. It (and its services) will be responsible for
giving access to functionality that is not available in capability mode
sandbox. The functionality can be precisely restricted.

Start with the following services:
- system.dns - provides API compatible to:
	- gethostbyname(3),
	- gethostbyname2(3),
	- gethostbyaddr(3),
	- getaddrinfo(3),
	- getnameinfo(3),
- system.grp - provides getgrent(3)-compatible API,
- system.pwd - provides getpwent(3)-compatible API,
- system.random - allows to obtain entropy from /dev/random,
- system.sysctl - provides sysctlbyname(3-compatible API.

Sponsored by:	The FreeBSD Foundation
2013-12-02 08:21:28 +00:00
Pedro F. Giffuni
51e28103da libcpp: Merge fixes from upstream
GCC preprocessor/29966:
* macro.c (lex_expansion_token): Save and restore cpp_reader's
cur_token.
(_cpp_create_definition): Don't restore cur_token here.
* lex.c (_cpp_lex_token): Added assertion.

GCC preprocessor/28709:
* macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.

GCC c/31924
* expr.c (interpret_float_suffix): Check for invalid suffix.

GCC preprocessor/14331
* lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.

Fixup whitespacing

Obtained from:	gcc per-4.3 (rev. 121340, 124356, 124358, 124730,
				  125212, 125255 ; GPLv2)
MFC after:	3 weeks
2013-12-02 03:47:08 +00:00
Pedro F. Giffuni
6d94bd07cc libiberty: upstream updates.
There is a new ChangeLog.gcc43 file but most notable:

* floatformat.c (get_field): Fix segfault with little-endian word
  order on 64-bit hosts.
  (put_field): Likewise.
  (min): Move definition.

gcc/cp/ChangeLog
2007-05-04  Geoffrey Keating  <geoffk@apple.com>

  PR 31775
  * mangle.c (write_mangled_name): Mangle static variable names.
  (write_unqualified_name): Use local-source-name for
  namespace-scope static variables.
(Completes FreeBSD's r258017 )

Obtained from:	gcc 4.3 (rev. 118552, 120097, 20698, 120702,
			 121364, 122972, 126588; GPLv2)
MFC after:	2 weeks
2013-12-01 22:08:19 +00:00
Pedro F. Giffuni
5b1674597f gcc: upstream alignment cleanups.
This solves GCC/32617 and contributes to reduce differences with
Apple's gcc42.

Complete some references in the ChangeLog while here.

Obtained from:	gcc 4.3 (rev. 126529, 126588; GPLv2)
MFC after:	3 weeks
2013-11-29 18:46:02 +00:00
Pedro F. Giffuni
9a252f0990 gcc: Make use of TREE_OVERFLOW_P.
While it was brought in r258179 only to fix a build issue,
bringing the rest of the change has the advantage of fixing
GCC/19978.

Obtained from:	gcc 4.3 (rev. 120505; GPLv2)
MFC after:	1 week
2013-11-29 05:00:07 +00:00
Pedro F. Giffuni
729f64d6ae libcpp: fix an underflow.
Obtained from:	OpenBSD (Rev 1.2)
MFC after:	2 weeks
2013-11-28 16:36:03 +00:00
Konstantin Belousov
0615c93b2c Use sysctl KERN_PROC_SIGTRAMP to retrieve the signal trampoline
location for the native amd64 ABI.  This fixes unwinding over the
signal frame after trampoline was moved to the shared page.

The code would be more correct if using sysctl for the target process
instead of inspecting gdb' own trampoline, but the current change is
least intrusive and currently, we always initialize the native ABI
sysvec first, which means that trampoline location for FreeBSD/amd64
ABI is relatively stable.

Similar change will benefit libunwind.

Analyzed by:	avg
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2013-11-26 19:54:12 +00:00
Matthew D Fleming
9b76499a0b Fix a segfault / internal compiler error.
Among other causes, when gcc throws a warning before parsing any tokens,
the cur_token pointer is at the beginning of malloc'd memory.
Dereferencing cur_token[-1] can cause a segfault.

Code taken from OpenBSD
http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/gcc/libcpp/errors.c
which was a more complete fix than the one I originally coded.

MFC after:	1 week
2013-11-26 17:11:43 +00:00
Pedro F. Giffuni
346d5f0202 Forced commit to note that r258652 is actually:
gcc: Move conditions before an assert.

It is a bit cleaner to check the conditions before calling the assertion.
It also preserves the style from the rest of the code.
This is just a cosmetical change to match better what both Apple's gcc42
and Android's gcc-4.2.1 do.
2013-11-26 15:18:40 +00:00
Pedro F. Giffuni
db8e31dfdd gcc: Altivec register adjustments from Apple.
Obtained from:	gcc pre-4.3 (rev. 124763; GPLv2)
MFC after:	3 weeks
2013-11-26 14:58:37 +00:00
Pedro F. Giffuni
7b0d23ce5a gcc: Altivec register adjustments from Apple.
Obtained from:	gcc pre-4.3 (rev. 124763; GPLv2)
MFC after:	3 weeks
2013-11-26 14:52:29 +00:00
Dimitry Andric
ce67429848 Pull in r195558 from upstream clang trunk:
Fix a SSE2 intrinsics typo

  Full discourse at:

   http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131104/092514.html
   http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-November/068124.html

  Patch by Dimitry Andric and Alexey Dokuchaev!

Reported by:	danfe
MFC after:	3 days
2013-11-26 08:07:45 +00:00
Peter Wemm
a5b9d9b723 Import apr-util-1.5.3 from vendor branch (rr258600)
This is a minor bug fix release.
2013-11-25 22:20:34 +00:00
Pedro F. Giffuni
340b342723 MFV: removes strict-aliasing warnings from GCC in tcpdump.
Reported by:	tinderbox (gjb)
Submitted by:	glebius
MFC after:	2 weeks
2013-11-25 18:46:08 +00:00
Peter Wemm
949ef25c23 Import svn-1.8.5. This contains a user-visible fix for svn:externals
handling (there are no svn:externals in freebsd repo), and two security
fixes for modules that we don't build for the apache http server stack.
2013-11-25 17:52:16 +00:00
Pedro F. Giffuni
b5e1e9602d libcpp: Keep a record of changes from upstream GCC (pre-43).
This makes it easier to track the changes in the rare event of the code
being distributed without access to version control.

MFC after:	3 weeks
2013-11-24 20:54:52 +00:00
Pedro F. Giffuni
81e5b01765 gcc: Bring updates from Google's enhanced gcc-4.2.1.
Google released and enhanced version of gcc-4.2.1 plus their local
patches for Android[1].

The patches are owned by Google and the license hasn't been changed
from  the original GPLv2. We are only bringing a subset of the
available patches that may be helpful in FreeBSD. Changes specific
to android are not included.

From the README.google file[1].

Patches applied to google_vendor_src_branch/gcc/gcc-4.2.1:

gcc/Makefile.in
gcc/c-common.c
gcc/c-common.h
gcc/c-opts.c
gcc/c-typeck.c
gcc/cp/typeck.c
gcc/doc/invoke.texi
gcc/flags.h
gcc/opts.c
gcc/tree-flow.h
gcc/tree-ssa-alias-warnings.c
gcc/tree-ssa-alias.c

 Backport of -Wstrict-aliasing from mainline.
  Silvius Rus <rus@google.com>

gcc/coverage.c:
  Patch coverage_checksum_string for PR 25351.
  Seongbae Park <spark@google.com>
  Not yet submitted to FSF.

gcc/c-opts.c
gcc/c-ppoutput.c
gcc/c.opt
gcc/doc/cppopts.texi
libcpp/Makefile.in
libcpp/directives-only.c
libcpp/directives.c
libcpp/files.c
libcpp/include/cpplib.h
libcpp/init.c
libcpp/internal.h
libcpp/macro.c
  Support for -fdirectives-only.
  Ollie Wild <aaw@google.com>.
  Submitted to FSF but not yet approved.

libstdc++-v3/include/ext/hashtable.h
  http://b/742065
  http://b/629994
  Reduce min size of hashtable for hash_map, hash_set from 53 to 5

libstdc++-v3/include/ext/hashtable.h
  http://b/629994
  Do not iterate over buckets if hashtable is empty.

gcc/common.opt
gcc/doc/invoke.texi
gcc/flags.h
gcc/gimplify.c
gcc/opts.c
  Add Saito's patch for -finstrument-functions-exclude-* options.

gcc/common.opt
gcc/doc/invoke.texi
gcc/final.c
gcc/flags.h
gcc/opts.c
gcc/testsuite/gcc.dg/Wframe-larger-than.c
  Add a new flag -Wframe-larger-than- which enables a new warning
  when a frame size of a function is larger than specified.
  This patch hasn't been integrated into gcc mainline yet.

gcc/tree-vrp.c
  Add a hack to avoid using ivopts information for pointers starting
  at constant values.

Reference:

[1]
https://android.googlesource.com/toolchain/gcc/+/master/gcc-4.2.1/

Obtained from:	Google Inc.
MFC after:	3 weeks
2013-11-23 18:32:53 +00:00
Dimitry Andric
56510193f0 Revert r258455 for now, as it apparently causes miscompilation in some
situations.  Until this is fully resolved, the X.org workaround in ports
still needs to take place.
2013-11-22 17:54:53 +00:00
Dimitry Andric
711f10ae9f Pull in r195318 from upstream llvm trunk:
The basic problem is that some mainstream programs cannot deal with the way
  clang optimizes tail calls, as in this example:

  int foo(void);
  int bar(void) {
  return foo();
  }

  where the call is transformed to:

   calll .L0$pb
  .L0$pb:
   popl  %eax
  .Ltmp0:
   addl  $_GLOBAL_OFFSET_TABLE_+(.Ltmp0-.L0$pb), %eax
   movl  foo@GOT(%eax), %eax
   popl  %ebp
   jmpl  *%eax                   # TAILCALL

  However, the GOT references must all be resolved at dlopen() time, and so this
  approach cannot be used with lazy dynamic linking (e.g. using RTLD_LAZY), which
  usually populates the PLT with stubs that perform the actual resolving.

  This patch changes X86TargetLowering::LowerCall() to skip tail call
  optimization, if the called function is a global or external symbol.

This fixes problems with loading X.org driver modules, which could occur
when X.org was compiled on i386 with tailcall optimization on, for which
ports r312583 was committed as a workaround.  After this change, the
workaround can be removed.

MFC after:	3 days
2013-11-21 23:09:07 +00:00
Brooks Davis
19fa1aa698 Sync with NetBSD. The funtional change is to make the output when
comparing a directory to an mtree file more compatible with fmtree when
FreeBSD 9 compatiblity mode is on.  This output is clearly intended for
humans not computers, but some tools such as mergemaster's -U option rely
on it.

MFC after:	3 days
2013-11-21 19:29:41 +00:00
Pedro F. Giffuni
096464d39c libstdc++: merge non-abi changes from Apple's developer tools
Take some changes from Apple's Developer Tools 4.0 [1]:

block.patch
emergency-buffer-reduction.patch
test_cleanup.patch

vector_copy_no_alloc.patch
	problem/6473222 copy-constructing a std::vector	from an
	empty std::vector calls malloc

2008-10-27  Howard Hinnant
stl_tree_system_header.patch
	Added #pragma GCC system_header to stl_tree.h.
copy_doc.patch
	Corrected documentation concerning copy in stl_algobase.h.
string_compare.patch
	Fixed basic_string.h, basic_string.tcc, incorrect 64bit to
	32bit narrowing.

Reference:

[1] http://opensource.apple.com/source/libstdcxx/libstdcxx-39/patches-4.2.1/

Obtained from:	Apple
MFC after:	1 month
2013-11-21 16:44:36 +00:00
Pedro F. Giffuni
2bd5e058b7 gcc: another round of merges from the gcc pre-43 branch.
Bring The following revisions from the gcc43 branch[1]:

118360, 118361, 118363, 118576, 119820,
123906, 125246, and 125721.

They all have in common that the were merged long ago
into Apple's gcc and should help improve the general
quality of the compiler and make it easier to bring
new features from Apple's gcc42.

For details please review the additions to the files:
gcc/ChangeLog.gcc43
gcc/cp/ChangeLog.gcc43 (new, adds previous revisions)

Reference:
[1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700

Obtained from:	gcc pre4.3 (GPLv2) branch
MFC after:	3 weeks
2013-11-21 16:38:57 +00:00
Ed Maste
3e7aca6f4e libexecinfo: Include terminating null in byte count
Otherwise, a formatted string with a strlen equal to the remaining
buffer space would have the last character omitted (because vsnprintf
always null-terminates), and later the assert in backtrace_symbols_fmt
would fail.

MFC after:	3 days
Sponsored by:	DARPA, AFRL
2013-11-21 14:12:36 +00:00
Dimitry Andric
110f993aa9 Pull in r191896 from upstream llvm trunk:
CaptureTracking: Plug a loophole in the "too many uses" heuristic.

  The heuristic was added to avoid spending too much compile time in a
  specially crafted test case (PR17461, PR16474) with many uses on a
  select or bitcast instruction can still trigger the slow case. Add a
  check for that case.

  This only affects compile time, don't have a good way to test it.

This fixes the excessive compile time spent on a specific file of the
graphics/rawtherapee port.

Reported by:	mandree
MFC after:	3 days
2013-11-19 17:53:19 +00:00
Pedro F. Giffuni
6ca7e51c77 gcc: Record some previous commits in the gcc43 ChangeLog.
It is useful to update the ChangeLog with upstream references
related to our local r189824 and r255095.

MFC after:	3 weeks
2013-11-18 20:21:44 +00:00
Julio Merino
be1938b303 Drop all ATF tools code.
We stopped building the tools in r256365 so there is no need to ship
their code any longer.

Approved by:	rpaulo (mentor)
2013-11-18 01:28:29 +00:00
Julio Merino
a18eacbefd MFV: Import atf-0.18.
Approved by:	rpaulo (mentor)
2013-11-17 23:51:19 +00:00
Julio Merino
73cdac7877 Update notes for imports of atf.
This is because the atf vendor branch now includes a verbatim copy of
the distfile sources.  As a result, the list of files to-be-removed from
the contrib/ directory is now more aggressive (and different) and the
upgrade notes now only describe stuff that is specific to the atf import
and is not documented in the Subversion Primer.

Approved by:	rpaulo (mentor)
2013-11-17 23:19:06 +00:00
Pedro F. Giffuni
a88cf0f07f gcc: Fix postreload-gcse treatment of call-clobbered registers.
Reference:
http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01636.html

Obtained from:	gcc 4.3 (rev. 125037; GPLv2)
MFC after:	3 weeks
2013-11-16 01:29:27 +00:00
Pedro F. Giffuni
71fd392a23 gcc: add femit-struct-debug support to reduce Reduce dwarf debug size
Obtained from:	gcc 4.3 (rev. 123909; GPLv2)
MFC after:	3 weeks
2013-11-16 01:16:24 +00:00
Pedro F. Giffuni
966b6fbbae libcpp: preprocessor speedup patches from mainline.
* lex.c (_cpp_clean_line): Add uses of __builtin_expect.  Don't
look backward at the end of the line unless we saw a backslash.

* internal.h (struct cpp_reader): Add new fields:
nonexistent_file_hash and nonexistent_file_ob.
* files.c: Include "obstack.h".
(find_file_in_dir): Before trying to open the file, look up the
path name in the hash table of nonexistent files.  After failing
to open the file, add the path name to the hash table.
(_cpp_find_file): Cache the results of looking up the file name
starting with the quote and bracket chain heads, if we can.
(nonexistent_file_hash_eq): New static function.
(_cpp_init_files): Initialize pfile->nonexistent_file_hash and
pfile->nonexistent_file_ob.
(_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
pfile->nonexistent_file_ob.

Obtained from:	gcc 4.3 (rev. 120263, 124929 ; GPLv2)
MFC after:	3 weeks
2013-11-16 01:07:02 +00:00
Pedro F. Giffuni
007acff069 gcc: Add a new option -Wvla to warn variable length array.
Obtained from:	gcc 4.3 (rev. 122851; GPLv2)
MFC after:	3 weeks
2013-11-16 01:03:56 +00:00
Xin LI
5abd6fdcfa MFV: netcat from OpenBSD 5.4.
No functional change.
2013-11-15 22:45:14 +00:00
Sean Bruno
2f0e4b9e62 Merge in gcc svn r120505 to include definition of TREE_OVERFLOW_P:
http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/tree.h?revision=120505&view=markup

This repairs build breakage for non x86 arch's that use gcc to build
intruduced at svn R258157
2013-11-15 18:44:25 +00:00
Pedro F. Giffuni
57e56fa7b9 gcc: warn about integer overflow in constant expressions in the C++ frontend.
This fixes GCC 28986:
 http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00473.html

Obtained from:	gcc 4.3 (rev. 120558; GPLv2)
MFC after:	3 weeks
2013-11-15 03:05:33 +00:00
Pedro F. Giffuni
448b703500 Merge vrp-tree fix from gcc-4.3
Fix missed conversion from / to >> (GCC PR32521)

Note that vrp-tree is currently disabled by default in
FreeBSD's gcc due many bugs.

While here fix a revision number in the 4.3 Changelog.

Obtained from:	gcc 4.3 (rev. 122831 - partial; GPLv2)
MFC after:	3 weeks
2013-11-14 20:21:05 +00:00
Sean Bruno
b770668b1e Repair build after svn r258115
options.get_size_type() appears to return a const char *, so assume that
its a string as oppose to *nothing*.  I have no idea what apple's code is
trying to do here:

http://opensource.apple.com/source/gperf/gperf-9/patches/size_type.patch
2013-11-14 18:41:58 +00:00
Pedro F. Giffuni
57538af0b7 gcc: merge rs6000 change from FSF pre-gcc43
config/rs6000/rs6000.c
http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01551.html
Don't set MASK_PPC_GFXOPT for 8540 or 8548.

Obtained from:	gcc 4.3 (rev. 124381; GPLv2)
MFC after:	3 weeks
Reviewed by:	nathan
2013-11-14 16:10:21 +00:00
Pedro F. Giffuni
0c8565a099 gperf: bring small update from Apple Developers tools 4.4
From [1]

offset.patch
Makes use the C offsetof() macro.

size_type.patch
Lets you specify the type for length parameters.

[1] http://opensource.apple.com/source/gperf/gperf-9/patches/

MFC after:	3 weeks
2013-11-14 00:57:20 +00:00
Simon J. Gerraty
bc49bb2062 Don't SEGV when Hash_Table is uninitialized 2013-11-14 00:29:48 +00:00
Simon J. Gerraty
4ec38eb510 Avoid SEGV when passed NULL for list 2013-11-14 00:06:44 +00:00
Ed Maste
afda932a71 Merge upstream LLDB r194487:
Log failure to restore thread state in ThreadPlanCallFunction::DoTakedown

  In order to help track down llvm.org/pr17226.

Sponsored by:	DARPA, AFRL
2013-11-13 17:06:26 +00:00
Ed Maste
4d1da75392 lldb: Correct a standalone debug file path
For a file /bin/ls with a .gnu_debuglink entry of "ls.debug" the path
should be /usr/lib/debug/bin/ls.debug, not /usr/lib/debug/bin/ls.

ref: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

Upstream defect pr17903 (http://llvm.org/pr17903)

Sponsored by:	DARPA, AFRL
2013-11-13 14:46:41 +00:00
Pedro F. Giffuni
3b5bdcdf37 gcc: Backport fixes for -W parentheses in C++
This fixes GCC 19564:
  http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00868.html
  http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01772.html
  http://gcc.gnu.org/ml/gcc-patches/2007-01/msg00545.html

The patch and its fixes are used by Google in their enhanced gcc-4.2.1
port and predates the license switch in GCC so they are still under
GPLv2.

MFC after:	3 weeks
2013-11-13 04:31:27 +00:00
Pawel Jakub Dawidek
36da5199bb Bring in libnv library for managing name/value pairs. The following types
are currently supported:

- NV_TYPE_NULL - only name, no data;
- NV_TYPE_BOOL - boolean (true or false);
- NV_TYPE_NUMBER - 64bit unsigned integer;
- NV_TYPE_STRING - C string;
- NV_TYPE_NVLIST - nested nvlist;
- NV_TYPE_DESCRIPTOR - file descriptor;
- NV_TYPE_BINARY - binary data.

For detailed documentation and examples see nv(3) manual page.

Sponsored by:	The FreeBSD Foundation
2013-11-12 19:39:14 +00:00
Ed Maste
3561791104 Update LLDB to upstream r194122 snapshot
ludes minor changes relative to upstream, for compatibility with
FreeBSD's in-tree LLVM 3.3:

- Reverted LLDB r191806, restoring use of previous API.
- Reverted part of LLDB r189317, restoring previous enum names.
- Work around missing LLVM r192504, using previous registerEHFrames API
  (limited functionality).
- Removed PlatformWindows header include and init/terminate calls.

Sponsored by:	DARPA, AFRL
2013-11-12 17:25:33 +00:00
Gleb Smirnoff
ce102ac2ae Just disable recoding support in libsmb if built WITHOUT_ICONV. 2013-11-12 15:09:28 +00:00
Pedro F. Giffuni
0944614655 cxxfilt: small changes from Apple's developer tools
From Apple's Developer Tools 4.0 [1]:

demangle.patch
2007-05-05  Geoffrey Keating
	(d_name): Detect local-source-name.
	(d_prefix): Likewise.
	(d_unqualified_name): Implement local-source-name.

libiberty-printf.patch

MFC after:	1 month

[1] http://opensource.apple.com/source/cxxfilt/cxxfilt-9/patches/
2013-11-11 21:18:02 +00:00
Ed Maste
0adcb21d02 Merge upstream LLVM r192118:
Formally added an explicit enum for DWARF TLS support. No functionality
  change.

Reviewed by:	dim@
Sponsored by:	DARPA, AFRL
2013-11-11 19:06:12 +00:00
Ed Maste
66cbfb81eb Merge upstream LLVM r182803:
[Mips] Add Mips specific dynamic table entry tags.

This is to support an upcoming LLDB snapshot update.

Reviewed by:	dim@
Sponsored by:	DARPA, AFRL
2013-11-11 19:00:20 +00:00
Peter Wemm
9d9df6f478 Merge nvi-2.1.1 -> 2.1.2 2013-11-11 16:52:02 +00:00
Peter Wemm
18b44c2d73 Update svn from 1.8.1 to 1.8.4 - minor security fixes and client side
merge handling bug fixes (reintegrate, mergeinfo etc)
2013-11-11 01:14:58 +00:00
Gleb Smirnoff
096013098a Use system libiconv, instead of trying to dlopen() it.
PR:		183153
Submitted by:	Dominic Fandrey <kamikaze bsdforen.de>
2013-11-09 14:48:50 +00:00
Simon J. Gerraty
1a02b48ede Propagate ancient fix from Junos.
Use of -h is not supposed to depend on AUTHENTICATION being defined.

Reviewed by: markm
2013-11-07 00:36:39 +00:00
Edwin Groothuis
c26a580251 MFV of 255902, tzdata2013f
MFV of 257651, tzdata2013h

tzdata2013f
- Jordan goes to winter time on the last Friday in October.
- Tocantins in Brazil will not go into summer time in October.
- Indonesian time zones renames.
- Lots of cleanups in with regarding to links and historical data.

tzdata2013h
- Libya didn't go back to DST.
- Fix Morocco 2038 issue.
- Brazil/Acre and Western Amazonas are chaning timezones.
2013-11-05 06:32:23 +00:00
Sean Bruno
2f2f23894e Quiesce warning about unused argument in call to rl_message() by wrapping
this call with the same #if defined (PREFER_STDARG) directive as in display.c

Using -E to compile display.c/search.c shows that this is the code chosen by
the build when we create libreadline
2013-11-04 16:52:27 +00:00
Sean Bruno
9161dd723e Update libreadline with vendor patches 8-13 as fetched from:
ftp://ftp.cwru.edu/pub/bash/readline-5.2-patches/

MFC after:	2 weeks
2013-11-03 20:38:51 +00:00
Sean Bruno
3055dc3e48 Integrate github revision 0446821e49224c6a29be28760cc9c4cc14f56d8a as
suggested by upstream

https://github.com/the-tcpdump-group/libpcap/issues/327

Quiesce assignment warnings by use of const
2013-10-31 20:03:59 +00:00
Sean Bruno
a9f8a8772a Queisce warning about attempting to add char * together and use explicit
array indexing to indicate what is meant to be done
2013-10-31 18:53:39 +00:00
Sean Bruno
9113c7c613 Queisce warning about attempting to add char * together and use explicit
array indexing to indicate what is meant to be done
2013-10-31 18:53:13 +00:00
Sean Bruno
707dd2b1d7 Queisce warning about undeclared function usage.
yp_get_default_domain is defined in workaround.c but is not declared
in any header file.  Tie the declaration to the same #define conditional
used when the function is called, NETGROUP
2013-10-30 22:45:35 +00:00
Sean Bruno
5375e4f833 Quiesce warning, which could be a bug IMO, by correctly defining the host_info
structure name
2013-10-30 22:43:40 +00:00
Sean Bruno
bbaadbd796 Quiesce two warnings:
1.  define the CODE * as const
2.  restructure function to eliminate warning about exiting with no return.
    severity_map() never returns when it can't find an appropriate sysylog
    facility, and it longjmp()'s away into error code handling.  Keep this
    behavior by stashing the facility value found during our search and
    checking for -1 if found.
2013-10-30 22:41:18 +00:00
Sean Bruno
46bcf11d50 Quiesce warnings by updating headerfile includes 2013-10-30 21:18:14 +00:00
Ed Maste
3901c6c9af Revert to upstream literal $FreeBSD tag
radiotap.h in upstream wpa originally came from the FreeBSD CVS
repository.  The copy in vendor/ matched the upstream one; with this
change the contrib copy now matches too.

Discussed with:	jhb@
2013-10-30 18:33:40 +00:00
Sean Bruno
dde0bbff1f Quiesce warnings regarding assignement of loop conditionals by implementing
the solution from the compiler to wrap the statement in parens.
2013-10-29 20:53:09 +00:00
Sean Bruno
b01ec0d4e7 Quiesce warning by including appropriate header file 2013-10-29 20:36:04 +00:00
Sean Bruno
06dce123b6 Queisce warning about empty bodies in these loops by bumping the ;; to the
next line.
2013-10-29 20:35:28 +00:00
Gleb Smirnoff
3e4d5cd37b Make userland tools honor WITHOUT_PF build option.
Tested by:	dt71@gmx.com
2013-10-29 17:38:13 +00:00
Baptiste Daroussin
7dde5df42b Merge byacc 20130925
2 changes:
- Increase default stack-size so that used to be our default stack-size prior byacc import
- fix two loop-limits found by clang 3.3
2013-10-29 08:21:22 +00:00
Eygene Ryabinkin
4ba4bea936 binutils/bfd: fix printf-like format strings for "bfd *" arguments
There is a special format argument '%B' that directly handles values
of type 'bfd *', they must be used instead of '%s'.  Manifestations
of this bug can be seen in ld(1) error messages, for example,
  http://lists.freebsd.org/pipermail/freebsd-current/2013-August/043580.html
  http://lists.freebsd.org/pipermail/freebsd-current/2013-October/045404.html

Approved by:	dim
MFC after:	2 weeks
2013-10-29 04:25:49 +00:00
Sean Bruno
2f1e5d4767 Queisce two category of clang warnings:
1.  missing explicit includes for string.h, stdio.h, etc
2.  missing explicit declaration for some common functions

I have been unable to contact the upstream maintainer for this patch,
http://www.inner.net/opie appears to be the source of truth but it
unreachable
2013-10-28 18:24:31 +00:00
Sean Bruno
b51b786d73 Quiesce warnings -Wdangling-else
Thanks to jilles for some reviews and tips.
2013-10-28 18:10:35 +00:00
Gleb Smirnoff
75bf2db380 Move new pf includes to the pf directory. The pfvar.h remain
in net, to avoid compatibility breakage for no sake.

The future plan is to split most of non-kernel parts of
pfvar.h into pf.h, and then make pfvar.h a kernel only
include breaking compatibility.

Discussed with:		bz
2013-10-27 16:25:57 +00:00
Gleb Smirnoff
9dae57e134 Start splitting pfvar.h into internal and external parts.
- Provide pf_altq.h that has only stuff needed for ALTQ.
- Start pf.h, that would have all constant values and
  eventually non-kernel structures.
- Build ALTQ w/o pfvar.h, include if_var.h, that before
  came via pollution.
- Build tcpdump w/o pfvar.h.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 18:59:58 +00:00
Sean Bruno
61390f6811 Queisce warnings for gperf -Wlogical-op-parentheses with parens to
explicitly define the logic
2013-10-26 14:49:19 +00:00
Colin Percival
7fedb8b7a5 Remove time and date stamps from svn* binaries, in order to make the
builds reproducible.

Reviewed by:	peter
MFC after:	3 days
2013-10-25 18:43:53 +00:00
Steven Hartland
3e8aed7f71 Add clang-CC and CC to list of hints allowing clang to identify its operating
mode as c++ instead of defaulting to c for the binary names CC and clang-CC.

This fixes builds that use cmake, which automatically sets CXX to
/usr/bin/CC by default.

PR:		bin/182442
Reviewed by:	dwhite, wca
MFC after:	2 days
2013-10-25 09:09:00 +00:00
Sean Bruno
29ef2f0e31 Queisce quite a few clang warnings -Wdangling-else due to this work around
for compiling gperf under Visual Studio from 1998.

ref. http://msdn.microsoft.com/en-us/library/b80153d8%28v=vs.90%29.aspx
ref. http://stackoverflow.com/questions/984878/what-is-the-possible-use-for-define-for-if-false-else-for
2013-10-25 01:10:07 +00:00
Sean Bruno
4971c4adad Resolve clang warning about a use of syslog. By using a proper enforcement
of string format in a call so syslog

/usr/src/gnu/lib/libssp/../../../contrib/gcclibs/libssp/ssp.c:137:23:
warning: format string is not a string literal (potentially insecure)
      [-Wformat-security]
    syslog (LOG_CRIT, msg1);
                      ^~~~

Reviewed by:	dim@
2013-10-21 22:55:56 +00:00
Ed Maste
9773a1f20f Don't force 64-bit DWARF2 on MIPS
64-bit debug data is only necessary for objects with greater than 4GB of
debug data, and is not used on other 64-bit FreeBSD targets.

Sponsored by:	DARPA, AFRL
2013-10-21 20:38:02 +00:00
Jason Evans
2b06b2013c Update jemalloc to version 3.4.1. 2013-10-21 05:10:46 +00:00
Andrew Turner
9bff0a1d6a Merge from projects/arm_eabi_vfp r255380:
Fix the VCVT instruction. It must round towards zero when converting from
a floating-point to an integer value. This was not the case causing issues
when printing certain values.

There is a VCVTR instruction that will round depending on the current
rounding mode. We don't yet support this instruction, or setting the
rounding mode.
2013-10-20 15:13:32 +00:00
Ed Maste
1b182736a6 Fix .debug_line prologue header length calculation for 64-bit DWARF
The header_length field is the number of bytes following the field to
the first byte of the line number program.  The hard-coded constants
previously here (4 + 2 + 4) were correct only for 32-bit DWARF.

Sponsored by:	DARPA, AFRL
2013-10-17 17:25:00 +00:00
Brooks Davis
6ab38b8e25 Upgrade to the latest version of mtree from NetBSD. This revision
re-removes the printing of size for non-regular files, supports
type-less root (.) entries as seen in a couple ports, and corrects a bug
in -N that caused expanded Subversion $FreeBSD$ strings in comments to
be processed as /etc/group entries.

Includes one trivial portability fix (including <stdint.h> in three
files) that has been submitted upstream but not yet committed.

MFC after:	3 days
2013-10-17 14:18:11 +00:00
Shteryana Shopova
546401ce54 Fix the -Wconversion warnings produced when compiling the SNMP agent. 2013-10-17 12:03:17 +00:00
Shteryana Shopova
0698344859 Fix SNMP Error response PDUs and properly encode them when using v3 auth/encryption.
Reported by:	harti@
2013-10-17 11:49:46 +00:00
Dimitry Andric
04461e6012 Since C++ typeinfo objects are currently not guaranteed to be merged at
runtime by the dynamic linker, check for their equality in libcxxrt by
not only comparing the typeinfo's name pointers, but also comparing the
full names, if necessary.  (This is similar to what GNU libstdc++ does
in its default configuration.)  The 'deep' check can be turned off again
by defining LIBCXXRT_MERGED_TYPEINFO, and recompiling libcxxrt.

Reviewed by:	theraven
MFC after:	3 days
2013-10-16 17:00:21 +00:00
Gleb Smirnoff
6ed910fabe Hide 'struct ifaddr' definition from userland. Two tools left that use it,
namely ipftest(1) and ifmcstat(1). These sniff structure definition using
_WANT_IFADDR define.

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-15 10:19:24 +00:00
Dimitry Andric
e1a5a8a74a Add support for assembling and disassembling Intel Random Number
Generator extensions (e.g. the 'rdrand' mnemonic) to our copy of
binutils.

Approved by:	re (kib)
Obtained from:	OpenBSD, via pfg
MFC after:	1 week
2013-10-07 16:33:16 +00:00
Dimitry Andric
7ae3e01a31 Pull in r192064 from upstream llvm trunk:
X86: Don't fold spills into SSE operations if the stack is unaligned.

  Regalloc can emit unaligned spills nowadays, but we can't fold the
  spills into SSE ops if we can't guarantee alignment. PR12250.

This fixes unaligned SSE accesses (leading to a SIGBUS) which could
occur in the ffmpeg ports.

Approved by:	re (kib)
Reported by:	tijl
MFC after:	3 days
2013-10-06 16:12:45 +00:00
Bernhard Froehlich
ac64499012 ename internal function test() to avoid name clashes with
common macros. This fixes ports like mysql 5.6 which has an
internal macro called test.

Approved by:	re (gjb)
Discussed with:	theraven
2013-10-06 10:12:11 +00:00
Dimitry Andric
5b3c2be312 Pull in r189644 from upstream llvm trunk:
Add ms_abi and sysv_abi attribute handling.

  Based on a patch by Benno Rice!

This will help to develop EFI support.

Approved by:	re (kib)
Verified by:	benno
MFC after:	1 week
2013-10-03 20:38:57 +00:00
Dimitry Andric
75345ac580 Pull in r186338 from upstream llvm trunk:
Remove invalid assert in DAGTypeLegalizer::RemapValue

  There is a comment at the top of DAGTypeLegalizer::PerformExpensiveChecks
  which, in part, says:

   // Note that these invariants may not hold momentarily when processing a node:
   // the node being processed may be put in a map before being marked Processed.

  Unfortunately, this assert would be valid only if the above-mentioned invariant
  held unconditionally. This was causing llc to assert when, in fact,
  everything was fine.

  Thanks to Richard Sandiford for investigating this issue!

  Fixes PR16562.

This fixes assertions which could occur in the multimedia/ffmpeg1 and
multimedia/ffmpeg2 ports.

Approved by:	re (hrs)
Reported by:	Matthias Apitz <guru@unixarea.de>
MFC after:	3 days
2013-10-03 17:50:14 +00:00
Ed Maste
36afc9ab6c Use correct size for MIPS .rld_map section
On MIPS .dynamic is read-only and so a special section .rld_map is used
to store the pointer to the rtld information for debuggers.  This
section had a hard coded size of 4 bytes which is not correct for
mips64.  (Note that FreeBSD's rtld does not yet populate .rld_map.)

Sponsored by:   DARPA, AFRL
Approved by:	re (delphij)
2013-10-02 00:50:27 +00:00
Dimitry Andric
1f27f9b50b Pull in r191711 from upstream llvm trunk:
The X86FixupLEAs pass for Intel Atom must not call
  convertToThreeAddress on ADD16rr opcodes, if src1 != src, since that
  would cause convertToThreeAddress to try to create a virtual register.
  This is not permitted after register allocation, which is when the
  X86FixupLEAs pass runs.

  This patch fixes PR16785.

Pull in r191715 from upstream llvm trunk:

  Forgot to add a break statement.

This should enable building the x11-toolskits/libXaw port with
CPUTYPE=atom.

Approved by:	re (gjb)
Reported by:	Kenta Suzumoto <kentas@hush.com>
MFC after:	3 days
2013-10-01 19:14:24 +00:00
Dag-Erling Smørgrav
56b72efe82 Remove BIND.
Approved by:	re (gjb)
2013-09-30 17:23:45 +00:00
Dimitry Andric
64fa5e4ddf Fix a bug in ld, where indirect symbols are not handled properly during
linking of a shared library, leading to corrupt indexes in the dynamic
symbol table.  This should fix the multimedia/ffmpegthumbnailer port.

Approved by:	re (kib)
Reported by:	swills
MFC after:	2 weeks
2013-09-28 23:03:40 +00:00
Simon J. Gerraty
a0774d09d3 Fix Fx syntax.
PR: 182269
Approved by: re@
2013-09-27 17:42:23 +00:00
Andrew Turner
27b7672219 Add an elf note on ARM to store the MACHINE_ARCH an executable was built
for. This is useful for software needing to know which architecture a
binary is built for as arm and armv6 have slight differences meaning only
some binaries build for one will work as expected on the other. It is
expected pkgng will be able to make use of this to simplify the logic to
determine which package ABI to use.

Approved by:	re (kib)
2013-09-26 07:53:18 +00:00
Xin LI
e10b5a023e Correct a NULL pointer deference in nslookup and nsupdate that would
cause the utility to crash in interactive mode when the user gives
an EOF on standard input.

MFC after:	3 days
Approved by:	re (gjb)
2013-09-25 20:37:16 +00:00
Devin Teske
febdb46880 Update dialog to 1.2-20130923.
Approved by:	re (marius)
2013-09-24 14:52:43 +00:00
Dag-Erling Smørgrav
a3096cc770 Regenerate
Approved by:	re (blanket)
2013-09-24 09:56:58 +00:00
Dag-Erling Smørgrav
8ba2dec2ce Regenerate the configure script before running it.
Set the default config file to /var/unbound/unbound.conf.

Approved by:	re (blanket)
2013-09-24 09:56:10 +00:00
Dag-Erling Smørgrav
68ab5d8f35 Don't include the build date or command-line arguments in the binary.
Approved by:	re (blanket)
2013-09-24 09:54:07 +00:00
David Chisnall
0f9eee39f0 Import a new libcxxrt. This fixes some potential crashing in the demangler.
Approved by:	re (gjb)
MFC after:	1 week
2013-09-23 13:16:21 +00:00
Dimitry Andric
462fc0e072 Pull in r191165 from upstream llvm trunk:
ISelDAG: spot chain cycles involving MachineNodes

  Previously, the DAGISel function WalkChainUsers was spotting that it
  had entered already-selected territory by whether a node was a
  MachineNode (amongst other things). Since it's fairly common practice
  to insert MachineNodes during ISelLowering, this was not the correct
  check.

  Looking around, it seems that other nodes get their NodeId set to -1
  upon selection, so this makes sure the same thing happens to all
  MachineNodes and uses that characteristic to determine whether we
  should stop looking for a loop during selection.

  This should fix PR15840.

Specifically, this fixes the long-standing assertion failure when
compiling the multimedia/gstreamer port on i386.  Thanks to Tijl
Coosemans for his help in getting upstream to fix it.

Approved by:	re (marius)
2013-09-22 22:03:30 +00:00
Dag-Erling Smørgrav
fdde88bc82 Build and install drill(1).
Approved by:	re (blanket)
2013-09-22 20:30:55 +00:00
Dag-Erling Smørgrav
c1d67563f6 Due to a missing command-line argument, yacc regenerated the parser but
not its header file, resulting in a mismatch between the lexer and parser
and strange errors when reading the configuration file.

Approved by:	re (blanket)
2013-09-22 19:09:43 +00:00
Dag-Erling Smørgrav
a6a726073f Set props and correct RCS ID tag.
Approved by:	re (blanket)
2013-09-21 23:29:02 +00:00
Cy Schubert
c4d0c9d04e Remove redundant files.
Approved by:    glebius (mentor)
Approved by:    re (blanket)
2013-09-21 14:23:20 +00:00
Cy Schubert
8464e56e2a Check return code from inet_pton.
Discovered by:	Coverity.
Approved by:	glebius (mentor)
Approved by:	re (blanket)
2013-09-21 14:22:07 +00:00
Ed Maste
34ff737fae Disable LLDB OSX ABI plugin
Approved by:	re (blanket)
2013-09-20 01:18:50 +00:00
Ed Maste
fc8b9f8f79 Merge lldb man page from r188801 to contrib/llvm/tools/lldb/docs/
Approved by:	re (gjb)
2013-09-19 00:32:07 +00:00
Dag-Erling Smørgrav
44995aca33 Remove duplicate function declaration.
Approved by:	re (blanket)
2013-09-15 15:52:07 +00:00
Dag-Erling Smørgrav
9dcfb8beaf The Unbound developers have never met a pointer game they didn't like.
Fix needless deconsting.

Approved by:	re (blanket)
2013-09-15 15:49:17 +00:00
Dag-Erling Smørgrav
c775ab573d Previous commit accidentally left out the umask change.
Approved by:	re (blanket)
2013-09-15 13:50:56 +00:00
Dag-Erling Smørgrav
b502f8bfb3 Set the correct prefix and exec-prefix.
Approved by:	re (blanket)
2013-09-15 13:49:43 +00:00
Dag-Erling Smørgrav
e0f0c857db Regenerate.
Approved by:	re (blanket)
2013-09-15 13:49:23 +00:00
Dag-Erling Smørgrav
16efed0220 The unbound-control-setup script needs to be generated so it knows where
to place the keys.  Also, the correct umask is 027, not 026, although it's
not likely to make any difference.

Approved by:	re (blanket)
2013-09-15 13:48:08 +00:00
Dag-Erling Smørgrav
05ff931f41 Add unbound-control.
Approved by:	re (blanket)
2013-09-15 12:41:05 +00:00
Dag-Erling Smørgrav
8860c90c1c Final #include tweak.
Approved by:	re (blanket)
2013-09-15 11:58:07 +00:00
Dag-Erling Smørgrav
ebc5657f89 Massive constification + solve an alignment issue by using a union.
Approved by:	re (blanket)
2013-09-15 01:44:07 +00:00
Dag-Erling Smørgrav
39dd631a2c Add missing #includes and fix some incorrect definitions.
Approved by:	re (blanket)
2013-09-15 01:32:32 +00:00
Dag-Erling Smørgrav
5d649f2dc0 Wholesale constification.
Approved by:	re (blanket)
2013-09-15 01:31:55 +00:00
Dag-Erling Smørgrav
8a9587d773 Move more prototypes around, and remove one that wasn't used.
Approved by:	re (blanket)
2013-09-15 01:29:00 +00:00
Dag-Erling Smørgrav
49e6c5a26d Regenerated lexer and parser
Approved by:	re (blanket)
2013-09-15 00:40:46 +00:00
Dag-Erling Smørgrav
47ec2d313c Generated configuration and documentation
Approved by:	re (blanket)
2013-09-15 00:40:21 +00:00
Dag-Erling Smørgrav
69d86e3ff0 Forgotten in r255579: #include fixes.
Approved by:	re (blanket)
2013-09-15 00:37:30 +00:00
Dag-Erling Smørgrav
04b59eac33 Numerous fixes to make Unbound compile cleanly:
- cast through void * to silence alignment warnings (presumably false
   positives resulting from poor API design)

 - constify a few function arguments

 - move prototypes for callbacks into a common header

 - now that the prototypes are in scope, fix instances of function
   definitions that don't match the prototype or what the caller
   actually passes

 - hide a conditionally unused global variable behind the same #ifdef
   that controls its use

Approved by:	re (blanket)
2013-09-15 00:36:18 +00:00
Dag-Erling Smørgrav
f41b5392e6 Move prototypes into header.
Approved by:	re (blanket)
2013-09-15 00:07:51 +00:00
Dag-Erling Smørgrav
439fafc748 Two helper scripts for porting Unbound:
- freebsd-configure.sh runs ./configure with the correct parameters
   and regenerates the lex and yacc code.

 - freebsd-sources.pl untangles the upstream Makefile and generates
   source lists for our Makefiles.

Approved by:	re (blanket)
2013-09-15 00:05:16 +00:00
Ed Maste
377fc97958 Improve readelf notes output for Linux ELF files
Add four ELF note constants:
- NT_FILE and NT_SIGINFO (core file notes output by recent Linux kernels)
- NT_GNU_ABI_TAG (was incorrectly reported as NT_VERSION)
- NT_GNU_BUILD_ID (used for locating standalone debug files)

Approved by:	re (kib)
2013-09-13 18:21:31 +00:00
Dag-Erling Smørgrav
3fc9e2c365 Import Magerya Vitaly's ldns-host, and build it instead of the BIND version
in the WITH_LDNS_UTILS case.

Approved by:	re (blanket)
2013-09-08 19:40:32 +00:00
Dag-Erling Smørgrav
d1c8ba6e97 MFV (r255387): undo autoprop damage
Approved by:	re (glebius)
2013-09-08 16:56:17 +00:00
Dag-Erling Smørgrav
ce77a8d692 Update to OpenPAM Nummularia. 2013-09-07 19:43:39 +00:00
Dag-Erling Smørgrav
fec3606c04 This was a good idea that never went anywhere. 2013-09-07 18:55:52 +00:00
Dag-Erling Smørgrav
f7e6344d4a MFV (r255364): move the code around in preparation for Nummularia. 2013-09-07 18:46:35 +00:00
Andrew Turner
0a10f22a30 On ARM EABI double precision floating point values are stored in the
endian the CPU is in, i.e. little-endian on most ARM cores.

This allows ARMv4 and ARMv5 boards to boot with the ARM EABI.
2013-09-07 14:04:10 +00:00
Cy Schubert
bfc88dcbf7 Update ipfilter 4.1.28 --> 5.1.2.
Approved by:		glebius (mentor)
BSD Licensed by:	Darren Reed <darrenr@reed.wattle.id.au> (author)
2013-09-06 23:11:19 +00:00
David Chisnall
52b42bace1 On platforms where clang is the default compiler, don't build gcc or libstdc++.
To enable them, set WITH_GCC and WITH_GNUCXX in src.conf.
Make clang default to using libc++ on FreeBSD 10.
Bumped __FreeBSD_version for the change.

GCC is still enabled on PC98, because the PC98 bootloader requires GCC to build
(or, at least, hard-codes the use of gcc into its build).

Thanks to everyone who helped make the ports tree ready for this (and bapt
for coordinating them all).  Also to imp for reviewing this and working on the
forward-porting of the changes in our gcc so that we're getting to a much
better place with regard to external toolchains.

Sorry to all of the people who helped who I forgot to mention by name.

Reviewed by:	bapt, imp, dim, ...
2013-09-06 20:08:03 +00:00
Simon J. Gerraty
2d395cb507 If MAKE_JOB_ERROR_TOKEN is set to false, do not put an error token ("E")
into the job queue.
This avoids closing down an entire build on failure of one branch.
Probably has no use outside the context of universe/tinderbox.

Reviewed by:	obrien
2013-09-06 02:55:51 +00:00
Simon J. Gerraty
1bbe5942b5 Merge bmake-20130904 2013-09-05 15:57:26 +00:00
Pawel Jakub Dawidek
7008be5bd7 Change the cap_rights_t type from uint64_t to a structure that we can extend
in the future in a backward compatible (API and ABI) way.

The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.

The structure definition looks like this:

	struct cap_rights {
		uint64_t	cr_rights[CAP_RIGHTS_VERSION + 2];
	};

The initial CAP_RIGHTS_VERSION is 0.

The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.

The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.

To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.

	#define	CAP_PDKILL	CAPRIGHT(1, 0x0000000000000800ULL)

We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:

	#define	CAP_LOOKUP	CAPRIGHT(0, 0x0000000000000400ULL)
	#define	CAP_FCHMOD	CAPRIGHT(0, 0x0000000000002000ULL)

	#define	CAP_FCHMODAT	(CAP_FCHMOD | CAP_LOOKUP)

There is new API to manage the new cap_rights_t structure:

	cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
	void cap_rights_set(cap_rights_t *rights, ...);
	void cap_rights_clear(cap_rights_t *rights, ...);
	bool cap_rights_is_set(const cap_rights_t *rights, ...);

	bool cap_rights_is_valid(const cap_rights_t *rights);
	void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
	void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
	bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);

Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:

	cap_rights_t rights;

	cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);

There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:

	#define	cap_rights_set(rights, ...)				\
		__cap_rights_set((rights), __VA_ARGS__, 0ULL)
	void __cap_rights_set(cap_rights_t *rights, ...);

Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:

	cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);

Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.

This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.

Sponsored by:	The FreeBSD Foundation
2013-09-05 00:09:56 +00:00
John Baldwin
dffe0dc4d2 Add support for the 'invpcid' instruction to binutils and DDB's
disassembler on amd64.

MFC after:	1 month
2013-09-03 21:21:47 +00:00
John-Mark Gurney
003f0fa63f add support to gcc for AES and PCLMUL intrinsics... This addes the
-maes option, but not the -mpclmul option as I ran out of bits in
the 32 bit flags field...  You can -D__PCLMUL__ to get this, but it
won't be compatible w/ clang and modern gcc...

Reviewed by:	-current, -toolchain
2013-09-03 17:33:29 +00:00
Ed Maste
e7fec5c320 Add $FreeBSD$ tag for user-facing header 2013-09-03 13:36:23 +00:00