This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -x assembler-with-cpp behavior different on different unixes.


Hi Karel,

> On Fri, Aug 8, 2014 at 11:04 PM, Rainer Orth
> <ro@cebitec.uni-bielefeld.de> wrote:
>> Hi Karel,
>>
>>> More information: It looks like gcc driver invokes cc1 with -P option
>>> which switches off linemakers on Solaris. On Linux cc1 is invoked
>>> without -P and so linemakers are presented. The question is why on
>>> Solaris -P is added to the options since I don't use it myself. It's
>>> inserted by gcc itself...
>>
>> you can find this explained in gcc/config/i386/sol2.h (so this
>> behaviour is Solaris/x86-specific):
>>
>> /* Solaris 2/Intel as chokes on #line directives before Solaris 10.  */
>> #undef CPP_SPEC
>> #define CPP_SPEC "%{,assembler-with-cpp:-P} %(cpp_subtarget)"
>
> Thanks a lot for this reference! Hmm, I see I can't do with this
> anything since I'd like to use as much as possible Solaris bundled GNU
> C.

right, and even if you wanted to build gcc yourself, you'd need to patch
it, which does no good for anyone else trying to build/test ghc.

>> With Solaris 9 support gone on mainline, this can be revisited now, but
>> this won't change anything for released versions.
>
> What shall I do for this to be at least considered?

Nothing: it's already on my agenda to fix this for 4.10/5.0, thanks to
your report :-)  The only thing one could possibly do for older releases
is to restrict passing -P to Sun as, but given the niche case that
triggers this, this is almost certainly too invasive for a micro
release.

>> Apart from that, why are you invoking gcc with -x assembler-with-cpp
>> when the input is clearly anything but assembler input?  You're
>> obviously lying to the compiler, and I'd go as far as claiming that you
>> get what you deserve: garbage in, garbage out.
>
> :-) fair enough, but GHC requires to use some CPP and GNU C's provided
> one is very comfortable. Well, at least except on Solaris as you
> see...

But why the -x assembler-with-cpp instead of plain -E?  Besides, this is
another example of why cpp is not really suited as a general-purpose
preprocessor.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]