Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#4447 new defect

rtems-source-builder undefined reference to `BCryptGenRandom'

Reported by: Burak Deniz Owned by:
Priority: normal Milestone:
Component: admin Version: 6
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

When trying to build RTEMS by RSB with below instruction I get following error;

"../source-builder/sb-set-builder --prefix=$HOME/quick-start/rtems/6 6/rtems-sparc"

Error; "
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: ../gnulib/import/libgnu.a(getrandom.o): in function `getrandom':

C:\msys64\home\w7\quick-start\src\rsb\rtems\build\srg7xwm1\build\gnulib\import/../../../sourceware-mirror-binutils-gdb-7ab567f/gnulib/import/getrandom.c:129: undefined reference to `BCryptGenRandom'

collect2.exe: error: ld returned 1 exit status

make[2]: * [Makefile:1866: gdb.exe] Error 1

make[2]: Leaving directory '/c/msys64/home/w7/quick-start/src/rsb/rtems/build/srg7xwm1/build/gdb'

make[1]: * [Makefile:9410: all-gdb] Error 2

make[1]: Leaving directory '/c/msys64/home/w7/quick-start/src/rsb/rtems/build/srg7xwm1/build'

make: * [Makefile:866: all] Error 2

shell cmd failed: sh -ex /c/msys64/home/w7/quick-start/src/rsb/rtems/build/srg7xwm1/do-build

error: building srg7xwm1
"

OS: Windows 7 64 bit,
Rtems Version: 6
using MSYS2

Change History (4)

comment:1 Changed on 06/01/21 at 12:59:36 by Joel Sherrill

This looks like gdb on msys2 is not being linked against a random number library.

https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom

Also looks like that may be deprecated.

comment:2 Changed on 06/01/21 at 13:38:05 by Burak Deniz

Last edited on 06/01/21 at 13:48:52 by Burak Deniz (previous) (diff)

comment:3 in reply to:  1 Changed on 06/01/21 at 13:47:37 by Burak Deniz

Replying to Joel Sherrill:

This looks like gdb on msys2 is not being linked against a random number library.

https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom

Also looks like that may be deprecated.

Hello Joel, thank you for your comment.
I check the file on this path ;"/mingw64/x86_64-w64-mingw32/include" by grep and the file is exist but not exist in "/mingw64/include". I will try to copy or install.
$find . | grep "bcrypt.h"
./bcrypt.h

Last edited on 06/01/21 at 13:48:18 by Burak Deniz (previous) (diff)

comment:4 Changed on 06/01/21 at 16:47:11 by Joel Sherrill

I found this thread which I read as you might be missing a DLL:

http://sourceware-org.1504.n7.nabble.com/Unable-to-build-GDB-on-Windows-td649748.html

It is also possible based on that thread that gdb is missing some configure magic still.

Note: See TracTickets for help on using tickets.