[pgpool-hackers: 4584] Re: Make pgpool build on OpenBSD

Tatsuo Ishii ishii at postgresql.org
Mon May 5 13:06:12 JST 2025


Thank you for the patch!

I have pushed it to all supported branches, down to v4.2.

Best regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

> Hello all,
> 
> There's currently 4 changes needed to make pgpool build on OpenBSD:
> - va_list is defined stdarg.h[0]
> - pthread_t is defined in pthread.h / sys/types.h[1]
>   On OpenBSD sys/types.h doesn't suffice, so include pthread.h.
> - LibreSSL has removed HMAC_CTX_init(), and has support for HMAC_CTX_new
>   since 2018. I've talked to Theo Buehler of LibreSSL and he said that he'd
>   prefer to simply remove the LIBRESSL_VERSION_NUMBER, but if desired by
>   upstream the LIBRESSL_VERSION_NUMBER should be 0x2070100fL.
> - WIFEXITED is defined in sys/wait.h[2]
> 
> Sincerely,
> 
> Martijn van Duren
> 
> [0] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdarg.h.html
> [1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/pthread.h.html
> [2] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_wait.h.html
> 
> diff /home/martijn/src/pgpool2
> path + /home/martijn/src/pgpool2
> commit - 5c41d5338710ab89a3c4e5b9466eaea5ae1bb09c
> blob - 1eb6797ea67e4e553868facdb5c175c25a730969
> file + src/include/utils/fe_ports.h
> --- src/include/utils/fe_ports.h
> +++ src/include/utils/fe_ports.h
> @@ -28,6 +28,7 @@
>  #error "This file is not expected to be compiled for pgpool utilities only"
>  #endif
>  
> +#include <stdarg.h>
>  #include <stdlib.h>
>  #ifndef FE_PORTS
>  #define FE_PORTS
> commit - 5c41d5338710ab89a3c4e5b9466eaea5ae1bb09c
> blob - 414376a16def75089af64e57db57bcbbd19f03d7
> file + src/include/watchdog/wd_utils.h
> --- src/include/watchdog/wd_utils.h
> +++ src/include/watchdog/wd_utils.h
> @@ -26,6 +26,7 @@
>  #define WD_UTILS_H
>  
>  #include <ifaddrs.h>
> +#include <pthread.h>
>  #include "parser/pg_list.h"
>  
>  #define WD_NG (0)
> commit - 5c41d5338710ab89a3c4e5b9466eaea5ae1bb09c
> blob - eff2dde952689ca4fcdd3169745b63ce8379ce17
> file + src/utils/ssl_utils.c
> --- src/utils/ssl_utils.c
> +++ src/utils/ssl_utils.c
> @@ -221,7 +221,7 @@ calculate_hmac_sha256(const char *data, int len, char 
>  	unsigned int res_len = WD_AUTH_HASH_LEN;
>  	HMAC_CTX   *ctx = NULL;
>  
> -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER))
> +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
>  	ctx = HMAC_CTX_new();
>  	HMAC_CTX_reset(ctx);
>  #else
> @@ -233,7 +233,7 @@ calculate_hmac_sha256(const char *data, int len, char 
>  	HMAC_Init_ex(ctx, key, strlen(key), EVP_sha256(), NULL);
>  	HMAC_Update(ctx, (unsigned char *) data, len);
>  	HMAC_Final(ctx, (unsigned char *) str, &res_len);
> -#if (OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined (LIBRESSL_VERSION_NUMBER))
> +#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
>  	HMAC_CTX_reset(ctx);
>  	HMAC_CTX_free(ctx);
>  #else
> commit - 5c41d5338710ab89a3c4e5b9466eaea5ae1bb09c
> blob - b0d01ecb6f8ae1ddda9ac818a391c2ba6f62422c
> file + src/watchdog/wd_escalation.c
> --- src/watchdog/wd_escalation.c
> +++ src/watchdog/wd_escalation.c
> @@ -27,9 +27,7 @@
>  #include <unistd.h>
>  #include <errno.h>
>  
> -#ifdef __FreeBSD__
>  #include <sys/wait.h>
> -#endif
>  
>  #include "utils/pool_signal.h"
>  #include "utils/elog.h"
> 
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers


More information about the pgpool-hackers mailing list