From: Alan W. I. <ai...@us...> - 2003-10-16 01:08:49
|
On 2003-10-15 08:24-0700 Alan W. Irwin wrote: > So I think > we need to do some simple experiments first with bare dlopen, then > with libtool-1.5 before making a decision. Well, I could not restrain my curiosity so I went ahead with some investigation, and here are the results. My simple dlopen experiments convinced me that dlopening object files is not allowed in Linux (contrary to the Howto): gcc -shared -fPIC libhello.c -o libhello.so gcc -g -o demo_dynamic demo_dynamic.c -ldl ./demo_dynamic Hello, library world. So simple dlopen of shared object works as advertised. gcc -fPIC libhello.c -c -o libhello.so Couldn't open libhello.so: ./libhello.so: ELF file's phentsize not the expected size But simple dlopen of non-shared simple object file does not work. If you look up that error message on google, you see lots of discussion including this year 2000 thread: http://sources.redhat.com/ml/bug-glibc/2000-10/msg00031.html Apparently, you can do this on solaris, but the linux dlopen types don't want to implement this behaviour (at least that was the attitude in 2000). Now, as Joao noted, libtool has some solutions for platforms (e.g., Linux) where plugins cannot be object files. I tried to make that work (using libtool options like -dlopen self), but I couldn't do it for the simple test case I put together. I have run out of time for now and doubt I will try this again any time soon. Unless someone else wants to take over with their own libtool experiments, I guess we could just accept that the combination of --disable-shared and plug-ins is not well supported on our dominant platform (Linux) even under libtool for now (or else I could not find the right combination of options to make this work under libtool.) Given this, then as a semi-permanent workaround (at least until libtool can support it cross-platform) it makes sense to disable dyndrivers if shared libraries are disabled just like Joao has suggested all along. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the PLplot scientific plotting software package (plplot.org), the Yorick front-end to PLplot (yplot.sf.net), the Loads of Linux Links project (loll.sf.net), and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |