Commit Graph

299 Commits

Author SHA1 Message Date
Dimitry Andric
3ea909cc76 Upgrade our copies of clang, llvm, lldb and compiler-rt to r312293 from
the upstream release_50 branch.  This corresponds to 5.0.0 rc4.

As of this version, the cad/stepcode port should now compile in a more
reasonable time on i386 (see bug 221836 for more information).

PR:		221836
MFC after:	2 months
X-MFC-with:	r321369
2017-09-01 18:53:36 +00:00
Dimitry Andric
0fa4377182 Upgrade our copies of clang, llvm, lldb and compiler-rt to r311606 from
the upstream release_50 branch.

As of this version, lib/msun's trig test should also work correctly
again (see bug 220989 for more information).

PR:		220989
MFC after:	2 months
X-MFC-with:	r321369
2017-08-24 20:19:27 +00:00
Dimitry Andric
0554abf0e0 Upgrade our copies of clang, llvm, lld and libc++ to r311219 from the
upstream release_50 branch.

MFC after:	2 months
X-MFC-with:	r321369
2017-08-21 07:03:02 +00:00
Ed Maste
f66f6e66a1 lld: Add -z muldefs option.
Obtained from:	LLVM r310757
2017-08-13 21:11:48 +00:00
Ed Maste
4c320ca0d6 lldb: Report inferior signals as signals, not exceptions, on FreeBSD
This is the FreeBSD equivalent of LLVM r238549.

This serves 2 purposes:

* LLDB should handle inferior process signals SIGSEGV/SIGILL/SIGBUS/
  SIGFPE the way it is suppose to be handled. Prior to this fix these
  signals will neither create a coredump, nor exit from the debugger
  or work for signal handling scenario.
* eInvalidCrashReason need not report "unknown crash reason" if we have
  a valid si_signo

llvm.org/pr23699

Patch by Karnajit Wangkhem

Differential Revision:  https://reviews.llvm.org/D35223

Submitted by:	Karnajit Wangkhem
Obtained from:	LLVM r310591
2017-08-10 13:51:04 +00:00
Ed Maste
39901227a5 lldb: Make i386-*-freebsd expression work on JIT path
* Enable i386 ABI creation for freebsd
* Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap
  syscall
* Unlike linux, the last argument of mmap is actually 64-bit(off_t).
  This requires us to push an additional word for the higher order bits.
* Prior to this change, ktrace dump will show mmap failures due to
  invalid argument coming from the 6th mmap argument.

Submitted by:	Karnajit Wangkhem
Differential Revision:	https://reviews.llvm.org/D34776
2017-08-09 19:09:23 +00:00
Dimitry Andric
9dc417c32b Upgrade our copies of clang, llvm and libc++ to r310316 from the
upstream release_50 branch.

MFC after:	2 months
X-MFC-with:	r321369
2017-08-09 17:32:39 +00:00
Dimitry Andric
37cd60a321 Upgrade our copies of clang, llvm, lld and lldb to r309439 from the
upstream release_50 branch.  This is just after upstream's 5.0.0-rc1.

MFC after:	2 months
X-MFC-with:	r321369
2017-07-30 18:01:34 +00:00
Dimitry Andric
14bc6a676e Pull in r309503 from upstream clang trunk (by Richard Smith):
PR33902: Invalidate line number cache when adding more text to
  existing buffer.

  This led to crashes as the line number cache would report a bogus
  line number for a line of code, and we'd try to find a nonexistent
  column within the line when printing diagnostics.

This fixes an assertion when building the graphics/champlain port.

Reported by:	antoine, kwm
PR:		219139
2017-07-30 11:50:16 +00:00
Dimitry Andric
b40b48b876 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and update
build glue.
2017-07-19 19:41:41 +00:00
Dimitry Andric
c439438675 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r307894, and update
build glue.
2017-07-13 21:58:45 +00:00
Ed Maste
0a7e7475c3 lld: [ELF] Remove unused synthetic sections from script commands
Script commands are processed before unused synthetic sections are
removed. Therefore, if a linker script matches one of these sections
it'll get emitted as an empty output section because the logic for
removing unused synthetic sections ignores script commands which
could have already matched and captured one of these sections. This
patch fixes that by also removing the unused synthetic sections from
the script commands.

