Commit Graph

6413 Commits

Author SHA1 Message Date
Dimitry Andric
6402890244 Merge ^/head r277804 through r277843. 2015-01-28 18:45:40 +00:00
Ed Maste
272a972b88 Preserve hard & symbolic links when modifying source file
Strip is often used to modify existing files, rather than creating new
files. If the existing file has hard links or is a symbolic link, act as
if editing the file in place and preserve the links.

Reported by:	luigi
Reviewed by:	imp, rpaulo
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D1682
2015-01-28 18:37:09 +00:00
Dimitry Andric
54edb5043c Fix the following clang 3.6.0 warning in contrib/amd/hlfsd/homedir.c:
contrib/amd/hlfsd/homedir.c:497:8: error: address of array 'buf' will
always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  if (!buf || buf[0] == '\0')
      ~^~~

In the affected function, 'buf' is declared as an array of char, so it
can never be null.  Remove the unecessary check.
2015-01-28 18:19:25 +00:00
Dimitry Andric
a45fd13259 Apply changeset 854 from upstream openpam (by Dag-Erling Smørgrav):
Silence all remaining qual-cast warnings except in the test suite.
2015-01-28 18:13:52 +00:00
Enji Cooper
0d972b25f6 Revert r277357 as expr has been enhanced to better detect overflow conditions,
and now the tests pass

PR: 196867
X-MFC with: r277798
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-28 11:38:12 +00:00
Pedro F. Giffuni
1c139114b6 amd: Add extra check for NULL before deref.
CID:		274421
Obtained from:	NetBSD
MFC after:	5 days
2015-01-27 20:48:05 +00:00
Dimitry Andric
76f411ce48 Merging ^/head r277777 through r277803. 2015-01-27 19:40:08 +00:00
Gregory Neil Shapiro
e18480699e Remove build specific details from sendmail.cf/submit.cf in support of
https://wiki.freebsd.org/ReproducibleBuilds

The contrib/sendmail change will be made in the upstream source for a
future sendmail release.

Reviewed by:	des
MFC after:	3 days
2015-01-27 04:06:47 +00:00
Pedro F. Giffuni
20869109e3 MFV r277782:
Merge some cherry-picked fixes originating in OpenBSD

Check whether the version field is available before looking at it.
While we're at it, use ND_TCHECK(), rather than a hand-rolled check, to
check whether we have the full fixed-length portion of the IPv4 header.

commit c67afe913011138a2504ec4d3d423b48e73b12f3

Do more length checking. From OpenBSD.

commit d7516761f9c4877bcb05bb6543be3543e165249
2015-01-27 01:45:47 +00:00
Dimitry Andric
8179004eba Merge ^/head r277719 through 277776. 2015-01-26 21:41:54 +00:00
Dimitry Andric
09e84db383 Add llvm and clang patches corresponding to r277774 and r277775. 2015-01-26 21:24:04 +00:00
Dimitry Andric
fce16cf29f Pull in r227062 from upstream clang trunk (by Renato Golin):
Allows Clang to use LLVM's fixes-x18 option

  This patch allows clang to have llvm reserve the x18
  platform register on AArch64. FreeBSD will use this in the kernel for
  per-cpu data but has no need to reserve this register in userland so
  will need this flag to reserve it.

  This uses llvm r226664 to allow this register to be reserved.

  Patch by Andrew Turner.

Requested by:	andrew
2015-01-26 21:19:24 +00:00
Dimitry Andric
5ada58c747 Pull in r226664 from upstream llvm trunk (by Tim Northover):
AArch64: add backend option to reserve x18 (platform register)

  AAPCS64 says that it's up to the platform to specify whether x18 is
  reserved, and a first step on that way is to add a flag controlling
  it.

  From: Andrew Turner <andrew@fubar.geek.nz>

Requested by:	andrew
2015-01-26 21:17:14 +00:00
Dimitry Andric
477129542c Merge ^/head r277327 through r277718. 2015-01-25 23:43:12 +00:00
Dimitry Andric
39d628a0c7 Merge llvm 3.6.0rc1 from ^/vendor/llvm/dist, merge clang 3.6.0rc1 from
^/vendor/clang/dist, resolve conflicts, and cleanup patches.
2015-01-25 23:36:55 +00:00
Pedro F. Giffuni
82b6caf97a MFV r277658:
GDB: Replace use of sprintf.

2005-03-17  Mark Kettenis  <kettenis@gnu.org>

      * corelow.c (get_core_register_section): Replace usage of sprintf
      and strcpy with xstrprintf and xstrdup.

Sourceware commit:	3ecda4574edb38ad12fb491ccaf6d9b0caa3a07a

CID:	1006819
MFC after:	4 days
2015-01-24 21:05:18 +00:00
Pedro F. Giffuni
af2c167e63 MFV: r277654
gdb: Add missing break statements

2004-05-21  Jim Blandy  <jimb@redhat.com>

       * dwarf2expr.c (execute_stack_op): Add 'break' statements after
       cases for DW_OP_div and DW_OP_shr.  (Thanks to Reva Cuthbertson.)

Sourceware commit	99c87dab95747d380392a3698740507a21ad3236

CID:	1008254
MFC after:	4 days
2015-01-24 20:25:21 +00:00
Jilles Tjoelker
8dd985befe Enable utimensat tests from NetBSD.
As with other tests from c063, a required #include <sys/stat.h> was missing.
2015-01-24 15:49:40 +00:00
Xin LI
2fae2ab4c7 Don't include libcapsicum headers when requested.
Reported by:	luigi
MFC after:	14 days
X-MFC-with:	r276788
2015-01-24 06:06:46 +00:00
Pedro F. Giffuni
f860bc065a MFV r277607:
GDB: Fix memset thinkos.

2005-03-25  Anthony Green  <green@redhat.com>

       * remote.c (remote_store_registers): Fix memset usage.
       * std-regs.c (value_of_builtin_frame_reg): Ditto.
       (value_of_builtin_frame_fp_reg): Ditto.
       (value_of_builtin_frame_reg): Ditto.

Reported by:	Dirk Engling
CID:		604160, 604161, 604162, 604163
MFC after:	5 days
2015-01-23 20:40:31 +00:00
Ed Maste
5773625048 redelf: Add missing R_X86_64_ relocation types
PR:		196918
Reviewed by:	dim
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D1570
2015-01-21 01:07:58 +00:00
Sean Bruno
20ef3b88cd Allow clang to be built for mips/mips64 backend types by adding our mips
triple ids

This only allows testing and does not change the defaults for mips/mips64.
They still build/use gcc by default.

Differential Revision:	https://reviews.freebsd.org/D1190
Reviewed by:	dim
2015-01-20 17:00:28 +00:00
Enji Cooper
2e5b60079b Expect :overflow to fail with FreeBSD's expr as it doesn't have stringent
overflow checks like NetBSD's expr does

MFC after: 3 days
PR: 196867
2015-01-19 06:10:01 +00:00
Marcel Moolenaar
545ddfbe7d Upgrade libxo to 0.2.0.
Obtained from:	https://github.com/Juniper/libxo
Requested by: Phil Shafer <phil@juniper.net>

Revisions 276253 & 276273 were incorporated into 0.2.0.
Revision 276260 has been merged-in.
2015-01-19 02:22:03 +00:00
Allan Jude
0700a396cb Fix minor syntax and grammar errors in the markup of the ee(1) man page
Differential Revision:	https://reviews.freebsd.org/D1552
Submitted by:	bcallah@openbsd.org (original)
Approved by:	wblock (mentor)
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.
2015-01-18 17:25:41 +00:00
Dimitry Andric
9cac79b378 Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfix
only release, no new features have been added.

