216 Commits

Author SHA1 Message Date
jca
ea572b9bd1 Stop using -mlongcall on powerpc
Using long calls means slower code.  It is not useful right now because
the size of the llvm executables has been reduced, as shown by tests by
Charlene Wendling.  And it breaks compilation with gcc 6, as pointed out
by a report from George Koehler.
2019-01-04 00:14:57 +00:00
jca
ee542c5865 Take devel/llvm maintainership
The goal is to provide quick feedback on proposed diffs, and enforce
testing on at least one gcc arch (probably sparc64) before diffs get
committed.  All contributions are still welcome.

Maintainer timeout, ok ajacoutot@ visa@ naddy@ sthen@ espie@
2018-12-15 15:21:48 +00:00
semarie
2fcf889dd6 unbreak lldb python module by making the symlink to point to versioned liblldb.so
tweak and ok jca@
2018-12-07 09:01:39 +00:00
sthen
c380b5a309 subpackage LLDB, and knock out that subpackage on arches where we
build with ports-gcc which isn't yet in shape to build LLDB.

tests and tweaks from various people including jca@, landry@,
Charlene Wendling, and probably others -- ok jca@
2018-12-06 21:51:01 +00:00
ajacoutot
8730604019 Remove duplicates. 2018-11-21 12:46:00 +00:00
ajacoutot
9c67f8ed48 Adjust PLIST with PFRAG to deal with PowerPC specific build behavior.
from Brad (maintainer)
2018-11-21 08:03:05 +00:00
ajacoutot
82187d36a5 From upstream:
- [mips] Prevent PIC to be set to level 2
- [mips] Improve handling of -fno-[pic/PIC] option
- [PowerPC] Set the default PLT mode on OpenBSD/powerpc to Secure PLT.

- Remove PowerPC -nopie workaround
- Add workaround to PowerPC to only build the PowerPC backend as a means
  of reducing the code size
- Enable building on PowerPC

from Brad (maintainer)
This allows building webkitgtk4 on OpenBSD/powerpc
2018-11-19 08:51:03 +00:00
ajacoutot
348faba600 Revert, it breaks the build on (at least) i386.
spotted by sthen@, thanks!
2018-11-18 13:50:36 +00:00
ajacoutot
298d4badff - [mips] Prevent PIC to be set to level 2
- [mips] Improve handling of -fno-[pic/PIC] option

from Brad (maintainer)
2018-11-18 09:02:56 +00:00
ajacoutot
634e5c9204 - Sync with base:
add PowerPC Secure PLT support and enable Secure PLT by default for
OpenBSD.

from Brad (maintainer)
2018-11-17 08:32:38 +00:00
sthen
6b8e265514 bump ports known/suspected to be affected by issue with libedit/libreadline
and termcap on lld arches.
2018-11-14 20:48:21 +00:00
ajacoutot
aa81e92d88 Merge from upstream:
- [Sparc] Add mnemonic aliases for flush, stb, stba, sth, and stha
- [Sparc] Add membar assembler tags

from Brad (maintainer)
2018-11-14 09:07:41 +00:00
ajacoutot
1e6c9d2358 Sync OpenBSD driver code a bit closer to upstream.
from Brad (maintainer)
2018-10-29 08:36:35 +00:00
ajacoutot
9b536d7f79 Sync with base:
- Accept both `--foo bar` and `--foo=bar` styles options.
- Add support for -z initfirst.
- Generate __data_start symbol that marks the start of .data when __data_start
  is referenced from code being linked.

From Brad (maintainer)
2018-10-25 09:25:38 +00:00
ajacoutot
e443ecd01a Sync with base:
When merging sections into the output, lld tries to adjust the alignment of
the section to be at least as large as the entry size of the section.
This causes a later check that validates the alignment to fail if the
entry size isn't a power of two.  This happens when building some of the
java support code in ports gcc.  Fix this by sticking to the original
alignment if the entry size isn't a power of two.

from Brad (maintainer)
2018-10-23 08:59:59 +00:00
ajacoutot
85514ee306 Resolve file collision with py-six by removing the copy of Six shipped
with LLVM and add a build depends on py-six.

From Brad (maintainer)
2018-10-17 08:35:55 +00:00
ajacoutot
e8b39de277 Add LLDB.
from Brad (maintainer)
input and ok sthen@
2018-10-06 15:27:10 +00:00
ajacoutot
de82d6b432 Sync with base:
Allow preemption of functions with protected visibility.  Disallowing this
makes no sense.  Yes it breaks function address equality and therefore
the expectations of the standard C language.  However declaring symbols
with protected visibility isn't standard C in the first place.

