On Fri, May 31, 2019 at 05:45:17AM +0100, Ken Moffat via blfs-support wrote:
> In my experiments with tuning my build I was feeling pleased with
> myself: got everything which uses gcc or g++ in my normal desktop
> builds using my (basic) CFLAGS/CXXFLAGS.  Next stage: try the first
> item on the "cheap hardening" list : -D_FORTIFY_SOURCE=2.  Mostly ok
> until I got to boost, but although b2 was happy with cxxflags="-O2
> -march=native" (I later dropped the O2 from this package because it
> defaults to -O3), if I try "-march=native -D_FORTIFY_SOURCE=2" it
> gets most upset at the -D.
> 
> Tried various things, got nowhere.  Subscribed to the boost build
> list, but that appears to be moderated even for subscribers.  So, in
> the meantime - has anybody managed to pass anything similar to a
> recent version of boost ?
> 
Well, moderation is apparently only for the first post to that list
(if I hadn't been up all night trying to fix that, I might have read
the confirmation mail better), and I got a reply with a link

https://boostorg.github.io/build/manual/develop/index.html#bbv2.tutorial.libs

(b2 app optimization=full define=USE_ASM)

For building boost with one of more defines this comes down to first
separating it.them into CPPFLAGS, then replacing '-D' with
'define='.

So, for my original CXXFLAGS='-march=native -D_FORTIFY_SOURCE=2'
(the optimization of -O3 is used by boost ahead of user supplied
flags) the build bommand becomes

./b2 stage cxxflags="-march=native" -j8  define=_FORTIFY_SOURCE=2 \
 threading=multi link=shared -d+2

More CXXFLAGS can be added in the string as desired. If more defines
are needed, each one needs define=.

I think I put the -d+2 in the wiki a few days ago: to save you
looking, it makes b2 verbose so that you can can see what it is
doing.

ĸen
-- 
Before the universe began, there was a sound. It went: "One, two, ONE,
two, three, four" [...] The cataclysmic power chord that followed was
the creation of time and space and matter and it does Not Fade Away.
 - wiki.lspace.org/mediawiki/Music_With_Rocks_In


-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to