From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Magnus Granberg <zorry@gentoo.org>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][1-3] New configure options that make the compiler use -fPIE and -pie as default option
Date: Fri, 01 Aug 2014 08:52:00 -0000 [thread overview]
Message-ID: <yddlhr8lhh0.fsf@lokon.CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <4827012.p4mTkPPu1h@laptop1.gw.ume.nu> (Magnus Granberg's message of "Thu, 31 Jul 2014 22:06:40 +0200")
Hi Magnus,
a couple of comments, mostly nits.
> 2014-07-31 Magnus Granberg <zorry@gentoo.org>
>
> /gcc
> * config/gnu-user.h: Define PIE_DRIVER_SELF_SPECS for PIE
> as default and GNU_DRIVER_SELF_SPECS.
> * config/i386/gnu-user-common.h: Define DRIVER_SELF_SPECS
> * configure.ac: Add new option that enable PIE as default.
> * configure, config.in: Rebuild.
> * Makefile.in: Disable PIE when building the compiler.
> * doc/install.texi: Add the new configure option default PIE.
> * doc/invoke.texi: Add note for the new configure option default PIE.
Many of those entries are mis-formatted. See other examples and the GNU
Coding Standards for details. E.g. the first would be
* config/gnu-user.h (PIE_DRIVER_SELF_SPECS): Define.
In general, you need to mention which macro, variable, manual section
you change. Emacs' add-change-log-entry does the basics for you.
Besides, you only state what changed, not why.
Apart from that, I don't think defining PIE_DRIVER_SELF_SPECS in
gnu-user.h is a good idea. This way, every other target supporting the
option would have to duplicate that stuff.
* testsuite/gcc/default-pie.c: New test for new configure option
--enale-default-pie
gcc/testsuite has its own ChangeLog file. Typo for --enale-...
* testsuite/gcc.dg/other/anon5.C: Add skip test as it fail to link
on effective_target default_pie.
should be
* g++.dg/other/anon5.C: Skip if default_pie.
No explanations in ChangeLog entries; they belong into the code.
Besides, you had the first dir component wrong. Again, Emacs does this
for you.
* testsuite/lib/target-supports.exp (check_profiling_available):
We can't use profiling on effective target default_pie.
(check_effective_target_pie): Add check_effective_target_default_pie.
Wrong: should be
* lib/target-supports.exp (check_effective_target_default_pie):
New proc.
The new default_pic effective-target keyword needs to be documented in
doc/sourcebuild.texi.
--- a/gcc/testsuite/gcc.dg/default-pie.c 2013-11-09 21:07:16.741479728 +0100
+++ b/gcc/testsuite/gcc.dg/default-pie.c 2013-11-09 21:05:07.801479218 +0100
@@ -0,0 +1,12 @@
+/* { dg-do compile { target *-*-linux* *-*-gnu* } } */
+/* { dg-require-effective-target default_pie } */
Why restrict to Linux, GNU? default_pie should be enough once other
targets add this.
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c 2012-03-14 17:33:37.000000000 +0100
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-store-ccp-3.c 2014-07-29 00:55:17.421086416 +0200
@@ -2,6 +2,9 @@
/* Skipped on MIPS GNU/Linux target because __PIC__ can be
defined for executables as well as shared libraries. */
/* { dg-skip-if "" { *-*-darwin* hppa*64*-*-* mips*-*-linux* *-*-mingw* } { "*" } { "" } } */
+/* Skipped on default_pie targets because __PIC__ is
+ defined for executables. */
+/* { dg-skip-if "" { default_pie } { "*" } { "" } } */
Emit those default args, they're unnecessary. Also in g++.dg/other/anon5.C.
--- a/gcc/testsuite/g++.dg/other/anon5.C 2012-11-10 15:34:42.000000000 +0100
+++ b/gcc/testsuite/g++.dg/other/anon5.C 2013-11-09 14:49:52.281390127 +0100
@@ -1,5 +1,6 @@
// PR c++/34094
// { dg-do link { target { ! { *-*-darwin* *-*-hpux* *-*-solaris2.* } } } }
+// { dg-skip-if "" { default_pie } { "*" } { "" } }
The first arg to dg-skip-if should explain why you're skipping the test.
--- a/gcc/testsuite/lib/target-supports.exp 2013-10-01 11:18:30.000000000 +0200
+++ b/gcc/testsuite/lib/target-supports.exp 2013-10-25 22:01:46.743388469 +0200
@@ -474,6 +474,11 @@ proc check_profiling_available { test_wh
}
}
+ # Profiling don't work with default -fPIE -pie.
Grammar: "doesn't work".
+# Return 1 if -pie, -fPIE are default enable, 0 otherwise.
+
+proc check_effective_target_default_pie { } {
Hard to understand, perhaps
# Return 1 if -pie -fPIE are enabled by default, 0 otherwise.
--- a/gcc/doc/invoke.texi 2013-10-03 19:13:50.000000000 +0200
+++ b/gcc/doc/invoke.texi 2013-11-17 21:30:02.784220111 +0100
@@ -10535,6 +10535,12 @@ For predictable results, you must also s
used for compilation (@option{-fpie}, @option{-fPIE},
or model suboptions) when you specify this linker option.
+NOTE: With configure --enable-default-pie this option is enabled by default
With the @option{--enable-default-pie} configure option, ...
+for C, C++, ObjC, ObjC++, if none of @option{-fno-PIE}, @option{-fno-pie},
+@option{-fPIC}, @option{-fpic}, @option{-fno-PIC}, @option{-fno-pic},
+@option{-nostdlib}, @option{-nostartfiles}, @option{-shared},
+@option{-nodefaultlibs}, nor @option{static} are found.
@option{-static}.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University
next prev parent reply other threads:[~2014-08-01 8:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 20:32 Magnus Granberg
2014-08-01 8:52 ` Rainer Orth [this message]
2014-08-31 15:49 ` Gerald Pfeifer
2014-11-10 20:33 ` Magnus Granberg
2014-11-14 23:19 ` Magnus Granberg
2014-12-30 22:04 ` [PING][PATCH][1-3] " Magnus Granberg
2015-01-09 4:31 ` Allan McRae
2015-01-09 13:04 ` Richard Biener
2015-01-09 14:17 ` Daniel Micay
2015-01-09 17:57 ` Joseph Myers
2015-01-09 18:03 ` Daniel Micay
2015-01-09 20:40 ` Magnus Granberg
2015-01-10 2:32 ` H.J. Lu
2015-01-10 17:06 ` H.J. Lu
2015-01-12 16:18 ` [PATCH]: " H.J. Lu
2015-01-12 23:53 ` Joseph Myers
2015-01-13 0:31 ` H.J. Lu
2015-01-13 13:10 ` H.J. Lu
2015-01-14 0:03 ` H.J. Lu
2015-01-09 10:48 ` [PATCH][1-3] " Marcus Meissner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yddlhr8lhh0.fsf@lokon.CeBiTec.Uni-Bielefeld.DE \
--to=ro@cebitec.uni-bielefeld.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=zorry@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).