This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][configure] Make sure CFLAGS_FOR_TARGET And CXXFLAGS_FOR_TARGET contain -O2
- From: Christophe Lyon <christophe dot lyon at st dot com>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, "bonzini at gnu dot org" <bonzini at gnu dot org>, "dj at redhat dot com" <dj at redhat dot com>, "neroden at gcc dot gnu dot org" <neroden at gcc dot gnu dot org>, "Ralf dot Wildenhues at gmx dot de" <Ralf dot Wildenhues at gmx dot de>
- Date: Wed, 27 Jun 2012 11:08:16 +0200
- Subject: Re: [PATCH][configure] Make sure CFLAGS_FOR_TARGET And CXXFLAGS_FOR_TARGET contain -O2
- References: <4F744C01.8030909@st.com> <4F8C15DC.3020503@st.com> <4FE8818D.6020808@st.com> <Pine.LNX.4.64.1206251524260.15303@digraph.polyomino.org.uk> <4FE976CF.1010000@st.com> <orvcidbzfu.fsf@livre.localdomain>
On 26.06.2012 22:17, Alexandre Oliva wrote:
On Jun 26, 2012, Christophe Lyon <christophe.lyon@st.com> wrote:
On 25.06.2012 17:24, Joseph S. Myers wrote:
On Mon, 25 Jun 2012, Christophe Lyon wrote:
Ping?
I advise CCing appropriate maintainers (in this case, build system
maintainers) on pings.
Ping again, CCing build system maintainers as suggested by Joseph.
Is this a ping for the patch you quoted in your Jun 25 email? It's
generally good practice to include a link to the message holding the
patch in a ping.
Yes it is, sorry.
The original proposal was:
http://gcc.gnu.org/ml/gcc-patches/2012-03/msg01855.html
I looked at the patch in there, and I'm afraid I don't understand how it
achieves the ChangeLog-suggested purpose of ensuring -O2 makes to
C*FLAGS_FOR_TARGET, when all it appears to do is to prepend -g. Can you
please clarify?
With more context, the current code fragment is:
CFLAGS_FOR_TARGET=$CFLAGS
case " $CFLAGS " in
*" -O2 "*) ;;
*) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
esac
case " $CFLAGS " in
*" -g "* | *" -g3 "*) ;;
*) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
esac
where pre-pending -g discards -O2 if it was pre-pended just above.
That's why I replace CFLAGS by CFLAGS_FOR_TARGET when pre-pending -g.
Ditto for CXXFLAGS.
Christophe.