media-gfx/sane-backends should link with libstdc++ to make external backends work (iscan #50043) here is the patch against media-gfx/sane-backends-1.0.14-r6.ebuild: --- sane-backends-1.0.14-r6.ebuild.orig 2004-10-15 15:05:46.244561904 +0200 +++ sane-backends-1.0.14-r6.ebuild 2004-10-15 15:06:43.183905808 +0200 @@ -25,6 +25,8 @@ LICENSE="GPL-2 public-domain" KEYWORDS="~x86 ~sparc ~ppc ~ppc64" +#Make external backends (iscan) happy +LDFLAGS="-lstdc++" src_unpack() { unpack ${A} Thanks.- felix Reproducible: Always Steps to Reproduce: 1. 2. 3.
This doesn't look really clean - sane-backends can't link against all possible libraries external backends use. Are you sure it is not possible to modify iscan in a way that doesn't require sane-backends to be changed?
In my understanding this means to rewrite iscan in c instead of c++. Correct me if im wrong. But is this so expensive to link against libstdc++ since this lib is prvovided by glibc ? So it should be always avialable. But maybe you have a better idea how to solve this in a clean way ?
My point is that a library (or plugin, or backend, whatever) that depends on other libraries should tell the linker that it needs them, not rely on the main application being linked against this library. So IMHO iscan should be changed to link with all necessary libraries, not sane-backends.
A description of the problem is here: http://www.epkowa.co.jp/cgi-bin/lx/bbs/en/scanner-bbs/hyperbbs.cgi?mode=view;start=1;Code=87 so if i execute: LD_PRELOAD=/usr/lib/libstdc++-v3/libstdc++.so.5 scanimage -L (i have an gcc3.4 system) it works. Any idea how to solve this ? A wrapper isn't possible, since we want to use the epkowa-backend (iscan) with all other apps. (kooka, xsane, scanimage...)
The backend .so should link to libstdc++.
I had a short look at your iscan ebuild - no idea where the dependency on libstdc++ actually comes from, but please give it a try with unmodified sane-backends and a slightly modified iscan.ebuild: make LDFLAGS="${LDFLAGS} -lstdc++" || die instead of make || die I can't really test it, but this makes libsane-epokwa.so depend on libstdc++ on my system.
That was of course the first i tried. But it doesnt work. Here is the output of LD_DEBUG=files scanimage -L (this doesnt work) 16074: 16074: file=libsane.so.1; needed by scanimage 16074: file=libsane.so.1; generating link map 16074: dynamic: 0x400341b0 base: 0x4002f000 size: 0x0000551c 16074: entry: 0x400305c0 phdr: 0x4002f034 phnum: 5 16074: 16074: 16074: file=libusb-0.1.so.4; needed by scanimage 16074: file=libusb-0.1.so.4; generating link map 16074: dynamic: 0x4003b38c base: 0x40035000 size: 0x00007978 16074: entry: 0x40036220 phdr: 0x40035034 phnum: 5 16074: 16074: 16074: file=libnsl.so.1; needed by scanimage 16074: file=libnsl.so.1; generating link map 16074: dynamic: 0x40050e6c base: 0x4003e000 size: 0x000158e0 16074: entry: 0x40041ae0 phdr: 0x4003e034 phnum: 9 16074: 16074: 16074: file=libjpeg.so.62; needed by scanimage 16074: file=libjpeg.so.62; generating link map 16074: dynamic: 0x40071a34 base: 0x40054000 size: 0x0001dc78 16074: entry: 0x40056370 phdr: 0x40054034 phnum: 5 16074: 16074: 16074: file=libieee1284.so.3; needed by scanimage 16074: file=libieee1284.so.3; generating link map 16074: dynamic: 0x40079144 base: 0x40072000 size: 0x000073c8 16074: entry: 0x40073b20 phdr: 0x40072034 phnum: 5 16074: 16074: 16074: file=libgphoto2.so.2; needed by scanimage 16074: file=libgphoto2.so.2; generating link map 16074: dynamic: 0x40094014 base: 0x4007a000 size: 0x0007a8e0 16074: entry: 0x4007ec90 phdr: 0x4007a034 phnum: 5 16074: 16074: 16074: file=libgphoto2_port.so.0; needed by scanimage 16074: file=libgphoto2_port.so.0; generating link map 16074: dynamic: 0x400fb52c base: 0x400f5000 size: 0x000067fc 16074: entry: 0x400f6640 phdr: 0x400f5034 phnum: 5 16074: 16074: 16074: file=libdl.so.2; needed by scanimage 16074: file=libdl.so.2; generating link map 16074: dynamic: 0x400feee8 base: 0x400fc000 size: 0x00003088 16074: entry: 0x400fdb80 phdr: 0x400fc034 phnum: 9 16074: 16074: 16074: file=libexif.so.9; needed by scanimage 16074: file=libexif.so.9; generating link map 16074: dynamic: 0x40113014 base: 0x40101000 size: 0x00013580 16074: entry: 0x40102f90 phdr: 0x40101034 phnum: 5 16074: 16074: 16074: file=libm.so.6; needed by scanimage 16074: file=libm.so.6; generating link map 16074: dynamic: 0x40136ef8 base: 0x40115000 size: 0x000220a0 16074: entry: 0x40118370 phdr: 0x40115034 phnum: 9 16074: 16074: 16074: file=libc.so.6; needed by scanimage 16074: file=libc.so.6; generating link map 16074: dynamic: 0x40246d3c base: 0x40138000 size: 0x00112c0c 16074: entry: 0x4014cd20 phdr: 0x40138034 phnum: 11 16074: 16074: 16074: calling init: /lib/libc.so.6 16074: 16074: 16074: calling init: /lib/libm.so.6 16074: 16074: 16074: calling init: /usr/lib/libexif.so.9 16074: 16074: 16074: calling init: /lib/libdl.so.2 16074: 16074: 16074: calling init: /usr/lib/libgphoto2_port.so.0 16074: 16074: 16074: calling init: /usr/lib/libgphoto2.so.2 16074: 16074: 16074: calling init: /usr/lib/libieee1284.so.3 16074: 16074: 16074: calling init: /usr/lib/libjpeg.so.62 16074: 16074: 16074: calling init: /lib/libnsl.so.1 16074: 16074: 16074: calling init: /usr/lib/libusb-0.1.so.4 16074: 16074: 16074: calling init: /usr/lib/libsane.so.1 16074: 16074: 16074: initialize program: scanimage 16074: 16074: 16074: transferring control: scanimage 16074: 16074: file=/usr/lib/sane/libsane-epkowa.so.1; generating link map 16074: dynamic: 0x402654c0 base: 0x4024c000 size: 0x0001d540 16074: entry: 0x4024f300 phdr: 0x4024c034 phnum: 6 16074: 16074: 16074: file=libstdc++.so.5; needed by /usr/lib/sane/libsane-epkowa.so.1 16074: file=libstdc++.so.5; generating link map 16074: dynamic: 0x40341784 base: 0x40282000 size: 0x000c8e94 16074: entry: 0x402c1dc0 phdr: 0x40282034 phnum: 6 16074: 16074: 16074: file=libgcc_s.so.1; needed by /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 16074: file=libgcc_s.so.1; generating link map 16074: dynamic: 0x40353504 base: 0x4034b000 size: 0x000086c0 16074: entry: 0x4034c580 phdr: 0x4034b034 phnum: 6 16074: 16074: 16074: calling init: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.2/libgcc_s.so.1 16074: 16074: 16074: calling init: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.so.5 16074: 16074: 16074: calling init: /usr/lib/sane/libsane-epkowa.so.1 16074: 16074: opening file=/usr/lib/sane/libsane-epkowa.so.1; opencount == 1 16074: 16074: file=libesint23.so; generating link map 16074: dynamic: 0x40391fb4 base: 0x4036c000 size: 0x00026a3c 16074: entry: 0x4037164c phdr: 0x4036c034 phnum: 4 16074: 16074: 16074: file=libpthread.so.0; needed by /usr/lib/libesint23.so 16074: file=libpthread.so.0; generating link map 16074: dynamic: 0x403a1ecc base: 0x40393000 size: 0x000111ec 16074: entry: 0x403977d0 phdr: 0x40393034 phnum: 10 16074: 16074: /usr/lib/libesint23.so: error: symbol lookup error: undefined symbol: __gxx_personality_v0 (fatal) 16074: 16074: calling fini: /usr/lib/libesint23.so 16074: No scanners were identified. If you were expecting something different, >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> And this is the output of: LD_DEBUG=files LD_PRELOAD=/usr/lib/libstdc++-v3/libstdc++.so.5 scanimage -L (this works) 16104: file=/usr/lib/libstdc++-v3/libstdc++.so.5; needed by scanimage 16104: file=/usr/lib/libstdc++-v3/libstdc++.so.5; generating link map 16104: dynamic: 0x400c962c base: 0x40017000 size: 0x000bb600 16104: entry: 0x400520c0 phdr: 0x40017034 phnum: 6 16104: 16104: 16104: file=libsane.so.1; needed by scanimage 16104: file=libsane.so.1; generating link map 16104: dynamic: 0x400f11b0 base: 0x400ec000 size: 0x0000551c 16104: entry: 0x400ed5c0 phdr: 0x400ec034 phnum: 5 16104: 16104: 16104: file=libusb-0.1.so.4; needed by scanimage 16104: file=libusb-0.1.so.4; generating link map 16104: dynamic: 0x400f838c base: 0x400f2000 size: 0x00007978 16104: entry: 0x400f3220 phdr: 0x400f2034 phnum: 5 16104: 16104: 16104: file=libnsl.so.1; needed by scanimage 16104: file=libnsl.so.1; generating link map 16104: dynamic: 0x4010ce6c base: 0x400fa000 size: 0x000158e0 16104: entry: 0x400fdae0 phdr: 0x400fa034 phnum: 9 16104: 16104: 16104: file=libjpeg.so.62; needed by scanimage 16104: file=libjpeg.so.62; generating link map 16104: dynamic: 0x4012da34 base: 0x40110000 size: 0x0001dc78 16104: entry: 0x40112370 phdr: 0x40110034 phnum: 5 16104: 16104: 16104: file=libieee1284.so.3; needed by scanimage 16104: file=libieee1284.so.3; generating link map 16104: dynamic: 0x40135144 base: 0x4012e000 size: 0x000073c8 16104: entry: 0x4012fb20 phdr: 0x4012e034 phnum: 5 16104: 16104: 16104: file=libgphoto2.so.2; needed by scanimage 16104: file=libgphoto2.so.2; generating link map 16104: dynamic: 0x40150014 base: 0x40136000 size: 0x0007a8e0 16104: entry: 0x4013ac90 phdr: 0x40136034 phnum: 5 16104: 16104: 16104: file=libgphoto2_port.so.0; needed by scanimage 16104: file=libgphoto2_port.so.0; generating link map 16104: dynamic: 0x401b752c base: 0x401b1000 size: 0x000067fc 16104: entry: 0x401b2640 phdr: 0x401b1034 phnum: 5 16104: 16104: 16104: file=libdl.so.2; needed by scanimage 16104: file=libdl.so.2; generating link map 16104: dynamic: 0x401bbee8 base: 0x401b9000 size: 0x00003088 16104: entry: 0x401bab80 phdr: 0x401b9034 phnum: 9 16104: 16104: 16104: file=libexif.so.9; needed by scanimage 16104: file=libexif.so.9; generating link map 16104: dynamic: 0x401cf014 base: 0x401bd000 size: 0x00013580 16104: entry: 0x401bef90 phdr: 0x401bd034 phnum: 5 16104: 16104: 16104: file=libm.so.6; needed by scanimage 16104: file=libm.so.6; generating link map 16104: dynamic: 0x401f2ef8 base: 0x401d1000 size: 0x000220a0 16104: entry: 0x401d4370 phdr: 0x401d1034 phnum: 9 16104: 16104: 16104: file=libc.so.6; needed by scanimage 16104: file=libc.so.6; generating link map 16104: dynamic: 0x40302d3c base: 0x401f4000 size: 0x00112c0c 16104: entry: 0x40208d20 phdr: 0x401f4034 phnum: 11 16104: 16104: 16104: file=libgcc_s.so.1; needed by /usr/lib/libstdc++-v3/libstdc++.so.5 16104: file=libgcc_s.so.1; generating link map 16104: dynamic: 0x4030f504 base: 0x40307000 size: 0x000086c0 16104: entry: 0x40308580 phdr: 0x40307034 phnum: 6 16104: 16104: 16104: calling init: /lib/libc.so.6 16104: 16104: 16104: calling init: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.4.2/libgcc_s.so.1 16104: 16104: 16104: calling init: /lib/libm.so.6 16104: 16104: 16104: calling init: /usr/lib/libexif.so.9 16104: 16104: 16104: calling init: /lib/libdl.so.2 16104: 16104: 16104: calling init: /usr/lib/libgphoto2_port.so.0 16104: 16104: 16104: calling init: /usr/lib/libgphoto2.so.2 16104: 16104: 16104: calling init: /usr/lib/libieee1284.so.3 16104: 16104: 16104: calling init: /usr/lib/libjpeg.so.62 16104: 16104: 16104: calling init: /lib/libnsl.so.1 16104: 16104: 16104: calling init: /usr/lib/libusb-0.1.so.4 16104: 16104: 16104: calling init: /usr/lib/libsane.so.1 16104: 16104: 16104: calling init: /usr/lib/libstdc++-v3/libstdc++.so.5 16104: 16104: 16104: initialize program: scanimage 16104: 16104: 16104: transferring control: scanimage 16104: 16104: file=/usr/lib/sane/libsane-epkowa.so.1; generating link map 16104: dynamic: 0x4032a4c0 base: 0x40311000 size: 0x0001d540 16104: entry: 0x40314300 phdr: 0x40311034 phnum: 6 16104: 16104: 16104: calling init: /usr/lib/sane/libsane-epkowa.so.1 16104: 16104: opening file=/usr/lib/sane/libsane-epkowa.so.1; opencount == 1 16104: 16104: file=libesint23.so; generating link map 16104: dynamic: 0x4037cfb4 base: 0x40357000 size: 0x00026a3c 16104: entry: 0x4035c64c phdr: 0x40357034 phnum: 4 16104: 16104: 16104: file=libpthread.so.0; needed by /usr/lib/libesint23.so 16104: file=libpthread.so.0; generating link map 16104: dynamic: 0x4038cecc base: 0x4037e000 size: 0x000111ec 16104: entry: 0x403827d0 phdr: 0x4037e034 phnum: 10 16104: 16104: 16104: calling init: /lib/libpthread.so.0 16104: 16104: 16104: calling init: /usr/lib/libesint23.so 16104: 16104: opening file=/usr/lib/libesint23.so; opencount == 1 16104: device `epkowa:libusb:001:003' is a Epson Perfection 1260 flatbed scanner Do you have an idea how to make libesint23.so link to libstdc++ ? Its a binary, so i cant simply recompile/relink it -:( Maybe writing a new libesint23.so wich links libstdc++ and the orig libesint23.so ?
Will have another look tomorrow.
i did solve the problem with wrapper libs for the binary iscan libs. so no more need to links sane-backends with stdc. This bug can be closed. Thank you for you hints.