Boost logo

Boost-Build :

Subject: Re: [Boost-build] Choice of optimization flags for GCC
From: David Abrahams (dave_at_[hidden])
Date: 2008-09-14 04:47:06


on Tue Sep 09 2008, Vladimir Prus <ghost-AT-cs.msu.su> wrote:

> On Tuesday 09 September 2008 20:33:00 Brad Howes wrote:
>> On Sep 9, 2008, at 11:45 AM, David Abrahams wrote:
>>
>> > Yes, but then we have another problem: the gcc documentation says that
>> > you should only use one -Ox option on the command-line, and we have no
>> > way to avoid producing command lines containing one of the values -O0
>> > -O3 or -Os.
>>
>>
>> From http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Optimize-Options.html#Optimize-Options>
>> If you use multiple -O options, with or without level numbers,
>> the last such option is the one that is effective.
>>
>> I assume it works since I rely on that to keep my release builds at -O2.
>
> Exactly. The last option takes predecence, and cxxflags are added to the end of
> the command line.

Okay, great. I don't know where I saw it, but I guess somewhere the GCC
docs contradict themselves.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk