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 1p2cFg-0002Vs-QE for pgsql-interfaces@arkaria.postgresql.org; Tue, 06 Dec 2022 18:01:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1p2cFf-0006m0-Df for pgsql-interfaces@arkaria.postgresql.org; Tue, 06 Dec 2022 18:01:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2cFf-0006lr-68 for pgsql-interfaces@lists.postgresql.org; Tue, 06 Dec 2022 18:01:07 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p2cFc-0002ot-Oi for pgsql-interfaces@lists.postgresql.org; Tue, 06 Dec 2022 18:01:06 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4A35E5C0099; Tue, 6 Dec 2022 13:01:02 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 06 Dec 2022 13:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1670349662; x=1670436062; bh=ePUeh+y3qh s5HHYhyZSt9i7ld4o32VZbB0XzSPEaIWo=; b=hV8rqqN9OfqUgvkom+26HgIce+ xdEBbvuqQzqLoA4RJIfK4LYOe6dxbFaBifzmK4Vwr5mrvheA6Q2feiJVEZtsrlfT 4LGxkfK/9CThIfdufartRcUOPCLqcNhaKi0wGIxqXFFx8gQ9QYwL2/64jswIIKML Pw/HjGRG9fPDuidKUw5S060cRhBL9mF6wLMAPrQqb81K12NY1/cpxGKiZ8FJ8unx ZUaMij43Rzrqih7Y4r/7yzRIiYY7q/OPn37EBo6hJosQ5TwvQLfVHjYxdyRgkJJs ul82bdgfh5M2FpBpNyFbKOouBbFELqg+kAJFh2MpngYRJJ0mx2qm1ok78kGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1670349662; x=1670436062; bh=ePUeh+y3qhs5HHYhyZSt9i7ld4o3 2VZbB0XzSPEaIWo=; b=kvAvU7OYu5OKVTd9C+uffnGmjCZabidlAQ2O54lb+mTA HTZMwuMx+6rQadB6cRFoDY6GK7LnCtM3SF0zHmFAS+KD1PR7VwtkxysfhmCX9vXW H0g85qgzxxi6ypHH0JvCi8QlaLRAK/jDx+JKzLkKwaNRseC2WFM/8EU9mneHtgYG A47DWjHO4IQ61Fh2y//XwU4zi7ivtK0lN30M/kLz2atVcP2uXBpd45BTY7TV4nzw eyUiXtZN7icMyFlaqzOCR9e3MfZzij2A4C6iqiXzfBOY+og6MDUxSThQHMZTvtCq BMARCF6qjyDv3v1G/GJrWzKuD+is8iFLtbvu+d15Bg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudeigddutdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Dec 2022 13:01:01 -0500 (EST) Date: Tue, 6 Dec 2022 10:01:00 -0800 From: Andres Freund To: Marco Bambini Cc: ALBERTO CABELLO =?utf-8?Q?S=C3=81NCHEZ?= , "pgsql-interfaces@lists.postgresql.org" Subject: Re: Libpq linked statically linked to OpenSSL/LibreSSL Message-ID: <20221206180100.yoluppdnsaivckwi@awork3.anarazel.de> References: <7B10A8B6-04E3-49F3-AB0D-413E8B0AC365@creolabs.com> <10650109-6ECE-4F7D-9014-2785AA2D413B@creolabs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <10650109-6ECE-4F7D-9014-2785AA2D413B@creolabs.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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