summaryrefslogtreecommitdiff
path: root/gnu/gcc
AgeCommit message (Collapse)Author
2014-07-11make the __cxa_call_terminate() proto match the definitionJonathan Gray
From dt71 at gmx.com via FreeBSD Required to build with recent versions of clang.
2014-07-10Backport support for -Wframe-larger-than=N to base GCCMatthew Dempsky
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
2014-06-23gcc4: emit warning when ignoring alignment constraintsMatthew Dempsky
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
2014-05-06When the stack protector heuristics doesn't cover a function, leaveMartynas Venckus
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!
2014-05-06Introduce -fstack-shuffle, which randomizes local stack variables.Martynas Venckus
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@
2014-05-01x86-64 ABI requires arrays greater than 16 bytes to be aligned toMartynas Venckus
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.
2014-03-30Change the heuristics of -fstack-protector to select to protectMartynas Venckus
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.
2014-03-27remove gets reference. ok espieTed Unangst
2014-01-24Catch SIGPIPE to clean up temp filesPhilip Guenther
ok deraadt@
2014-01-14Add wcstring attribute support for Wbounded. To be used for wchar.hMartynas Venckus
which operates on element counts rather than buffer sizes. I'll start annotating headers in a few weeks, after the hackathon. OK millert@.
2014-01-14Add a new option "-fstack-protector-strong" for GCC4. This includesMartynas Venckus
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).
2014-01-13Enable Wbounded by default. Passing bound bigger than the bufferMartynas Venckus
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.
2013-12-28Prevent GCC from inlining these unsafe builtins: sprintf, vsprintf,Martynas Venckus
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@.
2013-12-11Revert the previous commit; this is not the right approach.Mark Kettenis
2013-12-11Stop the madness! Prevent GCC from inlining these unsafe functions:Martynas Venckus
sprintf, vsprintf, stpcpy, strcat, strcpy. We're hitting the linker again, therefore the warning will show up now.
2013-10-29Make gcc call collect2 on powerpc (instead of directly calling ld).Jeremie Courreges-Anglas
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@
2013-10-29Revert previous, wrong M ...Jeremie Courreges-Anglas
2013-10-29Make gcc call collect2 on powerpc (instead of directly calling ld).Jeremie Courreges-Anglas
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@
2013-08-07don't warn on missing newline at eofJonathan Gray
matches the behaviour of gcc >= 4.3 and clang ok miod@
2013-07-30Fix attribute((init_priority)) on sparc and sparc64.Mark Kettenis
2013-07-04Add support for the GCC binary integer constants extension.Jonathan Gray
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@
2013-07-03add support for %td for ptrdiff_t in kernel printfStefan Fritsch
this also adds support in gcc 4.x kprintf format checks ok kettenis@
2013-06-06Disable a broken optimization in try_combine(); GCC PR #34628.Miod Vallat
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.
2013-06-04classify_integer(): test whether the value can be built using the `set'Miod Vallat
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.
2013-06-04Add "length" attribute to "weird" class instructions of small length: userMiod Vallat
inline assembly, tb/tbnd instructions. Don't use `r' qualifier for "register_operand", it's redundant.
2013-05-18Replace strcpy() calls with strlcpy() to avoid triggering warnings whenMiod Vallat
linking against -lgcov.
2013-05-09Define WINT_TYPE as well.Miod Vallat
2013-05-09Define LOCAL_ALIGNMENT as well.Miod Vallat
2013-05-08Backport fix for gcc PR target/31152:Miod Vallat
* arm.md (negscc): Match the correct operand for optimized LT0 test. Remove optimization for GT.
2013-05-08A port of the current gcc 3.3.6 m88k backend to gcc 4.2.1.Miod Vallat
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.
2013-04-04Add support for "d" floating-point suffix, as defined by draft N1312Martynas Venckus
of TR 24732. Emit pedantic warning if the feature is being used. Requested by jasper@; needed by certain ports. OK miod@.
2013-02-03Sanitize LINK_SPEC for hppa64, making it identical to what we have on amd64Mark Kettenis
and i386. pointed out by miod@
2013-02-03Sanitize LINK_SPEC for hppa, making it identical to what we have on amd64 andMark Kettenis
i386. ok pascal@, miod@
2013-01-15Simplify OBSD_LIB_SPEC a bit for gcc3/4.Brad Smith
ok miod@
2012-12-31Remove GLIBC_DYNAMIC_LINKER which is only relevant for Linux.Brad Smith
ok miod@
2012-12-20Bring stack smashing protector for MIPS; enabled by default.Martynas Venckus
Reorganize soft frame pointer so that locals are below it and grow downwards. Tested by miod@, jasper@. OK miod@.
2012-12-20Bring stack smashing protector for Alpha; enabled by default.Martynas Venckus
Reorganize soft frame pointer so that locals are below it and grow downwards. Thanks Nick for the access. OK miod@.
2012-12-17Make the SH register spill failure for R0 workaround work againMartynas Venckus
after switching to __guard_local. OK matthew@, miod@.
2012-12-10Fix c-bounded when arrays are declared without the size expression.Martynas Venckus
The array_size was uninitialized and used to work by accident. Spotted with SSP on MIPS. OK miod@. Tested by jasper@.
2012-12-10Fix unaligned memory loads on Alpha. GCC used to generate them inMartynas Venckus
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@.
2012-10-23Define __PIE__ and __pie__ when compiling PIE code, just like newer versionsMark Kettenis
of GCC do. ok millert@, guenther@, pascal@, deraadt@
2012-10-06Our system headers are supposed to be C++-aware these days so stop GCC fromMark Kettenis
wrapping them with an implicit extern "C" since that breaks the webkit port. Help from matthew@ and landry@. ok landry@
2012-09-01Bounds check before addressing call_used_regs[], avoids segfaults inMiod Vallat
fixup_match_2() on landisk building mysql; gcc PR #28467 help and prodding jsg@, ok kettenis@
2012-08-31Apply to sparc the same change as to sparc64: Pass -K PIC to the assembler whenPascal Stumpf
we're default PIE. allows Theo to build PIE-by-default sparc; ok kettenis@
2012-08-31Switch GCC to use __guard_local instead of __guard. This allows GCCMatthew Dempsky
to emit -fstack-protector code that doesn't need GOT indirection for accessing __guard. Tested on amd64, i386, sparc64, hppa, loongson, and sgi (thanks lteo, djm, sthen, todd, naddy, kettenis, phessler, jasper, and anyone else that I'm missing who tested).
2012-08-31Use OBSD_LIB_SPEC and OBSD_CPP_SPEC instead of rolling our own. MeansMark Kettenis
powerpc now gets the right behaviour for -pthread as well. ok pascal@, krw@, millert@
2012-08-30On sparc64, we still need to pass -K PIC to the assembler when compiling PIE.Pascal Stumpf
Found out the hard way by deraadt@. ok kettenis@
2012-08-29Our _mcount doesn't use profile counters. Partially fixes profiling on hppaMark Kettenis
(things link now).
2012-08-28Add support for PIE-by-default in both ld and gcc. This is a completelyPascal Stumpf
different approach than the one taken in kurt@'s original diff, but deemed better after discussion and diff exchange with kettenis@ and matthew@. Lots of feedback by kettenis@ and matthew@, prodding and encouragement by deraadt@. ok kettenis@ matthew@
2012-08-24Back out the bit that links all shared libraries against -lc from the previousMark Kettenis
commit. It breaks make build on arm and generally causes more grief than the the (small) benefit it is supposed to bring. ok matthew@