← Back to team overview

hugin-devs team mailing list archive

[Bug 679658] Re: Avoiding extra linking

 

has this been applied already?  and if not, is it still applicable?

** Tags added: build patch

** Changed in: hugin
       Status: New => Triaged

-- 
You received this bug notification because you are a member of Hugin
Developers, which is subscribed to Hugin.
https://bugs.launchpad.net/bugs/679658

Title:
  Avoiding extra linking

Status in Hugin - Panorama Tools GUI:
  Triaged

Bug description:
  (originally submitted by Cyril Brulebois in hugin-ptx)

"since one might want to limit the dependencies against other pacakages (which, distribution-wide, really helps WRT release management), it is usually possible to use the following: LDFLAGS="-Wl,--as-needed". It tells the linker not to include inconditionally all -lFOO -lBAR passed on the command-line in NEEDED sections, if no symbols from these libraries are actually used."

"Note that curiously, cmake sometimes can't handle using a static library inside a shared library, which is why I've added -fPIC explicitely.

I've rebuilt hugin with and without -Wl,--as-needed and -Wl,-z,defs and it doesn't seem like anything is broken.

Please review and possibly apply the updated attached patch. Note that for the second hunk, one might want to use ${image_libs} instead, but I added library one by one, on demand, so as to fix undefined references issues one after each other."