This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Correct use of "-flto"


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]