[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: 20051127200252.GB7460@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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
need.

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> http://svana.org/kleptog/
> 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.

Attachment Content-Type Size
pgsql-makefile.patch text/plain 715 bytes

Responses

Browse pgsql-patches by date

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