build: add LTO (linker time optimization) for {release,distribution}
build: add LTO (linker time optimization) for {release,distribution}

Some numbers:
============
component       after      before
- server        4.2M       12M
- deb package   1.4M       3.0M
- time of make  0m22.879ss 0m13.088ss
- readelf -s    4365       4588

$ for i in boostcached boostcached-nolto; do
    readelf -S $i | \
    gawk '{if ($1 ~ /^[0-90-f]+$/ && name ~ /^\./) { printf "%s %.0f\n", name, strtonum("0x" $1); } name=$(NF > 3 ? NF-3 : ""); }' | \
    sort -k1,1 >| symtab.${i/boostcached/}
  done
$ join -j1 symtab.nolto symtab | \
  awk '{diff=($3-$2)/1024; if (diff < -10) { printf "%18s: %.3fKB\n", $1, diff}; total += diff; } END { printf "Total: %.fKB\n", total }'
    .debug_aranges: -12.406KB
       .debug_info: -2003.333KB
       .debug_line: -195.751KB
        .debug_loc: -868.711KB
     .debug_ranges: -290.578KB
        .debug_str: -3476.869KB
           .dynstr: -62.563KB
           .dynsym: -10.195KB
             .text: -62.641KB
  Total: -6951KB

As you can see, results are pretty cool.
And as for -fwhole-program I decide not to turn it on for now, because
this must be done only for final binaries, while I wanted to make this
patch as simple as it can be. (Even if we can reduce binary sizes with
-fwhole-program)

But this LTO stuff sometimes are a bit tricky and can break some stuff,
for more information about tricky stuff you could look into
http://thread.gmane.org/gmane.linux.kbuild.devel/8586/focus=8629 this
lkml post.

azat/boostcache,azat/boostcache,azat/boostcache,azat/boostcache