From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: bignum branch Date: Fri, 10 Aug 2018 22:57:01 +0300 Message-ID: <83lg9em1v6.fsf@gnu.org> References: <87o9fbbw1t.fsf@tromey.com> <86sh4b1833.fsf@gmail.com> <861sbgz3dm.fsf@gmail.com> <83a7q4ufxp.fsf@gnu.org> <87wot71hpb.fsf@tromey.com> <86in4rgt1m.fsf@gmail.com> <83pnyyu0k1.fsf@gnu.org> <86k1p59haq.fsf@gmail.com> <83va8osuz2.fsf@gnu.org> <87ftzrknyg.fsf@tromey.com> <87zhxwig5k.fsf@tromey.com> <86lg9gl7vy.fsf@gmail.com> <87tvo4i9em.fsf@tromey.com> <86k1ozl0yd.fsf@gmail.com> <83in4iojva.fsf@gnu.org> <86bmaasm39.fsf@gmail.com> <83a7puo8oq.fsf@gnu.org> <83zhxummef.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1533930939 17245 195.159.176.226 (10 Aug 2018 19:55:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2018 19:55:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Andy Moreton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 10 21:55:35 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1foDVT-0004GP-2q for ged-emacs-devel@m.gmane.org; Fri, 10 Aug 2018 21:55:31 +0200 Original-Received: from localhost ([::1]:57817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foDXX-00020H-S2 for ged-emacs-devel@m.gmane.org; Fri, 10 Aug 2018 15:57:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foDWz-00020A-Hh for emacs-devel@gnu.org; Fri, 10 Aug 2018 15:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1foDWu-0004zu-Mm for emacs-devel@gnu.org; Fri, 10 Aug 2018 15:57:05 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53805) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1foDWu-0004zp-Il; Fri, 10 Aug 2018 15:57:00 -0400 Original-Received: from [176.228.60.248] (port=4806 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1foDWu-0006Oe-0e; Fri, 10 Aug 2018 15:57:00 -0400 In-reply-to: (message from Andy Moreton on Fri, 10 Aug 2018 15:05:19 +0100) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:228393 Archived-At: > From: Andy Moreton > Date: Fri, 10 Aug 2018 15:05:19 +0100 > > | | __GMP_LIBGMP_DLL | libgmp.dll.a | dependencies | data-tests | > |---+------------------+--------------+---------------+------------| > | 1 | 0 | libgmp.dll.a | libgmp-10.dll | crash | > |---+------------------+--------------+---------------+------------| > | 2 | 0 | (removed) | (none) | pass | > |---+------------------+--------------+---------------+------------| > | 3 | 1 | libgmp.dll.a | libgmp-10.dll | pass | > |---+------------------+--------------+---------------+------------| > | 4 | 1 | (removed) | (link fails) | n/a | > |---+------------------+--------------+---------------+------------| > > Row (1) is the original bignum build with the problem. Can you show a C backtrace from the crash? I'm asking because there's something weird about this crash. What row (1) does is use gmp.h where exported functions are not declared __declspec(dllexport). But that shouldn't prevent a valid dynamic link against the DLL; in fact, you should see that most other DLLs we use in Emacs don't have __declspec(dllexport) in their header files, because that's the old MS convention that at least GNU tools tossed a long time ago (although they still support it for backward compatibility). And since your problem AFAIU is with a single GMP function, I think there's something special in that single function or maybe in the way it is declared in gmp.h. Or something similarly unique. > Row (4) shows that asking for dllimport APIs without the import library > fails to link: > > CCLD temacs.exe > C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: frame.o: in function `XFLOATINT': > C:/emacs/git/emacs/bignum/src/lisp.h:2923: undefined reference to > `__imp___gmpz_get_d' > [many similar lines omitted] That's expected, if gmp.h uses __declspec(dllexport) for function prototypes. > I think this clearly shows that the problem is nmismatched calling > convention and library usage. See above: there's still some mystery here.