You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 2002/01/30 03:00:06 UTC
httpd and utils should use static libraries
httpd, htpasswd, htdigest, and the other main applications need
to be built with static libraries. In other words, they must
not be linked against libapr.so and friends.
Why? Because otherwise we make life difficult for users, and
make violation of the Principle of Least Astonishment a virtual
certainty.
Assume we provide binaries that are linked against dynamic libraries,
and then consider someone who has an Apache installation (whether
built from source or installed from RPM or other package is
immaterial) who copies the existing tree to another directory tree
for testing or whatever reason. Everything in the second tree will
work fine -- until something changes in the original tree, such as it
being deleted or upgraded. Since the original library locations
are hard-coded in the binaries that were copied, they no longer
work -- perhaps spectacularly. Similarly, it is unacceptable
for someone to copy htpasswd (for instance) from one system to
another and have it hork because of differing versions or locations
of the libraries.
If we didn't include the libraries in our package, but specified
them as prerequisites instead, this wouldn't be a problem --
everything that used the libraries would probably access them
from some standard system location. But since we're so
tightly tied to them and force the httpd-and-other apps to
be built against the versions included, we need to make sure
those builds include the libraries statically.
--
#ken P-)}
Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, opinionist http://Apache-Server.Com/
"Millenium hand and shrimp!"
Re: httpd and utils should use static libraries
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Jeff Trawick wrote:
>
> Ken's talking binbuild...
For what we distribute, certainly. But I think static
libraries should also be our default. Otherwise someone
who builds from scratch is going to run into the same
astonishment when it tries to copies home-built files
around. It'll look like it screwed up the build somewhere,
when that's not the case, and also generate a FAQ for sure.
--
#ken P-)}
Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, opinionist http://Apache-Server.Com/
"Millenium hand and shrimp!"
Re: httpd and utils should use static libraries
Posted by Jeff Trawick <tr...@attglobal.net>.
Rodent of Unusual Size <Ke...@Golux.Com> writes:
> httpd, htpasswd, htdigest, and the other main applications need
> to be built with static libraries. In other words, they must
> not be linked against libapr.so and friends.
>
> Why? Because otherwise we make life difficult for users, and
> make violation of the Principle of Least Astonishment a virtual
> certainty.
Ken's talking binbuild...
--
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: httpd and utils should use static libraries
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Jan 30, 2002 at 07:43:36AM -0800, Aaron Bannert wrote:
> I've already added this for our various support binaries:
> --enable-static-htpasswd
> ...
>
> I see no reason why we couldn't do the same for httpd. I agree that it
> may make life easier for binbuild users, but I'm totally against doing
> this always, if not merely for the fact that we're trying to make APR
> a standalone library.
++1. -- justin
Re: httpd and utils should use static libraries
Posted by Greg Ames <gr...@remulak.net>.
Aaron Bannert wrote:
> > I tried sticking --disable-shared for apr and apr-util in httpd's configure.in.
> > That doesn't work any more if you try to build the modules shared.
> I think all you have to do is pass -static to the libtool link command
> for httpd. I'll be able to fool around with this later today if nobody
> beats me to it.
you're right...-static on the httpd link works great. I guess it helps to know
what you're doing. I hid my lib/ directory after make install, and the only
failures I got on a log replay are minor things which seem to be related to
recent commits.
Greg
Re: httpd and utils should use static libraries
Posted by Aaron Bannert <aa...@clove.org>.
On Wed, Jan 30, 2002 at 11:30:23AM -0500, Greg Ames wrote:
> > I see no reason why we couldn't do the same for httpd. I agree that it
> > may make life easier for binbuild users,
>
> that would be most excellent
>
> > but I'm totally against doing
> > this always, if not merely for the fact that we're trying to make APR
> > a standalone library.
>
> agreed, but until apr and apr-util (and maybe expat??) are installed in "well
> known" locations, we should at least provide an httpd configure option to link
> the libraries statically. Otherwise, our users are going to have to dick around
> with LD_LIBRARY_PATH etc, if somebody ever tries to make a backup copy of the
> install directory for example. Yeah, apachectl now does this for you if you do
> a binbuild. But if you move the install directory manually or try to execute
> httpd directly with a binbuild, you're hosed.
>
> I tried sticking --disable-shared for apr and apr-util in httpd's configure.in.
> That doesn't work any more if you try to build the modules shared. When libtool
> tries to link the first module, it tells ld to link the .lo file which contains
> the word "timestamp". I suspect we're picking up a static build rule for the
> modules as well as the libraries.
I think all you have to do is pass -static to the libtool link command
for httpd. I'll be able to fool around with this later today if nobody
beats me to it.
Also, it looks like the two newer support binaries htdbm and checkgid don't
have this option, I'll add that in a minute.
-aaron
Re: httpd and utils should use static libraries
Posted by Greg Ames <gr...@remulak.net>.
Aaron Bannert wrote:
>
> On Tue, Jan 29, 2002 at 09:00:06PM -0500, Rodent of Unusual Size wrote:
> > httpd, htpasswd, htdigest, and the other main applications need
> > to be built with static libraries. In other words, they must
> > not be linked against libapr.so and friends.
> >
> > Why? Because otherwise we make life difficult for users, and
> > make violation of the Principle of Least Astonishment a virtual
> > certainty.
>
> I've already added this for our various support binaries:
> --enable-static-htpasswd
> ...
u da man!!
> I see no reason why we couldn't do the same for httpd. I agree that it
> may make life easier for binbuild users,
that would be most excellent
> but I'm totally against doing
> this always, if not merely for the fact that we're trying to make APR
> a standalone library.
agreed, but until apr and apr-util (and maybe expat??) are installed in "well
known" locations, we should at least provide an httpd configure option to link
the libraries statically. Otherwise, our users are going to have to dick around
with LD_LIBRARY_PATH etc, if somebody ever tries to make a backup copy of the
install directory for example. Yeah, apachectl now does this for you if you do
a binbuild. But if you move the install directory manually or try to execute
httpd directly with a binbuild, you're hosed.
I tried sticking --disable-shared for apr and apr-util in httpd's configure.in.
That doesn't work any more if you try to build the modules shared. When libtool
tries to link the first module, it tells ld to link the .lo file which contains
the word "timestamp". I suspect we're picking up a static build rule for the
modules as well as the libraries.
Greg
Re: httpd and utils should use static libraries
Posted by Greg Ames <gr...@remulak.net>.
Justin Erenkrantz wrote:
>
> On Wed, Jan 30, 2002 at 01:20:49PM -0600, William A. Rowe, Jr. wrote:
> > Certainly would agree there. httpd has dozens of modules loading anyways,
> > and benefits greatly from the apachectl configuration of the DYLD path,
> > etc. Even linking httpd static causes headaches for dynamic modules, when
> > you factor libapr/libaprutil back into the equation.
>
> Which is why I think forcing static linking of APR is not what we
> want to do.
I'm agnostic on the default, like Jeff.
> Here's a question: how many other open-source projects allow moving
> the binaries around once they are compiled and installed?
There's one very important open source project that lets you move binaries:
Apache 1.3 built with binbuild.
> An approach that I would be in favor of is twofold:
>
> - Allow explicit configure-time options to disable shared libraries
> (This can be used by third-parties, but shared libraries are still
> used by default.)
+1 on the options, punt on the default.
> - Provide a libtool wrapper that handles the relinking of the paths
> if you move your httpd binaries around.
I don't think we could reasonably expect binbuilds to use this approach. Every
binbuild installation is essentially moving the install directory. We'd have to
ship all the object files and archives, plus users would need all the tools that
libtool invokes for relinking. Not a problem on Linux, but what about OSes
where you have to pay for compilers? I think this would stop many Apache 1.3
binary users from migrating to 2.0.
If we do a little more work to enhance the configure options for disabling
shared libraries, that seems like the simplest solution for binbuild.
Greg
Re: httpd and utils should use static libraries
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Jan 30, 2002 at 01:20:49PM -0600, William A. Rowe, Jr. wrote:
> Certainly would agree there. httpd has dozens of modules loading anyways,
> and benefits greatly from the apachectl configuration of the DYLD path,
> etc. Even linking httpd static causes headaches for dynamic modules, when
> you factor libapr/libaprutil back into the equation.
Which is why I think forcing static linking of APR is not what we
want to do.
Here's a question: how many other open-source projects allow moving
the binaries around once they are compiled and installed? Especially
those that are centered around libtool?
Note that I don't have an answer to this.
An approach that I would be in favor of is twofold:
- Allow explicit configure-time options to disable shared libraries
(This can be used by third-parties, but shared libraries are still
used by default.)
- Provide a libtool wrapper that handles the relinking of the paths
if you move your httpd binaries around.
(If we must do this, this is my preferred solution. This is also
what we came up with a few weeks ago when we discussed this issue
as listed under STATUS for binbuilds. This allows dynamic
libraries and pushes this back to the libtool people who can do
this better than we can.)
My $.02. -- justin
Re: OSX libtool relinking
Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Justin Erenkrantz" <je...@ebuilt.com>
Sent: Wednesday, January 30, 2002 1:29 PM
> On Wed, Jan 30, 2002 at 01:20:49PM -0600, William A. Rowe, Jr. wrote:
> > This is especially true on my OSX box - after make install, the DYLD path
> > info is not updated, so all binaries are broken. apachectl at least
> > wraps those variables for httpd.
>
> We are relying on libtool to handle this relinking. Are you using
> the latest libtool? I believe Fred has some special OSX patches for
> libtool that are in the latest Apple developers' toolset, but I'm
> not sure. Fred? -- justin
Only the --flat-namespace patch. I will look around for the other
updates.
Bill
OSX libtool relinking was Re: httpd and utils should use static libraries
Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Wed, Jan 30, 2002 at 01:20:49PM -0600, William A. Rowe, Jr. wrote:
> This is especially true on my OSX box - after make install, the DYLD path
> info is not updated, so all binaries are broken. apachectl at least
> wraps those variables for httpd.
We are relying on libtool to handle this relinking. Are you using
the latest libtool? I believe Fred has some special OSX patches for
libtool that are in the latest Apple developers' toolset, but I'm
not sure. Fred? -- justin
Re: httpd and utils should use static libraries
Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Aaron Bannert" <aa...@clove.org>
Sent: Wednesday, January 30, 2002 9:43 AM
> On Tue, Jan 29, 2002 at 09:00:06PM -0500, Rodent of Unusual Size wrote:
> > httpd, htpasswd, htdigest, and the other main applications need
> > to be built with static libraries. In other words, they must
> > not be linked against libapr.so and friends.
> >
> > Why? Because otherwise we make life difficult for users, and
> > make violation of the Principle of Least Astonishment a virtual
> > certainty.
>
> I've already added this for our various support binaries:
> --enable-static-htpasswd
I believe that should probably be the _default_, and the converse
(something like --enable-dynamic-htpasswd) the alternative.
I think that was what Ken was getting at.
This is especially true on my OSX box - after make install, the DYLD path
info is not updated, so all binaries are broken. apachectl at least
wraps those variables for httpd.
> I see no reason why we couldn't do the same for httpd. I agree that it
> may make life easier for binbuild users, but I'm totally against doing
> this always, if not merely for the fact that we're trying to make APR
> a standalone library.
Certainly would agree there. httpd has dozens of modules loading anyways,
and benefits greatly from the apachectl configuration of the DYLD path,
etc. Even linking httpd static causes headaches for dynamic modules, when
you factor libapr/libaprutil back into the equation.
Bill
Re: httpd and utils should use static libraries
Posted by Jeff Trawick <tr...@attglobal.net>.
Aaron Bannert <aa...@clove.org> writes:
> On Wed, Jan 30, 2002 at 12:00:23PM -0500, Rodent of Unusual Size wrote:
> > Aaron Bannert wrote:
> > >
> > > I've already added this for our various support binaries:
> > > --enable-static-htpasswd
> >
> > Having to explicitly specify this to make it happen is not on;
> > it needs to be the default. Having to specify for each individual
> > util is also bogus; there should be a switch, defaulting to
> > enabled, which provides a default setting for any
> > --{en,dis}able-static-* options that are omitted.
> ...
> > As long as our build process uses private copies of apr
> > and apr-util, linking httpd statically against them needs
> > to be the default case. When we go to using a system installation
> > of apr (i.e., a standalone library already installed, rather
> > than our private copy), I agree -- in such a case the default
> > should be to use the library dynamically. And at that point
> > the utils can be linked that way as well.
>
> I could definately go for a blanket --enable-static/--disable-static
> for our support modules, and even for httpd,
+1
Is there a reason on Unix why it shouldn't include httpd too?
Is it an issue of code getting dynamically loaded by some Apache
module that wants to talk to libapr.so and doesn't know how to use the
copy of apr statically linked to httpd?
(same for aprutil, expat)
> but I'm not convinced
> that it needs to be static by default.
I'm staying out of that argument :)
--
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
Re: httpd and utils should use static libraries
Posted by Aaron Bannert <aa...@clove.org>.
On Wed, Jan 30, 2002 at 12:00:23PM -0500, Rodent of Unusual Size wrote:
> Aaron Bannert wrote:
> >
> > I've already added this for our various support binaries:
> > --enable-static-htpasswd
>
> Having to explicitly specify this to make it happen is not on;
> it needs to be the default. Having to specify for each individual
> util is also bogus; there should be a switch, defaulting to
> enabled, which provides a default setting for any
> --{en,dis}able-static-* options that are omitted.
...
> As long as our build process uses private copies of apr
> and apr-util, linking httpd statically against them needs
> to be the default case. When we go to using a system installation
> of apr (i.e., a standalone library already installed, rather
> than our private copy), I agree -- in such a case the default
> should be to use the library dynamically. And at that point
> the utils can be linked that way as well.
I could definately go for a blanket --enable-static/--disable-static
for our support modules, and even for httpd, but I'm not convinced
that it needs to be static by default. Will we link each of our
shared DSOs against a static APR as well? How will third-party
modules link against APR, statically or dynamically? What APR
library types will we install in each case?
-aaron
Re: httpd and utils should use static libraries
Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Aaron Bannert wrote:
>
> I've already added this for our various support binaries:
> --enable-static-htpasswd
Having to explicitly specify this to make it happen is not on;
it needs to be the default. Having to specify for each individual
util is also bogus; there should be a switch, defaulting to
enabled, which provides a default setting for any
--{en,dis}able-static-* options that are omitted.
> I see no reason why we couldn't do the same for httpd. I agree that it
> may make life easier for binbuild users, but I'm totally against doing
> this always, if not merely for the fact that we're trying to make APR
> a standalone library.
As long as our build process uses private copies of apr
and apr-util, linking httpd statically against them needs
to be the default case. When we go to using a system installation
of apr (i.e., a standalone library already installed, rather
than our private copy), I agree -- in such a case the default
should be to use the library dynamically. And at that point
the utils can be linked that way as well.
--
#ken P-)}
Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, opinionist http://Apache-Server.Com/
"Millenium hand and shrimp!"
Re: httpd and utils should use static libraries
Posted by Aaron Bannert <aa...@clove.org>.
On Tue, Jan 29, 2002 at 09:00:06PM -0500, Rodent of Unusual Size wrote:
> httpd, htpasswd, htdigest, and the other main applications need
> to be built with static libraries. In other words, they must
> not be linked against libapr.so and friends.
>
> Why? Because otherwise we make life difficult for users, and
> make violation of the Principle of Least Astonishment a virtual
> certainty.
I've already added this for our various support binaries:
--enable-static-htpasswd
...
I see no reason why we couldn't do the same for httpd. I agree that it
may make life easier for binbuild users, but I'm totally against doing
this always, if not merely for the fact that we're trying to make APR
a standalone library.
-aaron