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

Re: Packaging of static libraries



On Tue, Apr 12, 2016 at 02:52:33PM +0100, Ian Jackson wrote:
> Vincent Lefevre writes ("Re: Packaging of static libraries"):
> > On 2016-04-10 14:28:02 +0100, Alastair McKinstry wrote:
> > > (1) When performance matters. Here we need the static library to be
> > > built without position independent code. This can still give several
> > > percent gains depending on arch / programming language.
> > 
> > Yes, but in that case, the best thing to do is to recompile everything
> > for the target processor (instead of generic x86_64, for instance),
> > with LTO. For GMP+MPFR, I noticed a gain of up to 37% a few years ago.
> 
> I'm afraid that LTO is probably too dangerous to be used as a
> substitute for static linking.  See my comments in the recent LTO
> thread here, where I referred to the problem of undefined behaviour,
> and pointed at John Regehr's blog.

LTO is no different from just concatenating all source files and making
functions static.  If your code blows after this, it is your fault not
LTO's.  LTO just allows interprocedural optimizations to work between
functions that were originally in different source files.

-- 
A tit a day keeps the vet away.


Reply to: