summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove LLVM 8.0.1 files.patrick2020-08-032170-1411331/+0
|
* int64_t and intmax_t are always (signed) long long on OpenBSD.kettenis2020-07-181-0/+2
| | | | ok deraadt@
* Set the default ABI for OpenBSD to ELFv2 in the clang frontend as well.kettenis2020-07-111-0/+4
| | | | | | | This makes sure the compiler defines the _CALL_ELF pre-processor symbol correctly. ok mortimer@
* Make long double the same as double for now on powerpc64 like we do onkettenis2020-06-281-0/+1
| | | | | | powerpc. This matched what FreeBSD does. ok patrick@
* Powerpc64 should use same _mcount profiling as powerpc 32bit.drahn2020-05-301-0/+1
| | | | ok kettenis@
* PowerPC: optimize away the frame pointer.gkoehler2020-05-251-3/+4
| | | | | | | | clang defaulted to -fomit-frame-pointer when optimizing PowerPC code for Linux and NetBSD. Now do it for all systems, including OpenBSD. This affects both 32-bit and powerpc64 code. ok kettenis@
* Make sure that we add our OpenBSD specific defines on PowerPC64 targets.patrick2020-05-201-0/+4
| | | | | Prompted and tested by drahn@ ok deraadt@ drahn@ kettenis@ visa@
* Define the appropriate __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* symbols like allkettenis2020-04-051-0/+5
| | | | | | other clang platforms do. ok jca@
* Switch powerpc clang to -msvr4-struct-return, like gcc.gkoehler2020-03-044-9/+103
| | | | | | | | Add these options from gcc to clang: -maix-struct-return # return all structs in memory -msvr4-struct-return # return small structs in r3/r4 ok mortimer@ jca@ deraadt@
* Add retguard for octeon/mips64.mortimer2019-10-251-0/+2
| | | | | | | | | | For this architecture we use separate retguard prologue and epilogue code for static or PIC code. In the PIC case we use some additional code before the retguard epilogue to recover the function start address and the GOT pointer in order to get the per-function random cookie. Much thanks to visa@ for suggestions and advice making it all work. ok deraadt@ visa@
* Make clang emit the proper path to our libcompiler_rt.a when asked to.patrick2019-09-282-0/+12
| | | | | | | | Change of behaviour in latest clang upgrade noticed by jsing@ during the Go port update, where --print-libgcc-file-name is being used which prints the compiler-rt path. ok kettenis@
* Merge LLVM 8.0.1 release.patrick2019-09-013-5/+11
| | | | | | | Tested in snaps and package builds Tested on amd64 by naddy@ Tested on arm64 by patrick@ Tested on octeon by visa@
* Import LLVM 8.0.1 release including clang, lld and lldb.patrick2019-09-017-44/+44
|
* Implement the 'h' register constraint on mips64. This lets clang buildvisa2019-07-011-0/+1
| | | | | | | | | | | pieces of software that use the constraint if the compiler claims to be compatible with GCC 4.2.1. Note that the constraint was removed in GCC 4.4. The reason was that 'h' could generate code whose result is unpredictable. The underlying reason is that the HI and LO registers are special, and the optimizer has to be careful when choosing the order of HI/LO accesses. It looks that LLVM has the needed logic.
* In LLVM 8 somebody had the glorious idea to enable the integrated assemblerclaudio2019-06-261-1/+1
| | | | | | | | for OpenBSD sparc64. The problem is that the integrated assembler is not even able to compile the .S files in lib/csu or lib/libc so revert this and use gas again. Fixes build issues with clang on sparc64. Issue identified by jca@ OK deraadt@, patrick@, jca@
* The -nopie flag has already been pushed a few lines before,patrick2019-06-241-3/+2
| | | | | | we don't need to do that again here. From Brad
* Merge LLVM 8.0.0 release.patrick2019-06-2377-20092/+4764
| | | | | | | | | Prepared with help from jsg@ and mortimer@ Tested on amd64 by bcallah@, krw@, naddy@ Tested on arm64 by patrick@ Tested on macppc by kettenis@ Tested on octeon by visa@ Tested on sparc64 by claudio@
* Import LLVM 8.0.0 release including clang, lld and lldb.patrick2019-06-231071-38929/+87218
|
* Back out frame pointer elimination optimization.mortimer2019-06-011-11/+0
|
* Do not eliminate frame pointers on i386. The entire i386 ecosystem assumesmortimer2019-06-011-1/+0
| | | | | it will be there. problem found by naddy@, "heck yeah" kettenis@
* Re-enable frame pointer elimination for x86 and mips64 if optimizations aremortimer2019-05-311-0/+12
| | | | | | enabled. ok visa@
* Stop using the moribund MLINKS bsd.man.mk feature for clang(1).schwarze2019-05-161-2/+2
| | | | | Patch clang.rst such that "gmake -f Makefile.sphinx man" keeps working. Using input from jsg@; OK patrick@; "no worries" deraadt@
* Also touch --param ssp-buffer-size when using retguard in lieu of themortimer2019-04-251-1/+2
| | | | | | | stack protector. Fixes 'unused arguments' warning when this argument is given. Noticed by robert@, ok robert@
* frame-pointer elimination has encountered some resistance in ports but wederaadt2019-04-041-12/+0
| | | | | | are close to release, so punt the change till after-release easier for everyoned and especially naddy ok tedu
* Enable frame pointer elimination on i386, amd64 and mips64 when givenmortimer2019-04-021-0/+12
| | | | | | optimization flags. ok kettenis@ visa@
* Consume SSP options when using retguard to prevent warnings.mortimer2019-04-011-0/+4
| | | | ok millert@
* If using retguard, we do not also need the stack protector.mortimer2019-03-311-3/+4
| | | | ok deraadt@
* Improve the X86FixupGadgets pass:mortimer2019-02-222-0/+14
| | | | | | | | | | - Target all four kinds of return bytes (c2, c3, ca, cb) - Fix up instructions using both ModR/M and SIB bytes - Force alignment before instructions with return bytes in immediates - Force alignment before instructions that have return bytes in their encoding - Add a command line switch to toggle the functionality. ok deraadt@
* Merge LLVM commits r340844, r353818 and r353819 from the 8.0 branchpatrick2019-02-131-1/+1
| | | | | | | | | | to fix a regression in floating point operations. Bluhm noticed that the bc regression test has been failing after the upgrade to 7.0.1 because setting the floating point control register was in some cases reordered erroneously. Found and tested by bluhm@ ok bluhm@ kettenis@
* On OpenBSD/powerpc (and NetBSD/powerpc) long double == double like onkettenis2019-02-101-1/+7
| | | | | | FreeBSD/powerpc. From George Koehler. ok millert@, deraadt@, visa@
* implement -msave-args in clang/llvm, like the sun did for gccdlg2019-01-303-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this is a bit different to gcc as gcc likes to use movs to move stuff on and off the stack, and directly updates the stack pointers with add and sub instructions. llvm prefers to use push and pop instructions, is a lot more careful about keeping track of how much stuff is currently on the stack, and generally pops the frame pointer rather than do maths on it. -msave-args adds a bunch of pushes as the first thing a function prologue does. to keep the stack aligned, if there's an odd number of arguments to the function it pushes the first one again to put the frame back on a 16 byte boundary. to undo the pushes the frame pointer needs to be updated in function epilogues. clang emits a series of pops to fix up the registers on the way out, but popping saved arguments is a waste of time and harmful to actual data in the function. rather than add an offset to the stack pointer, -msave-args emits a leaveq operation to fix up the frame again. leaveq is effectively mov rbp,rsp; pop rbp, and is a single byte, meaning there's less potential for gadgets compared to a direct add to rsp, or an explicit mov rbp,rsp. the only thing missing compared to the gcc implementation is adding the SUN_amd64_parmdump dwarf flag to affected functions. if someone can tell me how to add that from the frame lowering code, let me know. when enabled in kernel builds again, this will provide useful arguments in ddb stack traces again.
* Tedu files that got removed in LLVM 7.0.1.patrick2019-01-2710-2410/+0
|
* Merge LLVM 7.0.1 release.patrick2019-01-2723-5439/+8131
| | | | | With fixes from mortimer@ (thanks!) Tested by many, especially naddy@ (thanks!)
* Import LLVM 7.0.1 release including clang, lld and lldb.patrick2019-01-271383-73085/+132104
|
* The %b printf extension in the kernel is not fixed to a int type. On sparc64claudio2018-12-293-13/+38
| | | | | | there are various %llb formats. Adjust the code to handle the length specifiers and type check like it is used by the regular case. OK guenther@
* Enable the integrated assembler on mips64.visa2018-10-211-4/+6
| | | | | | | | Upstream references: https://reviews.llvm.org/D31557 https://reviews.llvm.org/D48515 OK kettenis@
* Add retguard for arm64.mortimer2018-08-121-1/+2
| | | | ok deraadt@
* Pass -nopie to the linker when -pg is specified to make theyasuoka2018-06-071-2/+3
| | | | | | profiler(gprof) work properly. ok mpi
* Add RETGUARD to clang for amd64. This security mechanism uses per-functionmortimer2018-06-065-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | 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. On function entry the return address is combined with a per-function random cookie and stored in the stack frame. The integrity of this value is verified before function return, and if this check fails, the program aborts. In this way RETGUARD is an improved stack protector, since the cookies are per-function. The verification routine is constructed such that the binary space immediately before each ret instruction is padded with int03 instructions, which makes these return instructions difficult to use in ROP gadgets. In the kernel, this has the effect of removing approximately 50% of total ROP gadgets, and 15% of unique ROP gadgets compared to the 6.3 release kernel. Function epilogues are essentially gadget free, leaving only the polymorphic gadgets that result from jumping into the instruction stream partway through other instructions. Work to remove these gadgets will continue through other mechanisms. Remaining work includes adding this mechanism to assembly routines, which must be done by hand. Many thanks to all those who helped test and provide feedback, especially deaadt, tb, espie and naddy. ok deraadt@
* Add ret protctor options as no-ops.mortimer2018-06-032-0/+14
|
* Switch armv7 to the "softfp" floating-point ABI. The ABI is identical tokettenis2018-05-051-1/+1
| | | | | | | the "soft" floating-point ABI but this does allow the compiler to generate FPU instructions. ok deraadt@
* Tedu files that got removed in LLVM 6.0.0.patrick2018-04-067-1741/+0
|
* Merge LLVM 6.0.0 release.patrick2018-04-0612-11792/+3567
|
* Import LLVM 6.0.1 release including clang, lld and lldb.patrick2018-04-06970-28342/+89535
| | | | "where is the kaboom?" deraadt@
* add clang-local(1) to SEE ALSOjsg2018-01-221-1/+1
| | | | suggested by jmc@ ok patrick@
* Tedu files that got removed in LLVM 5.0.1.patrick2017-12-251-27/+0
|
* Merge LLVM 5.0.1 release.patrick2017-12-243-5/+14
|
* Import LLVM 5.0.1 release including clang, lld and lldb.patrick2017-12-2425-83/+162
|
* Tedu files that got removed in LLVM 5.0.0.patrick2017-10-0423-23995/+0
|
* Merge LLVM 5.0.0 release.patrick2017-10-0415-958/+3801
|