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
Список pgsql-hackers
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"
Дата:
Сообщение: Re: [HACKERS] Dynamic result sets from procedures
Следующее
От: Nico Williams
Дата:
Сообщение: Re: [HACKERS] [PATCH] Add ALWAYS DEFERRED option for constraints