From: Thomas Munro Date: Mon, 29 Dec 2025 02:22:16 +0000 (+1300) Subject: Fix Mkvcbuild.pm builds of test_cloexec.c. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80e8ec772bff93e04f6cafe20bdf142bfa8c79de;p=thirdparty%2Fpostgresql.git Fix Mkvcbuild.pm builds of test_cloexec.c. Mkvcbuild.pm scrapes Makefile contents, but couldn't understand the change made by commit bec2a0aa. Revealed by BF animal hamerkop in branch REL_16_STABLE. 1. It used += instead of =, which didn't match the pattern that Mkvcbuild.pm looks for. Drop the +. 2. Mkvcbuild.pm doesn't link PROGRAM executables with libpgport. Apply a local workaround to REL_16_STABLE only (later branches dropped Mkvcbuild.pm). Backpatch-through: 16 Reported-by: Tom Lane Discussion: https://postgr.es/m/175163.1766357334%40sss.pgh.pa.us --- diff --git a/src/test/modules/test_cloexec/Makefile b/src/test/modules/test_cloexec/Makefile index cd16a59add5..a83571dd182 100644 --- a/src/test/modules/test_cloexec/Makefile +++ b/src/test/modules/test_cloexec/Makefile @@ -3,8 +3,13 @@ PGFILEDESC = "test_cloexec - test O_CLOEXEC flag handling" PGAPPICON = win32 -PROGRAM += test_cloexec -OBJS += $(WIN32RES) test_cloexec.o +PROGRAM = test_cloexec +OBJS = $(WIN32RES) test_cloexec.o + +ifeq ($(PORTNAME), win32) +# Force Mkvcbuild.pm to link libpgport +PG_LIBS_INTERNAL = $(libpq_pgport) +endif NO_INSTALLCHECK = 1 TAP_TESTS = 1