From: "H.J. Lu" <hjl.tools@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Richard Earnshaw <richard.earnshaw@arm.com>,
Bernd Schmidt <bernds@codesourcery.com>,
Hans-Peter Nilsson <hans-peter.nilsson@axis.com>,
Nick Clifton <nickc@redhat.com>,
Matthew Fortune <Matthew.Fortune@imgtec.com>,
David Edelsohn <dje.gcc@gmail.com>,
"David S. Miller" <davem@redhat.com>,
Matt Thomas <matt@3am-software.com>,
Rainer Orth <ro@cebitec.uni-bielefeld.de>,
Mike Stump <mikestump@comcast.net>,
GCC Patches <gcc-patches@gcc.gnu.org>,
"Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: Fwd: PING^3: [PATCH]: New configure options that make the compiler use -fPIE and -pie as default option
Date: Sat, 30 May 2015 16:24:00 -0000 [thread overview]
Message-ID: <CAMe9rOpu7dZ9PfsDmjVfO380w95b0iPuvkuxGRmnMM3YEAk11Q@mail.gmail.com> (raw)
In-Reply-To: <87oal2ayo8.fsf@igel.home>
On Sat, May 30, 2015 at 8:10 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> "H.J. Lu" <hjl.tools@gmail.com> writes:
>
>> +# Check if -fno-PIE works.
>> +AC_CACHE_CHECK([for -fno-PIE option],
>> + [gcc_cv_c_no_fpie],
>> + [saved_CFLAGS="$CFLAGS"
>> + CFLAGS="$CFLAGS -fno-PIE"
>> + AC_COMPILE_IFELSE([int main(void) {return 0;}],
>> + [gcc_cv_c_no_fpie=yes],
>> + [gcc_cv_c_no_fpie=no])
>> + CFLAGS="$saved_CFLAGS"])
>> +if test "$gcc_cv_c_no_fpie" = "yes"; then
>> + NO_PIE_CFLAGS="-fno-PIE"
>> +fi
>> +AC_SUBST([NO_PIE_CFLAGS])
>> +
>
> That doesn't work:
>
> configure:28726: checking for -fno-PIE option
> configure:28737: g++ -c -g conftest.cpp >&5
> configure:28737: $? = 0
> configure:28745: result: yes
>
>> +# Check if -no-pie works.
>> +AC_CACHE_CHECK([for -no-pie option],
>> + [gcc_cv_no_pie],
>> + [saved_LDFLAGS="$LDFLAGS"
>> + LDFLAGS="$LDFLAGS -no-pie"
>> + AC_LINK_IFELSE([int main(void) {return 0;}],
>> + [gcc_cv_no_pie=yes],
>> + [gcc_cv_no_pie=no])
>> + LDFLAGS="$saved_LDFLAGS"])
>> +if test "$gcc_cv_no_pie" = "yes"; then
>> + NO_PIE_FLAG="-no-pie"
>> +fi
>> +AC_SUBST([NO_PIE_FLAG])
>> +
>
> That doesn't work with gcc 4.3:
>
> configure:28753: checking for -no-pie option
> configure:28764: g++ -std=c++98 -o conftest -g -no-pie conftest.cpp >&5
> g++: unrecognized option '-no-pie'
> configure:28764: $? = 0
> configure:28773: result: yes
>
Starting GCC 4.6, the unrecognized option became an error.
Before 4.6, it was ignored. Does it cause any problems for
bootstrap?
--
H.J.
next prev parent reply other threads:[~2015-05-30 15:42 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 17:31 H.J. Lu
2015-03-06 20:22 ` Magnus Granberg
2015-03-06 20:25 ` H.J. Lu
2015-05-07 21:17 ` Joseph Myers
2015-05-08 17:35 ` H.J. Lu
2015-05-18 22:53 ` Magnus Granberg
2015-05-19 1:25 ` Joseph Myers
2015-05-19 1:34 ` H.J. Lu
2015-05-19 15:27 ` Joseph Myers
2015-05-19 15:33 ` H.J. Lu
2015-05-19 15:33 ` Paul_Koning
2015-05-19 15:43 ` H.J. Lu
2015-05-19 15:37 ` Joseph Myers
2015-05-19 19:33 ` H.J. Lu
2015-05-20 21:29 ` Joseph Myers
2015-05-20 23:01 ` Hans-Peter Nilsson
2015-05-20 23:54 ` H.J. Lu
2015-05-21 14:42 ` Rainer Orth
2015-05-21 17:19 ` Joseph Myers
2015-05-21 17:57 ` H.J. Lu
2015-06-03 12:48 ` Rainer Orth
[not found] ` <CAMe9rOpZow4w3zcycLoTb5LZdLKP2QWNpsU5oLMJCyZGUTd1fg@mail.gmail.com>
[not found] ` <87vbflkh05.fsf@igel.home>
[not found] ` <CAMe9rOr0SApdtzeOrc-uNDRH8=z6c4EzHUkyXmERW_q9BYjrAQ@mail.gmail.com>
[not found] ` <87k2w1k54t.fsf@igel.home>
2015-05-22 15:39 ` Fwd: " H.J. Lu
2015-05-26 22:42 ` Bill Schmidt
2015-05-26 22:53 ` Bill Schmidt
2015-05-27 15:42 ` Peter Bergner
2015-05-27 15:59 ` H.J. Lu
2015-05-27 16:17 ` Peter Bergner
2015-05-27 16:34 ` H.J. Lu
2015-05-27 17:43 ` David Edelsohn
2015-05-27 17:44 ` H.J. Lu
2015-05-30 15:45 ` Andreas Schwab
2015-05-30 16:24 ` H.J. Lu [this message]
2015-05-30 16:44 ` Andreas Schwab
2015-05-30 17:04 ` H.J. Lu
2015-05-30 20:08 ` Andreas Schwab
2015-05-30 21:42 ` H.J. Lu
2015-05-31 0:52 ` Andreas Schwab
2015-05-31 7:13 ` H.J. Lu
2015-05-31 8:23 ` Andreas Schwab
2015-05-31 15:52 ` H.J. Lu
2015-05-30 20:04 ` Andreas Schwab
2015-05-30 21:08 ` Andreas Schwab
2015-10-23 11:57 ` Marcus Shawcroft
2015-10-23 12:44 ` H.J. Lu
2015-10-23 14:27 ` Marcus Shawcroft
2015-10-28 16:06 ` Marcus Shawcroft
2015-10-29 11:02 ` Richard Earnshaw
2015-10-29 11:18 ` H.J. Lu
2015-06-10 13:26 ` Rainer Orth
2015-05-26 23:09 ` Matthew Fortune
2015-05-27 2:49 ` Matthew Fortune
2015-05-27 4:59 ` H.J. Lu
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=CAMe9rOpu7dZ9PfsDmjVfO380w95b0iPuvkuxGRmnMM3YEAk11Q@mail.gmail.com \
--to=hjl.tools@gmail.com \
--cc=Matthew.Fortune@imgtec.com \
--cc=bernds@codesourcery.com \
--cc=davem@redhat.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hans-peter.nilsson@axis.com \
--cc=joseph@codesourcery.com \
--cc=matt@3am-software.com \
--cc=mikestump@comcast.net \
--cc=nickc@redhat.com \
--cc=richard.earnshaw@arm.com \
--cc=ro@cebitec.uni-bielefeld.de \
--cc=schwab@linux-m68k.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).