Hi Simon, > Hi. I re-read the discussion around getrandom vs gc-random and didn't > see any point in keeping the duplicated code. I believe the > getrandom-approach is better than what was in gc-gnulib.c today, so this > patch make it use that function. I have pushed the patch below.
The change produces a link error when building for native Windows with MSVC: libgnu.a(getrandom.obj) : error LNK2019: unresolved external symbol BCryptGenRandom referenced in function getrandom test-gc.exe : fatal error LNK1120: 1 unresolved externals This patch fixes it. 2021-01-20 Bruno Haible <br...@clisp.org> gc-random: Fix link error in tests. * modules/crypto/gc-random (Link): New section. * modules/crypto/gc-tests (Makefile.am): Link test-gc with $(LIB_GETRANDOM). diff --git a/modules/crypto/gc-random b/modules/crypto/gc-random index 8a5ae46..0e1bd76 100644 --- a/modules/crypto/gc-random +++ b/modules/crypto/gc-random @@ -15,6 +15,9 @@ Makefile.am: Include: "gc.h" +Link: +$(LIB_GETRANDOM) + License: LGPLv2+ diff --git a/modules/crypto/gc-tests b/modules/crypto/gc-tests index 7b153d1..5a16ba3 100644 --- a/modules/crypto/gc-tests +++ b/modules/crypto/gc-tests @@ -8,4 +8,4 @@ configure.ac: Makefile.am: TESTS += test-gc check_PROGRAMS += test-gc -test_gc_LDADD = $(LDADD) @LIB_CRYPTO@ +test_gc_LDADD = $(LDADD) @LIB_CRYPTO@ $(LIB_GETRANDOM)