On czw, 2017-06-15 at 03:09 -0500, Matthias Maier wrote:
> > > +# @FUNCTION: tc-enables-pie
> > > +# @RETURN: Truth if the current compiler generates position-independent 
> > > code (PIC) which can be linked into executables
> > > +# @DESCRIPTION:
> > > +# Return truth if the current compiler generates position-independent 
> > > code (PIC)
> > > +# which can be linked into executables.
> > > +tc-enables-pie() {
> > > + $($(tc-getCC) ${CPPFLAGS} ${CFLAGS} -E -P - <<-EOF 2> /dev/null
> > > +         #if defined(__PIE__)
> > > +         true
> > > +         #else
> > > +         false
> > > +         #endif
> > > +         EOF
> > > + )
> > 
> > Looks quite horrible. Why can't you just compare the output against
> > a value instead of randomly executing it?
> 
> Because we have to execute the compiler anyway and this is the quickest
> way of getting the answer we need. Further, piping an unfiltered output
> (e.g. -E -dM -x c) through grep is by no means prettier.
> 

That's not what I mean. What I mean is that you are executing
the filtered output, i.e. calling whatever gets spilt on stdout as shell
script.

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to