Correct use of "-flto"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've been experimenting with "-flto" to compile various source packages.

Using binutils-2.23.1 and gcc-4.7.2, both compiled with "--enable-lto"

and

CC="gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe" CXX="g++ -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe  -fno-exceptions -fno-rtti" ./configure --yada-yada


glibc-2.17 ./configure fails complaining that ld does not support array something or other (removing "-flto -fuse-linker-plugin" fixes this).

apps are generally 0-20% smaller than without "-flto -fuse-linker-plugin"

dynamic libs are generally 0-20% smaller than without "-flto -fuse-linker-plugin"

static libs are generally much larger than without "-flto -fuse-linker-plugin" (a few 100kb without lto to several mb with lto)


1. Am I using "-flto" correctly?

2. I'm removing "-O2" from the Makefiles - do I need to remove "-g" as well?


John





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux