From 07838f75d8d57c72516cf327fcfd2dcb2bd2b6b1 Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Tue, 16 Sep 2025 17:50:58 +0200 Subject: [PATCH 1/5] PG-1879 Silence warnings from libkmip in make builds Warnings from libkmip were previously only silenced in Meson builds. --- contrib/pg_tde/Makefile | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/pg_tde/Makefile b/contrib/pg_tde/Makefile index f691f3d400302..7c3837b95ce69 100644 --- a/contrib/pg_tde/Makefile +++ b/contrib/pg_tde/Makefile @@ -27,6 +27,12 @@ version TAP_TESTS = 1 endif +KMIP_OBJS = \ +src/libkmip/libkmip/src/kmip.o \ +src/libkmip/libkmip/src/kmip_bio.o \ +src/libkmip/libkmip/src/kmip_locate.o \ +src/libkmip/libkmip/src/kmip_memset.o + OBJS = src/encryption/enc_tde.o \ src/encryption/enc_aes.o \ src/access/pg_tde_tdemap.o \ @@ -47,10 +53,7 @@ src/smgr/pg_tde_smgr.o \ src/pg_tde_event_capture.o \ src/pg_tde_guc.o \ src/pg_tde.o \ -src/libkmip/libkmip/src/kmip.o \ -src/libkmip/libkmip/src/kmip_bio.o \ -src/libkmip/libkmip/src/kmip_locate.o \ -src/libkmip/libkmip/src/kmip_memset.o +$(KMIP_OBJS) SCRIPTS_built = src/bin/pg_tde_archive_decrypt \ src/bin/pg_tde_change_key_provider \ @@ -78,6 +81,8 @@ endif override SHLIB_LINK += -lcurl -lcrypto -lssl +$(KMIP_OBJS): CFLAGS += '-w' # This is a 3rd party, disable warnings completely + src/bin/pg_tde_change_key_provider: src/bin/pg_tde_change_key_provider.o $(top_srcdir)/src/fe_utils/simple_list.o $(top_builddir)/src/libtde/libtde.a $(CC) -DFRONTEND $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) From e134104ba77c9acecf4842d64a0d3e0e28bee06e Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Tue, 16 Sep 2025 17:55:08 +0200 Subject: [PATCH 2/5] PG-1879 Simplify Makefile logic There is no reaosn to user override and appending for everything. PostgreSQL themselves only use it for things like CFLAGS where the user is expected to specify their own stuff. --- contrib/pg_tde/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/pg_tde/Makefile b/contrib/pg_tde/Makefile index 7c3837b95ce69..49d2857767316 100644 --- a/contrib/pg_tde/Makefile +++ b/contrib/pg_tde/Makefile @@ -59,8 +59,8 @@ SCRIPTS_built = src/bin/pg_tde_archive_decrypt \ src/bin/pg_tde_change_key_provider \ src/bin/pg_tde_restore_encrypt -EXTRA_INSTALL += contrib/pg_buffercache contrib/test_decoding -EXTRA_CLEAN += src/bin/pg_tde_archive_decrypt.o \ +EXTRA_INSTALL = contrib/pg_buffercache contrib/test_decoding +EXTRA_CLEAN = src/bin/pg_tde_archive_decrypt.o \ src/bin/pg_tde_change_key_provider.o \ src/bin/pg_tde_restore_encrypt.o \ xlogreader.c \ @@ -69,17 +69,17 @@ xlogreader.o ifdef USE_PGXS PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) -override PG_CPPFLAGS += -I$(CURDIR)/src/include -I$(CURDIR)/src/libkmip/libkmip/include +PG_CPPFLAGS = -I$(CURDIR)/src/include -I$(CURDIR)/src/libkmip/libkmip/include include $(PGXS) else subdir = contrib/pg_tde top_builddir = ../.. -override PG_CPPFLAGS += -I$(top_srcdir)/$(subdir)/src/include -I$(top_srcdir)/$(subdir)/src/libkmip/libkmip/include +PG_CPPFLAGS = -I$(top_srcdir)/$(subdir)/src/include -I$(top_srcdir)/$(subdir)/src/libkmip/libkmip/include include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk endif -override SHLIB_LINK += -lcurl -lcrypto -lssl +SHLIB_LINK = -lcurl -lcrypto -lssl $(KMIP_OBJS): CFLAGS += '-w' # This is a 3rd party, disable warnings completely From 51003a4b0b9b399a52d0ae5a2573c37cbd1daa51 Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Tue, 16 Sep 2025 17:55:56 +0200 Subject: [PATCH 3/5] PG-1879 Use libpgfeutils.a when building with make This mirrors how it is done in other parts of PostgreSQL where meson uses the .o object directly while Make uses libpgutils.a. --- contrib/pg_tde/Makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/contrib/pg_tde/Makefile b/contrib/pg_tde/Makefile index 49d2857767316..b0271795d98d5 100644 --- a/contrib/pg_tde/Makefile +++ b/contrib/pg_tde/Makefile @@ -80,17 +80,19 @@ include $(top_srcdir)/contrib/contrib-global.mk endif SHLIB_LINK = -lcurl -lcrypto -lssl +LDFLAGS_EX = -L$(top_builddir)/src/fe_utils +PG_LIBS = -lcurl -lcrypto -lssl -lpgfeutils $(KMIP_OBJS): CFLAGS += '-w' # This is a 3rd party, disable warnings completely -src/bin/pg_tde_change_key_provider: src/bin/pg_tde_change_key_provider.o $(top_srcdir)/src/fe_utils/simple_list.o $(top_builddir)/src/libtde/libtde.a - $(CC) -DFRONTEND $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) +src/bin/pg_tde_change_key_provider: src/bin/pg_tde_change_key_provider.o $(top_builddir)/src/libtde/libtde.a | submake-libpgfeutils + $(CC) -DFRONTEND $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) -src/bin/pg_tde_archive_decrypt: src/bin/pg_tde_archive_decrypt.o xlogreader.o $(top_srcdir)/src/fe_utils/simple_list.o $(top_builddir)/src/libtde/libtdexlog.a $(top_builddir)/src/libtde/libtde.a - $(CC) -DFRONTEND $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) +src/bin/pg_tde_archive_decrypt: src/bin/pg_tde_archive_decrypt.o xlogreader.o $(top_builddir)/src/libtde/libtdexlog.a $(top_builddir)/src/libtde/libtde.a | submake-libpgfeutils + $(CC) -DFRONTEND $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) -src/bin/pg_tde_restore_encrypt: src/bin/pg_tde_restore_encrypt.o xlogreader.o $(top_srcdir)/src/fe_utils/simple_list.o $(top_builddir)/src/libtde/libtdexlog.a $(top_builddir)/src/libtde/libtde.a - $(CC) -DFRONTEND $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X) +src/bin/pg_tde_restore_encrypt: src/bin/pg_tde_restore_encrypt.o xlogreader.o $(top_builddir)/src/libtde/libtdexlog.a $(top_builddir)/src/libtde/libtde.a | submake-libpgfeutils + $(CC) -DFRONTEND $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) xlogreader.c: % : $(top_srcdir)/src/backend/access/transam/% rm -f $@ && $(LN_S) $< . From 0c18c4d1baf25ee20ca5d2d51ea5857d891c7207 Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Tue, 16 Sep 2025 17:56:03 +0200 Subject: [PATCH 4/5] PG-1870 Silence make output in the CI The output spam from make makes it hard to find errors when the build fails. --- ci_scripts/make-build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_scripts/make-build.sh b/ci_scripts/make-build.sh index 79b5cf9281666..64f3d6dafac8a 100755 --- a/ci_scripts/make-build.sh +++ b/ci_scripts/make-build.sh @@ -44,4 +44,4 @@ case "$1" in esac ./configure --prefix="$INSTALL_DIR" --enable-debug --enable-tap-tests $ARGS -make install-world -j +make install-world -j -s From fc502c37d0e4b6898a83f69ddcc68cc72af5e5b4 Mon Sep 17 00:00:00 2001 From: Andreas Karlsson Date: Wed, 17 Sep 2025 15:13:16 +0200 Subject: [PATCH 5/5] Remove pointless define when linking executables When linking the define is ignored anyway. --- contrib/pg_tde/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/pg_tde/Makefile b/contrib/pg_tde/Makefile index b0271795d98d5..91154698667dc 100644 --- a/contrib/pg_tde/Makefile +++ b/contrib/pg_tde/Makefile @@ -86,13 +86,13 @@ PG_LIBS = -lcurl -lcrypto -lssl -lpgfeutils $(KMIP_OBJS): CFLAGS += '-w' # This is a 3rd party, disable warnings completely src/bin/pg_tde_change_key_provider: src/bin/pg_tde_change_key_provider.o $(top_builddir)/src/libtde/libtde.a | submake-libpgfeutils - $(CC) -DFRONTEND $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) + $(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) src/bin/pg_tde_archive_decrypt: src/bin/pg_tde_archive_decrypt.o xlogreader.o $(top_builddir)/src/libtde/libtdexlog.a $(top_builddir)/src/libtde/libtde.a | submake-libpgfeutils - $(CC) -DFRONTEND $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) + $(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) src/bin/pg_tde_restore_encrypt: src/bin/pg_tde_restore_encrypt.o xlogreader.o $(top_builddir)/src/libtde/libtdexlog.a $(top_builddir)/src/libtde/libtde.a | submake-libpgfeutils - $(CC) -DFRONTEND $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) + $(CC) $(CFLAGS) $^ $(PG_LIBS_INTERNAL) $(LDFLAGS) $(LDFLAGS_EX) $(PG_LIBS) $(LIBS) -o $@$(X) xlogreader.c: % : $(top_srcdir)/src/backend/access/transam/% rm -f $@ && $(LN_S) $< .