summaryrefslogtreecommitdiffstats
path: root/gnu/gcc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* a regular function decl collides with an inline, due to C99 inline rules.deraadt2021-02-011-1/+2
| | | | | | | We are never updating this sub-tree. Knock out the collision in the simplest way. diff from mortimer. This is the last change required for -fno-common on all architectures, thanks to mortimer for starting the effort and encouraging others.
* Don't pass the -dynamic-linker flag to ld when linking statically.millert2020-09-2311-11/+11
| | | | | Fixes creation of static binaries with base gcc and ld.lld. OK kettenis@ a while ago, prodded by daniel@
* base tree had only two uses of the printf %n format string, in this file.deraadt2020-07-101-2/+2
| | | | | | | | | Appending "%n" to the format string to capture the output-length in bytes (into an uninitialized variable) is exactly the same as using the printf return value. Why did they do this so unnaturally? (normally we don't change gcc import code, but I'm doing a study of %n prevelance) ok millert
* mortimer unlinked libobjc from the build, but didn't know how to cvs rm.tedu2019-04-0358-23868/+0
| | | | | I don't know much about compilers, but what I do have are a very particular set of skills. Skills I have acquired over a very long career.
* Pass -L/usr/lib to the linker in preparation for switching to lld, whichnaddy2018-09-142-2/+4
| | | | does not have a default search path. ok kettenis@ jsg@
* inform that diagnostics in functions won't work, but don't error outespie2018-07-201-1/+1
| | | | | | | | | | | flatly. this will help sparc64 compile code without needing to patch away recent pragma diagnostic use. problem found by landry@ okay kettenis@, guenther@
* Explicitly pass -L/usr/lib to the linker. Needed for switching to lld(1)kettenis2018-07-081-1/+2
| | | | | | as the default linker on armv7. ok espie@
* Add ARM EABI aliases and remove functions that are also provided by our libc.kettenis2018-01-043-0/+43
| | | | | | | | | This allows linking code compiled by clang with the gcc compiler driver and makes sure we always use the softfloat implementation in libc. The libc softfloat implementation is preferred over the one in libgcc as it implements rounding modes and floating point exceptions. ok patrick@
* Fix the __sync_* functions to make them work properlyvisa2017-08-201-1/+22
| | | | as full memory barriers.
* Make gcc accept -Oz as an alias for -Os for compatibility with clang.kettenis2017-07-241-1/+1
| | | | | | | | | | With clang -Os doesn't generate the smallest code possible but some middle ground between optimization for speed and optimization for size. A new -Oz option was introduced for optmization for size only. We need that for our floppies, otherwise they overflow. Making gcc accept -Oz too makes our life easier. ok millert@, deraadt@, robert@
* Make gcc move switch tables into .rodata instead of .text on i386/amd64stefan2017-05-311-1/+1
| | | | | | | | | | | | For C++, gcc has to make use of comdat sections instead of .gnu.linkonce sections for this because switch tables and functions would now end up in different .gnu.linkonce sections. This can cause ld to sometimes incorrectly discard the switch tables, which causes linker errors. With comdat sections, making the switch table and function sections belong together is more reliable. ok deraadt@
* gcc 4.9 makes unknown -Wno-* vanish.espie2017-05-083-2/+26
| | | | | | | | | | | | Reimplement that from scratch in our ancient gcc, because it's really useful for porting newer code and dealing with compiler variations. (slightly tweaked to reset location to unknown location after the okays) okay kettenis@ jasper@ found out https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28322 after the patch, which explains a similar reasoning better, and leads to another patch for older GCC, possibly GPLv3.
* add support for -msave-args in gcc on amd64dlg2017-04-275-12/+121
| | | | | | | | | | | | | | | | | i got sick of not having arguments in ddb stack traces on amd64, which is because amd64 passes arguments in registers, and it's impossible to figure out where they go without dwarf info, and when you have dwarf info it is complicated. solaris has a simple solution for this. they tweaked their compilers to accept an -msave-args option which makes functions store their arguments on the stack, while maintaining compatability with the System V AMD64 ABI. tools (eg, ddb) can then look at the stack to get access to function arguments in traces. this ports their changes to gcc 3 to our gcc. ok deraadt@
* fix format stringchl2017-02-011-1/+1
| | | | ok krw@
* Prevent too much reordering in the instruction prologue, in order to fulfillmiod2017-01-242-150/+22
| | | | | | the expectations of the DWARF code... and in order to get correct information. Tested by aoyama@
* Revert the addition of PROMOTE_MODE. This breaks libobjc; I guess themiod2017-01-081-10/+0
| | | | true reason of objc still being in-tree is to expose compiler issues.
* Switch the arm default config from arm9e (armv5te) to mpcore (armv6k).jsg2017-01-011-2/+2
| | | | | | | | | | | | The same change was made in ports gcc 4.9 already. This is is most recent arm architecture version base gcc has support for. This changes builtin defines from __ARM_ARCH_5TE__ to __ARM_ARCH_6K__. These defines are often used to select between inline assembly paths. Note that base gcc still lacks support for atomic builtins available in ports gcc and clang however. ok patrick@ kettenis@
* Prevent scheduling from interfering with the epilogue instructions, as soonmiod2016-12-302-2/+29
| | | | | | | | | as any of the stack or frame pointers are modified. Allow narrower-than-register types to be kept in registers in wider modes, as was the case with gcc 3. This now seems to produce reliable code with -O1. -O2 is not safe yet.
* Convert the gcc 3 scheduling information to the gcc 4 model.miod2016-12-191-1/+165
|
* Don't warn about shadowing a global function unless the localguenther2016-10-191-2/+14
| | | | | | variable or parameter is a pointer to a function. ok kettenis@
* Use rcrt0.o instead of crt0.o for -static -pie executables.kettenis2016-09-081-29/+7
| | | | ok guenther@, jsg@
* Implement exception handling for ARM EABI. Cobbled together from bits ofkettenis2016-09-011-8/+124
| | | | | | libsupc++. Passes the (limited) tests in the gcc 4.2.1 testsuite. ok patrick@, tom@
* Switch OpenBSD/armv7 to ARM EABI (soft-float). This is a complete ABIpatrick2016-09-013-9/+37
| | | | | | break which cannot be easily crossed. ok kettenis@ jsg@
* Fix internal compiler error with long long arithmeticdcoppa2016-06-024-37/+71
| | | | | | | | | | | | Adapted from a change to mainline gcc while it was still GPLv2. Original diff found by stefan@ Adaptation by me ICE caught by ml(at)extensibl(dot)com while he was porting MLton to OpenBSD. Ok stefan@ "Go for it" deraadt@
* Add support for named initializers for anonymous structs/unions. This is akettenis2016-05-051-1/+22
| | | | | | | | | C11 feature that is starting to get used in places such as Mesa. This implementation takes a different approach to upstream and is therefore not covered by GPLv3. ok stefan@, jsg@
* Fix optimization for alphas without the ``precise arithmetic trap'' extensionafresh12016-03-301-3/+15
| | | | | | From Miod Vallat I trust miod deraadt@
* 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.