From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.devel Subject: Re: gnutls on mingw64 Date: Tue, 26 Nov 2019 15:42:14 +0000 Message-ID: References: <86h82qq0jh.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f9005e059841ba3f" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="112937"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 26 16:43:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iZczs-000TFd-Ty for ged-emacs-devel@m.gmane.org; Tue, 26 Nov 2019 16:43:25 +0100 Original-Received: from localhost ([::1]:56376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZczr-00009f-Oq for ged-emacs-devel@m.gmane.org; Tue, 26 Nov 2019 10:43:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59124) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iZczE-00009Q-Bf for emacs-devel@gnu.org; Tue, 26 Nov 2019 10:42:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iZczC-0005q0-Er for emacs-devel@gnu.org; Tue, 26 Nov 2019 10:42:44 -0500 Original-Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]:44057) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iZczC-0005og-7q for emacs-devel@gnu.org; Tue, 26 Nov 2019 10:42:42 -0500 Original-Received: by mail-ot1-x334.google.com with SMTP id c19so16244423otr.11 for ; Tue, 26 Nov 2019 07:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iLTJuu5SFFmtwqxubuzPj/IkHvOj9fGL9ggYgKxkWI0=; b=ho3brNQD9oG0O/ujiXGUj3udEIOrRtXs/fS3YbIM/xw0Ufm7zt9JAtCNfjBmFkhjZN Aknf7ParlFOKu5LZaHvJ5lu13SQ5+pdRVmbLavhM1Om3vHU3EqJ6W4/tx4FkEOcacEGn oyHB1htENOA0NK/iVxt1v4coBoMbSzK9NRYZx+Q0ejdQVegVrPA5e/0VFLFLfKskg7ID D0Bd40x0ajLWWrE3OI6CZkkwreOVj6YoVf7huJT8esjeripWes4jZNA7px7woL6pBSAM xZg9KxC4CETacy0UlUrUQ1H/SR3Ccp5ClLITxskFmpU5bBIlix3A9dToUKouPaLB6Xeb QUdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iLTJuu5SFFmtwqxubuzPj/IkHvOj9fGL9ggYgKxkWI0=; b=oski/Nyg0Cub2bGd7kJJdIbzs57j9isI0ST6TA+5P19fIWUvk66J79+IDRT6Q2Hikg FVxp4Oy7fldUSlPqksrG2ctYOA5v6KpIqAAiCV5+lKEiHvTBuJLXIj957OBFrKB5r4qs jlilEFAPaQpdGQq4rg0tll+oj4ZT+Gazqvr8rbBrAdmn9rniddIVwWWzX1o4O8bohHlA oIzYyaiJfco7RBwu67Lq8vKYLJy2mgvHIECB3+y147NRVDhF0IVPM5lHuzgJP4qysczf pfmIBO97fyhLzLwrUdV9uF78/7wUSac47s3Flb3+I77xN00jdQD8wTqSl/4TYYlUFiyY OMzg== X-Gm-Message-State: APjAAAXr9GQ9ufTiCz6sNst05dCtp36658x8YJFTGC9c8o4Z4xLL3p5+ /pd+m+Za0VS0mv23cyu+I+hjO1qMFmhCqzA5GQEX1xXL X-Google-Smtp-Source: APXvYqzg9rmNKTdpKyn8nFcPM4QI2WUl2rDQgUH7Us34i9aV+brh45Bss041IiLBPOPfugn8iPJRcTpufgUxFcOE6xM= X-Received: by 2002:a9d:6b86:: with SMTP id b6mr10394541otq.182.1574782960728; Tue, 26 Nov 2019 07:42:40 -0800 (PST) In-Reply-To: <86h82qq0jh.fsf@stephe-leake.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::334 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242736 Archived-At: --000000000000f9005e059841ba3f Content-Type: text/plain; charset="UTF-8" On Tue, 26 Nov 2019 at 12:35, Stephen Leake wrote: > I'm trying to get list-packages to use https, which requires gnutls. I'm > running Emacs master on mingw64. > > gnutls-available-p returns nil. Running emacs under the debugger, I can > trace this to LoadLibraryW failing; the file name is > L"libgnutls-30.dll", which is in PATH as > D:\msys64\mingw64\bin\libgnutls-30.dll, installed via pacman. > > Currently neither w32_delayed_load nor init_gnutls_functions calls > GetLastError; would it help to add that? > > Since the file should be found, it seems DllMain is returning False? > What might be the reason for that? Not a lot to go on here. Works just fine for me. Are you missing a dependency? You can investigate DLL loading with < https://github.com/lucasg/Dependencies> (use it on libgnutls-30.dll, not on emacs.exe). Non-system dependencies here: C:\msys64\mingw64\bin\libwinpthread-1.dll C:\msys64\mingw64\bin\libgcc_s_seh-1.dll C:\msys64\mingw64\bin\libgmp-10.dll C:\msys64\mingw64\bin\libhogweed-5.dll C:\msys64\mingw64\bin\libidn2-0.dll C:\msys64\mingw64\bin\libintl-8.dll C:\msys64\mingw64\bin\libnettle-7.dll C:\msys64\mingw64\bin\libp11-kit-0.dll C:\msys64\mingw64\bin\libtasn1-6.dll C:\msys64\mingw64\bin\libunistring-2.dll It's unlikely, but is LoadLibrary finding a mismatched (32-bit) libgnutls-30.dll? It needn't be on PATH. < https://docs.microsoft.com/en-gb/windows/win32/dlls/dynamic-link-library-search-order#standard-search-order-for-desktop-applications >. GnuTLS's DllMain (defined by the CRT) always returns true, but there is a library constructor which calls gnutls_global_init. You could look there for further clues. < https://gitlab.com/gnutls/gnutls/blob/master/lib/global.c> --000000000000f9005e059841ba3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, 26 Nov 2019 at 12:35, Stephen Leake <stephen_leake@stephe-leake.org&= gt; wrote:
> I'm trying to get list-packages to use https, which = requires gnutls. I'm
> running Emacs master on mingw64.
>> gnutls-available-p returns nil. Running emacs under the debugger, I = can
> trace this to LoadLibraryW failing; the file name is
> L&= quot;libgnutls-30.dll", which is in PATH as
> D:\msys64\mingw64\= bin\libgnutls-30.dll, installed via pacman.
>
> Currently neith= er w32_delayed_load nor init_gnutls_functions calls
> GetLastError; w= ould it help to add that?
>
> Since the file should be found, i= t seems DllMain is returning False?
> What might be the reason for th= at?

