From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 45E7F1F4B4 for ; Wed, 20 Jan 2021 20:48:27 +0000 (UTC) Received: from localhost ([::1]:55030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2KOw-0001pT-1I for normalperson@yhbt.net; Wed, 20 Jan 2021 15:48:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2KOt-0001pN-Je for bug-gnulib@gnu.org; Wed, 20 Jan 2021 15:48:23 -0500 Received: from mo4-p02-ob.smtp.rzone.de ([85.215.255.82]:35158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2KOr-00044h-Hg for bug-gnulib@gnu.org; Wed, 20 Jan 2021 15:48:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1611175697; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:To:From:From:Subject: Sender; bh=WDtNJ8WGYbZ4rcVvpj1XPkbmDKH2UlW5nHNwe58n/6k=; b=rt2Y9VQUmBS4SC3mC645o9Mg5GX2IbywMB15AkTf6ZZti2/vp76jJtukp3CJSz13b0 MeeMzxrGP9AuD6sxFMLROPPjrvSUqNueYdrNiFr7b/Z+HcE1qy22+VV5N8Ps32GuoyVz W5/w+Mv/6d291fbbXPX3W4BAKFfz22FC/YCRMuhx04sVwt6LtSj2SOlqGfXPZDZEdyZa elWdj4j3SjDgCT084Pjvbl6sR/tzMQoO38AJIMUB/Clwua4BivKx7G2XoLg1GiavRKnC yr91k3fbw5XUUtbaQlHNEcwtoN/DxtqKTCS9TKMCMzK3cFOd30Nym15+7Lc+PeW+o/1P zfWQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOHqfyyvs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 47.12.1 DYNA|AUTH) with ESMTPSA id u0aa20x0KKmCAel (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Wed, 20 Jan 2021 21:48:12 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org, Simon Josefsson Subject: Re: [PATCH] gc-random: Replace implementation with call to getrandom. Date: Wed, 20 Jan 2021 21:48:11 +0100 Message-ID: <7496840.xjiyzb4qgF@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <8735yvvp31.fsf@latte.josefsson.org> References: <8735yvvp31.fsf@latte.josefsson.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=85.215.255.82; envelope-from=bruno@clisp.org; helo=mo4-p02-ob.smtp.rzone.de X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.094, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" 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 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)