summaryrefslogtreecommitdiffstats
path: root/gnu/gcc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Link -static -pie executables with rcrt0.o instead of crt0.o such that theykettenis2014-12-271-2/+3
| | | | | | self-relocate. ok kurt@
* Link -static -pie executables on powerpc with rcrt0.o instead of crt0.okurt2014-12-261-2/+3
| | | | such that they self-relocate. okay kettenis@
* Link -static -pie executables with rcrt0.o instead of crt0.o such that theykurt2014-12-221-1/+2
| | | | self-relocate.
* Link -static -pie executables with rcrt0.o instead of crt0.o such that theykettenis2014-12-221-1/+2
| | | | | | | | self-relocate. Based on a diff from kurt@ ok deraadt@
* Link -static -pie executables with rcrt0.o instead of crt0.o such that theykettenis2014-12-221-1/+4
| | | | | | self-relocate. Based on a diff for amd64 from kurt@
* Link -static -pie executables with rcrt0.o instead of crt0.o such that theykettenis2014-12-221-1/+2
| | | | | | self-relocate. Based on a diff for amd64 from kurt@
* Add cpuid.h from clang r197399 with additional feature bits,jsg2014-09-101-0/+172
| | | | | | | | | and defines for compatibility with the equivalent gcc header. cpuid.h was introduced in gcc 4.3 and a compatible header has been included with recent versions of clang. Earlier version ok miod@. Tested in a ports bulk build by landry@.
* Revert ssp-strong on arm. This has been exposing one or more bugs in GCC thatpascal2014-07-241-0/+4
| | | | | | | kill large portions of the ports tree. Most notably, it broke devel/gperf at runtime. ok martynas@, "make a decision" deraadt@
* printf(9) and friends don't support the <number>$ flags, so gcc'sguenther2014-07-211-1/+1
| | | | | | kprintf attribute shouldn't accept them. ok martynas@
* make the __cxa_call_terminate() proto match the definitionjsg2014-07-111-1/+1
| | | | | From dt71 at gmx.com via FreeBSD Required to build with recent versions of clang.
* Backport support for -Wframe-larger-than=N to base GCCmatthew2014-07-102-0/+5
| | | | | | | | This is the flag name that modern GCC and Clang have de facto standardized on for the functionality that we locally named -Wstack-larger-than-N. ok brad, miod
* gcc4: emit warning when ignoring alignment constraintsmatthew2014-06-231-1/+4
| | | | | | | | | | | | Currently, GCC 4.2 silently ignores the "aligned" attribute for objects allocated on the stack if the specified minimum alignment exceeds the platform's natural stack alignment. This has bitten us in the past, so we shouldn't allow this to continue. Fixing the "ignores" problem seems hard, so this commit settles for tackling the "silently" problem instead. ok miod, and possibly guenther and deraadt
* When the stack protector heuristics doesn't cover a function, leavemartynas2014-05-061-8/+7
| | | | | | | a little pointer-sized gap before the return value. This protects from common off-by-one type of bugs and costs nothing: the attacker won't be able to overwrite return pointer. Developed at m2k14, thanks for the hackathon!
* Introduce -fstack-shuffle, which randomizes local stack variables.martynas2014-05-062-12/+33
| | | | | | | | This will make the environment more hostile and help detect bugs that depend on overrunning one variable into another, with almost no performance cost. Discussed with Theo at m2k14 hackathon. "oh god yes" tedu@, "oh nice" djm@
* x86-64 ABI requires arrays greater than 16 bytes to be aligned tomartynas2014-05-011-1/+1
| | | | | | | | | | | 16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS, not BYTES. This diff improves bug detectability for code which has local arrays of [16 .. 127] bits: in those cases SSP will now detect even 1-byte overflows. OK kettenis@. Tested in snaps for a week.
* Change the heuristics of -fstack-protector to select to protectmartynas2014-03-302-2/+2
| | | | | | | | | | | | | | | additional functions --- those that have local array definitions, or have references to local frame addresses. Note that upstream uses -fstack-protector-strong and misleads people: -fstack-protector, -fstack-protector-all, -fstack-protector-strong can you tell which one is safe? Luckily, OpenBSD has its own compiler and is able to do the right thing for security: this is enabled by default, and called -fstack-protector. OK deraadt@, miod@. Tested for 3 months.
* remove gets reference. ok espietedu2014-03-271-1/+0
|
* Catch SIGPIPE to clean up temp filesguenther2014-01-241-0/+4
| | | | ok deraadt@
* Add wcstring attribute support for Wbounded. To be used for wchar.hmartynas2014-01-141-2/+21
| | | | | which operates on element counts rather than buffer sizes. I'll start annotating headers in a few weeks, after the hackathon. OK millert@.
* Add a new option "-fstack-protector-strong" for GCC4. This includesmartynas2014-01-147-11/+99
| | | | | | | | | additional functions to be protected --- those that have local array definitions, or have references to local frame addresses. Note 1: Han explicitly licensed this under GPLv2 for us. Note 2: Do *not* use this anywhere in "src" Makefiles, as the other GCC doesn't have this option yet (but I'm working on it).
* Enable Wbounded by default. Passing bound bigger than the buffermartynas2014-01-131-1/+1
| | | | | | | | | | | size almost always has security implications. I think this quote from Theo summarizes the situation best: Which is why it is important to have at least one unforgiving platform in the ecosystem which properly labels shit shit. That's OpenBSD. If anyone can't handle that, they can go to platforms which hide the reality.
* Prevent GCC from inlining these unsafe builtins: sprintf, vsprintf,martynas2013-12-282-6/+28
| | | | | | stpcpy, strcat, strcpy. Also don't simplify some safe builtins into unsafe ones, otherwise we'll hit the linker with the bogus warning. OK miod@, millert@.
* Revert the previous commit; this is not the right approach.kettenis2013-12-113-5/+17
|
* Stop the madness! Prevent GCC from inlining these unsafe functions:martynas2013-12-113-17/+5
| | | | | sprintf, vsprintf, stpcpy, strcat, strcpy. We're hitting the linker again, therefore the warning will show up now.
* Make gcc call collect2 on powerpc (instead of directly calling ld).jca2013-10-291-3/+0
| | | | | | | Kernel, base and ports seem happy with this change, and there's no reason for collect2 to be less useful on these machines. Offending lines in gcc/config found by Miod, thanks. Let's commit the right file this time. ok kettenis@ miod@ mpi@
* Revert previous, wrong M ...jca2013-10-291-1/+1
|
* Make gcc call collect2 on powerpc (instead of directly calling ld).jca2013-10-291-1/+1
| | | | | | Kernel, base and ports seem happy with this change, and there's no reason for collect2 to be less useful on these machines. Offending lines in gcc/config found by Miod, thanks! ok kettenis@ miod@ mpi@
* don't warn on missing newline at eofjsg2013-08-071-3/+0
| | | | | matches the behaviour of gcc >= 4.3 and clang ok miod@
* Fix attribute((init_priority)) on sparc and sparc64.kettenis2013-07-302-0/+8
|
* Add support for the GCC binary integer constants extension.jsg2013-07-042-3/+44
| | | | | | | From Joerg Wunsch in GCC PR 23479, under the GPLv2. This is required to build the i965 backend with newer versions of mesa. ok kettenis@ espie@ miod@
* add support for %td for ptrdiff_t in kernel printfsf2013-07-031-3/+4
| | | | | | this also adds support in gcc 4.x kprintf format checks ok kettenis@
* Disable a broken optimization in try_combine(); GCC PR #34628.miod2013-06-061-0/+2
| | | | | | | | The PR comes with a real fix, but it is covered by the GPL v3, and is neither trivial nor straightforward, so use a hammer and disable the unreliable code. Verified to fix bogus code generation on macppc.
* classify_integer(): test whether the value can be built using the `set'miod2013-06-041-20/+33
| | | | | | | | | instruction, before testing whether it can be built with `or.u'; this allows further optimization. condition_value(): handle ORDERED and UNORDERED condition codes. print_operand(): remove support for no longer used `w' qualifier.
* Add "length" attribute to "weird" class instructions of small length: usermiod2013-06-041-11/+16
| | | | | | inline assembly, tb/tbnd instructions. Don't use `r' qualifier for "register_operand", it's redundant.
* Replace strcpy() calls with strlcpy() to avoid triggering warnings whenmiod2013-05-181-2/+2
| | | | linking against -lgcov.
* Define WINT_TYPE as well.miod2013-05-091-0/+3
|
* Define LOCAL_ALIGNMENT as well.miod2013-05-091-0/+3
|
* Backport fix for gcc PR target/31152:miod2013-05-081-4/+1
| | | | | * arm.md (negscc): Match the correct operand for optimized LT0 test. Remove optimization for GT.
* A port of the current gcc 3.3.6 m88k backend to gcc 4.2.1.miod2013-05-0810-0/+8409
| | | | | | | | | | | | | | | | | | | | | Main features: - md constraints rewritten in RTL - md predicaties rewritten in RTL - md va_arg switched to gimple - abort() calls replaced with gcc_assert() or gcc_unreachable() for better diagnostics - support for non-ELF systems completely removed Missing: - conversion of the pipeline information from define_function_unit to define_automata not done yet (thus pipeline information currently removed) Known regressions against 3.3.6 so far: - no stack protector support yet - __builtin_setjmp doesn't restore the frame pointer correctly upon return from __builtin_longjmp - at least one case of optimization error when delay slots are not disabled. - libgcc is only built -fPIC, instead of static/fpic/fPIC.
* Add support for "d" floating-point suffix, as defined by draft N1312martynas2013-04-043-3/+24
| | | | | of TR 24732. Emit pedantic warning if the feature is being used. Requested by jasper@; needed by certain ports. OK miod@.
* Sanitize LINK_SPEC for hppa64, making it identical to what we have on amd64kettenis2013-02-031-8/+7
| | | | | | and i386. pointed out by miod@
* Sanitize LINK_SPEC for hppa, making it identical to what we have on amd64 andkettenis2013-02-031-8/+7
| | | | | | i386. ok pascal@, miod@
* Simplify OBSD_LIB_SPEC a bit for gcc3/4.brad2013-01-151-1/+1
| | | | ok miod@
* Remove GLIBC_DYNAMIC_LINKER which is only relevant for Linux.brad2012-12-311-2/+0
| | | | ok miod@
* Bring stack smashing protector for MIPS; enabled by default.martynas2012-12-202-9/+9
| | | | | Reorganize soft frame pointer so that locals are below it and grow downwards. Tested by miod@, jasper@. OK miod@.
* Bring stack smashing protector for Alpha; enabled by default.martynas2012-12-202-1/+4
| | | | | Reorganize soft frame pointer so that locals are below it and grow downwards. Thanks Nick for the access. OK miod@.
* Make the SH register spill failure for R0 workaround work againmartynas2012-12-171-1/+1
| | | | after switching to __guard_local. OK matthew@, miod@.
* Fix c-bounded when arrays are declared without the size expression.martynas2012-12-101-1/+1
| | | | | | The array_size was uninitialized and used to work by accident. Spotted with SSP on MIPS. OK miod@. Tested by jasper@.
* Fix unaligned memory loads on Alpha. GCC used to generate them inmartynas2012-12-101-10/+15
| | | | | | | | | | | | | | the following manner: ([reg:A & -8] << (64 - (((reg:FP+reg:B) & 0x7) << 3))) >> 56 This fails when we're doing loads with the offset from the frame pointer %8. Since it's aligned, optimizer makes it a zero. The correct expression is: ([reg:A & -8] << (56 - (((reg:FP+reg:B-1) & 0x7) << 3))) >> 56 This is actually a 13-year-old bug. Checked by Miod; a few files in the kernel were affected. Spotted with SSP for Alpha. OK miod@. Tested by naddy@.
* Define __PIE__ and __pie__ when compiling PIE code, just like newer versionskettenis2012-10-231-0/+5
| | | | | | of GCC do. ok millert@, guenther@, pascal@, deraadt@