Re: [PING][PATCH][1-3] New configure options that make the compiler use -fPIE and -pie as default option
On 31/12/14 07:23, Magnus Granberg wrote: > fredag 14 november 2014 23.31.48 skrev Magnus Granberg: >> måndag 10 november 2014 21.26.39 skrev Magnus Granberg: Rainer >>> >>> Thanks Rainer for the nits and comments. >>> Have updated the patches and Changelogs. >>> But i still use PIE_DRIVER_SELF_SPECS, do you have a ide where move it so >>> i don't need to duplicate that stuff or how to do it? >>> >>> Magnus G >>> >>> 2014-11-10 Magnus Granberg >>> >>> /gcc >>> * config/gnu-user.h (PIE_DRIVER_SELF_SPECS) and >>> (GNU_DRIVER_SELF_SPECS): Define. >>> * config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Define >>> * configure.ac: Add new option. >>> * configure, config.in: Rebuild. >>> * Makefile.in (ALL_CFLAGS) and (ALL_CXXFLAGS): Disable PIE. >>> * doc/install.texi: New configure option. >>> * doc/invoke.texi: Add note to PIE. >>> * doc/sourcebuild.texi: New effective target. >>> gcc/testsuite >>> * gcc/default-pie.c: New test >>> * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Skip if default_pie >>> * g++.dg/other/anon5.C: Skip if default_pie >>> * lib/target-supports.exp (check_effective_target_default_pie): >>> New proc. >>> /libgcc >>> * Makefile.in (CRTSTUFF_CFLAGS): Disable PIE. >> >> Can this be included for GCC 5 ? >> >> /Magnus G. > One more ping on this. The patches where sent before stage 1 closed but i > did't get any feed back from it > Have updete the patchses for gcc 5.0 20141228 snapshot. > Bootstrapped and tested on x86_64-unknown-linux-gnu (Gentoo) > /Magnus > I'm giving this a further ping as my distribution has interest in these patches. Thanks! > 2014-12-30 Magnus Granberg > > /gcc > * config/gnu-user.h (PIE_DRIVER_SELF_SPECS): Define. > * config/i386/gnu-user-common.h (DRIVER_SELF_SPECS): Define and > add PIE_DRIVER_SELF_SPECS. > * configure.ac: Add new option. > * configure, config.in: Rebuild. > * Makefile.in (ALL_CFLAGS) and (ALL_CXXFLAGS): Disable PIE. > * doc/install.texi: New configure option. > * doc/invoke.texi: Add note to PIE. > * doc/sourcebuild.texi: New effective target. > gcc/testsuite > * gcc/default-pie.c: New test > * gcc.dg/tree-ssa/ssa-store-ccp-3.c: Skip if default_pie > * g++.dg/other/anon5.C: Skip if default_pie > * lib/target-supports.exp (check_effective_target_default_pie): > New proc. > /libgcc > * Makefile.in (CRTSTUFF_CFLAGS): Disable PIE. >
[PATCH] testsuite/70230 - fix failures with default SSP
Configuring with --enable-default-ssp triggers various testsuite failures. These contain asm statements that are not compatible with -fstack-protector. Adding -fno-stack-protector to dg-options to work around this issue. Tested on x86_64-linux. 2022-01-26 Allan McRae PR testsuite/70230 * gcc.dg/asan/use-after-scope-4.c (dg-options): Add -fno-stack-protector. * gcc.dg/stack-usage-1.c: Likewise * gcc.dg/superblock.c: Likewise * gcc.target/i386/avx-vzeroupper-17.c: Likewise * gcc.target/i386/cleanup-1.c: Likewise * gcc.target/i386/cleanup-2.c: Likewise * gcc.target/i386/interrupt-redzone-1.c: Likewise * gcc.target/i386/interrupt-redzone-2.c: Likewise * gcc.target/i386/pr79793-1.c: Likewise * gcc.target/i386/pr79793-2.c: Likewise * gcc.target/i386/shrink_wrap_1.c: Likewise * gcc.target/i386/stack-check-11.c: Likewise * gcc.target/i386/stack-check-18.c: Likewise * gcc.target/i386/stack-check-19.c: Likewise * gcc.target/i386/stackalign/pr88483-1.c: Likewise * gcc.target/i386/stackalign/pr88483-2.c: Likewise * gcc.target/i386/sw-1.c: Likewise --- gcc/testsuite/gcc.dg/asan/use-after-scope-4.c| 1 + gcc/testsuite/gcc.dg/stack-usage-1.c | 2 +- gcc/testsuite/gcc.dg/superblock.c| 2 +- gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c| 2 +- gcc/testsuite/gcc.target/i386/cleanup-1.c| 2 +- gcc/testsuite/gcc.target/i386/cleanup-2.c| 2 +- gcc/testsuite/gcc.target/i386/interrupt-redzone-1.c | 2 +- gcc/testsuite/gcc.target/i386/interrupt-redzone-2.c | 2 +- gcc/testsuite/gcc.target/i386/pr79793-1.c| 2 +- gcc/testsuite/gcc.target/i386/pr79793-2.c| 2 +- gcc/testsuite/gcc.target/i386/shrink_wrap_1.c| 2 +- gcc/testsuite/gcc.target/i386/stack-check-11.c | 2 +- gcc/testsuite/gcc.target/i386/stack-check-18.c | 2 +- gcc/testsuite/gcc.target/i386/stack-check-19.c | 2 +- gcc/testsuite/gcc.target/i386/stackalign/pr88483-1.c | 2 +- gcc/testsuite/gcc.target/i386/stackalign/pr88483-2.c | 2 +- gcc/testsuite/gcc.target/i386/sw-1.c | 2 +- 17 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gcc/testsuite/gcc.dg/asan/use-after-scope-4.c b/gcc/testsuite/gcc.dg/asan/use-after-scope-4.c index 44dc79535d2..e1486e75045 100644 --- a/gcc/testsuite/gcc.dg/asan/use-after-scope-4.c +++ b/gcc/testsuite/gcc.dg/asan/use-after-scope-4.c @@ -1,4 +1,5 @@ // { dg-do run } +/* { dg-options "-fno-stack-protector" } */ #define FN(NAME) \ NAME (void) \ diff --git a/gcc/testsuite/gcc.dg/stack-usage-1.c b/gcc/testsuite/gcc.dg/stack-usage-1.c index 93cfe7c0163..1d7d1fee435 100644 --- a/gcc/testsuite/gcc.dg/stack-usage-1.c +++ b/gcc/testsuite/gcc.dg/stack-usage-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-fstack-usage" } */ +/* { dg-options "-fstack-usage -fno-stack-protector" } */ /* nvptx doesn't have a reg allocator, and hence no stack usage data. */ /* { dg-skip-if "" { nvptx-*-* } } */ diff --git a/gcc/testsuite/gcc.dg/superblock.c b/gcc/testsuite/gcc.dg/superblock.c index 2b2fa9e154f..6b4419adaf5 100644 --- a/gcc/testsuite/gcc.dg/superblock.c +++ b/gcc/testsuite/gcc.dg/superblock.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fno-asynchronous-unwind-tables -fsched2-use-superblocks -fdump-rtl-sched2 -fdump-rtl-bbro" } */ +/* { dg-options "-O2 -fno-asynchronous-unwind-tables -fsched2-use-superblocks -fdump-rtl-sched2 -fdump-rtl-bbro -fno-stack-protector" } */ /* { dg-require-effective-target scheduling } */ typedef int aligned __attribute__ ((aligned (64))); diff --git a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c index 6dc0dc05321..d677e6f10e0 100644 --- a/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c +++ b/gcc/testsuite/gcc.target/i386/avx-vzeroupper-17.c @@ -1,5 +1,5 @@ /* { dg-do compile { target lp64 } } */ -/* { dg-options "-O2 -mavx -mabi=ms -dp" } */ +/* { dg-options "-O2 -mavx -mabi=ms -dp -fno-stack-protector" } */ typedef float __m256 __attribute__ ((__vector_size__ (32), __may_alias__)); diff --git a/gcc/testsuite/gcc.target/i386/cleanup-1.c b/gcc/testsuite/gcc.target/i386/cleanup-1.c index dcfcc4edb5f..6e7544c6b7a 100644 --- a/gcc/testsuite/gcc.target/i386/cleanup-1.c +++ b/gcc/testsuite/gcc.target/i386/cleanup-1.c @@ -1,5 +1,5 @@ /* { dg-do run { target *-*-linux* *-*-gnu* } } */ -/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2" } */ +/* { dg-options "-fexceptions -fnon-call-exceptions -fasynchronous-unwind-tables -O2 -fno-stack-protector" } */ /* Test complex CFA value expressions. */ #include diff --git a/gcc/testsuite/gcc.target/i386/cleanup-2
Re: [PATCH] configure: add --disable-fix-includes
On 5/2/22 01:22, Martin Liška wrote: On 2/4/22 14:30, Jakub Jelinek via Gcc-patches wrote: We don't ship any include-fixed headers in Fedora/RHEL. Removing include-fixed from an installed folder, I see: make[2]: Entering directory '/home/marxin/Programming/postgres/src/common' gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O3 -march=native -flto=auto -DFRONTEND -I. -I../../src/common -I../../src/include -D_GNU_SOURCE -DVAL_CC="\"gcc\"" -DVAL_CPPFLAGS="\"-D_GNU_SOURCE\"" -DVAL_CFLAGS="\"-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O3 -march=native -flto=auto\"" -DVAL_CFLAGS_SL="\"-fPIC\"" -DVAL_LDFLAGS="\"-O3 -march=native -flto=auto -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql/lib64',--enable-new-dtags\"" -DVAL_LDFLAGS_EX="\"\"" -DVAL_LDFLAGS_SL="\"\"" -DVAL_LIBS="\"-lpgcommon -lpgport -lz -lreadline -lm \"" -c -o pg_lzcompress.o pg_lzcompress.c In file included from pg_lzcompress.c:186: /usr/include/limits.h:124:26: error: no include path in which to search for limits.h 124 | # include_next | ^ pg_lzcompress.c:226:9: error: ‘INT_MAX’ undeclared here (not in a function) 226 | INT_MAX, /* No upper limit on what we'll try to | ^~~ pg_lzcompress.c:189:1: note: ‘INT_MAX’ is defined in header ‘’; did you forget to ‘#include ’? 188 | #include "common/pg_lzcompress.h" +++ |+#include How do you solve this in Fedora/RHEL? The Fedora gcc.spec file has this: mv $FULLPATH/include-fixed/syslimits.h $FULLPATH/include/syslimits.h mv $FULLPATH/include-fixed/limits.h $FULLPATH/include/limits.h My understanding are these are not real fixinclude processed headers. Allan