From 8ade9e0b2ef62efa32ce50a50df0d5e22d9f954b Mon Sep 17 00:00:00 2001 From: Eric Sabouraud Date: Fri, 21 Mar 2025 17:17:29 +0100 Subject: [PATCH] Add rpath for PG_LIBDIR. This ensures that libpq is loaded at run time from the same directory as the one used at compile time. This removes ambiguity at run time on systems where multiple versions of the PostgreSQL client are installed. Of course this is however less flexible because multiple versions of pgqd have to be built against different versions of libpq, but this protects against unforeseen API/ABI breakages. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0bcefc5..3d6b68c 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ pgqd_SOURCES = src/pgqd.c src/maint.c src/ticker.c src/retry.c \ src/pgqd.h nodist_pgqd_SOURCES = pgqd.ini.h pgqd_CPPFLAGS = -I$(PG_INCDIR) -Isrc -I. -pgqd_LDFLAGS = -L$(PG_LIBDIR) +pgqd_LDFLAGS = -L$(PG_LIBDIR) -Wl,-rpath,$(PG_LIBDIR) pgqd_LIBS = -lpq -lm pgqd_EMBED_LIBUSUAL = 1