Please note that this version requires C++11 support to build; see
UPDATING for more information.

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

MFC after:	1 month
X-MFC-With:	276479
2015-01-18 14:14:47 +00:00
Enji Cooper
0c76184ced Fix lib/libthr/tests/detach_test
- Eliminate race with liberal use of sleep(3) [1]
- Fix NetBSD-specific implementation way of testing result from pthread_cancel
  by testing with `td` instead of `NULL` [2]

PR: 196738 [1]
PR: 191906 [2]

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-17 00:58:24 +00:00
Enji Cooper
5962fd53ac Don't call abort on usage errors; print out the usage message instead
PR: 196793
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-01-16 21:12:36 +00:00
Ed Maste
8ae6c16d82 Verify that section header offset is not past EOF
MFC After:	1 week
Sponsored by:	The FreeBSD Foundation
2015-01-16 15:16:19 +00:00
Dimitry Andric
d72607e9e2 Import libc++ trunk r224926. This fixes a number of bugs, completes
C++14 support[1], adds more C++1z features[2], and fixes the following
LWG issues[3]:

1450: Contradiction in regex_constants
2003: String exception inconsistency in erase.
2075: Progress guarantees, lock-free property, and scheduling
      assumptions
2104: unique_lock move-assignment should not be noexcept
2112: User-defined classes that cannot be derived from
2132: std::function ambiguity
2135: Unclear requirement for exceptions thrown in
      condition_variable::wait()
2142: packaged_task::operator() synchronization too broad?
2182: Container::[const_]reference types are misleadingly specified
2186: Incomplete action on async/launch::deferred
2188: Reverse iterator does not fully support targets that overload
      operator&
2193: Default constructors for standard library containers are explicit
2205: Problematic postconditions of regex_match and regex_search
2213: Return value of std::regex_replace
2240: Probable misuse of term "function scope" in [thread.condition]
2252: Strong guarantee on vector::push_back() still broken with C++11?
2257: Simplify container requirements with the new algorithms
2258: a.erase(q1, q2) unable to directly return q2
2263: Comparing iterators and allocator pointers with different
      const-character
2268: Setting a default argument in the declaration of a member
      function assign of std::basic_string
2271: regex_traits::lookup_classname specification unclear
2272: quoted should use char_traits::eq for character comparison
2278: User-defined literals for Standard Library types
2280: begin / end for arrays should be constexpr and noexcept
2285: make_reverse_iterator
2288: Inconsistent requirements for shared mutexes
2291: std::hash is vulnerable to collision DoS attack
2293: Wrong facet used by num_put::do_put
2299: Effects of inaccessible key_compare::is_transparent type are not
      clear
2301: Why is std::tie not constexpr?
2304: Complexity of count in unordered associative containers
2306: match_results::reference should be value_type&, not const
      value_type&
2308: Clarify container destructor requirements w.r.t. std::array
2313: tuple_size should always derive from integral_constant<size_t, N>
2314: apply() should return decltype(auto) and use decay_t before
      tuple_size
2315: weak_ptr should be movable
2316: weak_ptr::lock() should be atomic
2317: The type property queries should be UnaryTypeTraits returning
      size_t
2320: select_on_container_copy_construction() takes allocators, not
      containers
2322: Associative(initializer_list, stuff) constructors are
      underspecified
2323: vector::resize(n, t)'s specification should be simplified
2324: Insert iterator constructors should use addressof()
2329: regex_match()/regex_search() with match_results should forbid
      temporary strings
2330: regex("meow", regex::icase) is technically forbidden but should
      be permitted
2332: regex_iterator/regex_token_iterator should forbid temporary
      regexes
2339: Wording issue in nth_element
2341: Inconsistency between basic_ostream::seekp(pos) and
      basic_ostream::seekp(off, dir)
2344: quoted()'s interaction with padding is unclear
2346: integral_constant's member functions should be marked noexcept
2350: min, max, and minmax should be constexpr
2356: Stability of erasure in unordered associative containers
2357: Remaining "Assignable" requirement
2359: How does regex_constants::nosubs affect basic_regex::mark_count()?
2360: reverse_iterator::operator*() is unimplementable

[1] http://libcxx.llvm.org/cxx1y_status.html
[2] http://libcxx.llvm.org/cxx1z_status.html
[3] http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html

Exp-run:	antoine
MFC after:	1 month
2015-01-15 21:17:36 +00:00
Hans Petter Selasky
d7275b3f14 Fix compilation for 32-bit architectures.
PR:		196580
Sponsored by:	Mellanox Technologies
MFC after:	3 days
2015-01-15 14:47:48 +00:00
Hiren Panchasara
a2b8f1cbb7 ntpd tries to bind to IPv6 interfaces in 'tentative' state and fails as IPv6 is
actually disabled. Fix it by making ntpd ignore such interfaces.

Submitted by:	ume
Reviewed by:	bz, gnn
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D1527
2015-01-14 23:34:00 +00:00
Dimitry Andric
3a5ae4edcf Remove the <netinet/ip_compat.h> include from one of the newly added
sanitizer sources.  It is apparently unnecessary, and causes trouble for
people using WITHOUT_IPFILTER.

Reported by:	Pawel Biernacki <pawel.biernacki@gmail.com>, Kurt Lidl <lidl@pix.net>
2015-01-14 22:37:11 +00:00
Ed Maste
2b39d4f68b elfcopy: Avoid divide-by-0 on section alignment 0
According to ELF ABI, alignment 0 and 1 has the same meaning: the
section has no alignment constraints.

PR:		196715
Sponsored by:	The FreeBSD Foundation
2015-01-14 14:49:58 +00:00
Ed Maste
93e0d5cabf libdwarf: add missing break
Reported by:	Coverity
CID:		1193315
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2015-01-13 15:18:54 +00:00
Dimitry Andric
39107d9a91 Pull in r225610 from upstream compiler-rt trunk (by Roman Divacky):
Add FreeBSD support for __clear_cache.
2015-01-12 21:28:10 +00:00
Dag-Erling Smørgrav
748bd82957 MFV (r277045): merge upstream version of the local socket patch. 2015-01-12 09:46:49 +00:00
Hans Petter Selasky
68d89cc22a Fix support for ConnectX2 hardware.
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2015-01-11 15:00:08 +00:00
Baptiste Daroussin
8606363bf9 Install the liblzma pkg-config file
MFC after:	1 week
2015-01-10 00:11:10 +00:00
Dimitry Andric
f4341a5a66 Update compiler-rt to trunk r224034. This brings a number of new
builtins, and also the various sanitizers.  Support for these will be
added in a later commit.
2015-01-08 19:47:10 +00:00
Hans Petter Selasky
9a0603fa5f Add makefile for the "osmtest" utility. While at it:
- Fix depend target by removing a space after an "-I" inclusion option.
- Fix some minor compile issues in the "osmtest" utility.

MFC after:	3 days
PR:		196580
Sponsored by:	Mellanox Technologies
2015-01-08 14:45:54 +00:00
Ed Maste
9a1048f7e5 nm: Accept long option --extern-only for -g
Submitted by:	jkim
2015-01-08 14:35:16 +00:00
Hans Petter Selasky
dda7d972d5 Fix for compilation issue. Don't use the "abs()" function for unsigned
computations.

