Unable to build GDB on Windows

Simon Cook simon.cook@embecosm.com
Mon Sep 28 13:47:25 GMT 2020


I've been trying to build top of tree GDB on Windows (natively under
the MSYS2 environment), and haven't been able to link successfully due
to undefined symbols after linking against gnulib:

    CXXLD  gdb.exe
  ../gnulib/import/libgnu.a(getrandom.o): In function `getrandom':
undefined reference to `BCryptGenRandom'
  collect2.exe: error: ld returned 1 exit status

Reading through the source file and gnulib/import/m4/getrandom.m4, it
suggests that in my case if bcrypt can be guaranteed to be present
then I should add -lbcrypt to my linker flags to resolve these
references, and indeed if I execute the failing gdb link command and
add -lbcrypt at the end then my link succeeds.

Is this an issue that anyone has seen before? It's not clear on my
side whether there's an issue with my environment causing that
dependency to be needed, and something missing from the GDB makefiles.

Many thanks,

More information about the Gdb mailing list