Skip site navigation (1) Skip section navigation (2)

[PATCH] Reduce dependancies of postmaster (without --as-needed)

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: [PATCH] Reduce dependancies of postmaster (without --as-needed)
Date: 2005-11-27 20:02:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
As a recent bug pointed out, you really only want to link libraries you
actually need because the others could export functions that you don't
want and interfere. Rather than relying a GCC only feature, this takes
the good old fashioned approach: filtering out the libraries you don't

Attached is a patch which applies this filtering to the backend and has
the same results as linking with --as-needed. I basically took the
filter list of libpq and altered it as follows:

libs removed: -lnsl -lresolv
libs added: -ldl -lm

Incidently, the libs removed don't appear to be needed by anything in
any file in the source, so I wonder if they're even required.

This probably needs a bit of testing on a few different architechtures
to make sure it works. I also only apply it to the non-windows, non-aix
case since the building requirements there are different enough that
someone with such a platforn should do it.

Have a nice day,
Martijn van Oosterhout   <kleptog(at)svana(dot)org>
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


pgsql-patches by date

Next:From: Alvaro HerreraDate: 2005-11-27 21:30:59
Subject: Re: Reduce dependancies of postmaster (without --as-needed)
Previous:From: Michael FuhrDate: 2005-11-27 18:27:54
Subject: Re: Strange interval arithmetic

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group