unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
@ 2015-04-10 16:38 Chris Zheng
  2015-04-10 17:48 ` Eli Zaretskii
  2016-02-12 17:10 ` bug#20294: Consider this patch for emacs 24 Karol Ostrovsky
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Zheng @ 2015-04-10 16:38 UTC (permalink / raw)
  To: 20294

Hello Emacs,
After the release of GnuTLS 3.4.0, the DLL name of libgnutls has changed
from `libgnutls-28.dll' to `libgnutls-30.dll', which makes Emacs unable
to load the DLL.  Can we add this name to `dynamic-library-alist', as
the following patch do?
Thanks.

From 4b0c27dd6accce69757e60a8ac0904db085e034e Mon Sep 17 00:00:00 2001
From: Chris Zheng <chriszheng99@gmail.com>
Date: Fri, 10 Apr 2015 18:06:04 +0200
Subject: [PATCH] Add GnuTLS 3.4.0 support for MS-Windows

* lisp/term/w32-win.el
(dynamic-library-alist): Add `libgnutls-30.dll'.
---
 lisp/term/w32-win.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index b5e6ff3..2cc0504 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -266,7 +266,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
        '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
        '(glib "libglib-2.0-0.dll")
        '(gobject "libgobject-2.0-0.dll")
-       '(gnutls "libgnutls-28.dll" "libgnutls-26.dll")
+       '(gnutls "libgnutls-30.dll" "libgnutls-28.dll" "libgnutls-26.dll")
        '(libxml2 "libxml2-2.dll" "libxml2.dll")
        '(zlib "zlib1.dll" "libz-1.dll")))
 
-- 
2.3.5





^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
  2015-04-10 16:38 bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows Chris Zheng
@ 2015-04-10 17:48 ` Eli Zaretskii
  2015-04-11 12:35   ` Chris Zheng
  2016-02-12 17:10 ` bug#20294: Consider this patch for emacs 24 Karol Ostrovsky
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-04-10 17:48 UTC (permalink / raw)
  To: Chris Zheng; +Cc: 20294

> Date: Sat, 11 Apr 2015 00:38:52 +0800
> From: Chris Zheng <chriszheng99@gmail.com>
> 
> After the release of GnuTLS 3.4.0, the DLL name of libgnutls has changed
> from `libgnutls-28.dll' to `libgnutls-30.dll', which makes Emacs unable
> to load the DLL.  Can we add this name to `dynamic-library-alist', as
> the following patch do?

No, because libgnutls-30.dll exports a binary-incompatible ABI (that's
why its name changes in the first place).  Just adding that DLL will
cause Emacs compiled against an older GnuTLS to try loading the new
DLL, or vice versa, which will most probably crash at run time.

Instead, we need to introduce a libgnutls-version variable, whose
value depends on the version of GnuTLS as conveyed by version-related
macros in the GnuTLS headers, and insert into dynamic-library-alist
the DLL whose name matches the version with which Emacs was compiled,
like we do with several image libraries.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
  2015-04-10 17:48 ` Eli Zaretskii
@ 2015-04-11 12:35   ` Chris Zheng
  2015-04-11 12:41     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Zheng @ 2015-04-11 12:35 UTC (permalink / raw)
  To: eliz; +Cc: 20294

From: Eli Zaretskii <eliz@gnu.org>
Subject: Re: bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
Date: Fri, 10 Apr 2015 20:48:10 +0300

Hi Eli,
> No, because libgnutls-30.dll exports a binary-incompatible ABI (that's
> why its name changes in the first place).  Just adding that DLL will
> cause Emacs compiled against an older GnuTLS to try loading the new
> DLL, or vice versa, which will most probably crash at run time.
Sorry I don't know it.
> Instead, we need to introduce a libgnutls-version variable, whose
> value depends on the version of GnuTLS as conveyed by version-related
> macros in the GnuTLS headers, and insert into dynamic-library-alist
> the DLL whose name matches the version with which Emacs was compiled,
> like we do with several image libraries.
According to your suggestion, I've reverted the patch.  Can this one
be the starting point?

Thanks,
Chris


From 07162bcef08d398a2f69e81c83c28a4b722e2d0c Mon Sep 17 00:00:00 2001
From: Chris Zheng <chriszheng99@gmail.com>
Date: Fri, 10 Apr 2015 18:06:04 +0200
Subject: [PATCH] Add GnuTLS 3.4.0 support for MS-Windows

* src/gnutls.c
(libgnutls-version): New variable.
(syms_of_gnutls): Generate `libgnutls-version' from GnuTLS header.
* lisp/term/w32-win.el
(dynamic-library-alist): Set library name according to `libgnutls-version'.
---
 lisp/term/w32-win.el |  6 +++++-
 src/gnutls.c         | 10 ++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index b5e6ff3..b0667e6 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -214,6 +214,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
 (defvar libgif-version)
 (defvar libjpeg-version)
 
+(defvar libgnutls-version)              ; gnutls.c
+
 ;;; Set default known names for external libraries
 (setq dynamic-library-alist
       (list
@@ -266,7 +268,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
        '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
        '(glib "libglib-2.0-0.dll")
        '(gobject "libgobject-2.0-0.dll")
-       '(gnutls "libgnutls-28.dll" "libgnutls-26.dll")
+       (if (>= libgnutls-version 30400)
+	   '(gnutls "libgnutls-30.dll")
+	 '(gnutls "libgnutls-28.dll" "libgnutls-26.dll"))
        '(libxml2 "libxml2-2.dll" "libxml2.dll")
        '(zlib "zlib1.dll" "libz-1.dll")))
 
diff --git a/src/gnutls.c b/src/gnutls.c
index 35f0eb4..ddd36a9 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1645,6 +1645,16 @@ DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
 void
 syms_of_gnutls (void)
 {
+  DEFSYM (Qlibgnutls_version, "libgnutls-version");
+  Fset (Qlibgnutls_version,
+#ifdef HAVE_GNUTLS
+	make_number (GNUTLS_VERSION_MAJOR * 10000
+		     + GNUTLS_VERSION_MINOR * 100
+		     + GNUTLS_VERSION_PATCH)
+#else
+	make_number (-1)
+#endif
+        );
 #ifdef HAVE_GNUTLS
   gnutls_global_initialized = 0;
 
-- 
2.3.5







^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
  2015-04-11 12:35   ` Chris Zheng
