public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andres Freund <[email protected]>
To: Marco Bambini <[email protected]>
Cc: ALBERTO CABELLO SÁNCHEZ <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Libpq linked statically linked to OpenSSL/LibreSSL
Date: Tue, 6 Dec 2022 10:01:00 -0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<PA4PR05MB8969E8C20AC8EC343149E0F8A7189@PA4PR05MB8969.eurprd05.prod.outlook.com>
	<PA4PR05MB896952E77CAFA3AD5CB188EBA7189@PA4PR05MB8969.eurprd05.prod.outlook.com>
	<[email protected]>
	<[email protected]>

Hi,

On 2022-12-06 11:05:49 +0100, Marco Bambini wrote:
> I made some progresses, especially in understanding where the issue can be.
> 
> I started with a fresh postgresql-15.1 source code installation:
> # ./configure --with-openssl --without-readline
> 
> I then modified the Makefile.global in the src directory by replacing the occurrences of -lssl and -lcrypto with:
> /root/rothsoft/libressl-3.6.1/ssl/.libs/libssl.a /root/rothsoft/libressl-3.6.1/crypto/.libs/libcrypto.a
> in the LIBS entry.

I think this is completely the wrong path. You should add libressl's include
and library directories to --with-includes=, --with-libraries=.


> Please notice all the U entries in the crypto/ssl functions, so it looks like that they are NOT statically linked inside the libpq.so shared library, even if I replaced the LIBS in the Makefile.

If there's also a shared version of libressl, you possibly would need to
specify that you'd want to link statically. Something like
-Wl,-Bstatic -lssl -lcrypto -Wl,-Bdynamic

But I suspect that you're better of linking dynamically, specifying
--with-includes= --with-libraries= should provide a path towards that. It's
possible that you should add -Wl,-rpath,/path/to/libressl/lib to the LDFLAGS,
so that the dynamic version can be found at runtime.

Greetings,

Andres Freund





view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Libpq linked statically linked to OpenSSL/LibreSSL
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox