Re: [HACKERS] Linking libpq statically to libssl

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: [HACKERS] Linking libpq statically to libssl
Дата
Msg-id
f5f53163-0536-ed09-5b1d-aeaccecc1c29@2ndquadrant.com
Ответ на
Список
Дерево обсуждения
[HACKERS] Linking libpq statically to libssl Daniele Varrazzo <daniele.varrazzo@gmail.com>
Re: [HACKERS] Linking libpq statically to libssl Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Linking libpq statically to libssl Daniele Varrazzo <daniele.varrazzo@gmail.com>
Re: [HACKERS] Linking libpq statically to libssl Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] Linking libpq statically to libssl Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Linking libpq statically to libssl Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] Linking libpq statically to libssl Stephen Frost <sfrost@snowman.net>
Re: [HACKERS] Linking libpq statically to libssl Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
On 10/27/17 08:24, Daniele Varrazzo wrote:
> I have a problem building binary packages for psycopg2. Binary
> packages ship with their own copies of libpq and libssl;

Aside from the advice of "don't do that" ...

> however if
> another python package links to libssl the library will be imported
> twice with conflicting symbols, likely resulting in a segfault (see
> https://github.com/psycopg/psycopg2/issues/543). This happens e.g. if
> a python script both connects to postgres and opens an https resource.

... the standard solutions to this problem are symbol versioning and
linker flags to avoid making all symbols globally available.  libpq has
symbol versioning.  Maybe the libssl you are using does not.  Also, for
example, if you dlopen() with RTLD_LOCAL, the symbols will not be
globally available, so there should be no conflicts.

This needs cooperation from various different parties, and the details
will likely be platform dependent.  But it's generally a solved problem.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
В списке pgsql-hackers по дате отправления
От: Daniel Verite
Дата:
От: Nico Williams
Дата:
FAQ