summaryrefslogtreecommitdiff
path: root/gnu/gcc
AgeCommit message (Collapse)Author
2023-02-24disable jump tables by default on sparc64, in prep for xonly by defaultTheo de Raadt
ok miod
2023-01-18Adjust how gcc4 handles the "missing braces around initializer" warning.Claudio Jeker
In c99 any value can be initalised using a { 0 } constructor independent of the type. Now if a struct's first member is another struct then gcc4 issues the above warning but it should not do that. Move the warning check from push_init_level() to pop_init_level() and check if either { 0 } or { } was used. If additional implicit braces were added surpress the warning. Inspired by gcc PR#64709 OK deraadt@ miod@
2023-01-10like hppa, sparc64 will need gcc's jump tables option disabled toTheo de Raadt
allow execute-only binaries ok miod
2023-01-10disable jump tables by default on hppa because they are incompatibleTheo de Raadt
with --execute-only in the linker ok kettenis
2023-01-10create infrastructure so that jump tables on/off can be tweaked by anTheo de Raadt
architecture by changing JUMP_TABLES_DEFAULT ok kettenis
2023-01-09Change the __canonicalize_funcptr_for_compare() implementation to stopMark Kettenis
trying to read a branch instruction and decode it to extract the address of the ld.so resolver function. Instead, directly execute that branch instruction. This is effectively a C runtime ABI change. In order to cross this if you are building from source, make sure you install an updated ld.so first. ok deraadt@
2022-07-27Force disabling the use of delay slots. This is ugly but gets the compilerMiod Vallat
to produce 99+% correct code at all optimization levels, and can help people who would like to tinker a bit with the backend. (note m88k ports still use gcc 3 at the moment)
2021-06-28Fix base-gcc -Wno-error=uninitializedJeremie Courreges-Anglas
base-gcc always errored out when -Werror was passed and -Wuninitialized triggered, even when -Wno-error=uninitialized was passed. Deemed correct by Miod
2021-02-01a regular function decl collides with an inline, due to C99 inline rules.Theo de Raadt
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.
2020-09-23Don't pass the -dynamic-linker flag to ld when linking statically.Todd C. Miller
Fixes creation of static binaries with base gcc and ld.lld. OK kettenis@ a while ago, prodded by daniel@
2020-07-10base tree had only two uses of the printf %n format string, in this file.Theo de Raadt
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
2019-04-03mortimer unlinked libobjc from the build, but didn't know how to cvs rm.Ted Unangst
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.
2018-09-14Pass -L/usr/lib to the linker in preparation for switching to lld, whichChristian Weisgerber
does not have a default search path. ok kettenis@ jsg@
2018-07-20inform that diagnostics in functions won't work, but don't error outMarc Espie
flatly. this will help sparc64 compile code without needing to patch away recent pragma diagnostic use. problem found by landry@ okay kettenis@, guenther@
2018-07-08Explicitly pass -L/usr/lib to the linker. Needed for switching to lld(1)Mark Kettenis
as the default linker on armv7. ok espie@
2018-01-04Add ARM EABI aliases and remove functions that are also provided by our libc.Mark Kettenis
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@
2017-08-20Fix the __sync_* functions to make them work properlyVisa Hankala
as full memory barriers.
2017-07-24Make gcc accept -Oz as an alias for -Os for compatibility with clang.Mark Kettenis
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@
2017-05-31Make gcc move switch tables into .rodata instead of .text on i386/amd64Stefan Kempf
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@
2017-05-08gcc 4.9 makes unknown -Wno-* vanish.Marc Espie
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.
2017-04-27add support for -msave-args in gcc on amd64David Gwynne
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@
2017-02-01fix format stringCharles Longeau
ok krw@
2017-01-24Prevent too much reordering in the instruction prologue, in order to fulfillMiod Vallat
the expectations of the DWARF code... and in order to get correct information. Tested by aoyama@
2017-01-08Revert the addition of PROMOTE_MODE. This breaks libobjc; I guess theMiod Vallat
true reason of objc still being in-tree is to expose compiler issues.
2017-01-01Switch the arm default config from arm9e (armv5te) to mpcore (armv6k).Jonathan Gray
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@
2016-12-30Prevent scheduling from interfering with the epilogue instructions, as soonMiod Vallat
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.
2016-12-19Convert the gcc 3 scheduling information to the gcc 4 model.Miod Vallat
2016-10-19Don't warn about shadowing a global function unless the localPhilip Guenther
variable or parameter is a pointer to a function. ok kettenis@
2016-09-08Use rcrt0.o instead of crt0.o for -static -pie executables.Mark Kettenis
ok guenther@, jsg@
2016-09-01Implement exception handling for ARM EABI. Cobbled together from bits ofMark Kettenis
libsupc++. Passes the (limited) tests in the gcc 4.2.1 testsuite. ok patrick@, tom@
2016-09-01Switch OpenBSD/armv7 to ARM EABI (soft-float). This is a complete ABIPatrick Wildt
break which cannot be easily crossed. ok kettenis@ jsg@
2016-06-02Fix internal compiler error with long long arithmeticDavid Coppa
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@
2016-05-05Add support for named initializers for anonymous structs/unions. This is aMark Kettenis
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@
2016-03-30Fix optimization for alphas without the ``precise arithmetic trap'' extensionAndrew Fresh
From Miod Vallat I trust miod deraadt@
2016-03-24Change the default gcc arm arch target from strongarm (armv4) toJonathan Gray
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@
2016-02-28In emit_insxl() force the first operand of the insbl or inswl patternJonathan Gray
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.
2016-02-21In alpha_expand_block_clear(), cope with the offset being negative;Theo de Raadt
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.
2016-01-14fix typommcc
from Jan Schreiber, ok deraadt@
2015-12-26Fix branch delay slots. Found while making test builds of ports.Visa Hankala
2015-12-18Add library-based __sync functions for mips64.Visa Hankala
Help with testing and ok kettenis@
2015-12-17Implement a memory barrier for mips. Basically this makes __sync_synchronize()Mark Kettenis
emit a "sync" instruction. ok visa@
2015-12-01Fix __sync_val_compare_and_swap_8() on i386 for code compiled with -fPIC.Mark Kettenis
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@
2015-11-14pledge 'stdio rpath wpath cpath", since that is all large program does.Theo de Raadt
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..
2015-11-13Both gcc & collect2 can pledge "stdio rpath wpath cpath proc exec".Theo de Raadt
(cc1 "toplev.c" uses brk/sbrk, so it is on hold to figure out the right direction...) ok semarie pascal
2015-11-11update NAME;Jason McIntyre
kettenis ok'd me poking around in here; ingo ok'd the diff
2015-10-07Correct handling of enum attributes with g++Jonathan Gray
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@
2015-09-15Make the famous _S_debug_messages warning go away, by hidining that symbol.Vadim Zhukov
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
2015-09-10Makde gcc handle __stack_smash_handler similarly to memcpy and memset whenPhilip Guenther
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@
2015-07-27Implement support for __builtin_complex() to construct complex values,Martynas Venckus
required by the upcoming libm work. OK miod@.
2015-07-19Add the documentation of -Wbounded and attribute(bounded) from gcc-local(1)Miod Vallat
to the gcc info documentation as well.