unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Chris Zheng <chriszheng99@gmail.com>
To: eliz@gnu.org
Cc: 20294@debbugs.gnu.org
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	[thread overview]
Message-ID: <20150411.203534.2120348032908170108.chriszheng99@gmail.com> (raw)
In-Reply-To: <83y4lzswmd.fsf@gnu.org>

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







  reply	other threads:[~2015-04-11 12:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150411.203534.2120348032908170108.chriszheng99@gmail.com \
    --to=chriszheng99@gmail.com \
    --cc=20294@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).