Not a lot to go on here. Works just fine for me.

Are you missing a dependency? You can investigate DLL loading with = <https://github.com/l= ucasg/Dependencies> (use it on libgnutls-30.dll, not on emacs.exe). = Non-system dependencies here:

C:\msys64\mingw64\bin\libwinpthread-= 1.dll
C:\msys64\mingw64\bin\libgcc_s_seh-1.dll
C:\msys64\mingw64\bin\= libgmp-10.dll
C:\msys64\mingw64\bin\libhogweed-5.dll
C:\msys64\mingw6= 4\bin\libidn2-0.dll
C:\msys64\mingw64\bin\libintl-8.dll
C:\msys64\min= gw64\bin\libnettle-7.dll
C:\msys64\mingw64\bin\libp11-kit-0.dll
C:\ms= ys64\mingw64\bin\libtasn1-6.dll
C:\msys64\mingw64\bin\libunistring-2.dll=

It's unlikely, but is LoadLibrary finding a mis= matched (32-bit) libgnutls-30.dll? It needn't be on PATH. <https://docs= .microsoft.com/en-gb/windows/win32/dlls/dynamic-link-library-search-order#s= tandard-search-order-for-desktop-applications>.

GnuTLS's DllMain (defined by the CRT) always = returns true, but there is a library constructor which calls gnutls_global_= init. You could look there for further clues. <https://gitlab.com/gnutls/gnut= ls/blob/master/lib/global.c>

--000000000000f9005e059841ba3f--