PG Bug reporting form <noreply@postgresql.org> writes:
> Build command:
> ../configure --prefix=/path/to/pgsql-gcc CFLAGS='-O3 -flto' CXXFLAGS='-O3
> -flto'
When I try that on that platform (well, actually RHEL 8.4, but should
be close enough) I get a lot of complaints like
ar: pgstrsignal.o: plugin needed to handle lto object
ar: pqsignal.o: plugin needed to handle lto object
ar: qsort.o: plugin needed to handle lto object
ar: qsort_arg.o: plugin needed to handle lto object
ar: quotes.o: plugin needed to handle lto object
ar: snprintf.o: plugin needed to handle lto object
so that the later complaints like
/tmp/ccWzhmx0.ltrans29.ltrans.o: In function `_bt_preprocess_array_keys':
<artificial>:(.text+0x2d264): undefined reference to `qsort_arg'
/tmp/ccWzhmx0.ltrans29.ltrans.o: In function `tblspc_desc':
<artificial>:(.text+0xdee): undefined reference to `appendStringInfo'
<artificial>:(.text+0xe0a): undefined reference to `appendStringInfo'
aren't terribly surprising. Those functions should come out of
libpqcommon.a, but seemingly that hasn't been built correctly.
I'd say the conclusion is "don't use -flto, it doesn't really work
yet on this platform". Or possibly there's some not-installed-by-
default infrastructure you need to use it. Either way, this does
not look like a Postgres bug; it's a compiler toolchain problem.
regards, tom lane