public inbox for [email protected]  
help / color / mirror / Atom feed
From: Daniel Gustafsson <[email protected]>
To: Heikki Linnakangas <[email protected]>
Cc: solai v <[email protected]>
Cc: Jacob Champion <[email protected]>
Cc: Mark Dilger <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Lars Kanis <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Merlin Moncure <[email protected]>
Subject: Re: libpq: Process buffered SSL read bytes to support records >8kB on async API
Date: Thu, 9 Jul 2026 17:06:55 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAOYmi+=jZNU9mZ4Z83aR0RiqZ2pF35u5040gCxBgcFqoA4oNbQ@mail.gmail.com>
	<CAOYmi+mpymrgZ76Jre2dx_PwRniS9YZojwH0rZnTuiGHCsj0rA@mail.gmail.com>
	<CAOYmi+=kbb7pV7k7RfWUcFt=CArJmp1R+R1Xnb8UnZLwpFgOwA@mail.gmail.com>
	<CAOYmi+==Y5ZZiwukN-wzGCyxdrL1dU3wOG-j0nza3MC3R2XhcA@mail.gmail.com>
	<kl6inl3iyycxqpiedmnnzaz2ytid5dw6knwwqk5plg6ej34oi6@fbyu4ll7ebzn>
	<CAOYmi+kZhv_LCg=g8Z6xtiueSYdz1fCvrXwAJ-i9m3VMm9_tXw@mail.gmail.com>
	<CAOYmi+mD6EbDEYfwZON0FCUAvGO+2=jR2V4KQYx+d+g0ap0Amg@mail.gmail.com>
	<CAOYmi+=YJ2J_sQ6yS8y1o9AX1Xgz35_r0hApV8QRWwi1K8gC0g@mail.gmail.com>
	<[email protected]>
	<CAHgHdKseseJG0j_96xrOuP3LgubvGScvXsQyPCYWANnBxTL4tA@mail.gmail.com>
	<[email protected]>
	<CAF0whuf=-G3SwXSTWyZNO148qoaEmth71cM7XBuX4X+2PnQkPQ@mail.gmail.com>
	<[email protected]>
	<[email protected]>

> On 7 Jul 2026, at 17:58, Heikki Linnakangas <[email protected]> wrote:

> Committed and backpatched to all supported versions. Thanks everyone!

Sorry for coming to this thread late.  When compiling against a local LibreSSL
on macOS I get an error on INT_MAX missing:

../src/interfaces/libpq/fe-secure-openssl.c:253:22: error: use of undeclared identifier 'INT_MAX'
        else if (pending == INT_MAX)
                            ^
1 error generated.

AFAICS it's because openssl/conf.h includes openssl/ossl_typ.h which in turn
includes <limits.h> but the LibreSSL counterpart does not.  That being said, it
clearly works in the buildfarm where we have LibreSSL animals on OpenBSD so it
must get pulled in indirectly from somewhere else there.  This might be
isolated to macOS builds, but I don't have other systems with LibreSSL handy so
not sure.  My LibreSSL installation is a libressl_portable locally compiled
which further may explain differences?

Any objections to the attached to make compilation pass when building against
LibreSSL on macOS (and possibly elsewhere)?

--
Daniel Gustafsson



Attachments:

  [application/octet-stream] 0001-ssl-Include-limits.h-to-get-INT_MAX-when-using-Libre.patch (1.0K, ../[email protected]/2-0001-ssl-Include-limits.h-to-get-INT_MAX-when-using-Libre.patch)
  download | inline diff:
From 731f58640688005edfaf981b446ae1392e1996ba Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <[email protected]>
Date: Thu, 9 Jul 2026 17:00:46 +0200
Subject: [PATCH] ssl: Include limits.h to get INT_MAX when using LibreSSL

When compiling against OpenSSL, the <limits.h> header is indirectly
included via openssl/ossl_typ.h from openssl/conf.h, but the LibreSSL
version of ossl_typ.h does not include <limits.h> which cause compiler
failure due to missing symbol (since ffd080d94fe).  Fix by explicitly
including <limits.h>.
---
 src/interfaces/libpq/fe-secure-openssl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index f8b2184a1ce..c7651c98ab5 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -25,6 +25,7 @@
 #include <signal.h>
 #include <fcntl.h>
 #include <ctype.h>
+#include <limits.h>
 
 #include "libpq-fe.h"
 #include "fe-auth.h"
-- 
2.39.3 (Apple Git-146)



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], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: libpq: Process buffered SSL read bytes to support records >8kB on async API
  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