Hi, hackers
I've run into a build issue when trying to use pg_probackup with PostgreSQL
18beta1. After some adjustments to pg_probackup, I encountered the following
linker errors:
/usr/bin/ld: src/pg_crc.o: in function `crc32_bytea':
/home/japin/Codes/extensions/pg_probackup/src/pg_crc.c:109:(.text+0x40): undefined reference to
`pg_detoast_datum_packed'
/usr/bin/ld: src/pg_crc.o: in function `crc32c_bytea':
/home/japin/Codes/extensions/pg_probackup/src/pg_crc.c:122:(.text+0x1a1): undefined reference to
`pg_detoast_datum_packed'
collect2: error: ld returned 1 exit status
make: *** [/data/Codes/ngdb/main/build/ngdb/lib/postgresql/pgxs/src/makefiles/pgxs.mk:478: pg_probackup] Error 1
It appears that PostgreSQL commit 760162f introduced user-callable CRC
functions. Since pg_probackup leverages pg_crc.c from the PostgreSQL source,
this change is leading to the "undefined reference to pg_detoast_datum_packed"
errors during the build.
To resolve this, I'm wondering about wrapping these user-callable CRC functions
with an #ifndef FRONTEND block:
#ifndef FRONTEND
... // user-callable CRC functions here
#endif
This would ensure these functions are only included in the backend compilation
and avoid linker issues when building extensions like pg_probackup.
Any thoughts or alternative suggestions would be greatly appreciated!
--
Regards,
Japin Li