from Brad (maintainer)
2018-09-30 10:57:28 +00:00
ajacoutot
8790d8dfed 2 patches from upstream:
- Initialize LiveRegs once in BranchFolder::mergeCommonTails
- [CodeGen] Initialize large arrays by copying from a global

from Brad (maintainer)
2018-09-21 08:56:06 +00:00
ajacoutot
482ca16c44 Fix --exclude-libs option.
from Brad (maintainer)
2018-09-16 06:09:16 +00:00
ajacoutot
3a1f1f84e9 [x86] Fix a really subtle miscompile due to a somewhat glaring bug in EFLAGS
copy lowering.

from upstream via Brad (maintainer)
2018-08-27 08:46:52 +00:00
ajacoutot
14520cde72 Bring retguard for arm64 from base.
from Brad (maintainer).
2018-08-21 06:56:09 +00:00
ajacoutot
e12b1b2c51 Fix for --sysroot.
from Brad (maintainer)
2018-07-16 07:26:18 +00:00
sthen
d64cdb6a21 - set PKGSPEC-main in devel/llvm, which provides the default pkgspec for
dependent ports, this restricts deps to use the current clang version
which is required for some ports using the unversioned libLLVM*.so
library. see https://marc.info/?l=openbsd-ports&m=152377935312657&w=2

- set RUN_DEPENDS on devel/llvm in lang/crystal as it uses libLLVM*.so
breakage reported by James Turner

I don't like this at all, but don't see what other option we have,
if anyone has a better idea please pipe up.
2018-07-12 21:19:34 +00:00
ajacoutot
5abfe5c4c7 Sync with what was commited upstream:
[mips][ias] Enable IAS by default for OpenBSD / FreeBSD mips64/mips64el.

from Brad (maintainer)
2018-07-08 10:32:45 +00:00
ajacoutot
fcf5bd770b Merge in diffs from base:
- Add ret protector options as no-ops.
- Add a clang pass that identifies potential ROP gadgets and replaces ROP
  friendly instructions with safe alternatives. This initial commit fixes
  this framework.
- Add RETGUARD to clang for amd64. This security mechanism uses per-function
  random cookies to protect access to function return instructions, with the
  effect that the integrity of the return address is protected, and function
  return instructions are harder to use in ROP gadgets.
- Put the new retguard symbols in their own section,
  '.openbsd.randomdata.retguard', to make them easier to work with in the
  kernel hibernate code.
- Pass -nopie to the linker when -pg is specified to make the
  profiler(gprof) work properly.
- Work around a bug where discarding the .ARM.exidx section in the armv7 kernel
  linker script makes ld.lld(1) crash.  This has been fixed in a different
  (proper?) way upstream but backporting their fix is a bit too invasive.
- Merge '.openbsd.randomdata.*' sections into a single '.openbsd.randomdata'
  section when linking, as we do when using ld from binutils.

from Brad (maintainer)
2018-07-06 06:55:10 +00:00
ajacoutot
59f9d81f6b Update to llvm-6.0.1.
Tested with flang and rust by their maintainers.
from Brad (maintainer)
2018-07-04 09:53:49 +00:00
rpointel
ff301ce4b2 add missing header for InstructionCombining.cpp, in order to export
LLVMInitializeInstCombine as extern "C".
ok brad@.
2018-05-08 05:55:20 +00:00
ajacoutot
c1576a1c19 Switch armv7 to the "softfp" floating-point ABI. The ABI is identical to
the "soft" floating-point ABI but this does allow the compiler to generate
FPU instructions.

from Brad (maintainer)
2018-05-07 06:42:54 +00:00
ajacoutot
ab10d0eb39 - Keep the STT_FILE symbol in the table so that we know what file was used to compile an object
- [Sparc] Fix addressing mode when using 64-bit values in inline assembly
- [Sparc] Use synthetic instruction clr to zero register instead of sethi

from Brad (maintainer)
2018-04-28 15:04:29 +00:00
ajacoutot
ab90bf3743 Update to llvm-6.0.0.
tested in a bulk
from Brad (maintainer)
2018-04-07 14:55:42 +00:00
jsg
4ba39943a1 Build libLLVM.so and link tools with it.
This seems to be the way almost all Linux distributions and BSDs ship
LLVM and is what Mesa expects.  There are concerns this may cause issues
if ports start linking it, hopefully this won't happen as everything
links libLLVM-X.Y.so where X.Y is the branch version which will have the
same ABI throughout X.Y.Z releases.  The rust port explicitly links
statically even if shared libLLVM is available.