MFC after:	3 days
PR:		196597
Sponsored by:	Mellanox Technologies
2015-01-08 10:13:56 +00:00
Hajimu UMEMOTO
359f2b4604 Correct comparison of IPv6 wildcard address.
MFC after:	3 days
2015-01-08 07:47:39 +00:00
Enji Cooper
c60d58825d Remove unnecessary .include of bsd.own.mk
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-01-08 02:36:43 +00:00
Enji Cooper
589497e4e0 Build contrib/ofed/usr.{bin,lib} in parallel
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-08 02:11:13 +00:00
Enji Cooper
585d162280 Fix 'make depend' before infiniband headers have been installed to build host
by removing space between -I and the header directory

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-01-08 02:04:37 +00:00
Xin LI
3c602fabf9 MFV r276761: tcpdump 4.6.2.
MFC after:	1 month
2015-01-07 19:55:18 +00:00
Dimitry Andric
61b3223976 Add llvm patch corresponding to r276786. 2015-01-07 19:38:52 +00:00
Dimitry Andric
6849e1fd53 Pull in r222292 from upstream llvm trunk (by Weiming Zhao):
[Aarch64] Customer lowering of CTPOP to SIMD should check for NEON
  availability

This ensures llvm's AArch64 backend does not emit floating point
instructions if they are disabled.
2015-01-07 19:37:26 +00:00
Ed Maste
a737d64c08 libelf: Add arm64 config
Upstream elftoolchain ticket: #470
Submitted by:	Andrew Turner
Sponsored by:	The FreeBSD Foundation
2015-01-07 19:34:44 +00:00
Xin LI
681ed54caa MFV r276759: libpcap 1.6.2.
MFC after:	1 month
2015-01-06 22:29:12 +00:00
Ed Maste
02b08c9092 readelf: Handle note types from different operating systems
Previously elftoolchain readelf(1) produced correct description text
only for Linux note types.

Upstream elftoolchain ticket #473

Differential Revision:	https://reviews.freebsd.org/D1428
Reviewed by:	kib
Sponsored by:	The FreeBSD Foundation
2015-01-05 16:05:15 +00:00
Dag-Erling Smørgrav
31099b506d mfv (r276698): support for remote control over local sockets. 2015-01-05 14:59:18 +00:00
Ed Maste
a726543364 addr2line: fflush output after each address lookup
Certain tools spawn addr2line and pass addresses one at a time for
resolution.

PR:		195561
Reported by:	antoine
Sponsored by:	The FreeBSD Foundation
2015-01-05 04:56:38 +00:00
Enji Cooper
a812392203 Expect :arithmetic_ops_body to fail with syntax errors on FreeBSD
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-01-04 23:41:17 +00:00
Baptiste Daroussin
bbb0fbde9a Add pregenerated documentation for as(1) and ld(1) 2015-01-04 00:58:30 +00:00
Baptiste Daroussin
4a3e081c7b Fix generating documentation with modern texinfo 2015-01-04 00:54:29 +00:00
Baptiste Daroussin
321f9e5ad9 Fix generating documents with modern texinfo 2015-01-04 00:44:24 +00:00
Baptiste Daroussin
04803ab217 Import NetBSD vis(1) mandoc fixes 2015-01-03 23:16:13 +00:00
Konstantin Belousov
8495e8b1e9 Fix known issues which blow up the process after dlopen("libthr.so")
(or loading a dso linked to libthr.so into process which was not
linked against threading library).

- Remove libthr interposers of the libc functions, including
  __error(). Instead, functions calls are indirected through the
  interposing table, similar to how pthread stubs in libc are already
  done.  Libc by default points either to syscall trampolines or to
  existing libc implementations.  On libthr load, libthr rewrites the
  pointers to the cancellable implementations already in libthr.  The
  interposition table is separate from pthreads stubs indirection
  table to not pull pthreads stubs into static binaries.

- Postpone the malloc(3) internal mutexes initialization until libthr
  is loaded.  This avoids recursion between calloc(3) and static
  pthread_mutex_t initialization.

- Reinstall signal handlers with wrapper on libthr load.  The
  _rtld_is_dlopened(3) is used to avoid useless calls to sigaction(2)
  when libthr is statically referenced from the main binary.

In the process, fix openat(2), swapcontext(2) and setcontext(2)
interposing.  The libc symbols were exported at different versions
than libthr interposers.  Export both libc and libthr versions from
libc now, with default set to the higher version from libthr.

Remove unused and disconnected swapcontext(3) userspace implementation
from libc/gen.

No objections from:	deischen
Tested by:	pho, antoine (exp-run) (previous versions)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-01-03 18:38:46 +00:00
Dag-Erling Smørgrav
c809460030 Add generated files. 2015-01-03 11:52:43 +00:00
Dag-Erling Smørgrav
ff8258499c Upgrade to Unbound 1.5.1. Almost all our local changes to date have been
adopted upstream, greatly reducing the diff.
2015-01-03 02:40:51 +00:00
Dag-Erling Smørgrav
7ca2a8903f Recognize the lexer and parser sources. 2015-01-03 00:31:52 +00:00
Jilles Tjoelker
d79f904ad2 Link lib/libc/c063 tests to the build.
Some files lack required #include <sys/stat.h>. The #ifdef is per ngie's
request; the includes are clearly necessary for struct stat.

The faccessat test fails because it tries to use AT_SYMLINK_NOFOLLOW with
faccessat(), which is not specified by POSIX.1-2008.

Differential Revision:	https://reviews.freebsd.org/D1411
Reviewed by:	ngie
2015-01-02 22:49:05 +00:00
Xin LI
4460e5b02d MFV r276568:
Update file to 5.22.

MFC after:	2 weeks
2015-01-02 21:20:02 +00:00
Ed Maste
34e3f14688 readelf: Correct rounding on note padding
In general 64-bit ELF notes use 4-byte padding, not 8, despite what is
claimed in various specs.

Upstream elftoolchain ticket 472
https://sourceforge.net/p/elftoolchain/tickets/472/

Sponsored by:	The FreeBSD Foundation
2015-01-02 20:49:43 +00:00
Baptiste Daroussin
2d2813618c Remove GNU texinfo from base along with all info pages.
To be able to info pages consider installing texinfo from ports print/texinfo or
via pkg: pkg install texinfo

Differential Revision:	https://reviews.freebsd.org/D1409
Reviewed by:	emaste, imp (previous version)
Relnotes:	yes
2015-01-02 18:45:03 +00:00
Dag-Erling Smørgrav
7954be7fa5 import unbound 1.5.1 2015-01-02 17:35:29 +00:00
Dag-Erling Smørgrav
d433784aff import unbound 1.5.0 2015-01-02 17:31:36 +00:00
Dimitry Andric
c956f15874 Add clang and llvm patches corresponding to r276516 and r276537. 2015-01-02 14:58:41 +00:00
Dimitry Andric
e5eac9539c Pull in r222587 from upstream llvm trunk (by Jörg Sonnenberger):
Fix transformation of add with pc argument to adr for non-immediate
  arguments.

This fixes an "Unimplemented" error when assembling certain ARM add
instructions with pc-relative arguments.

Reported by:	sbruno
PR:		196412, 196423
2015-01-02 14:55:02 +00:00
Enji Cooper
97e4ab0905 Don't install h_raw if dealing with clang 3.5.0+ to unbreak the tests2 Jenkins
job

The h_raw application doesn't do proper bounds checking without the option
being supplied via the build, which means that it doesn't throw signals and
fail as expected

PR: 196430
X-MFC with: r276479
2015-01-02 05:40:02 +00:00
Ed Maste
bc5438c566 libelf: Return an error instead of asserting on an invalid ar file
Upstream elftoolchain ticket 467
http://sourceforge.net/p/elftoolchain/tickets/467/

