From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AB85A3857C48; Sun, 28 Mar 2021 06:06:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB85A3857C48 From: "chrisj at rtems dot org" To: gdb-prs@sourceware.org Subject: [Bug build/27657] New: GDB fails to link on MSYS2 and mingw64 looking for BCryptGenRandom Date: Sun, 28 Mar 2021 06:06:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: build X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chrisj at rtems dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Mar 2021 06:06:49 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27657 Bug ID: 27657 Summary: GDB fails to link on MSYS2 and mingw64 looking for BCryptGenRandom Product: gdb Version: HEAD Status: UNCONFIRMED Severity: normal Priority: P2 Component: build Assignee: unassigned at sourceware dot org Reporter: chrisj at rtems dot org Target Milestone: --- I am building the RTEMS tool chain which includes GDB on Windows using MSYS= 2. We build GDB with Python. I am getting an unresolved symbol error for BCryptGenRandom.=20 The build log is .. https://ftp.rtems.org/pub/rtems/people/chrisj/gdb/rsb-log-20210328-155802.t= xt The repo we clone is a mirror of yours on github ... https://github.com/RTEMS/sourceware-mirror-binutils-gdb The version we are using is sourceware-mirror-binutils-gdb-fc9b4c8. GDB configure is in mixed minds about bcrypt.h ... checking bcrypt.h presence... yes configure: WARNING: bcrypt.h: present but cannot be compiled configure: WARNING: bcrypt.h: check for missing prerequisite headers? configure: WARNING: bcrypt.h: see the Autoconf documentation configure: WARNING: bcrypt.h: section "Present But Cannot Be Compiled" configure: WARNING: bcrypt.h: proceeding with the compiler's result checking for bcrypt.h... no checking whether the bcrypt library is guaranteed to be present... checking= if x86_64-w64-mingw32-gcc -O2 -g -pipe -I/d/opt/rtems/rsb.git/rtems/build/tmp/sb-197609/6s/d/opt/rtems/6/include supports -fno-rtti -fno-exceptions... checking if x86_64-w64-mingw32-gcc -O= 2 -g -pipe -I/d/opt/rtems/rsb.git/rtems/build/tmp/sb-197609/6s/d/opt/rtems/6/inc= lude supports -fno-rtti -fno-exceptions... no The source builds without error which is nice but the link fails ... CXXLD gdb.exe C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_= 64-w64-mingw32/bin/ld.exe: ../gnulib/import/libgnu.a(getrandom.o): in function `getrandom': D:\opt\rtems\rsb.git\rtems\build\srgfxwm1\build\gnulib\import/../../../sour= ceware-mirror-binutils-gdb-fc9b4c8/gnulib/import/getrandom.c:129: undefined reference to `BCryptGenRandom' collect2.exe: error: ld returned 1 exit status >>From my simplified outside view it seems like the library libbcrypt.a is missing ... $ grep -r BCryptGenRandom /mingw64 /mingw64/x86_64-w64-mingw32/include/bcrypt.h: NTSTATUS WINAPI BCryptGenRan= dom (BCRYPT_ALG_HANDLE hAlgorithm, PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFla= gs); Binary file /mingw64/x86_64-w64-mingw32/lib/libbcrypt.a matches The library is part of the MSYS2 package ... $ pacman -Qo /mingw64/x86_64-w64-mingw32/lib/libbcrypt.a /mingw64/x86_64-w64-mingw32/lib/libbcrypt.a is owned by mingw-w64-x86_64-crt-git 9.0.0.6128.07922837-1 This looks like an archive wrapper for the standard Windows DLL. --=20 You are receiving this mail because: You are on the CC list for the bug.=