Subject: [4.9] Link error on MinGW cross compile Linux -> Windows

From: Frank Büttner <[email-masked]>
Date: Wed, 21 Dec 2022 06:56:54 +0100

Hi,
the version 4.9 will compile, but the link part will fails with:
make[2]: Entering directory '/builddir/build/BUILD/sed-4.9/build_win64'
x86_64-w64-mingw32-gcc    -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 
-fexceptions --param=ssp-buffer-size=4  -fstack-protector -lssp -o 
sed/sed.exe sed/sed-compile.o sed/sed-debug.o sed/sed-execute.o 
sed/sed-mbcs.o sed/sed-regexp.o sed/sed-sed.o sed/sed-utils.o 
sed/libver.a lib/libsed.a
make[2]: Leaving directory '/builddir/build/BUILD/sed-4.9/build_win64'
/usr/lib/gcc/x86_64-w64-mingw32/11.2.1/../../../../x86_64-w64-mingw32/bin/ld: 
lib/libsed.a(libsed_a-getrandom.o): in function `getrandom':
/builddir/build/BUILD/sed-4.9/build_win64/../lib/getrandom.c:128: 
undefined reference to `BCryptGenRandom'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:3154: sed/sed.exe] Error 1
make[1]: *** [Makefile:5237: all-recursive] Error 1
make: *** [Makefile:2761: all] Error 2

Build OS: Fedora 36 64  bit
Target: Windows 64 bit

I have added the list with the used packages and the full build log.

Or make I something complete wrong at the build?

Thanks for help.
Frank

-- 
*Frank Büttner*
IT

MDC Berlin-Buch
Max-Delbrück-Centrum für Molekulare Medizin in der Helmholtz-Gemeinschaft
Robert-Rössle-Straße 10
13125 Berlin

☎ +49 30 9406 2038
℻ +49 30 9406 2599
✉ [email-masked]