Reported by:	Alexander Cherepanov
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2015-01-02 02:47:47 +00:00
Enji Cooper
8fe9679fd6 Reset errno in :scalbnf_val and :scalbnl_val before running the tests so the
tested errno isn't stale

This was needed in order for the test to pass on amd64 with stable/10

MFC after: 3 days
2015-01-02 00:57:40 +00:00
Dimitry Andric
fe3185864e Pull in r200010 from upstream libc++ trunk (by Marshall Clow):
Rename some internal templates to avoid conflict with complier
  intrinsics. __is_constructible --> __libcpp_is_constructible,
  __is_nothrow_constructible --> __libcpp_is_nothrow_constructible, and
  __is_nothrow_assignable --> __libcpp_is_nothrow_assignable. No
  functionality change.

Pull in r206805 from upstream libc++ trunk (by Marshall Clow):

  Use compiler intrinsic __is_constructible if available

This should fix building parts of world with -std=c++11 enabled.

Reported by:	Oliver Hartmann <ohartman@zedat.fu-berlin.de>
MFC after:	1 week
2015-01-01 22:49:17 +00:00
Dimitry Andric
f9d068d10d Pull in r213790 from upstream clang trunk (by Richard Smith):
PR20228: don't retain a pointer to a vector element after the
  container has been resized.

This fixes a possible crash when compiling certain parts of libc++'s
type_traits header.
2015-01-01 22:44:02 +00:00
Dimitry Andric
44b6c81fe4 Upgrade our copy of clang, llvm and lldb to 3.5.0 release.
Please note that this version now requires C++11 support to build; see
UPDATING for more information.

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

Thanks to Ed Maste, Roman Divacky, Andrew Turner, Justin Hibbits and
Antoine Brodin for their invaluable help with this import.

Approved by:	portmgr (antoine)
MFC after:	1 month
2014-12-31 20:31:32 +00:00
Ed Maste
3dc58d9cdb readelf: Add stdint.h for C99 fixed size types
Upstream elftoolchain brings in stdint.h via an ELF header that we
do not use in FreeBSD.

Sponsored by:	The FreeBSD Foundation
2014-12-31 19:21:53 +00:00
Dimitry Andric
ccd2f3b61a Merge ^/head r274961 through r276472. 2014-12-31 16:50:46 +00:00
Ed Maste
47fc54d8b0 libelf: Rearrange size test to prevent integer overflow
Sponsored by:	The FreeBSD Foundation
2014-12-31 01:48:23 +00:00
Enji Cooper
3e4930b0a9 Expect access_test:access_inval to fail before __FreeBSD_version == 1100033
This will allow me to MFC the test, as jilles@ requested that I don't MFC the
access(2) KBI change to 10-STABLE in r271655
2014-12-30 22:32:29 +00:00
Ed Maste
6db8a9f3a5 Check for multiplication integer overflow in CHECK_EHDR
The initial fix in r276374 is valid only for 64-bit objects. Revert it
and return an error in CHECK_EHDR if the multiplication would overflow.

The original buffer overflow issue was found with the security/afl
fuzzer and has upstream elftoolchain ticket 462. The 32-bit object issue
with r276374 found by antoine@ during an i386 exp-run.

Sponsored by:	The FreeBSD Foundation
2014-12-30 22:04:24 +00:00
Dimitry Andric
3ed527f1b5 Merge ^/head r274961 through r276418. 2014-12-30 20:23:03 +00:00
Dimitry Andric
f2dc4184d2 Import libcxxrt master 00bc29eb6513624824a6d7db2ebc768a4216a604.
Interesting fixes:
76584a0  Reorganize code to use only 32bit atomic ops for 32bit platforms
30d2ae5  Implement __cxa_throw_bad_array_new_length

Reviewed by:	bapt
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D1390
2014-12-30 20:01:06 +00:00
Ed Maste
4a85c69160 Update elftoolchain to upstream rev 3136
This fixes two strip(1) issues found during ports exp-run and adds a
string hash implementation which significantly speeds up certain
operations on objects with large numbers of symbols.

This also improves libdwarf handling for stripped objects with
.eh_frame or .debug_frame (but not other debug) sections.

PR:		196107
Sponsored by:	The FreeBSD Foundation
2014-12-30 03:25:42 +00:00
Ed Maste
3a6f20c19a libelf: Do not read past end of buffer
Previously a corrupt ELF file could read beyond the end of e_rawfile.

Upstream elftoolchain ticket 462.  Found via the security/afl fuzzer.

Sponsored by:	The FreeBSD Foundation
2014-12-29 20:23:42 +00:00
Ed Maste
2013b96e58 Rename DT_FEATURE_1 to DT_FEATURE
Track r270303:

  This provides a minor cleanup in elfdump; there are otherwise no
  consumers in the tree.  Old SUN documentation can be found for either
  variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by:	The FreeBSD Foundation
2014-12-29 19:38:12 +00:00
Ed Maste
4a9f54ac69 Restore r276252 mdoc fix
It was accidentally reverted in the elftoolchain update (r276371).

Sponsored by:	The FreeBSD Foundation
2014-12-29 19:27:10 +00:00
Ed Maste
b4e9f2392c Update elftoolchain to upstream rev 3130
This includes a number of libdwarf improvements (particularly DWARF4
related) and updates to elftoolchain tools such as strip(1). It also
includes a large number of miscellaneous fixes (memory leaks, sign and
cast warnings, integer overflow and underflow, etc.).

This is a merge of r276167,276170-276172 from the
projects/elftoolchain-update-r3130 branch.

Sponsored by:	The FreeBSD Foundation
2014-12-29 19:16:40 +00:00
Dimitry Andric
106370187a Merge ^/head r276347 through r276356. 2014-12-29 09:27:42 +00:00
Dimitry Andric
db39fc2a01 In contrib/binutils/bfd/elf32-ppc.c, avoid warnings about case values
not being in the enumerated type 'enum elf_ppc_reloc_type', by casting
the switch argument to int.

MFC after:	3 days
2014-12-29 00:10:43 +00:00
Dimitry Andric
81ccdbbb57 Merge ^/head r274961 through r276346. 2014-12-28 21:13:55 +00:00
Dimitry Andric
efabc957c5 In contrib/binutils/gas/config/tc-ppc.c, fix a few -Wformat-security
warnings.

MFC after:	3 days
2014-12-28 21:06:03 +00:00
Dimitry Andric
eca4d50aaa Merge ^/head r274961 through r276342. 2014-12-28 20:02:06 +00:00
Dimitry Andric
55b7c2bcf9 Add llvm patches corresponding to r276300, r276301 and r276324. 2014-12-28 02:33:13 +00:00
Dimitry Andric
c1ddc1e628 Pull in r224890 from upstream llvm trunk (by David Majnemer):
PowerPC: CTR shouldn't fire if a TLS call is in the loop

  Determining the address of a TLS variable results in a function call in
  certain TLS models.  This means that a simple ICmpInst might actually
  result in invalidating the CTR register.

  In such cases, do not attempt to rely on the CTR register for loop
  optimization purposes.

  This fixes PR22034.

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

This fixes a "Invalid PPC CTR loop" error when compiling parts of libc
for PowerPC-32.
2014-12-28 02:30:03 +00:00
Enji Cooper
e3ee0494af Fix the function signatures when MK_CRYPT == no for snmp_get_local_keys and
snmp_passwd_to_keys

