From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: Add functions for detection of PIE / SSP in way compatible with GCC >=6.
Date: Thu, 15 Jun 2017 10:11:21 +0200 [thread overview]
Message-ID: <1497514281.1807.2.camel@gentoo.org> (raw)
In-Reply-To: <874lvhhdu0.fsf@kestrel.kyomu.43-1.org>
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 988 bytes --]
next prev parent reply other threads:[~2017-06-15 8:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 23:15 [gentoo-dev] [RFC] toolchain-funcs.eclass / toolchain-glibc.eclass - gcc-6 bugfixes and updates Matthias Maier
2017-06-14 23:15 ` [gentoo-dev] [PATCH 1/5] toolchain-funcs.eclass: Add functions for detection of PIE / SSP in way compatible with GCC >=6 Matthias Maier
2017-06-15 7:07 ` Michał Górny
2017-06-15 8:09 ` Matthias Maier
2017-06-15 8:11 ` Michał Górny [this message]
2017-06-15 13:45 ` [gentoo-dev] [RFC v2] toolchain-funcs.eclass / toolchain-glibc.eclass - gcc-6 bugfixes and updates Matthias Maier
2017-06-15 13:45 ` [gentoo-dev] [PATCH 01/05] toolchain-funcs.eclass: Add functions for detection of PIE / SSP in way compatible with GCC >=6 Matthias Maier
2017-06-15 14:37 ` Michał Górny
2017-06-15 14:40 ` Matthias Maier
2017-06-14 23:15 ` [gentoo-dev] [PATCH 2/5] toolchain-glibc.eclass: Build most of >=sys-libs/glibc-2.25 with -fstack-protector-all (bug #609048) Matthias Maier
2017-06-14 23:15 ` [gentoo-dev] [PATCH 3/5] toolchain-glibc.eclass: Always enable stack guard randomization (bug #621742) Matthias Maier
2017-06-14 23:15 ` [gentoo-dev] [PATCH 4/5] eclass/toolchain-glibc.eclass: use tc-enables-pie instead of gcc-specs-pie Matthias Maier
2017-06-14 23:15 ` [gentoo-dev] [PATCH 5/5] eclass/toolchain-glibc.eclass: skip pie check for gcc-6 or newer Matthias Maier
2017-06-14 23:18 ` [gentoo-dev] Re: [RFC] toolchain-funcs.eclass / toolchain-glibc.eclass - gcc-6 bugfixes and updates Matthias Maier
2017-06-16 8:27 ` [gentoo-dev] " Matthias Maier
2017-06-16 13:25 ` M. J. Everitt
2017-06-16 21:38 ` Sergei Trofimovich
2017-06-16 21:42 ` Alexis Ballier
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=1497514281.1807.2.camel@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-dev@lists.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