@ 2015-04-11 12:41     ` Eli Zaretskii
  2015-04-11 14:22       ` Chris Zheng
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-04-11 12:41 UTC (permalink / raw)
  To: Chris Zheng; +Cc: 20294

> Date: Sat, 11 Apr 2015 20:35:34 +0800
> Cc: 20294@debbugs.gnu.org
> From: Chris Zheng <chriszheng99@gmail.com>
> 
> > No, because libgnutls-30.dll exports a binary-incompatible ABI (that's
> > why its name changes in the first place).  Just adding that DLL will
> > cause Emacs compiled against an older GnuTLS to try loading the new
> > DLL, or vice versa, which will most probably crash at run time.
> Sorry I don't know it.
> > Instead, we need to introduce a libgnutls-version variable, whose
> > value depends on the version of GnuTLS as conveyed by version-related
> > macros in the GnuTLS headers, and insert into dynamic-library-alist
> > the DLL whose name matches the version with which Emacs was compiled,
> > like we do with several image libraries.
> According to your suggestion, I've reverted the patch.  Can this one
> be the starting point?

Looks good to me.  Did you test this with both the previous and the
new versions of GnuTLS?

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
  2015-04-11 12:41     ` Eli Zaretskii
@ 2015-04-11 14:22       ` Chris Zheng
  2015-04-11 15:08         ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Zheng @ 2015-04-11 14:22 UTC (permalink / raw)
  To: eliz; +Cc: 20294

From: Eli Zaretskii <eliz@gnu.org>
Subject: Re: bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
Date: Sat, 11 Apr 2015 15:41:07 +0300

Hi Eli,
> Looks good to me.  Did you test this with both the previous and the
> new versions of GnuTLS?
Thank you for your prompt reply.  Yes, it works fine here.
> Thanks.
Cheers,
Chris





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
  2015-04-11 14:22       ` Chris Zheng
@ 2015-04-11 15:08         ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-04-11 15:08 UTC (permalink / raw)
  To: Chris Zheng; +Cc: 20294-done

> Date: Sat, 11 Apr 2015 22:22:09 +0800
> Cc: 20294@debbugs.gnu.org
> From: Chris Zheng <chriszheng99@gmail.com>
> 
> From: Eli Zaretskii <eliz@gnu.org>
> Subject: Re: bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
> Date: Sat, 11 Apr 2015 15:41:07 +0300
> 
> Hi Eli,
> > Looks good to me.  Did you test this with both the previous and the
> > new versions of GnuTLS?
> Thank you for your prompt reply.  Yes, it works fine here.

Thanks, pushed.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20294: Consider this patch for emacs 24
  2015-04-10 16:38 bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows Chris Zheng
  2015-04-10 17:48 ` Eli Zaretskii
@ 2016-02-12 17:10 ` Karol Ostrovsky
  2016-02-12 18:58   ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Karol Ostrovsky @ 2016-02-12 17:10 UTC (permalink / raw)
  To: 20294

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Hello Emacs and especially Eli,

I have just re-compiled latest emacs 24 against the latest MSYS2, and this
problem with GnuTLS 3.4 appeared.  Is it still possible to consider this
patch for emacs 24?  It cannot be applied right away, but I can sent the
required changes.

Best regards,

Karol

[-- Attachment #2: Type: text/html, Size: 373 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#20294: Consider this patch for emacs 24
  2016-02-12 17:10 ` bug#20294: Consider this patch for emacs 24 Karol Ostrovsky
@ 2016-02-12 18:58   ` Eli Zaretskii
  0 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2016-02-12 18:58 UTC (permalink / raw)
  To: Karol Ostrovsky; +Cc: 20294

> Date: Fri, 12 Feb 2016 18:10:53 +0100
> From: Karol Ostrovsky <karol.ostrovsky@gmail.com>
> 
> I have just re-compiled latest emacs 24 against the latest MSYS2, and this problem with GnuTLS 3.4
> appeared. Is it still possible to consider this patch for emacs 24? It cannot be applied right away, but I can
> sent the required changes.

Emacs 24 is no longer maintained.  The next release will be Emacs 25.1
(it is currently in pretest), where this is already fixed.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-02-12 18:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 16:38 bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows Chris Zheng
2015-04-10 17:48 ` Eli Zaretskii
2015-04-11 12:35   ` Chris Zheng
2015-04-11 12:41     ` Eli Zaretskii
2015-04-11 14:22       ` Chris Zheng
2015-04-11 15:08         ` Eli Zaretskii
2016-02-12 17:10 ` bug#20294: Consider this patch for emacs 24 Karol Ostrovsky
2016-02-12 18:58   ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).