There is an updated pull request by sgn against master on the void-packages repository https://github.com/sgn/void-packages postgresql-fix-pg-config https://github.com/void-linux/void-packages/pull/20783 postgresql: fix pg_config --*flags Current `pg_config` reports flags included `$SYSROOT`, $ pg_config --cppflags -D_GNU_SOURCE -I/usr/aarch64-linux-musl/usr/include/libxml2 Fix the build system to remove it from $CPPFLAGS $CFLAGS $LDFLAGS. Also ship a new pg_config.sh for cross-compiling other packages that depends on postgresql. That script was mostly translated from C code. (Partial?) fix for #19642 A patch file from https://github.com/void-linux/void-packages/pull/20783.patch is attached