gdb-add-index contains: $GDB --batch -nx -iex 'set auto-load no' \ -iex 'set debuginfod enabled off' \ -ex "file $file" -ex "save gdb-index $dwarf5 $dir" So it always disables debuginfod. But gdb/debuginfod-support.c has: /* Set callback for "set debuginfod enabled". */ static void set_debuginfod_enabled (const char *value) { #if defined(HAVE_LIBDEBUGINFOD) debuginfod_enabled = value; #else error (NO_IMPL); #endif } So when not compiled against libdebuginfod that will always generate a error on stderr. This causes some testcase in dwz to FAIL, because any output to stderr is seen as failure. It also makes package build logs (if they use gdb-add-index) somewhat noisy.
Patch posted to mailing list https://sourceware.org/pipermail/gdb-patches/2022-July/190521.html
Fixed in commit 92b0a182fe00