use shared lib of libbackend.so
Ian Lance Taylor
iant@google.com
Sat Apr 2 17:37:00 GMT 2011
parttor@gmail.com writes:
> As cc1plus cc1 lto1 using the same big static lib libbackend.a, so
> I patched it to use a shared lib in order to save space.
> I pached by the attachment and set CFLAGS="${CFLAGS} -fPIC"
> CXXFLAGS="${CXXFLAGS} -fPIC" before configure.
> It works well after patched and size reduced. But it works much slower
> than using libbackend.a , spend two times time.
> Can I keep speed while using shared lib?
I'm kind of surprised that it is twice as slow. But it is true that on
an ELF system shared libraries are always slower than static libraries,
though the slowdown is normally more on the order of 5%.
Disk prices have fallen so far that very few people are short on space
these days. At least, they aren't short on space for the compiler which
normally lives on a regular computer rather than, say, a phone. Does
this really matter for you?
Ian
More information about the Gcc-help
mailing list