[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows
From: |
Chris Zheng |
Subject: |
bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows |
Date: |
Sat, 11 Apr 2015 20:35:34 +0800 |
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