You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Mladen Turk <mt...@apache.org> on 2005/08/13 12:54:16 UTC

Creating .so with static APR

Hi,

Anyone knows if there is a possibility to create a .so that
will use APR as static library?

Also what will happen if I have a multiple .so's inside the
same process each with APR statically linked.

Is something like that possible?

Regards,
Mladen.

Re: Creating .so with static APR

Posted by Joe Orton <jo...@redhat.com>.
On Sun, Aug 14, 2005 at 01:32:27PM -0500, William Rowe wrote:
> At 07:07 AM 8/13/2005, Ryan Bloom wrote:
> >I have created a dynamic Apache 1.3 module with APR statically linked
> >in, so I know it is possible.  I have never tried loading multiple
> >modules like this into a single running Apache however.
> 
> It's portable if we don't load each module LTDL_GLOBAL (?) but
> since we do, all modules are promiscuously placed into the global
> namespace.

For any self-contained module you only need to define global symbol, the 
module entry point, so you should be able to hide any statically linked 
APR by linking it with "-export-symbols-regex foo_module".

> The *right* thing to do in httpd2.2 is probably quit loading global,

Removing global symbol dependencies between modules in the httpd tree 
would be a prerequisite to that, and that's nowhere near.  See e.g. 
proxy, cache, ...

joe


Re: Creating .so with static APR

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 05:09 PM 8/16/2005, Ryan Bloom wrote:
>Couple of things.
>
>1)  This is an httpd thread at this point, and should be migrated to that list.

Ack - however until apr_dso_load() supports the semantics, they
have nothing much to discuss :)

>2)  You can't support loading multiple modules with APR statically
>until httpd can be configured to load modules with local symbols.  You
>can't do this by default because of the mod_proxy case.

If mod_proxy exposes it's 'local symbols' via registered 
functions and hooks, this is a non-issue.

However, the parts of proxy which 'must' be exposed can become
a libproxyutil.so which is LoadFile'ed rather that LoadModule'ed,
and becomes more useful for everyone, including those apps not
loaded into httpd.

Bill



Re: Creating .so with static APR

Posted by Ryan Bloom <rb...@gmail.com>.
Couple of things.

1)  This is an httpd thread at this point, and should be migrated to that list.
2)  You can't support loading multiple modules with APR statically
until httpd can be configured to load modules with local symbols.  You
can't do this by default because of the mod_proxy case.

Ryan

On 8/16/05, Mladen Turk <mt...@apache.org> wrote:
> Nick Kew wrote:
> > William A. Rowe, Jr. wrote:
> >
> >> The *right* thing to do in httpd2.2 is probably quit loading global,
> >> since we getsym the module structure, and launch everything from
> >> there.  Perhaps, if a user needs all the symbols, they can use
> >> LoadFile to obtain those.
> >
> >
> > LoadModule foo_modules modules/mod_foo.so [local|global]
> >
> > If we do that, might we want to support LAZY|NOW at the same time?
> >
> 
> What would be required to at least support safe loading of
> multiple modules with APR statically bundled.
> I presume the 'local' would be a way to go as default as Bill proposed.
> 
> 
> Regards,
> Mladen
> 


-- 
Ryan Bloom
rbb@apache.org
rbb@rkbloom.net
rbloom@gmail.com

Re: Creating .so with static APR

Posted by Mladen Turk <mt...@apache.org>.
Nick Kew wrote:
> William A. Rowe, Jr. wrote:
> 
>> The *right* thing to do in httpd2.2 is probably quit loading global,
>> since we getsym the module structure, and launch everything from
>> there.  Perhaps, if a user needs all the symbols, they can use
>> LoadFile to obtain those.
> 
> 
> LoadModule foo_modules modules/mod_foo.so [local|global]
> 
> If we do that, might we want to support LAZY|NOW at the same time?
> 

What would be required to at least support safe loading of
multiple modules with APR statically bundled.
I presume the 'local' would be a way to go as default as Bill proposed.


Regards,
Mladen

Re: Creating .so with static APR

Posted by Nick Kew <ni...@webthing.com>.
William A. Rowe, Jr. wrote:

> The *right* thing to do in httpd2.2 is probably quit loading global,
> since we getsym the module structure, and launch everything from
> there.  Perhaps, if a user needs all the symbols, they can use
> LoadFile to obtain those.

LoadModule foo_modules modules/mod_foo.so [local|global]

If we do that, might we want to support LAZY|NOW at the same time?

-- 
Nick Kew

Re: Creating .so with static APR

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
At 07:07 AM 8/13/2005, Ryan Bloom wrote:
>I have created a dynamic Apache 1.3 module with APR statically linked
>in, so I know it is possible.  I have never tried loading multiple
>modules like this into a single running Apache however.

It's portable if we don't load each module LTDL_GLOBAL (?) but
since we do, all modules are promiscuously placed into the global
namespace.

The *right* thing to do in httpd2.2 is probably quit loading global,
since we getsym the module structure, and launch everything from
there.  Perhaps, if a user needs all the symbols, they can use
LoadFile to obtain those.  All of this needs an extra flavor of
apr_dso_load, of course.

All this is possible considering registered hooks and registered
functions provide us all the entry points we should need.

Bill



Re: Creating .so with static APR

Posted by Ryan Bloom <rb...@gmail.com>.
I have created a dynamic Apache 1.3 module with APR statically linked
in, so I know it is possible.  I have never tried loading multiple
modules like this into a single running Apache however.

Ryan

On 8/13/05, Mladen Turk <mt...@apache.org> wrote:
> Hi,
> 
> Anyone knows if there is a possibility to create a .so that
> will use APR as static library?
> 
> Also what will happen if I have a multiple .so's inside the
> same process each with APR statically linked.
> 
> Is something like that possible?
> 
> Regards,
> Mladen.
> 


-- 
Ryan Bloom
rbb@apache.org
rbb@rkbloom.net
rbloom@gmail.com