From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Dynamic loading progress Date: Thu, 12 Feb 2015 22:34:56 +0200 Message-ID: <83386a6f7z.fsf@gnu.org> References: <87y4t9m76w.fsf@lifelogs.com> <85k31coixa.fsf@stephe-leake.org> <85oapy5kt6.fsf@stephe-leake.org> <83y4oiiw81.fsf@gnu.org> <838ugdf251.fsf@gnu.org> <87bnl1vmqf.fsf@lifelogs.com> <87vbj8tow4.fsf@lifelogs.com> <87r3twtagf.fsf@lifelogs.com> <85siebl7ws.fsf@stephe-leake.org> <85a90ilwmm.fsf@stephe-leake.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1423773344 13892 80.91.229.3 (12 Feb 2015 20:35:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Feb 2015 20:35:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stephen Leake Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 12 21:35:35 2015 Return-path: Envelope-to: ged-emacs-devel@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 1YM0Ty-0004T2-JJ for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 21:35:30 +0100 Original-Received: from localhost ([::1]:52018 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM0Ty-0007VJ-3A for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2015 15:35:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58089) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM0Tc-0007J5-P0 for emacs-devel@gnu.org; Thu, 12 Feb 2015 15:35:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YM0TX-00046H-Ph for emacs-devel@gnu.org; Thu, 12 Feb 2015 15:35:08 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:36295) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YM0TX-00040B-2W for emacs-devel@gnu.org; Thu, 12 Feb 2015 15:35:03 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NJO00600EAJ4D00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Thu, 12 Feb 2015 22:35:01 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJO005Y3EICZ750@a-mtaout20.012.net.il>; Thu, 12 Feb 2015 22:35:01 +0200 (IST) In-reply-to: <85a90ilwmm.fsf@stephe-leake.org> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:182978 Archived-At: > From: Stephen Leake > Date: Thu, 12 Feb 2015 14:09:53 -0600 > > I had to add to options to the 'gcc' line in modules/curl/Makefile: > > -std=c99 -I$(ROOT)/nt/inc Why do you need -std=c99? What happens if you don't use it? GCC defaults to -std=gnu99, which is a superset of c99, so I don't understand why you needed to insist on strict C99. I also don't like the -I$(ROOT)/nt/inc thing, it should only be needed for Emacs-specific system-level stuff. Why was it needed here? > Normally those would be added by configure. Perhaps they could be set > via CFLAGS by the perl script when on mingw64? Sorry, I don't understand: the Emacs configure script already adds that directory to the include path. So what's wrong? > But then I get link errors: > > stephe@takver$ make > gcc -shared `pkg-config libcurl --libs` -o curl.so curl.o > curl.o: In function `Fcurl_make': > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:55: undefined reference to `__imp_curl_easy_init' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:56: undefined reference to `make_save_ptr' > curl.o: In function `Fcurl_fetch_url': > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:67: undefined reference to `XSAVE_POINTER' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:69: undefined reference to `SSDATA' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:69: undefined reference to `__imp_curl_easy_setopt' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:70: undefined reference to `__imp_curl_easy_setopt' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:71: undefined reference to `__imp_curl_easy_setopt' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:72: undefined reference to `__imp_curl_easy_setopt' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:73: undefined reference to `__imp_curl_easy_perform' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:77: undefined reference to `__imp_curl_easy_strerror' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:78: undefined reference to `make_string' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:81: undefined reference to `builtin_lisp_symbol' > curl.o: In function `Fcurl_content': > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:89: undefined reference to `XSAVE_POINTER' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:90: undefined reference to `make_string' > curl.o: In function `Fcurl_free': > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:98: undefined reference to `XSAVE_POINTER' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:100: undefined reference to `__imp_curl_easy_cleanup' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:102: undefined reference to `builtin_lisp_symbol' > curl.o: In function `init': > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:107: undefined reference to `__imp_curl_global_init' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:110: undefined reference to `intern' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:112: undefined reference to `defsubr' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:113: undefined reference to `defsubr' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:114: undefined reference to `defsubr' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:115: undefined reference to `defsubr' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:117: undefined reference to `builtin_lisp_symbol' > C:\Projects\emacs\feature\aptel\dynamic-modules-rc3\modules\curl/curl.c:117: undefined reference to `Fprovide' > collect2.exe: error: ld returned 1 exit status > Makefile:9: recipe for target 'curl.so' failed > make: *** [curl.so] Error 1 > > pkg-config libcurl --libs returns -L/mingw64/lib -lcurl -lwldap32 -lz -lws2_32 > > The "__imp_curl*" functions are provided by > /msys64/mingw64/lib/libcurl.dll.a; I assume that's what matches > '-lcurl'. So I don't understand those errors. GNU ld is a one-pass linker, so the libraries should be after the object files. > The other symbols appear to be Emacs symbols? There was some discussion > about a special flag for exporting those on Windows; is that '-Xlinker > -E'? I guess that goes in src/Makefile somewhere? The unresolved externals that are defined by Emacs are expected: you need to link against an import library produced as part of building emacs.exe. Otherwise all this stuff will not work on Windows, because the Windows port of the linker must see the import library at link time. The flag to produce the import library should be something like this: -Wl,--out-implib=libemacs.dll.a Then you need to link the shared library against -lemacs. And the link command line should produce curl.dll, not curl.so.