Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNKJa-00027u-Hw for pgsql-general@arkaria.postgresql.org; Tue, 29 Sep 2020 18:25:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kNKJZ-000470-GP for pgsql-general@arkaria.postgresql.org; Tue, 29 Sep 2020 18:25:25 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNKJZ-00046r-8n for pgsql-general@lists.postgresql.org; Tue, 29 Sep 2020 18:25:25 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNKJX-0001dq-8k for pgsql-general@lists.postgresql.org; Tue, 29 Sep 2020 18:25:24 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08TIPMfK713346; Tue, 29 Sep 2020 14:25:22 -0400 From: Tom Lane To: Joshua Poehls cc: pgsql-general@lists.postgresql.org Subject: Re: Compile 12.2 with specific OpenSSL libraries In-reply-to: References: Comments: In-reply-to Joshua Poehls message dated "Tue, 29 Sep 2020 13:13:57 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <713344.1601403922.1@sss.pgh.pa.us> Date: Tue, 29 Sep 2020 14:25:22 -0400 Message-ID: <713345.1601403922@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Joshua Poehls 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