I only bothered with this because the other ebuild is hard masked, but it's the one I have installed. This one was tricky. It'll quietly fail to find gtk if gtk isn't fixed, and compile fine with --as-needed. But it'll kill gnome-libs on configure, even if you disable --as-needed in make.conf. This is because it sticks --as-needed into the output of imlib-config, thus gnome-libs flips out, dies, and annoys user. The errors here were just dumb: Hey, let's have a libgdk_imlib.so, but not bother to link with gdk. I also altered configure so that linker flags come before any objects. It doesn't make a big difference, but it does matter. I only fixed this for linux. I just don't really care about HP-UX,IRIX,netbsd,etc. Sorry.
Created attachment 87080 [details, diff] imlib-1.9.14 as-needed fix
Created attachment 87081 [details, diff] imlib-1.9.14-r3.ebuild.patch for --as-needed
This patch is not correct. You should never touch the 'configure' file, if the code comes out of configure.in, patch that. If you have Makefile.am, don't patch Makefile.in. Also, you have to re-run autotools when you touch their files. When you touch only Makefile.am you can just run "eautomake" (it takes care by itself to call the right tools if the automake version originally used is too old), when you touch also configure.{in,ac} you have to use eautoreconf (you might just use eautoconf, but eautoreconf is safer, albeit longer, and should always used instead of eautoconf if possible). If the code in configure is not found in configure.in it might be that it's coming out of libtool, if that's the case you might want to use eautoreconf anyway to force libtool regeneration.
Created attachment 87188 [details, diff] Revised imlib-1.9.14-r3 patch for --as-needed configure.in isn't as changed as it seems. Mostly, I cleaned up quoting and enclosed nested macros in '[' and ']'
Created attachment 87189 [details, diff] Revised imlib-1.9.14-r3.ebuild.patch for --as-needed Now with 100% more "eautoreconf"...
Created attachment 87217 [details, diff] (Re)Revised imlib-1.9.14-r3 patch for --as-needed There were three chars that got unintentionally omitted from an AC_TRY_COMPILE. They're back now.
Created attachment 87218 [details, diff] (Re)Revised imlib-1.9.14-r3 patch for --as-needed There were three chars that got unintentionally omitted from an AC_TRY_COMPILE. They're back now.
Ummm, I don't know why firefox posted that twice.
Created attachment 87497 [details, diff] (Re(Re))Revised imlib-1.9.14-r3 patch for --as-needed Pasted in the wrong error message for jpeglib failure.
Hi, I tried your patch and it didn't work for me. I suspect the libraries are linked in the wrong order when I get the error: powerpc-unknown-linux-gnu-gcc -O2 -mcpu=7450 -mtune=7450 -pipe -maltivec -mabi=altivec -fno-strict-aliasing -Wl,--as-needed -o .libs/imlib_config imlib_config.o icons.o testimg.o -rdynamic ../gdk_imlib/.libs/libgdk_imlib.so -L/usr/X11R6/lib -L/usr/lib /usr/lib/libgtk.so /usr/lib/libgdk.so /usr/lib/libgmodule.so /usr/lib/libglib.so /usr/lib/libXi.so /usr/lib/libXext.so /usr/lib/libtiff.so -ljbig /usr/lib/libjpeg.so -lc /usr/lib/libgif.so /usr/lib/libSM.so /usr/lib/libICE.so /usr/lib/libX11.so /usr/lib/libXau.so /usr/lib/libXdmcp.so -ldl /usr/lib/libpng12.so -lz -lm ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_sBIT' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifGetExtensionNext' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_read_scanlines' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifGetRecordType' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifGetImageDesc' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFDefaultStripSize' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_strip_16' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_filler' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_create_read_struct' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_set_defaults' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifOpenFileHandle' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFReadRGBAImage' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_read_fn' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_packing' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_get_io_ptr' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `_TIFFmalloc' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_start_decompress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_IHDR' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifGetLine' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFWriteScanline' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_write_rows' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifCloseFile' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `_TIFFfree' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_get_valid' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_destroy_decompress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_std_error' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_CreateDecompress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFFdOpen' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_create_write_struct' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFSetField' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFScanlineSize' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `DGifGetExtension' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_write_info' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `PrintGifError' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFClose' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_expand' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFOpen' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_read_header' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_start_compress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_write_end' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_get_IHDR' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_finish_decompress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_stdio_src' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_CreateCompress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_read_info' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_finish_compress' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_destroy_read_struct' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_read_image' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_create_info_struct' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_set_quality' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_stdio_dest' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `jpeg_write_scanlines' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_destroy_write_struct' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_set_shift' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `TIFFGetField' ../gdk_imlib/.libs/libgdk_imlib.so: undefined reference to `png_init_io' I am on ppc and use binutils-2.17.
Created attachment 105032 [details, diff] (Re(Re))Revised imlib-1.9.14-r3 patch for --as-needed (Re(Re(Re)))Revised imlib-1.9.14-r3 patch for --as-needed Not a linking order problem so much as a not-linking-at-all problem. I forgot to link the various image libraries with libgdk_imlib.so. This patch does that. I never noticed because I've been using imlib-1.9.15 this whole time. I can't believe it took this long for someone to discover that the patch didn't actually fix a damn thing.
>(Re(Re))Revised imlib-1.9.14-r3 patch for --as-needed >(Re(Re(Re)))Revised imlib-1.9.14-r3 patch for --as-needed Why did Bugzilla do that? Or maybe it was firefox. Oh,well, f*** it. It's only aesthetics.
This is a gnome 1.4 ism, and the gnome herd doesn't want to maintain it anymore. No gnome package currently in the tree deps on this.
(In reply to comment #13) > This is a gnome 1.4 ism, and the gnome herd doesn't want to maintain it > anymore. No gnome package currently in the tree deps on this. > After running "equery d imlib" I found that kuickshow and scigraphica seem to depend on imlib. ldd run on kuickshow show that it is indeed linked on imlib but not imlib2. While equery also report scigraphica I haven't found a link to imlib or imlib2 on the executable with ldd. A bit strange of a kde app like kuickshow to depend on imlib instead of imlib2.
(In reply to comment #14) May I ask how's this related to --as-needed issues?
(In reply to comment #15) After comment #13 I checked that I really needed imlib and it wasn't just cruft that I should remove. I guess I had the idea that someone would solve the problem by pulling imlib out on the ground that apps using it are gone and reacted to that. So no it is not relevant to --as-needed sorry for the pollution.
My entire system is built with --as-needed and had no problems with imlib at all.