Patch cmake files in a similiar way to a patch in NetBSD pkgsrc to
correct symbols not getting added to the shared library on OpenBSD.

Use the documented cmake var for RTTI while here.

ok brad (MAINTAINER) sthen@ bcallah@
2018-03-09 03:01:22 +00:00
jca
9b76bc8f59 Don't use the integrated assembler on sparc64, as per upstream default
Brings us in line with clang in base, and should fix the builds errors
due to membar instructions used in libestdc++ headers.  ok kettenis@,
maintainer timeout.
2018-02-02 13:33:11 +00:00
ajacoutot
9b333d9ee2 Update for arm switching to Clang as default in base.
from Brad (maintainer)
2018-01-20 11:39:01 +00:00
ajacoutot
5588ed5146 Update to LLVM/Clang 5.0.1.
from Brad (maintainer)
2017-12-23 09:43:59 +00:00
ajacoutot
d7e4c06966 - Revert, [Sparc] efficient pattern for UINT_TO_FP conversion, as done upstream
- Make the behavior of the -v option more closer to GNU linkers

from Brad (maintainer)
2017-12-20 08:06:46 +00:00
ajacoutot
1cbe63224f Update to llvm-5.0.1rc2.
from Brad (maintainer)
2017-12-03 10:19:37 +00:00
ajacoutot
40587658f9 Bring in a patch from base.
The compiler is generally free to allocate general purpose registers in
whatever order it chooses. Reasons for choosing one register before another
usually include compiled instruction size (avoidance of REX prefixes, etc.)
or usage conventions, but somehow haven't included security implications in
the compiled bytecode. Some bytecode is more useful in polymorphic ROP
sequences than others, so it seems prudent to try to avoid that bytecode
when possible.

from Brad (maintainer)
2017-12-01 08:00:20 +00:00
jca
612bbaedf5 If you mark llvm as BROKEN-$arch, remove this arch from LLVM_ARCHS
Discussed with landry@
2017-11-24 16:42:04 +00:00
ajacoutot
5618eb1693 [Sparc] efficient pattern for UINT_TO_FP conversion
from Brad (maintainer)
2017-11-13 07:49:28 +00:00
ajacoutot
f5ec4ab208 [Sparc] Account for bias in stack readjustment.
from Brad (maintainer)
2017-11-02 10:36:23 +00:00
ajacoutot
eb0e7e6cc2 - Add OpenBSD support for setting the thread name
- [Sparc] allow tls_add/tls_call syntax in assembler parser

from Brad (maintainer)
2017-10-26 10:05:55 +00:00
ajacoutot
59014b7c45 Put .got.plt in RELRO.
from Brad (maintainer)
2017-10-25 06:50:59 +00:00
ajacoutot
57266c88fa - [ELF] - Fix segfault when processing .eh_frame.
- [LLD] Fix padding of .eh_frame when in executable segment

from Brad (maintainer)
2017-10-08 07:40:18 +00:00
ajacoutot
3efba61b8a Make clang include a FILE symbol for .(s|S) files.
from Brad (maintainer), confirmed by robert@
2017-10-07 12:35:31 +00:00
ajacoutot
d5fc4bf0c3 [X86] Disable _mm512_maskz_set1_epi64 intrinsic on 32-bit targets to prevent a
backend isel failure.

from Brad (maintainer)
2017-10-07 12:08:33 +00:00
ajacoutot
1e680c7e7c [AArch64] Fix bug in store of vector 0 DAGCombine.
Avoid using XZR/WZR directly as operands to split stores of zero
vectors.  Doing so can lead to the XZR/WZR being used by an instruction
that doesn't allow it (e.g. add)

from Brad (maintainer)
2017-09-25 10:44:19 +00:00
ajacoutot
1fa073903d [X86] Don't create i64 constants on 32-bit targets when lowering v64i1
constant build vectors.

from Brad (maintainer)
2017-09-16 07:01:33 +00:00
ajacoutot
038596ebbb A bug fix for sparc64.
Fix a logic error in DwarfExpression::addMachineReg()
This fixes PR34323 and thus splitting undescribable registers into
smaller, describable sub-registers.

from Brad (maintainer)
2017-09-14 06:10:11 +00:00
ajacoutot
1c2ac0d175 Update to llvm-5.0.0.
from Brad (maintainer)
2017-09-08 05:58:19 +00:00