summaryrefslogtreecommitdiffstats
path: root/gnu/gcc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change the default gcc arm arch target from strongarm (armv4) tojsg2016-03-241-2/+2
| | | | | | | | | arm9e (armv5te w/o xscale extensions). We no longer support anything less than armv5te and this allows some additional instructions. -mthumb-interwork remains off by default. ok patrick@
* In emit_insxl() force the first operand of the insbl or inswl patternjsg2016-02-281-0/+2
| | | | | | | | | into a register. Fixes an ICE when building Mesa with __sync builtins. From Roger Sayle in gcc svn rev 121779 in Feb 2007 before the license change. Tested by miod and matthieu.
* In alpha_expand_block_clear(), cope with the offset being negative;deraadt2016-02-211-3/+3
| | | | | | | this can happen due to the frame layout change introduced in order to support the stack protector. Fix from miod. Bug originally observed by jca and condensed to a 3-liner by myself, basically local [] arrays being initialized with shorter strings.
* fix typommcc2016-01-141-1/+1
| | | | from Jan Schreiber, ok deraadt@
* Fix branch delay slots. Found while making test builds of ports.visa2015-12-261-7/+7
|
* Add library-based __sync functions for mips64.visa2015-12-181-0/+316
| | | | Help with testing and ok kettenis@
* Implement a memory barrier for mips. Basically this makes __sync_synchronize()kettenis2015-12-171-0/+16
| | | | | | emit a "sync" instruction. ok visa@
* Fix __sync_val_compare_and_swap_8() on i386 for code compiled with -fPIC.kettenis2015-12-013-2/+34
| | | | | | | | | | | | In some cases GCC would generate a cmpxchg8b instruction with a memory reference that used %ebx. This is wrong (and will almost certainly result in SIGSEGV). This fix uses a new memory constraint "W" to prevent the use of %ebx in this case. This differs from the approach taken by upstream so there are no GPLv3 issues here. Fixes the Mesa i965 dri module on i386. ok jsg@
* pledge 'stdio rpath wpath cpath", since that is all large program does.deraadt2015-11-141-0/+3
| | | | | | NOTE: cc1 uses brk/sbrk, which was only enabled in pledge a few hours ago. So this requires a fairly new kernel if compiling monster c++ programs..
* Both gcc & collect2 can pledge "stdio rpath wpath cpath proc exec".deraadt2015-11-132-0/+10
| | | | | | (cc1 "toplev.c" uses brk/sbrk, so it is on hold to figure out the right direction...) ok semarie pascal
* update NAME;jmc2015-11-111-1/+1
| | | | kettenis ok'd me poking around in here; ingo ok'd the diff
* Correct handling of enum attributes with g++jsg2015-10-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc and g++ can currently have different ideas on the size of a packed enum type: enum __attribute__((packed)) foo { a = 0, b}; gcc: 1 g++: 4 enum foo { a = 0, b} __attribute__((packed)); gcc: 1 g++: 1 The first format is actually the preferred one according to the documentation. https://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Type-Attributes.html g++ will accept the first format and silently not actually choose a smaller size. This was responsible for memory corruption with recent versions of Mesa where c and c++ code share a header with a packed enum type. The problem was reported in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39219 and fixed in gcc >= 4.3.6 in rev 144284. This was after the switch from gplv2 but it's a trivial one line change. ok guenther@ deraadt@ kettenis@
* Make the famous _S_debug_messages warning go away, by hidining that symbol.zhuk2015-09-151-1/+1
| | | | | | | | | | This symbol isn't used anywhere outside libstdc++, thus no bump. Upstream initially went the samy way, but then implemented a different fix, which don't work for us. Eventually we should move to whitelisting the list of symbols exported anyway. okay miod@, no objections from sthen@; also supported by a few a while ago
* Makde gcc handle __stack_smash_handler similarly to memcpy and memset whenguenther2015-09-105-39/+71
| | | | | | | | creating calls: cache the RTL, let a declaration alter the asm spec, and set the same RTL attributes. For all three, let a declaration set the ELF visibility. ok miod@
* Implement support for __builtin_complex() to construct complex values,martynas2015-07-272-1/+41
| | | | | required by the upcoming libm work. OK miod@.
* Add the documentation of -Wbounded and attribute(bounded) from gcc-local(1)miod2015-07-191-3/+64
| | | | to the gcc info documentation as well.
* Link static pie binaries against rcrt0.omiod2015-07-031-2/+3
|
* Fix stack shuffle such that sj includes si and the last element actuallymartynas2015-06-181-1/+1
| | | | gets a chance to be reordered.
* Don't error out when an existing typedef is redefined with the same definition;miod2015-06-151-3/+11
| | | | | | | this is allowed in C11 and 3rd-party software is relying upon this to be accepted by the compiler. Nevertheless warn about this if -pedantic. ok ajacoutot@ deraadt@ millert@
* Actually commit the bits that make the compiler emit visibility informationkettenis2015-06-032-0/+3
| | | | for (undefined) references with non-default visibility on mips64.
* Make the compiler emit visibility information for (undefined) references withkettenis2015-05-188-113/+66
| | | | | | | | | | | | | non-default visibility. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218 for details. This version comes from FreeBSD and has been made available under the GPLv2 license. It has some additional bits thrown in from me to make it work in mips64 too, and another bit to stop the C++ compiler to randomly emit visibility information for C++ symbols that in the end aren't referenced. ok guenther@
* Change gcc and ld semantics to make static PIE the default when invokingpascal2015-04-028-14/+15
| | | | | | | | 'cc -static'. To explicitly request the legacy behaviour, use -nopie. For the few port affected by this, bumps will follow shortly. looks good to kettenis@, ok kurt@
* self-relocating crt0 bits for sh, and enable static pie by default. With somemiod2014-12-301-1/+2
| | | | archdep.h help from kettenis@
* Link -static -pie executables with rcrt0.o instead of crt0.o such that theykettenis2014-12-271-1/+2
| | | | self-relocate.
* 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
|