This is the mail archive of the
mailing list for the glibc project.
Re: DLOPEN and Statically linked executable
- From: Andreas Jaeger <aj at suse dot de>
- To: Peter Zaitsev <peter at mysql dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Thu, 20 Jun 2002 17:58:55 +0200
- Subject: Re: DLOPEN and Statically linked executable
- References: <firstname.lastname@example.org>
Peter Zaitsev <email@example.com> writes:
> Hello libc-alpha,
> Forgive me in advance if I am using wrong mailing list for the
> question, I just was unable to find better one.
> At MySQL we use patched version of GLIBC for MySQL binary
> distribution and so have to compile it statically. This patched
> version of GLIBC is must to handle high load, it uses smaller thread
> stack size instead of default 2M and has different mutex handling,
> so less context switches will happen in case of MySQL and will give
> better performance.
You can compile it shared and install glibc in a differnt directory.
The smaller threads shouldn't need a patch if you compile for
i686-linux-gnu with --enable-kernel=2.4.0.
> MySQL has a good possibility of adding UDF (User Defined functions)
> which are presented as dynamically loaded shared libraries, and
> there is good set of such contributions already exist.
> Unfortunately currently just a few people may benefit both from user
> extensions support and improved performance - the one who will
> install patched GLIBC to the system and will link dynamically
> against it.
> The problem is - UDF does not work then MySQL is compiled
> statically. dlopen() itself works but it does not allow access to
> global symbols of running binary which are required for the
> functions to work.
dlopen is not supported in static applications. It might work for you
in the glibc version you tested but as glibc developers we only
support it for the nss modules.
> So I'm wondering if there is good solution for this problem.
> Personally I see the following options:
> - make dlopen to work correctly with static applications ? Is this
> - special compilation way. May be it is possible to link statically
> everything but some minor library to make the thing solved
> - ship special glibc and following libraries in MySQL distribution
> and link to them explicitly ?
The latter would work as mentioned above.
SuSE Labs firstname.lastname@example.org