Re: building libpq.a static library

From: Jeroen Ooms <jeroen(at)berkeley(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jeroen Ooms <jeroen(at)berkeley(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: building libpq.a static library
Date: 2017-07-12 15:46:13
Message-ID: CABFfbXtey3Y4xXnOGshLKwSZQkFBJSDiz83_aZNDGXbR9m=fGA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 12, 2017 at 5:11 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jeroen Ooms <jeroen(at)berkeley(dot)edu> writes:
>> I maintain static libraries for libpq for the R programming language
>> (we need static linking to ship with the binary packages).
>
> How do you get that past vendor packaging policies? When I worked at
> Red Hat, there was a very strong policy against allowing any package
> to statically embed parts of another one, because it creates serious
> management problems if e.g. the other one needs a security update.
> I'm sure Red Hat isn't the only distro that feels that way.

We only use this on Windows. On platforms with a decent package
manager we indeed link to a shared library.

> FWIW, we used to have support for building static libpq, but
> we got rid of it a long time ago.

OK that's too bad. I agree that shared libs are often preferable but
in some environments dynamic linking is simply not possible and you
need to static link the library into the application. Most C/C++
libraries do support --enable-static and even for most linux distros
the static libs are included with the lib-dev / lib-devel package.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2017-07-12 15:49:52 Re: pl/perl extension fails on Windows
Previous Message Tom Lane 2017-07-12 15:35:07 Re: pl/perl extension fails on Windows