From 8695b5151efa806f13b04117ae34891f03c6ec2a Mon Sep 17 00:00:00 2001 From: Gavin Brand Date: Fri, 24 Jul 2026 10:52:03 -0700 Subject: [PATCH] fix: link vcpkg static libroaring by exact path The pgxs -L/usr/lib prefix otherwise wins the linker search order and binds -lroaring to the ancient system libroaring.so (0.2.66), which lacks symbols such as roaring_free. When ROARING_LIB_DIR is set, link the static archive by full path; otherwise fall back to -lroaring. --- pg_ducklake/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pg_ducklake/Makefile b/pg_ducklake/Makefile index 8559c59c..5798b7a1 100644 --- a/pg_ducklake/Makefile +++ b/pg_ducklake/Makefile @@ -54,9 +54,13 @@ endif # resolves static archives in a single left-to-right pass. PG_DUCKLAKE_LINK_FLAGS += -lssl -lcrypto -lstdc++ -llz4 ifneq ($(ROARING_LIB_DIR),) - PG_DUCKLAKE_LINK_FLAGS += -L$(ROARING_LIB_DIR) + # Link the vcpkg static archive by exact path: the pgxs -L/usr/lib prefix + # otherwise wins the search order and binds -lroaring to the ancient system + # libroaring.so (0.2.66), which lacks symbols like roaring_free. + PG_DUCKLAKE_LINK_FLAGS += $(ROARING_LIB_DIR)/libroaring.a +else + PG_DUCKLAKE_LINK_FLAGS += -lroaring endif -PG_DUCKLAKE_LINK_FLAGS += -lroaring ifneq ($(shell uname -s),Darwin) PG_DUCKLAKE_LINK_FLAGS += -Wl,--exclude-libs,ALL endif