From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22959: Emacs on Windows depends on libwinpthreads Date: Sun, 17 Apr 2016 19:42:59 +0300 Message-ID: <83shyk9ofg.fsf@gnu.org> References: <87egbj4sbh.fsf@russet.org.uk> <837ffwb8st.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1460911464 584 80.91.229.3 (17 Apr 2016 16:44:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Apr 2016 16:44:24 +0000 (UTC) Cc: 22959@debbugs.gnu.org To: Fabrice Popineau Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 17 18:44:13 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1arpnv-0006jg-77 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Apr 2016 18:44:11 +0200 Original-Received: from localhost ([::1]:48789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arpnu-000573-Lk for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Apr 2016 12:44:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arpnr-00054W-Kt for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 12:44:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arpnm-00035a-K2 for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 12:44:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arpnm-00035W-G9 for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 12:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1arpnm-0002C3-C1 for bug-gnu-emacs@gnu.org; Sun, 17 Apr 2016 12:44:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Apr 2016 16:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22959 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22959-submit@debbugs.gnu.org id=B22959.14609114058370 (code B ref 22959); Sun, 17 Apr 2016 16:44:02 +0000 Original-Received: (at 22959) by debbugs.gnu.org; 17 Apr 2016 16:43:25 +0000 Original-Received: from localhost ([127.0.0.1]:38601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1arpnB-0002Aw-1O for submit@debbugs.gnu.org; Sun, 17 Apr 2016 12:43:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48344) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1arpnA-0002Aj-0c for 22959@debbugs.gnu.org; Sun, 17 Apr 2016 12:43:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1arpn1-00031b-PU for 22959@debbugs.gnu.org; Sun, 17 Apr 2016 12:43:18 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51657) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1arpn1-00031X-Ld; Sun, 17 Apr 2016 12:43:15 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4705 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1arpn0-0000vq-Ts; Sun, 17 Apr 2016 12:43:15 -0400 In-reply-to: (message from Fabrice Popineau on Sun, 17 Apr 2016 17:25:23 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116569 Archived-At: > From: Fabrice Popineau > Date: Sun, 17 Apr 2016 17:25:23 +0200 > Cc: 22959@debbugs.gnu.org > > >From config.log: > > configure:24643: checking for library containing clock_gettime > configure:24674: gcc -I ../emacs/nt/inc -o conftest.exe -I/mingw64/include > -fomit-frame-pointer -O3 -g0 -mtune=corei7 -mtune=generic > -I/mingw64/include -L/mingw64/lib conftest.c >&5 > configure:24674: $? = 0 > configure:24691: result: none required > configure:24703: checking for clock_gettime > configure:24703: gcc -I ../emacs/nt/inc -o conftest.exe -I/mingw64/include > -fomit-frame-pointer -O3 -g0 -mtune=corei7 -mtune=generic > -I/mingw64/include -L/mingw64/lib conftest.c >&5 > configure:24703: $? = 0 > configure:24703: result: yes > configure:24703: checking for clock_settime > configure:24703: gcc -I ../emacs/nt/inc -o conftest.exe -I/mingw64/include > -fomit-frame-pointer -O3 -g0 -mtune=corei7 -mtune=generic > -I/mingw64/include -L/mingw64/lib conftest.c >&5 > configure:24703: $? = 0 > configure:24703: result: yes > > Testing with a very short C file, it seems that libwinpthread-1.dll is > linked in by default and may be gets removed by the linker if no symbol is > referenced. So this is the reason for what you see: evidently, MinGW64 considers libwinpthread DLL a necessary part of a MinGW64 linking. We can easily prevent Emacs (in nt/mingw-cfg.site) from pulling clock_gettime from libwinpthread, if we decide to do that. But since MinGW64 programs are evidently supposed to depend on that library, I question the need for exempting just Emacs from this rule. > I have asked for clarifications on the msys2 list. I'm not sure they are the right crowd, it could be MinGW64 developers, like Kai Tietz. > Anyway, I am afraid that some 3rd party libraries would require it anyway. > For example, --with-rsvg triggers the -pthread compile flag: > > config.status:S["RSVG_CFLAGS"]="-pthread -mms-bitfields > -I/mingw64/include/librsvg-2.0 -I/mingw64/include/gdk-pixbuf-2.0 > -I/mingw64/include/libpng16 -I/mingw64/include/cairo -I/min"\ That's not the same: the librsvg dependency is not a static one, i.e. Emacs will start up even if libwinpthread is not available, it just won't be able to display SVG images. By contrast, the dependency you are talking about is _static_, recorded at link time; Emacs will refuse to start if the DLL is not present. > and the dll list is: > > /c/Local/Emacs/bin/libasprintf-0.dll* Shouldn't be needed. > /c/Local/Emacs/bin/libp11-kit-0.dll* You should tell whoever build that GnuTLS to omit libp11-kit, it's generally useless on Windows, certainly with Emacs. > /c/Local/Emacs/bin/libgnutlsxx-28.dll* Shouldn't be required, as long as Emacs is not a C++ program. > /c/Local/Emacs/bin/libcharset-1.dll* Shouldn't be required. > /c/Local/Emacs/bin/libpangoft2-1.0-0.dll* > /c/Local/Emacs/bin/libgraphite2.dll* > /c/Local/Emacs/bin/libfontconfig-1.dll* > /c/Local/Emacs/bin/libfreetype-6.dll* Whoever built Cairo didn't take care of disabling features unneeded on Windows for librsvg. The result is a very fat build of Cairo, for no good reason. > /c/Local/Emacs/bin/libpcre-1.dll* > /c/Local/Emacs/bin/libexpat-1.dll* > /c/Local/Emacs/bin/libharfbuzz-0.dll* Are these also from librsvg dependencies? If so, they are just ballast, AFAIK. > /c/Local/Emacs/bin/libfftw3-3.dll* Which library needs this one? > /c/Local/Emacs/bin/libidn-11.dll* Which library needs this one? > /c/Local/Emacs/bin/libstdc++-6.dll* ??? Why? Emacs is not a C++ program. In any case, using "-static-libstdc++" should fix this, I think. > /c/Local/Emacs/bin/libgcc_s_seh-1.dll* Use -static-libgcc (and ask library maintainers to avoid this dependency). > /c/Local/Emacs/bin/liblcms2-2.dll* Which library needs this? > /c/Local/Emacs/bin/libtiffxx-5.dll* This is for C++ program, AFAIK. > /c/Local/Emacs/bin/libgettextpo-0.dll* Shouldn't be needed. > /c/Local/Emacs/bin/liblqr-1-0.dll* What is this library? > /c/Local/Emacs/bin/libltdl-7.dll* Which library needs this one?