tech-pkg archive

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

libtool inserting libraries not listed on the command line

I'm updating gutenprint to the next micro release, which is mostly
straightforward.  However, the linking of the gimp plugin is complaining
about gexiv2 not being found, and that's not in the bl3 list.

My build environment is up-to-date netbsd-7 amd64, with the default
cwrappers and the host gcc 4.8, and PKGSRC_COMPILER=ccache gcc.  (Plus, I
built with USE_CWRAPPERS=no and got the same result.)

Note that i have new gimp and many other things since my last build of
gutenprint.  But, I built gutenprint-lib from CVS, without my update,
and the same problem happens.

I see that gimpbase depends on exiv2:

          -lgio-2.0.0 => /usr/pkg/lib/
          -lgobject-2.0.0 => /usr/pkg/lib/
          -lglib-2.0.0 => /usr/pkg/lib/
          -lpcre.1 => /usr/pkg/lib/
          -lgcc_s.1 => /usr/lib/
          -lc.12 => /usr/lib/
          -lintl.1 => /usr/lib/
          -lpthread.1 => /usr/lib/
          -lffi.6 => /usr/pkg/lib/
          -lgmodule-2.0.0 => /usr/pkg/lib/
          -lz.1 => /usr/lib/
          -lgexiv2.2 => /usr/pkg/lib/
          -lexiv2.26 => /usr/pkg/lib/
          -lexpat.2 => /usr/lib/
          -lstdc++.7 => /usr/lib/
          -lm.0 => /usr/lib/
          -ljpeg.9 => /usr/pkg/lib/
          -lexecinfo.0 => /usr/lib/
          -lelf.1 => /usr/lib/

But, exiv2 is not in gimp's bl3, and thus in theory I should be able to
link to gimpbase-2.0 without explicitly linking in exiv2.

gutenprint's build grabs the gimp LIBS via pkg-config.  But, after
libtool is invoked with the variable as defined in the Makefile, the
actual gcc invocation has reordered the libraries and added exiv2 and

So I am wondering:

  is libtool reordering libraries for some reason?  Is this believed to
  be a good idea?

  is libtool running ldd behind my back and deciding to add in libraries
  to the link line when they weren't specified?  Or something like that?
    If so, is this a bug or a feature?  Or is it a clue that exiv/exiv2
    really should be dependencies of programs that link against gimp?

  does gimp really need to add exiv/exiv2 to the bl3 (by rights, not to
  work around libtool bugs)

The relevant part of the build log follows (plus I added newlines to
make it readable, and a comment).  I could not find any other reason for
exiv/exiv2 appearing other than libtool deciding to add it.

gmake[3]: Entering directory '/home/n0/gdt/pkgsrc-current/pkgsrc/print/gutenprint-lib/work/gutenprint-5.2.14/src/gimp2'
/bin/sh ../../libtool  --tag=CC   --mode=link gcc  -Disfinite=finite -O2 -D_FORTIFY_SOURCE=2
 -I/usr/pkg/include -I/usr/include -I/usr/X11R7/include -I/usr/X11R7/include/freetype2 -I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/include/glib/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/X11R7/include/libdrm -I/usr/include/krb5 -O6
  -L/usr/pkg/lib -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/X11R7/lib -Wl,-R/usr/X11R7/lib
 -o gutenprint print-image-gimp.o print.o print-gutenprint.o
 -L/usr/pkg/lib -lgimpui-2.0 -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpmath-2.0 -lgimpconfig-2.0 -lgimpcolor-2.0 -lgimpbase-2.0
 -lgegl-0.4 -lgegl-npd-0.4 -lm
 -Wl,--export-dynamic -lgmodule-2.0 -pthread -lglib-2.0 -ljson-glib-1.0 -lbabl-0.1 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0
 -L/usr/X11R7/lib -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes -lX11 -lXext -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,-R/usr/pkg/lib -lfribidi -lfreetype -lz -lbz2 -Wl,-rpath,/usr/X11R7/lib -lfontconfig  ../../src/main/ ../../src/gutenprintui2/ /usr/pkg/lib/ /usr/lib/ -Wl,-rpath -Wl,/usr/pkg/lib -lm 
libtool: link: gcc -Disfinite=finite -O2 -D_FORTIFY_SOURCE=2
 -Wl,-rpath -Wl,/usr/pkg/lib -Wl,-rpath -Wl,/usr/X11R7/lib
 -o .libs/gutenprint
 print-image-gimp.o print.o print-gutenprint.o
 -Wl,--export-dynamic -pthread -Wl,-rpath -Wl,/usr/pkg/lib -Wl,-rpath -Wl,/usr/X11R7/lib -Wl,-rpath -Wl,/usr/pkg/lib 

 -lgimpui-2.0 -L../xmpsdk/src -L../src/.libs -lgimpwidgets-2.0 -lgimpmodule-2.0 -lgimp-2.0 -lgimpconfig-2.0 -lgimpmath-2.0
 -lgimpcolor-2.0 -llcms2 # extra not given
 -lgimpbase-2.0 -lgexiv2 -lexiv2 -ljpeg -lexecinfo  # extra 4 not given
 -lgegl-npd-0.4 -lgegl-0.4 -ljson-glib-1.0 -lbabl-0.1 -lpthread

 -L../../src/main/.libs -L../../src/gutenprintui2/.libs -lgutenprintui2 -lgutenprint
 -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0
 -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lXfixes
 -latk-1.0 -lcairo -lpixman-1
 -lxcb-shm -lxcb-render -lxcb -lXrender -lX11 -lXext -lrt
 -lgdk_pixbuf-2.0 -lpng16 -lgio-2.0 -lgmodule-2.0 -lpangoft2-1.0 -lharfbuzz -lexpat -luuid -lpango-1.0 -lgthread-2.0 -lgobject-2.0 -lffi -lglib-2.0
 -lpcre -lfribidi -lfreetype -lz -lbz2 -lfontconfig -lintl -lc -lm
 -pthread -Wl,-rpath,/home/n0/gdt/pkgsrc-current/pkgsrc/print/gutenprint-lib/work/.buildlink/lib -Wl,-rpath,/usr/pkg/lib
ld: cannot find -lgexiv2
ld: cannot find -lexiv2
Makefile:523: recipe for target 'gutenprint' failed
gmake[3]: *** [gutenprint] Error 1
gmake[3]: Leaving directory '/home/n0/gdt/pkgsrc-current/pkgsrc/print/gutenprint-lib/work/gutenprint-5.2.14/src/gimp2'

Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index