[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gc-random: Replace implementation with call to getrandom.
From: |
Simon Josefsson |
Subject: |
Re: [PATCH] gc-random: Replace implementation with call to getrandom. |
Date: |
Thu, 21 Jan 2021 17:34:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Bruno Haible <bruno@clisp.org> writes:
> 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:
Thanks for testing!
> 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+
Is this part needed? The module depends on getrandom. Is it because
that is only a conditional dependency?
> 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)
Looks good to me.
/Simon
signature.asc
Description: PGP signature