Re: Writing spec rules for preprocessor definitions in 4.6

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan Hill <dirtyepic@xxxxxxxxxx> writes:

> On Mon, 4 Apr 2011 18:09:21 -0600
> Ryan Hill <dirtyepic@xxxxxxxxxx> wrote:
>
>> Before 4.6, you could write a spec rule for a preprocessor definition using
>> its joined non-canonical form.  Eg.
>> 
>> %{!D_FORTIFY_SOURCE:%{!D_FORTIFY_SOURCE=*:%{!U_FORTIFY_SOURCE:-D_FORTIFY_SOURCE=2}}}
>> 
>> Several distros used this rule to enable -D_FORTIFY_SOURCE=2 by default.
>> 
>> After 4.6, preprocessor definitions are passed in their separated, canonical,
>> form (see PR #47236) and the rule above stops working.  After a couple hours
>> of experimenting, I can't find any way to write a rule that works with the
>> new form.  Shouldn't the joined form still be usable, even if the new default
>> is separate?  Am I missing something obvious?  I know you can use whitespace
>> and * in a spec, but apparently not in the middle of a switch name.
>
> Could anyone tell me if it would be considered a bug that we can't write spec
> rules matching options having both separate and joined forms any more?

Yes, I think this is an omission in the spec language.  Please file a
request at http://gcc.gnu.org/bugzilla/ to add this facility.

I think that your spec would fail even with earlier versions of gcc if
the user wrote -D _FORTIFY_SOURCE rather than -D_FORTIFY_SOURCE.
Indeed, Ubuntu gcc does in fact give an error if I write -D
_FORTIFY_SOURCE, although should be supported.  So I think this change
to gcc is not clearly a bug; it is a clarification which should help
ensure that specs won't sometimes work and sometimes fail.

Ian


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux