From: "H.J. Lu" <hjl.tools@gmail.com>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: Jeff Law <law@redhat.com>, Magnus Granberg <zorry@gentoo.org>,
GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [testsuite] PATCH: Add check_effective_target_pie
Date: Wed, 11 Feb 2015 16:45:00 -0000 [thread overview]
Message-ID: <CAMe9rOqH0pLUqtd5KMQw+i1jJxxn06QiQBZD2TW2dfHv0o3jsg@mail.gmail.com> (raw)
In-Reply-To: <ydd8ug4s9tv.fsf@lokon.CeBiTec.Uni-Bielefeld.DE>
On Wed, Feb 11, 2015 at 8:15 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> On Wed, Feb 11, 2015 at 7:19 AM, Rainer Orth
>> <ro@cebitec.uni-bielefeld.de> wrote:
>>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>>
>>>> On Wed, Feb 11, 2015 at 6:10 AM, Rainer Orth
>>>> <ro@cebitec.uni-bielefeld.de> wrote:
>>>>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>>>>
>>>>>>> The new proc is bogus, unfortunately: there's already an existing
>>>>>>> check_effective_target_pie that checks if a target can support PIE. The
>>>>>>> new one just overrides the previous one. On targets supporting PIE
>>>>>>> (like Darwin), but not defaulting to it, the PIE tests suddenly turn out
>>>>>>> UNSUPPORTED.
>>>>>>>
>>>>>>> You should rename the new one to
>>>>>>> e.g. check_effective_target_pie_default, update the single user, and
>>>>>>> document it in sourcebuild.texi.
>>>>>>
>>>>>> I checked in this as an obvious fix.
>>>>>
>>>>> I think pie_enabled is not a very descriptive name:
>>>>>
>>>>> Index: doc/sourcebuild.texi
>>>>> ===================================================================
>>>>> --- doc/sourcebuild.texi (revision 220617)
>>>>> +++ doc/sourcebuild.texi (working copy)
>>>>> @@ -1884,6 +1884,9 @@
>>>>> @item nonpic
>>>>> Target does not generate PIC by default.
>>>>>
>>>>> +@item pie_enabled
>>>>> +Target generates PIE by default.
>>>>> +
>>>>> @item pcc_bitfield_type_matters
>>>>> Target defines @code{PCC_BITFIELD_TYPE_MATTERS}.
>>>>>
>>>>> With -fpie, PIE is also enabled, just not the default without any
>>>>
>>>> I was testing
>>>>
>>>> # make RUNTESTFLAGS="--target_board='unix{-m32\ -fpie,-fpie}'
>>>>
>>>> I don't consider PIE is default. It is just enabled.
>>>>
>>>>> options. Please either go with the pie_default I sugested or wait for
>>>>> others to weigh in before rushing in another `obvious' fix.
>>>
>>> Then the description (both sourcebuild.texi and target-supports.texi) is
>>> confusing.
>>
>> That is how other options are described.
>
> You're not getting my point:
>
> * target-supports.exp now has
>
> # Return 1 if the current multilib generates PIE by default.
>
> * sourcebuild.texi states
>
> Target generates PIE by default.
>
> Which one is it?
I copied them from nonpic
# Return 1 if the current multilib does not generate PIC by default.
@item nonpic
Target does not generate PIC by default.
>>> What are you trying to achieve here, actually? Even on Solaris 11/x86
>>> (which doesn't support PIE), -fpie lets the
>>> check_effective_target_pie_enabled (or whatever it's called) proc pass.
>>> Shouldn't it also check if the target can support PIE at all?
>>
>> Assembly outputs may be different, depending on if PIE is
>> enabled nor not. When we scan assembly outputs for test
>> results, we have different expected results when PIE is enabled.
>> That is how pie_enabled is used so far.
>
> But why would you need a new effective-target keyword for that? Simply
> test the existing { target pie }, add -fpie and scan the assembler
> output. Why would you need pie_enabled or whatever at all? Again: what
> are you trying to achieve that cannot be done with the current keyword?
>
> Right now, in gcc.target/i386/pie.c, you're only testing the PIE case
> when PIE has been enabled by some means external to testsuite. The test
> always comes out UNSUPPORTED if not, so it isn't even exercised in a
> regular bootstrap (except on Darwin which defaults to PIE, I believe).
That is intentional. gcc.target/i386/pie.c will be test by
1. RUNTESTFLAGS="--target_board='unix{-m32\ -fpie,-fpie}'" . Or
2. PIE is enabled by default:
https://gcc.gnu.org/ml/gcc-patches/2015-01/msg00956.html
--
H.J.
next prev parent reply other threads:[~2015-02-11 16:45 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-12 0:25 H.J. Lu
2015-01-12 18:28 ` Jeff Law
2015-01-12 19:58 ` H.J. Lu
2015-01-12 19:59 ` Jeff Law
[not found] ` <CAMe9rOp1R-FewC1D9fODCe3ia82Ve8YxvfzHPBCaSa9zn4xi+Q@mail.gmail.com>
[not found] ` <54B42880.2040800@redhat.com>
2015-01-12 20:16 ` H.J. Lu
2015-01-12 22:01 ` Magnus Granberg
2015-01-12 22:12 ` Jeff Law
2015-01-13 13:03 ` H.J. Lu
2015-01-13 19:45 ` Jeff Law
2015-02-10 23:11 ` Rainer Orth
2015-02-11 14:04 ` H.J. Lu
2015-02-11 14:11 ` Rainer Orth
2015-02-11 14:20 ` H.J. Lu
2015-02-11 15:19 ` Rainer Orth
2015-02-11 15:45 ` H.J. Lu
2015-02-11 16:16 ` Rainer Orth
2015-02-11 16:45 ` H.J. Lu [this message]
2015-01-13 13:04 ` [testsuite] PATCH: Check if -pg available H.J. Lu
2015-01-13 13:15 ` H.J. Lu
2015-01-13 19:49 ` Jeff Law
2015-01-13 20:47 ` H.J. Lu
2015-01-13 21:14 ` Jeff Law
2015-01-13 14:56 ` [testsuite] PATCH: Add check_effective_target_pie H.J. Lu
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=CAMe9rOqH0pLUqtd5KMQw+i1jJxxn06QiQBZD2TW2dfHv0o3jsg@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=law@redhat.com \
--cc=ro@cebitec.uni-bielefeld.de \
--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).