Re: Compile 12.2 with specific OpenSSL libraries

From: Joshua Poehls <joshua(at)poehls(dot)me>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Compile 12.2 with specific OpenSSL libraries
Date: 2020-09-29 18:30:42
Message-ID: CAF5BchhmvUkM1-PMzGNRFtKdzqnFuRK5JMVimv4LF3iy8iBDWA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

rpath and LD_LIBRARY_PATH are only relevant for the runtime
linking/resolution, right? My concern is that at *compilation time* the
wrong version of OpenSSL is being picked up. Is there a way to see the full
library/header path the compiler is using so that I can verify the path I
specified with --with-headers and --with-libraries is taking precedence
over the system paths?

On Tue, Sep 29, 2020 at 1:25 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Joshua Poehls <joshua(at)poehls(dot)me> writes:
> > I'm compiling PG 12.2 (on CentOS 7) and need to ensure that it uses a
> > specific version of OpenSSL (1.1.1h). I've added what I think are the
> > appropriate `./configure` flags (see below) and compilation is successful
> > but when I run `ldd -d initdb` or `readelf` I can see that it linked to a
> > different version of libcrypto/libssl.
>
> > --with-openssl --with-includes=/path/to/ssl/include
> > --with-libraries=/path/to/ssl/lib
>
> > My theory is that even though I'm adding
> --with-libraries/--with-includes,
> > the build script is finding and using the version of OpenSSL in /lib64/
> > because it has higher precedence somewhere.
>
> Linux is generally pretty unfriendly to putting shlibs in nonstandard
> places. If you want to do that, you need to add an "rpath" spec to
> the calling programs, or set LD_LIBRARY_PATH, or fool around with the
> dynamic linker's configuration files. "man ld.so" will get you started.
>
> regards, tom lane
>

--
--
Joshua Poehls
joshua(at)poehls(dot)me

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2020-09-29 18:33:34 Re: Compile 12.2 with specific OpenSSL libraries
Previous Message Tom Lane 2020-09-29 18:25:22 Re: Compile 12.2 with specific OpenSSL libraries