MFC after: 1 week
Reported by: Beeblebrox <zaphod@berentweb.com>
2014-12-27 20:58:01 +00:00
Dimitry Andric
8007ee2b0c Merge ^/head r274961 through r276301. 2014-12-27 14:58:52 +00:00
Dimitry Andric
630590abbc Pull in r221703 from upstream llvm trunk (by Bill Schmidt):
[PowerPC] Replace foul hackery with real calls to __tls_get_addr

  My original support for the general dynamic and local dynamic TLS
  models contained some fairly obtuse hacks to generate calls to
  __tls_get_addr when lowering a TargetGlobalAddress.  Rather than
  generating real calls, special GET_TLS_ADDR nodes were used to wrap
  the calls and only reveal them at assembly time.  I attempted to
  provide correct parameter and return values by chaining CopyToReg and
  CopyFromReg nodes onto the GET_TLS_ADDR nodes, but this was also not
  fully correct.  Problems were seen with two back-to-back stores to TLS
  variables, where the call sequences ended up overlapping with unhappy
  results.  Additionally, since these weren't real calls, the proper
  register side effects of a call were not recorded, so clobbered values
  were kept live across the calls.

  The proper thing to do is to lower these into calls in the first
  place.  This is relatively straightforward; see the changes to
  PPCTargetLowering::LowerGlobalTLSAddress() in PPCISelLowering.cpp.
  The changes here are standard call lowering, except that we need to
  track the fact that these calls will require a relocation.  This is
  done by adding a machine operand flag of MO_TLSLD or MO_TLSGD to the
  TargetGlobalAddress operand that appears earlier in the sequence.

  The calls to LowerCallTo() eventually find their way to
  LowerCall_64SVR4() or LowerCall_32SVR4(), which call FinishCall(),
  which calls PrepareCall().  In PrepareCall(), we detect the calls to
  __tls_get_addr and immediately snag the TargetGlobalTLSAddress with
  the annotated relocation information.  This becomes an extra operand
  on the call following the callee, which is expected for nodes of type
  tlscall.  We change the call opcode to CALL_TLS for this case.  Back
  in FinishCall(), we change it again to CALL_NOP_TLS for 64-bit only,
  since we require a TOC-restore nop following the call for the 64-bit
  ABIs.

  During selection, patterns in PPCInstrInfo.td and PPCInstr64Bit.td
  convert the CALL_TLS nodes into BL_TLS nodes, and convert the
  CALL_NOP_TLS nodes into BL8_NOP_TLS nodes.  This replaces the code
  removed from PPCAsmPrinter.cpp, as the BL_TLS or BL8_NOP_TLS
  nodes can now be emitted normally using their patterns and the
  associated printTLSCall print method.

  Finally, as a result of these changes, all references to get-tls-addr
  in its various guises are no longer used, so they have been removed.

  There are existing TLS tests to verify the changes haven't messed
  anything up).  I've added one new test that verifies that the problem
  with the original code has been fixed.

This fixes a fatal "Bad machine code" error when compiling parts of
libgomp for 32-bit PowerPC.
2014-12-27 14:50:53 +00:00
Dimitry Andric
1ee9c19fb9 Pull in r213890 from upstream llvm trunk (by Jörg Sonnenberger):
Use the same .eh_frame encoding for 32bit PPC as on i386.

This fixes DT_TEXTREL errors when linking C++ objects using exceptions
on PowerPC.
2014-12-27 14:38:15 +00:00
Alfred Perlstein
628a446c66 Output strerror from xo_warn
Reported by: bapt
Reviewed by: bapt, ngie