Discussed with:	dim
Obtained from:	LLVM r307037
Sponsored by:	The FreeBSD Foundation
2017-07-04 17:32:51 +00:00
Ed Maste
bb07ac4d64 Revert LLVM r306813: Resolve references properly when using .symver
This LLD commit was intended to fix one case of symbol versioning
(LLVM PR28414) but broke FreeBSD buildworld.  It has been reverted
upstream in LLVM r306996.

Discussed with:	dim
2017-07-03 13:41:05 +00:00
Dimitry Andric
a580b01494 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and update
build glue.
2017-07-02 11:41:15 +00:00
Dimitry Andric
edd7eaddc8 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and update
build glue.
2017-06-27 06:40:39 +00:00
Dimitry Andric
4dd7e43662 Revert changes in r312891 and go back to stock lld code for rounding the
PT_GNU_RELRO p_memsz.  This should now work properly for FreeBSD.
2017-06-18 12:59:43 +00:00
Dimitry Andric
f32b3b5783 Repair a few mismerges in r320041 and r320042. 2017-06-17 12:48:31 +00:00
Dimitry Andric
4198293b25 Merge ^/head r319801 through r320041. 2017-06-17 00:14:54 +00:00
Dimitry Andric
24d58133b7 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305575, and update
build glue.
2017-06-17 00:09:34 +00:00
Ed Maste
ec21d1a149 lld: Add armelf emulation mode
Obtained from:	LLD r305375
2017-06-14 19:36:28 +00:00
Ed Maste
afb4d242bc lld: Fix weak symbols on arm and aarch64
Given

.weak target
 .global _start
_start:
 b target

The intention is that the branch goes to the instruction after the
branch, effectively turning it on a nop.  The branch adds the runtime
PC, but we were adding it statically too.

I noticed the oddity by inspection, but llvm-objdump seems to agree,
since it now prints things like:

b       #-4 <_start+0x4>

Obtained from:  LLD commit r305212
Differential Revision:  https://reviews.freebsd.org/D11191

Reviewed by:	dim, Rafael Espíndola
Obtained from:	LLD r305212
MFC after:	3 days
2017-06-14 18:56:33 +00:00
Ed Maste
dbb5554133 lld: sort relocations
No functional change; applied to facilitate merge of later LLD commit.

Reviewed by:	dim, Rafael Espíndola
Obtained from:	LLD r298797
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D11190
2017-06-14 18:53:33 +00:00
Ed Maste
a443511817 lld: revert accidentally committed change from r319887
This change is a portion of LLD rev 305212 which accidentally ended
up in my svn tree. We do want to backport the change to LLD 4.0, but
it needs additional work and was not supposed to be included in
r319887.
2017-06-13 01:25:19 +00:00
Ed Maste
e47ea033a1 hexdump: actually enter capability mode on last file
Reviewed by:	cem, Kyle Evans
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D10897
2017-06-13 01:05:55 +00:00
Ed Maste
56c940ba49 lld: ELF: Fix ICF crash on absolute symbol relocations.
If two sections contained relocations to absolute symbols with the same
value we would crash when trying to access their sections. Add a check that
both symbols point to sections before accessing their sections, and treat
absolute symbols as equal if their values are equal.

Obtained from:	LLD commit r292578
MFC after:	3 days
2017-06-13 00:31:16 +00:00
Dimitry Andric
db17bf38c5 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305145, and update
build glue.
2017-06-10 19:17:14 +00:00
Dimitry Andric
6d97bb297c Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304659, and update
build glue.
2017-06-03 18:18:34 +00:00
Dimitry Andric
f9448bf33f Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304460, and update
build glue.
2017-06-01 22:47:02 +00:00
Dimitry Andric
89cb50c933 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and update
build glue.
2017-05-30 19:24:09 +00:00
Dimitry Andric
302affcb04 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and update
build glue.
2017-05-29 22:09:23 +00:00
Dimitry Andric
d02c951f8e Merge ^/head r318658 through r318963. 2017-05-26 19:11:24 +00:00
Ed Maste
b08e22797d lldb: map TRAP_CAP to a trace trap
In the absense of a more specific handler for TRAP_CAP (generated by
ENOTCAPABLE or ECAPMODE while in capability mode) treat it as a trace
trap.

Example usage (testing the bug in PR219173):

