Ok, so I've figured out (basically) where this bug is comming from:
[copied from the debian bug report at
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293815&msg=18 ]
he loaders for libimlib2 need to link with libImlib2.so by default.
This was apparently changed in 1.2.0 (see after the IRC conversation)
<dondelelcaro> vorlon: well, maybe that's not what it is... I'm trying
to understand why the loaders for Imlib2 would work
fine with just Imlib2, but fail when I try to load them
into perl
<dondelelcaro> it's #293815
<dondelelcaro> there doesn't seem to be any obvious issues that I can
see
<dondelelcaro> (but then, I'm not an expert at dynamic libraries by
any stretch of the imagination
<vorlon> dondelelcaro: you're trying to load them directly into perl,
or you're trying to load Imlib2 which is then loading the
loaders?
* trave11er senses a trick question
<dondelelcaro> vorlon: load Imlib2 which is then loading the loaders
<vorlon> if the latter, there's a possible issue if the loaders are
trying to look up symbols in imlib2 but have not been linked
against it, since symbols in a library linked by an
application are in the search path by default, but symbols in
a library that has itself been dlopen()ed are not.
<dondelelcaro> well, even more complicated. load Image::Imlib2 which
then loads Imlib2 which loads the loaders
<vorlon> right, same problem.
<vorlon> Are you getting undefined symbol errors, or no error at all?
<dondelelcaro> vorlon: no error at all...
<vorlon> what does ldd -d -r <loader.so> show?
<dondelelcaro> vorlon: ah, excellent
<dondelelcaro> undefined symbol: __imlib_GetTag
(/usr/lib/imlib2/loaders/png.so)
<vorlon> yep.
<vorlon> so to be used in situations where imlib2 is being dlopen()ed,
those loaders themselves need to be linked against imlib.
<dondelelcaro> vorlon: ok...
<dondelelcaro> cool... makes sense... and the fact that the perl
module links against them isn't good enough, right?
<dondelelcaro> rrr... links against libImlib2
<vorlon> right. When I say "imlib2 is being dlopen()ed", I mean
"imlib2 is only linked to by something that's being dlopen()ed"
<vorlon> either way, it doesn't end up in the master symbol list.
<dondelelcaro> oh, ok... so when the next thing gets dlopen()ed it
doesn't get to see the symbols loaded by something else
that was dlopen()ed?
<vorlon> right.
<vorlon> unless you use a particular flag to dlopen() -- one that you
should never, ever use. :)
<dondelelcaro> vorlon: right. Ok, good.
* dondelelcaro reassigns the bug to imlib2 with this conversation
This probably needs to be taken care of upstream, because I've already
heard reports of it breaking on Fedora, Mandrake, and Ubuntu.
[Probably breaks elsewhere as well.]
The following is basically the change that broke Imlib2 for perl:
--- Makefile.in 2005-01-05 17:22:26.000000000 -0800
+++ ../../imlib2-1.2.0/src/modules/loaders/Makefile.in 2005-02-05
14:34:57.000000000 -0800
@@ -286,49 +268,54 @@
$(GIF_L) \
$(ZLIB_L) \
$(BZ2_L) \
-pnm.la argb.la bmp.la xpm.la tga.la lbm.la
+pnm.la \
+argb.la \
+bmp.la \
+xpm.la \
+tga.la \
+lbm.la
jpeg_la_SOURCES = loader_jpeg.c
-jpeg_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-jpeg_la_LIBADD = @JPEGLIBS@ -lImlib2
+jpeg_la_LDFLAGS = -module -avoid-version
+jpeg_la_LIBADD = @JPEGLIBS@
png_la_SOURCES = loader_png.c
-png_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-png_la_LIBADD = @PNGLIBS@ -lImlib2
+png_la_LDFLAGS = -module -avoid-version
+png_la_LIBADD = @PNGLIBS@
tiff_la_SOURCES = loader_tiff.c
-tiff_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-tiff_la_LIBADD = @TIFFLIBS@ -lImlib2
+tiff_la_LDFLAGS = -module -avoid-version
+tiff_la_LIBADD = @TIFFLIBS@
gif_la_SOURCES = loader_gif.c
-gif_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-gif_la_LIBADD = @GIFLIBS@ -lImlib2
+gif_la_LDFLAGS = -module -avoid-version
+gif_la_LIBADD = @GIFLIBS@
+zlib_la_SOURCES = loader_zlib.c
+zlib_la_LDFLAGS = -module -avoid-version
+zlib_la_LIBADD = @ZLIBLIBS@
+bz2_la_SOURCES = loader_bz2.c
+bz2_la_LDFLAGS = -module -avoid-version
+bz2_la_LIBADD = @BZ2LIBS@
pnm_la_SOURCES = loader_pnm.c
-pnm_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-pnm_la_LIBADD = -lImlib2
+pnm_la_LDFLAGS = -module -avoid-version
+pnm_la_LIBADD =
argb_la_SOURCES = loader_argb.c
-argb_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-argb_la_LIBADD = -lImlib2
+argb_la_LDFLAGS = -module -avoid-version
+argb_la_LIBADD =
bmp_la_SOURCES = loader_bmp.c
-bmp_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-bmp_la_LIBADD = -lImlib2
+bmp_la_LDFLAGS = -module -avoid-version
+bmp_la_LIBADD =
xpm_la_SOURCES = loader_xpm.c
-xpm_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-xpm_la_LIBADD = -lImlib2
+xpm_la_LDFLAGS = -module -avoid-version
+xpm_la_LIBADD =
tga_la_SOURCES = loader_tga.c
-tga_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-tga_la_LIBADD = -lImlib2
-zlib_la_SOURCES = loader_zlib.c
-zlib_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-zlib_la_LIBADD = @ZLIBLIBS@ -lImlib2
-bz2_la_SOURCES = loader_bz2.c
-bz2_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-bz2_la_LIBADD = @BZ2LIBS@ -lImlib2
+tga_la_LDFLAGS = -module -avoid-version
+tga_la_LIBADD =
lbm_la_SOURCES = loader_lbm.c
-lbm_la_LDFLAGS = -no-undefined -module -avoid-version
-L$(top_builddir)/src -L$(top_builddir)/src/.libs
-lbm_la_LIBADD = -lImlib2
+lbm_la_LDFLAGS = -module -avoid-version
+lbm_la_LIBADD =
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am
$(am__configure_deps)
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \