This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [testsuite] PATCH: Add check_effective_target_pie
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Rainer Orth <ro at cebitec dot uni-bielefeld dot de>
- Cc: Jeff Law <law at redhat dot com>, Magnus Granberg <zorry at gentoo dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 11 Feb 2015 07:45:49 -0800
- Subject: Re: [testsuite] PATCH: Add check_effective_target_pie
- Authentication-results: sourceware.org; auth=none
- References: <20150111235837 dot GA26961 at gmail dot com> <54B42880 dot 2040800 at redhat dot com> <CAMe9rOq4mS7MtgrfLAKg2htp99rbZVcY8enGGiVSU5c9xG+3eQ at mail dot gmail dot com> <2219602 dot BYtQkL3Scp at laptop1 dot gw dot ume dot nu> <54B444E4 dot 1080700 at redhat dot com> <20150113125201 dot GA18558 at gmail dot com> <54B570D5 dot 4040008 at redhat dot com> <yddk2zp1hx7 dot fsf at CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOqXyp6rLQhGgsxhxWr21j-e-xAfGXATi8Z1C+cp9tW=mA at mail dot gmail dot com> <yddtwyssfm8 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <CAMe9rOqQ6W7zsLL5v=YkvDc6rF4Ld6ejDW4Ce7=ciM_VHuxezA at mail dot gmail dot com> <yddd25gscg1 dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE>
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.
> 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.
--
H.J.