From: "H.J. Lu" <hjl.tools@gmail.com>
To: Magnus Granberg <zorry@gentoo.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PING][PATCH][1-3] New configure options that make the compiler use -fPIE and -pie as default option
Date: Sat, 10 Jan 2015 17:06:00 -0000 [thread overview]
Message-ID: <CAMe9rOo9A0rkWY2Vz=scP=gNy16X9JmKKFkBFMHMJSP5jbsLnw@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOpjEotG=s=-vtc7GWe78eDw+uZtYrT=grFpri=GKogy+w@mail.gmail.com>
On Fri, Jan 9, 2015 at 5:56 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Fri, Jan 9, 2015 at 12:12 PM, Magnus Granberg <zorry@gentoo.org> wrote:
>> fredag 09 januari 2015 13.00.14 skrev Daniel Micay:
>>> On 09/01/15 12:49 PM, Joseph Myers wrote:
>>> > On Fri, 9 Jan 2015, Daniel Micay wrote:
>>> >>> --with-specs="%{pie|fpic|fPIC|fpie|fPIE|fno-pic|fno-PIC|fno-pie|fno-PIE|
>>> >>> shared|static|nostdlib|nodefaultlibs|nostartfiles:;:-fPIE -pie}"
>>> >>>
>>> >>> at configure time (using CONFIGURE_SPECS).
>> DRIVER_SELF_SPECS is checkt before CONFIGURE_SPECS. On mips it will have added
>> -mno-shared before it check CONFIGURE_SPECS. I want to support more targets
>> later on. Can move the spec to elfos.h.
>>> >>>
>>> >>> I have no idea if the above is really the proper spec to use - why
>>> >>> do you include static, nostdlib, nodefaultlibs and nostartfiles
>>> >>> for example? Similar, if I say
>>> >>
>>> >> PIE isn't supported for static executables by binutils, etc. so it
>>> >> does need to exclude that. The checks for nostdlib, nodefaultlibs
>>> >
>>> > Well - that would indicate excluding -pie if one of the link-time options
>>> > conflicting with it is used, -fPIE if one of the compile-time options
>>> > conflicting with it is used. That way, "gcc -static file.c" would still
>>> > have the same effect as "gcc -c file.c; gcc -static file.o" (building a
>>> > PIE object, linking it into a non-PIE static executable), which makes
>>> > logical sense to me (although there may be no great benefit either way).
>>>
>>> Sure, I agree. It should have separate lists of exceptions for both of
>>> these.
>> I can separete it to compile and linke sections and remove the nostdlib,
>> nodefaultlibs and nostartfiles. But how do we not pass -pie to the linker when
>> we don't pass static or shared and don't link it with -pie? For only the gold
>> linker support -no-pie.
>>
>> /Magnus G.
>>
>>
>
> Please try hjl/pie branch:
>
> https://gcc.gnu.org/git/?p=gcc.git;a=summary
>
> and let know if it works for you.
>
I updated the branch with some fixes.
--
H.J.
next prev parent reply other threads:[~2015-01-10 15:07 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-31 20:32 [PATCH][1-3] " Magnus Granberg
2014-08-01 8:52 ` Rainer Orth
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 [this message]
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
2015-01-11 10:21 [PING][PATCH][1-3] " Daniel Micay
2015-01-11 11:37 ` Daniel Micay
2015-01-11 12:39 ` H.J. Lu
2015-01-11 14:02 ` Magnus Granberg
2015-01-11 15:13 ` Magnus Granberg
2015-01-11 19:27 ` H.J. Lu
2015-01-11 19:29 ` H.J. Lu
2015-01-11 21:55 ` Magnus Granberg
2015-01-11 23:54 ` H.J. Lu
2015-01-11 17:47 ` H.J. Lu
2015-01-11 15:21 ` Daniel Micay
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='CAMe9rOo9A0rkWY2Vz=scP=gNy16X9JmKKFkBFMHMJSP5jbsLnw@mail.gmail.com' \
--to=hjl.tools@gmail.com \
--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).