This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: DLOPEN and Statically linked executable


Peter Zaitsev <peter@mysql.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
>    possible
>    - 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.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]