Boost logo

Boost-Build :

Subject: Re: [Boost-build] instruction-set core2 native; link --as-needed; -fomit-frame-pointer -fno-stack-protector
From: Serhat Sevki Dincer (jfcgauss_at_[hidden])
Date: 2009-09-15 09:01:24


> From: Vladimir Prus <ghost_at_[hidden]>
> To: "Boost.Build developer's and user's list" <boost-build_at_[hidden]>
> Date: Mon, 14 Sep 2009 13:39:00 +0400
> Subject: Re: [Boost-build] instruction-set core2 native; link --as-needed; -fomit-frame-pointer -fno-stack-protector
> On Friday 04 September 2009 Serhat Şevki Dinçer wrote:
>> 2nd adds an optimization for 'linking' (not for compiling; resulting
>> boost libraries do have unused dependencies otherwise, as reported by
>> 'ldd -r -u'),
> Is -as-needed sufficiently safe? Some pages say it's only available with
> binutils 2.17, and I am not sure that we can easily check for binutils
> version.

According to NEWS and Changelog files, --as-needed option was added to
binutils 2.15 which was released in May 2004. i think this is pretty
safe. people who have binutils<2.15, gcc<4 but trying to build
boost>1.40 should be pretty rare. they should first get rid of their
archaic systems :)

>> 3rd adds '-fomit-frame-pointer -fno-stack-protector' to optimization
>> flags because the former flag is 'not guaranteed' to be chosen for -O
>> and above, and -fstack-protector (available as of gcc 4.1) is 'set' by
>> default on Ubuntu 6.10 and later.
> Oh, so -fno-stack-protector won't work with gcc < 4.1? I guess another
> place where this behaviour has to be conditional.

that i realized before, but the bjam language is not the most trivial
one for this stuff. so how do i add a condition for enabling a feature
for, say, gcc 4.1 and up? something like below would be nice:
-toolset.flags gcc.compile OPTIONS <optimization>speed : -O3 ;
+toolset.flags gcc.compile OPTIONS <optimization>speed : -O3
-fomit-frame-pointer ;
+toolset.flags gcc.compile OPTIONS
<optimization>speed/<toolset-gcc:version:atLeast>4.1 :
-fno-stack-protector ;


Note: i see pyhton files within Boost.Build in the latest trunk, so
will there be a switch from bjam lang to pyhton? that would be nice..
i guess that is the reason for python support in bjam, right?

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at