% proccontrol -m trapcap lldb usr.bin/hexdump/obj/hexdump -- -Cv -s 1 /bin/ls
...
(lldb) run
Process 12980 launching
Process 12980 launched: '.../usr.bin/hexdump/obj/hexdump' (x86_64)
Process 12980 stopped
* thread #1, stop reason = trace
    frame #0: 0x0000004b80c65f1a libc.so.7`__sys_lseek + 10
...

In the future we should have LLDB control the trapcap procctl itself
(as it does with ASLR), as well as report a specific stop reason.
This change eliminates an assertion failure from LLDB for now.
2017-05-25 16:41:07 +00:00
Dimitry Andric
d8866befb8 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303571, and update
build glue.
2017-05-22 21:17:44 +00:00
Dimitry Andric
60ff8e32a5 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303291, and update
build glue.
2017-05-18 18:33:33 +00:00
Dimitry Andric
5517e702c0 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and update
build glue.
2017-05-16 21:50:29 +00:00
Dimitry Andric
0f5676f432 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302418, and update
build glue.
2017-05-08 19:20:55 +00:00
Dimitry Andric
f37b6182a5 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and update
build glue (preliminary, not all option combinations work yet).
2017-05-03 21:54:55 +00:00
Dimitry Andric
51690af2a4 Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and update
build glue.
2017-04-26 22:33:09 +00:00
Dimitry Andric
6bc11b1414 Merge llvm, clang, lld and lldb trunk r300890, and update build glue. 2017-04-20 21:48:54 +00:00
Dimitry Andric
28ae63f991 For lldb, delete the custom Xcode-only Host/Config.h, and provide a
pre-generated version in lib/clang/include/lldb/Host instead, similar to
what we do for clang, llvm and lld.
2017-04-18 20:31:02 +00:00
Dimitry Andric
f678e45dc4 Merge lldb trunk r300422 and resolve conflicts. 2017-04-16 16:48:25 +00:00
Dimitry Andric
46b69c6933 Merge lld trunk r300422 and resolve conflicts. 2017-04-16 16:35:48 +00:00
Dimitry Andric
20e90f04ad Merge clang trunk r300422 and resolve conflicts. 2017-04-16 16:31:20 +00:00
Dimitry Andric
7a7e605503 Merge llvm trunk r300422 and resolve conflicts. 2017-04-16 16:25:46 +00:00
Ed Maste
5868914ed4 lld: hack version and help output for compatibility with libtool
GNU libtool checks the output from invoking the linker with --version
and --help, in order to determine the linker "flavour" and the command-
ine arguments to use for various link operations (e.g. generating shared
libraries). To detect GNU ld it looks for the strings "GNU" and
"supported targets:.*elf". Since LLD is compatible with GNU ld we
include those same strings to fool libtool.

Quoting from a comment in the change:
    This is somewhat ugly hack, but in reality, we had no choice other
    than doing this. Considering the very long release cycle of Libtool,
    it is not easy to improve it to recognize LLD as a GNU compatible
    linker in a timely manner. Even if we can make it, there are still a
    lot of "configure" scripts out there that are generated by old
    version of Libtool. We cannot convince every software developer to
    migrate to the latest version and re-generate scripts. So we have
    this hack.

Upstream LLVM revisions r298532, r298568, r298591

Obtained from:	LLVM
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-03-27 16:01:16 +00:00
Dimitry Andric
817a00731b Update clang, llvm, lld, lldb, compiler-rt and libc++ to 4.0.0 release.
We were already very close to the last release candidate, so this is a
pretty minor update.

Relnotes:	yes
MFC after:	1 month
X-MFC-With:	r314564
2017-03-10 19:02:41 +00:00
Dimitry Andric
2e477b5e5e Merge llvm, clang, compiler-rt, libc++, lld and lldb release_40 branch
r296509, and update build glue.
2017-02-28 21:18:23 +00:00
Dimitry Andric
bc93f188f6 Merge llvm, clang, compiler-rt, libc++, lld and lldb release_40 branch
r296202, and update build glue.
2017-02-25 15:00:57 +00:00
Dimitry Andric
5d19388204 Merge llvm, clang, compiler-rt, libc++, lld and lldb release_40 branch
r296002, and update build glue.
2017-02-23 19:25:29 +00:00
Dimitry Andric
2bcad0d8d6 Merge llvm, clang, compiler-rt, libc++, lld and lldb release_40 branch
r295380, and update build glue.
2017-02-17 20:07:35 +00:00