Differential Revision: https://reviews.freebsd.org/D1378
2014-12-27 01:06:19 +00:00
Baptiste Daroussin
6fbbb9be44 Escape Do to prevent mdoc(7) parser to get confused with the "Do" macro
Reported by:	sjg
2014-12-26 22:34:15 +00:00
Baptiste Daroussin
6047eb6e49 mdoc fixes 2014-12-26 20:57:10 +00:00
Baptiste Daroussin
e66fe60d56 mdoc fixes 2014-12-26 20:50:40 +00:00
Baptiste Daroussin
df7f007fe8 mdoc fixes 2014-12-26 20:49:23 +00:00
Hans Petter Selasky
d0bd125135 Add proper Makefiles to build some infiniband example utilities.
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2014-12-26 10:25:34 +00:00
Baptiste Daroussin
445ed7b409 Remove unknown macro 2014-12-26 07:36:42 +00:00
Baptiste Daroussin
e3fe6b9488 Fix .TH having too many arguments 2014-12-26 07:34:42 +00:00
Pedro F. Giffuni
e63365a089 Backport fix for binutils 11867: .quad directive not assembled correctly
Alan Modra (and Alan's employer) graciously permitted use of his patch
under GPLv2.

Obtained from:	OpenBSD
MFC after:	5 days
2014-12-26 04:33:53 +00:00
Pedro F. Giffuni
32d0bb7e1b gas: use memmove instead of bogus memcpy.
partial_where points into the buffer that begins with buffer_start
so we need to use memmove() to handle the overlap.
Sourceware-PR 11456.

Obtained from:	OpenBSD (CVS rev. 1.2)
MFC after:	3 days
2014-12-26 03:03:41 +00:00
Dimitry Andric
7b4faa6c04 Add llvm patches corresponding to r276211 and r276223. 2014-12-26 00:10:08 +00:00
Dimitry Andric
c47b215d21 Pull in r224415 from upstream llvm trunk (by Justin Hibbits):
Add parsing of 'foo@local".

  Summary:
  Currently, it supports generating, but not parsing, this expression.
  Test added as well.

  Test Plan: New test added, no regressions due to this.

  Reviewers: hfinkel

  Reviewed By: hfinkel

  Subscribers: llvm-commits

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

Pull in r224494 from upstream llvm trunk (by Justin Hibbits):

  Add a corresponding '@LOCAL' parse to match r224415.

  Pointed out by Jim Grosbach.
2014-12-25 23:57:31 +00:00
Dimitry Andric
c26ad6e55e Amend r276211 for the new PowerPC relocation types that were added
there.  (Upstream is now using a generated file for this, so there is no
direct upstream commit associated with this change.)
2014-12-25 23:54:57 +00:00
Baptiste Daroussin
47ed86a875 Update mandoc to 1.13.2 2014-12-25 21:56:56 +00:00
Dimitry Andric
404df5bbd5 Pull in r214284 from upstream llvm trunk (by Hal Finkel):
[PowerPC] Add JMP_SLOT relocation definitions

  This will be required by upcoming patches for LLDB support.

  Patch by Justin Hibbits!

Pull in r221510 from upstream llvm trunk (by Justin Hibbits):

  Add Position-independent Code model Module API.

  Summary:
  This makes PIC levels a Module flag attribute, which can be queried by the
  backend.  The flag is named `PIC Level`, and can have a value of:

    0 - Backend-default
    1 - Small-model (-fpic)
    2 - Large-model (-fPIC)

  These match the `-pic-level' command line argument for clang, and the value of the
  preprocessor macro `__PIC__'.

  Test Plan:
  New flags tests specific for the 'PIC Level' module flag.
  Tests to be added as part of a future commit for PowerPC, which will use this new API.

  Reviewers: rafael, echristo

  Reviewed By: rafael, echristo

  Subscribers: rafael, llvm-commits

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

Pull in r221791 from upstream llvm trunk (by Justin Hibbits):

  Add support for small-model PIC for PowerPC.

  Summary:
  Large-model was added first.  With the addition of support for multiple PIC
  models in LLVM, now add small-model PIC for 32-bit PowerPC, SysV4 ABI.  This
  generates more optimal code, for shared libraries with less than about 16380
  data objects.

  Test Plan: Test cases added or updated

  Reviewers: joerg, hfinkel

  Reviewed By: hfinkel

  Subscribers: jholewinski, mcrosier, emaste, llvm-commits

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

Together, these changes implement small-model PIC support for PowerPC.

Thanks to Justin Hibbits and Roman Divacky for their assistance in
getting this working.
2014-12-25 18:22:22 +00:00
Dimitry Andric
42ac84b368 Remove doubled patch, which snuck in with the last merge from head. 2014-12-25 16:58:48 +00:00
Ed Maste
cf781b2e16 Update elftoolchain to upstream rev 3130
This brings a number of fixes to elfcopy/strip and DWARF4 improvements.

Sponsored by:	The FreeBSD Foundation
2014-12-24 03:13:16 +00:00
Xin LI
2f834a0b41 Fix multiple ntp vulnerabilities.
Reviewed by:	roberto (earlier revision), philip
Security:	CVE-2014-9293, CVE-2014-9294
Security:	CVE-2014-9295, CVE-2014-9296
Security:	FreeBSD-SA-14:31.ntp

Differential Revision: https://reviews.freebsd.org/D1343
2014-12-22 18:54:55 +00:00
Ed Maste
b3f2680928 Add AArch64 machine time and relocations for readelf
Reviewed by:	andrew
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1333
2014-12-22 16:34:59 +00:00
Ed Maste
9ef62fdb87 Set up default shstrtab entries at shstrtab initialization
Instead of waiting until the addition of the first non-default entry.
This fixes a segfault when strip(1) is asked to remove every section from
an object file.

Upstream elftoolchain ticket 463

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1341
2014-12-22 16:31:09 +00:00
Enji Cooper
92e8bbfdfd Add __FreeBSD_version guards around hsearch_r to ease MFCing the code to
stable/10

It was added when __FreeBSD_version was ~1100027
2014-12-21 23:47:30 +00:00
Ian Lepore
040610408e Allow -march=armv7a on the gcc command line, for compatibility with clang.
This will result in __ARM_ARCH_7A__ being defined during the compile.

When compiling with gcc, it will still only generate armv6 opcodes itself,
but should pass the arch to gas so that inline asm can use v7 opcodes.
2014-12-21 23:45:13 +00:00
Ed Maste
17eee5222e Include section name in strip warning message 2014-12-18 19:09:59 +00:00
Dimitry Andric
e65720e1ac Merge ^/head r275759 through r275911. 2014-12-18 18:44:22 +00:00
Justin Hibbits
e5701220a8 Make gas parse '__tls_get_addr(foo@tlsgd)'.
Corresponds to 727fc41e077139570ea8b8ddfd6c546b2a55627c.

This allows us to use -no-integrated-as with clang, if we prefer.

Obtained from:	binutils-gdb (Relicensed from Alan Modra as GPLv2)
MFC after:	2 weeks
X-MFC-with:	r275718
2014-12-18 03:12:46 +00:00
Ed Maste
a356a1f51f Do not strip all when stripping an explicit symbol
When requested to strip specific symbols (-N flag) the default should be
to strip nothing (other than the requested symbols). This is consistent
with binutils strip(1).

PR:		196038
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D1327
2014-12-17 14:46:21 +00:00
Xin LI
52df462f7f MFV r275844:
Fix unbound remote denial of service vulnerability.

Security:	FreeBSD-SA-14:30.unbound
Security:	CVE-2014-8602
2014-12-17 06:55:44 +00:00
Ed Maste
2c23cb7c27 Copy elftoolchain readelf from vendor branch 2014-12-16 16:23:54 +00:00
Ed Maste
30568ad37e Correct elftoolchain strip(1) memory size calculation
Calculate the segment's memory size (p_memsz) using the virtual
addresses, not the file offsets. Otherwise padding preceeding SHT_NOBITS
sections may be excluded from the calculation, resulting in a segment
that is too small.

PR:		195653
Sponsored by:	The FreeBSD Foundation
2014-12-15 18:18:57 +00:00
Dimitry Andric
580210532a Add clang patch corrsponding to r275773. 2014-12-14 18:21:03 +00:00
Dimitry Andric
01a314e59a Pull in r221170 from upstream clang trunk (by Roman Divacky):
Implement vaarg lowering for ppc32. Lowering of scalars and
  aggregates is supported. Complex numbers are not.

This adds va_args support for PowerPC (32 bit) to clang.
2014-12-14 18:20:03 +00:00
Dimitry Andric
f843434e37 Update clang patch for r275759 to use correct test cases. 2014-12-14 18:16:49 +00:00
Dimitry Andric
be038cc81f Add clang patch corresponding to r275759. 2014-12-14 13:40:42 +00:00
Dimitry Andric
b567315ffc Pull in r221170 from upstream clang trunk (by Roman Divacky):
Implement vaarg lowering for ppc32. Lowering of scalars and
  aggregates is supported. Complex numbers are not.

This adds va_args support for PowerPC (32 bit) to clang.

Reviewed by:	jhibbits
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1308
2014-12-14 13:38:10 +00:00
Dimitry Andric
b7f7b09969 Update patch-r274286-llvm-r201784-asm-dollar.diff, so
test/MC/AsmParser/macros.s is properly deleted when patching.
2014-12-14 13:32:14 +00:00
Dimitry Andric
60d2871897 Update llvm patch for r275635 so all the tests will pass. 2014-12-13 20:17:54 +00:00
Dimitry Andric
be281d7007 Merge ^/head r275715 through r275748. 2014-12-13 19:45:18 +00:00
Dimitry Andric
e5141ad104 Update llvm patches for r274286 and r275633 so all the tests will pass. 2014-12-13 18:54:46 +00:00
Justin Hibbits
ff0bab9760 Add new PowerPC relocations to binutils
Summary:
LLVM/Clang generates relocations that our binutils doesn't understand, but newer
binutils does.  I got permission from the author of a series of patches to
relicense them as GPLv2 for use in FreeBSD.  The upstream git hashes are:

ac2df442ac7901f00af15b272fc48b594b433713
2b95367962dc14f69d3c338c4d54195266e2e169
102890f04c44b64cf5cef4588267dd9f24086ac7
b7fcf6f6bb53b5027e111107f5416769cb9a5798
1d483afedd5a628dc84fb58d1d570f79fdfbfa7b
90aecf7a80c1cefeb45fc10a6cd02c8338e34b4c
3a71aa26df2a372a58e9c11ef9ba51fd0e83320a
727fc41e077139570ea8b8ddfd6c546b2a55627c

With the import of clang 3.5, and a few backported patches, we should be able to
move powerpc and powerpc64 to clang-as-cc soon.

Test Plan: Passes make tinderbox, so no regressions.  Binaries built with clang
run on powerpc64.

Reviewers: #committers, dim

Reviewed By: dim

Differential Revision: https://reviews.freebsd.org/D1297

Obtained from:	Alan Modra, upstream binutils-gdb git
MFC after:	3 weeks
Relnotes:	yes
2014-12-12 03:58:51 +00:00
Dimitry Andric
f45aab62b7 Merge ^/head r275685 through r275714. 2014-12-11 19:27:27 +00:00
Xin LI
c293113327 MFV r275696: file 5.21.
MFC after:	 2 weeks
2014-12-11 06:52:10 +00:00
Dimitry Andric
377af4f123 Merge ^/head r274961 through r275684. 2014-12-10 19:24:42 +00:00
Edward Tomasz Napierala
be3a49ee62 Add fstyp(8). This utility, named after its SVR4 counterpart, detects
filesystems.  It differs from file(1) in that it gives machine-parseable
output, it outputs filesystem labels, doesn't get confused by other
formats metadata, and runs in Capsicum sandbox.

Differential Revision:	https://reviews.freebsd.org/D1255
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2014-12-10 14:14:16 +00:00
Xin LI
2c4f16476d Fix multiple vulnerabilities in file(1) and libmagic(3).
Security:	FreeBSD-SA-14:28.file
Security:	CVE-2014-3710, CVE-2014-8116, CVE-2014-8117
2014-12-10 08:19:55 +00:00
Dimitry Andric
bdc6b44506 Add llvm patch corresponding to r275654, and clean up a few other patches. 2014-12-09 20:46:17 +00:00
Dimitry Andric
3f0ad6cf3c Pull in r223147, r223255 and r223390 from upstream llvm trunk (by Roman
Divacky):

  Introduce CPUStringIsValid() into MCSubtargetInfo and use it for ARM
  .cpu parsing.

  Previously .cpu directive in ARM assembler didnt switch to the new
  CPU and therefore acted as a nop. This implemented real action for
  .cpu and eg. allows to assembler FreeBSD kernel with -integrated-as.

  Change the name to be in style.

  Add a FIXME as requested by Renato Golin.
2014-12-09 20:41:51 +00:00
Dimitry Andric
ee287c9033 Add llvm patch corresponding to r275635. 2014-12-09 20:05:05 +00:00
Dimitry Andric
2ee6121f79 Add llvm patch corresponding to r275633. 2014-12-09 20:04:26 +00:00
Dimitry Andric
292d912acf Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Note: because this is applied on top of llvm/clang 3.5.0, this fix is
slightly different from the one just checked into head in r275633.
2014-12-09 07:48:25 +00:00
Dimitry Andric
cd9521158d Pull in r223171 from upstream llvm trunk (by Michael Zolotukhin):
PR21302. Vectorize only bottom-tested loops.

  rdar://problem/18886083

This fixes a bug in the llvm vectorizer, which could sometimes cause
vectorized loops to perform an additional iteration, leading to possible
buffer overruns.  Symptoms of this, which are usually segfaults, were
first noticed when building gcc ports, here:

https://lists.freebsd.org/pipermail/freebsd-ports/2014-September/095466.html
https://lists.freebsd.org/pipermail/freebsd-toolchain/2014-September/001211.html

Since this fix is very important for ports, bump __FreeBSD_version to
make it easier for port maintainers to test whether the fix has been
applied.

Upstream PR:	http://llvm.org/PR21302
MFC after:	3 days
2014-12-09 07:34:28 +00:00
Dimitry Andric
d7e0694a59 Merge ^/head r275478 through r275622. 2014-12-08 19:56:34 +00:00
Andrew Turner
6ed7db33bc Fix mrc and mrc2 with APSR_nzcv. Binutils encodes it internally as 0 where
we need it to be set to 15 for it to be equivalent to r15.

MFC after:	1 week
X-MFC with:	r275415
Sponsored by:	ABT Systems Ltd
2014-12-07 21:47:19 +00:00
Dimitry Andric
24ce0a02e5 Merge ^/head r275387 through r275477. 2014-12-04 17:38:32 +00:00
Dimitry Andric
b42a6953a1 Pull in r174303 from upstream gcc trunk (by Jason Merrill):
PR c++/48211
  * name-lookup.h (cp_class_binding): Make base a pointer.
  * name-lookup.c (new_class_binding): Adjust.
  (poplevel_class): Adjust.

This fixes a potential segfault when compiling gold, a part of the
devel/binutils port, with gcc.  See also the upstream bug report:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48211

Thanks to Jason Merrill, Tom Callaway and Red Hat legal for approving
the use of this patch under the GNU GPL, version 2 or later.

MFC after:	1 week
2014-12-04 17:26:04 +00:00
Christian Brueffer
850d588074 Add libcuse and libxo. 2014-12-03 18:14:21 +00:00
Baptiste Daroussin
1fb816da82 Update to mandoc cvs version as of 20141201
- Compatiblity with existing manpages has been improved
- Now support ".so" directive with compressed manpages (which fixes a regression
we have since we have new man(1))
2014-12-02 23:24:57 +00:00
Ed Maste
ccbdcd03f2 libelf: Fix cross-endian ELF note file / memory conversion
The namesz and descsz variables need to be used in native endianness.
The sizes are in native order after swapping in the file to memory case,
and before swapping in the memory to file case.

This issue was identified for r273443, but the change was applied to the
wrong case. Revert r273443 to fix the to-memory case, and apply the
equivalent change to the to-file case.

Sponsored by:	DARPA, AFRL
Reviewed by:	adrian, brooks, marcel
Differential Revision: https://reviews.freebsd.org/D1257
2014-12-02 22:35:43 +00:00
Andrew Turner
06b6b5da5e Allow the UAL APSR_nzcv format for the mrc and mrc2 instructions. The clang
integrated assembler only allows these forms so binutils will need to
support them.

MFC after:	1 Week
Sponsored by:	AB Systems Ltd
2014-12-02 18:12:16 +00:00
Dimitry Andric
2383695dc3 Merge ^/head r274961 through r275386. 2014-12-02 01:45:04 +00:00
Dimitry Andric
2d764cca51 Let GNU ld be less obscure about missing symbols and DSOs. If the BFD
object looks like a typical shared library, suggest adding '-l<foo>',
where <foo> has the 'lib' prefix and '.so<bar>' or '.a' suffix removed.

Otherwise, suggest adding '-l:<foo>', where <foo> is the full DT_SONAME.

Submitted by:	Conrad Meyer <conrad.meyer@isilon.com>
Sponsored by:	EMC / Isilon storage division
Reviewed by:	emaste
PR:		194296
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D1152
2014-12-02 01:30:53 +00:00
Baptiste Daroussin
e3ef75f1ea Sync the svn template with the one from ports 2014-12-02 00:23:26 +00:00
Andrew Turner
f9867ad74d Use the floating-point instruction on ARMv7 as the clang 3.5 integrated
assembler doesn't allow these two instructions to use co-processor 11.

MFC after:	1 Week
Sponsored by:	ABT Systems Ltd
2014-12-01 21:13:47 +00:00
Ed Maste
257d0dda42 Track libarchive API change 2014-12-01 16:10:44 +00:00
Ed Maste
310b1572ef Temporarily disable non-FreeBSD NT_ note types 2014-12-01 16:10:03 +00:00
Ed Maste
50f69bfbd6 Fix elftoolchain tools in-tree build
* make variables static
 * add header for uint*_t typedefs
2014-12-01 16:07:31 +00:00
Dimitry Andric
840b8445a5 Merge ^/head r274961 through r275366. 2014-12-01 15:11:29 +00:00
Dimitry Andric
15ad7a7c39 Pull in r209785 from upstream libc++ trunk (by Marshall Clow):
Fix a problem exposed by r208825, which caused bind (and other bits of
  libc++) to stop working. And tests

This fix is needed to support clang 3.5.0 and higher, which are more
strict about forming pointer-to-function types with cv-qualifiers or
ref-qualifiers.  See also the upstream PR <http://llvm.org/PR19742> and
<http://llvm.org/viewvc/llvm-project?rev=208825&view=rev>

Reported by:	amdmi3
MFC after:	3 days
2014-12-01 15:02:49 +00:00
Dimitry Andric
60c317af72 Merge ^/head r275262 through r275363. 2014-12-01 13:14:39 +00:00
Dimitry Andric
d814fbe9d2 Add patch file for r275362. 2014-12-01 13:07:49 +00:00
Dimitry Andric
258fa8bc6c For now, enable the clrex instruction for armv6, until upstream
implements this properly.

Submitted by:	andrew
2014-12-01 12:59:21 +00:00
Andrew Turner
b4ce9f7856 There is no need to use FUNC_END with aeabi_ldiv0 or aeabi_idiv0 as they
are aliases.

Sponsored by:	ABT Systems Ltd
2014-11-30 17:29:49 +00:00
Andrew Turner
da063e9d8c Use llabs when getting the absolute value of a long long.
Sponsored by:	ABT Ststems Ltd
2014-11-30 17:27:24 +00:00
Hans Petter Selasky
78328f86e2 Fix building of some infiniband utilities by updating some header file
locations and compiler include directives.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-11-30 13:27:58 +00:00
Hans Petter Selasky
dcf58f92e2 Add missing libraries when linking.
MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-11-30 13:13:46 +00:00
Dimitry Andric
5901d9eeec Add patch file for r275280. 2014-11-30 00:09:26 +00:00
Dimitry Andric
ee2ab7175c Pull in r215811 from upstream llvm trunk (by Nico Weber):
arm asm: Let .fpu enable instructions, PR20447.

  I'm not very happy with duplicating the fpu->feature mapping in ARMAsmParser.cpp
  and in clang's driver. See the bug for a patch that doesn't do that, and the
  review thread [1] for why this duplication exists.

  1: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140811/231052.html

This makes the .fpu directive work properly, so we can successfully
assemble several .S files using the directive, under lib/libc/arm.
2014-11-30 00:08:14 +00:00
Dimitry Andric
51cbfda29f Add patch file for r275265. 2014-11-29 20:24:18 +00:00
Dimitry Andric
50e3cdf0d7 Remove bogus revision numbers from diff header lines in the existing
llvm/clang patches.
2014-11-29 20:23:18 +00:00
Dimitry Andric
e1715afea7 Pull in r214802 from upstream llvm trunk (by Renato Golin):
Allow CP10/CP11 operations on ARMv5/v6

  Those registers are VFP/NEON and vector instructions should be used instead,
  but old cores rely on those co-processors to enable VFP unwinding. This change
  was prompted by the libc++abi's unwinding routine and is also present in many
  legacy low-level bare-metal code that we ought to compile/assemble.

  Fixing bug PR20025 and allowing PR20529 to proceed with a fix in libc++abi.

This enables assembling certain ARM instructions used in libgcc.
2014-11-29 20:18:08 +00:00
Dimitry Andric
980e47cff3 Merge ^/head r274961 through r275261. 2014-11-29 18:44:52 +00:00
Baptiste Daroussin
c04c768107 Implement --no-fatal-warning for compatibility with newer ld
what ever order the options are passed to ld(1) the --no-fatal-warning always
disable --fatal-warning
2014-11-29 11:50:19 +00:00
Baptiste Daroussin
4bf5485791 Update libucl to latest version
While here correctly link libucl to libm and register the dependency on libm
for static building
2014-11-29 00:45:09 +00:00
Dimitry Andric
344e0332fb Merge ^/head r275118 through r275209. 2014-11-28 13:25:57 +00:00
Ed Maste
a85fe12e36 Copy elftoolchain binutils replacements from vendor branch
Sponsored by:	The FreeBSD Foundation
2014-11-27 20:12:13 +00:00
Dimitry Andric
e19eaefe3a Add patch file for r275160. 2014-11-27 00:39:01 +00:00
Dimitry Andric
6a37c166fb Pull in r222856 from upstream llvm trunk (by David Majnemer):
Revert "Added inst combine transforms for single bit tests from Chris's note"

  This reverts commit r210006, it miscompiled libapr which is used in who
  knows how many projects.

  A test has been added to ensure that we don't regress again.

This fixes a miscompilation in libapr, which caused problems in svnlite.
2014-11-27 00:33:31 +00:00
Dimitry Andric
4e734b2430 Add patch files for r275152, r275153 and r275154. 2014-11-26 23:57:12 +00:00
Dimitry Andric
cdf306c8b1 Pull in r221900 from upstream clang trunk (by Ed Maste):
Hook up FreeBSD AArch64 support

  Patch from Andrew Turner.
2014-11-26 23:54:23 +00:00
Dimitry Andric
b57715cff8 Pull in r216571 from upstream llvm trunk (by Zachary Turner):
Fix some semantic usability issues with DynamicLibrary.

  This patch allows invalid DynamicLibrary instances to be
  constructed, and fixes the const-correctness of the isValid()
  method.

  No functional change.

This is needed for supporting the upgrade to a newer LLDB snapshot.
2014-11-26 23:53:35 +00:00
Dimitry Andric
b5479adaec Pull in r215352 from upstream llvm trunk (by Tim Northover):
AArch64: add support for dynamic-loader relocations

  LLD needs them, and it's good to be able to print them properly when
  our object dumpers encounter them.

  Patch by Daniel Stewart.

This is needed for supporting the upgrade to a newer LLDB snapshot.
2014-11-26 23:52:59 +00:00
Ed Maste
10b16cca63 Remove additional platform-specific LLDB code 2014-11-26 18:03:25 +00:00
Ed Maste
dcb99b2156 Revert LLDB changes for Clang/LLVM 3.5 API compatibility
This reverts the following upstream revisions:

      SVN      git
    214335  59a1f270
    214340  42f16b1e
2014-11-26 18:02:22 +00:00
Ed Maste
2691e63cfa Remove LLDB platform support not currently of interest to us 2014-11-26 17:32:20 +00:00
Ed Maste
5dd0c6d9b9 Update paths for FreeBSD build infrastructure
This same change was applied upstream in a later verison.
2014-11-26 17:29:01 +00:00
Ed Maste
7f04dba99f There is no Python in the FreeBSD base system 2014-11-26 17:24:12 +00:00
Ed Maste
a01d545e93 Avoid need for AppleObjCRuntime on FreeBSD
Since it is unlikely to provide much value to us, just #if 0 it away

Sponsored by:	DARPA, AFRL
2014-11-26 17:22:37 +00:00
Ed Maste
85dd3ec148 Revert LLDB changes for Clang/LLVM 3.5 API compatibility
This reverts the following upstream revisions:

     SVN       git
    214501  26d6f063
    215969  a083c0db
    216603  ee9cd340
    216810  f534f503

Sponsored by:	DARPA, AFRL
2014-11-26 17:09:58 +00:00
Ed Maste
0127ef0f2c Update LLDB snapshot to upstream r216948 (git 50f7fe44)
This is approximately "LLDB 3.5" although with a little bit of skew,
and will go along with the Clang 3.5 import.

Sponsored by:	DARPA, AFRL
2014-11-26 16:48:12 +00:00
Ed Maste
fc8fb3476a Revert Clang 3.4 API compatibility changes
Re-apply previously reverted changes to restore LLDB to parity with
the last update as of upstream revision 202189. This is the first step
an LLDB update to correspond with the Clang 3.5 import and re-applies
the following upstream revisions:

      SVN      git
    199408  3ad0a1a1
    199689  05be72c3
    200085  9ad47a93

Sponsored by:	DARPA, AFRL
2014-11-26 16:23:32 +00:00