* emacs-module is not GPL compatible (Windows) [not found] <1261593588.2422705.1475266631400.ref@mail.yahoo.com> @ 2016-09-30 20:17 ` Mambo Levis 2016-10-01 4:37 ` bug#24574: " Robert Cochran 2016-10-01 7:53 ` Alain Schneble 0 siblings, 2 replies; 11+ messages in thread From: Mambo Levis @ 2016-09-30 20:17 UTC (permalink / raw) To: help-gnu-emacs@gnu.org; +Cc: bug-gnu-emacs@gnu.org Hi, I build the emacs-sqlite3 project in Windows using MINGW (mingw64_shell.bat) and the following message appears whenI requiere the module: sqlite3-core.dll is not GPL compatible Questions: 1. Have anybody tried to build this project in windows using MINGW or Visual Studio? 2. Do you have any idea about the error message: sqlite3-core.dll is not GPL compatible? I found this project (sqlite3-core) more interesting/valuable for testing the new emacs-module than the default provided (mod-test) in emacs-25.1-src/modules Repository: https://github.com/syohex/emacs-sqlite3 I also found and build a similar project https://github.com/thom-jenks/emacs-sqlite but unfortunately with the same problem: it is not GPL compatible Thanks Levis ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-09-30 20:17 ` emacs-module is not GPL compatible (Windows) Mambo Levis @ 2016-10-01 4:37 ` Robert Cochran 2016-10-01 7:53 ` Alain Schneble 1 sibling, 0 replies; 11+ messages in thread From: Robert Cochran @ 2016-10-01 4:37 UTC (permalink / raw) To: Mambo Levis; +Cc: 24574, help-gnu-emacs@gnu.org Mambo Levis <mambo.levis@gmail.com> writes: > 2. Do you have any idea about the error message: sqlite3-core.dll is not GPL compatible? Well, the library needs to provide a C symbol named "plugin_is_GPL_compatible", which the first one does. So I'm not entirely sure why Emacs is rejecting the library. If I had to guess, I'd suppose that whatever compiler your using is noticing that the symbol is never used and removes it. That's an educated guess based on what I've seen compilers do for other things that end up being unused; I have no idea if I'm anywhere close to correct. On that thought, though, perhaps you could modify the `emacs_module_init` function to touch the variable (by doing something like, say, 'plugin_is_GPL_compatible = 42') and see what happens? HTH, -- ~Robert Cochran GPG Fingerprint - E778 2DD4 FEA6 6A68 6F26 AD2D E5C3 EB36 4886 8871 ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-09-30 20:17 ` emacs-module is not GPL compatible (Windows) Mambo Levis 2016-10-01 4:37 ` bug#24574: " Robert Cochran @ 2016-10-01 7:53 ` Alain Schneble 2016-10-01 12:31 ` Mambo Levis 1 sibling, 1 reply; 11+ messages in thread From: Alain Schneble @ 2016-10-01 7:53 UTC (permalink / raw) To: Mambo Levis; +Cc: 24574, help-gnu-emacs Mambo Levis <mambo.levis@gmail.com> writes: > Hi, > I build the emacs-sqlite3 project in Windows using MINGW (mingw64_shell.bat) and the following message appears whenI requiere the module: > sqlite3-core.dll is not GPL compatible > > Questions: > 1. Have anybody tried to build this project in windows using MINGW or Visual Studio? > 2. Do you have any idea about the error message: sqlite3-core.dll is not GPL compatible? > I found this project (sqlite3-core) more interesting/valuable for testing the new emacs-module than the default provided (mod-test) in emacs-25.1-src/modules > Repository: https://github.com/syohex/emacs-sqlite3 > I also found and build a similar project https://github.com/thom-jenks/emacs-sqlite but unfortunately with the same problem: it is not GPL compatible > > Thanks > Levis FWIW, mod-test works properly here on mingw64 with gcc 6.1.0, even with CFLAGS='-O3'. Did you try with mod-test? Do you get the same error? Alain ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: emacs-module is not GPL compatible (Windows) 2016-10-01 7:53 ` Alain Schneble @ 2016-10-01 12:31 ` Mambo Levis 2016-10-01 15:40 ` bug#24574: " Eli Zaretskii 0 siblings, 1 reply; 11+ messages in thread From: Mambo Levis @ 2016-10-01 12:31 UTC (permalink / raw) To: Alain Schneble; +Cc: help-gnu-emacs@gnu.org, bug-gnu-emacs@gnu.org Yes, I tried mod-test and it worked properly without using any calling convention such __declspec(dllexport). I have made the following tests: 1. I commented all module's functions related with sqlite3 library and only leave uncommented one of function to verify if the module is working: /* emacs-sqlite-version*/static emacs_valueFemacs_sqlite_version (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data){ const char* msg_docstr = "emacs-sqlite module version 0.1"; return env->make_string (env, msg_docstr, strlen(msg_docstr));} When I require (emacs-sqlite-version) it works as expected. 2. I tested only two function: the previous one Femacs_sqlite_version and other associated with sqlite. Once I consider a module function related to sqlite error message appears: is not GPL compatible I think the error is related with the linking process of the sqlite3.lib . One possible test is not linking sqlite3.lib and stead just using sqlite source code as a part of the module. Do you have any suggestion? Levis On Saturday, October 1, 2016 9:54 AM, Alain Schneble <a.s@realize.ch> wrote: Mambo Levis <mambo.levis@gmail.com> writes: > Hi, > I build the emacs-sqlite3 project in Windows using MINGW (mingw64_shell.bat) and the following message appears whenI requiere the module: > sqlite3-core.dll is not GPL compatible > > Questions: > 1. Have anybody tried to build this project in windows using MINGW or Visual Studio? > 2. Do you have any idea about the error message: sqlite3-core.dll is not GPL compatible? > I found this project (sqlite3-core) more interesting/valuable for testing the new emacs-module than the default provided (mod-test) in emacs-25.1-src/modules > Repository: https://github.com/syohex/emacs-sqlite3 > I also found and build a similar project https://github.com/thom-jenks/emacs-sqlite but unfortunately with the same problem: it is not GPL compatible > > Thanks > Levis FWIW, mod-test works properly here on mingw64 with gcc 6.1.0, even with CFLAGS='-O3'. Did you try with mod-test? Do you get the same error? Alain ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-01 12:31 ` Mambo Levis @ 2016-10-01 15:40 ` Eli Zaretskii 2016-10-01 20:28 ` Mambo Levis 0 siblings, 1 reply; 11+ messages in thread From: Eli Zaretskii @ 2016-10-01 15:40 UTC (permalink / raw) To: Mambo Levis; +Cc: 24574, a.s [Please don't cross post to help-gnu-emacs if you report bugs.] > Date: Sat, 1 Oct 2016 12:31:26 +0000 (UTC) > From: Mambo Levis <mambo.levis@gmail.com> > Cc: 24574@debbugs.gnu.org, help-gnu-emacs@gnu.org > > 1. I commented all module's functions related with sqlite3 library and only leave uncommented one of function > to verify if the module is working: > > /* emacs-sqlite-version*/ > static emacs_value > Femacs_sqlite_version (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) > { > const char* msg_docstr = "emacs-sqlite module version 0.1"; > return env->make_string (env, msg_docstr, strlen(msg_docstr)); > } > > When I require (emacs-sqlite-version) it works as expected. > > 2. I tested only two function: the previous one Femacs_sqlite_version and other associated with sqlite. Once I > consider a module function related to sqlite error message appears: > is not GPL compatible > > I think the error is related with the linking process of the sqlite3.lib . One possible test is not linking sqlite3.lib > and stead just using sqlite source code as a part of the module. > > Do you have any suggestion? I'd start by using the pexports program (or something similar) to see which symbols are exported by the sqlite DLL. ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-01 15:40 ` bug#24574: " Eli Zaretskii @ 2016-10-01 20:28 ` Mambo Levis 2016-10-02 6:24 ` Eli Zaretskii 0 siblings, 1 reply; 11+ messages in thread From: Mambo Levis @ 2016-10-01 20:28 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 24574@debbugs.gnu.org, a.s@realize.ch [-- Attachment #1: Type: text/plain, Size: 4972 bytes --] Thank you for the pexports recommendation. For somebody that just read this problem for the first time, a summary: Emacs version: GNU Emacs 25.1.1 Emacs module repo: https://github.com/syohex/emacs-sqlite3 Build process: mingw64_shell.bat (Windows) Dependency: sqlite.lib Makefile: EMACS = D:\user\emacs-src\emacs-25-branch-srcINCLUDE = -I. -I$(EMACS)\src CC = gccLD = gccLDFLAGS = # On MS-Windows, say "make SO=dll" to build the moduleSO = dll# -fPIC is a no-op on Windows, but causes a compiler warningifeq ($(SO),dll)CFLAGS = -std=gnu99 -ggdb3 -WallelseCFLAGS = -std=gnu99 -ggdb3 -Wall -fPICendif all: sqlite3-core.$(SO) %.$(SO): %.o $(LD) -shared $(LDFLAGS) -o $@ $< sqlite3.lib %.o: %.c $(CC) $(CFLAGS) $(INCLUDE) -c $< check: $(EMACS)/src/emacs -batch -l ert -l test.el -f ert-run-tests-batch-and-exit clean: rm -rf *.o *.dll *.a *.d -------------------------------------------------------------------------------------------------------------------------------- Now the result of my tests: 1. The symbols exported by the modules without considering any sqlite function are: LIBRARY sqlite3-core.dll EXPORTSemacs_module_init ; .text ; RVA 00001685plugin_is_GPL_compatible DATA ; no section ; RVA 00007010 2. onsidering the following sqlite3 related function: static voidel_sqlite3_free(void *arg){ sqlite3_close((sqlite3*)arg);} When I generate the sqlite3-core.dll using at least one sqlite3 DLL function, for example sqlite3_close , an error message appears: (the module can't be found) ..../modules/emacs-sqlite3/sqlite3-core.dll: Das angegebene Modul wurde nicht gefunden. I check the sqlite3.dll using pexports tool, and the symbols sqlite3_close is exported.LIBRARY sqlite3.dllEXPORTS.....sqlite3_changes ; .text ; RVA 0009c648sqlite3_clear_bindings ; .text ; RVA 000373dcsqlite3_close ; .text ; RVA 0009c9e8sqlite3_close_v2 ; .text ; RVA 0009ca08sqlite3_collation_needed ; .text ; RVA 0009f4b3sqlite3_collation_needed16 ; .text ; RVA 0009f51f I check the module qlite3-core.dll again and the symbols are there. ; .text : RVA: 00001000, File offset: 00000600; .data : RVA: 00003000, File offset: 00002400; .rdata : RVA: 00004000, File offset: 00002600; .pdata : RVA: 00005000, File offset: 00002e00; .xdata : RVA: 00006000, File offset: 00003200; .bss : RVA: 00007000, File offset: 00000000; .edata : RVA: 00008000, File offset: 00003400; .idata : RVA: 00009000, File offset: 00003600; .CRT : RVA: 0000a000, File offset: 00003e00; .tls : RVA: 0000b000, File offset: 00004000; .reloc : RVA: 0000c000, File offset: 00004200; /4 : RVA: 0000d000, File offset: 00004400; /19 : RVA: 0000e000, File offset: 00004800; /31 : RVA: 00018000, File offset: 0000e200; /45 : RVA: 0001a000, File offset: 0000fa00; /57 : RVA: 0001c000, File offset: 00011200; /70 : RVA: 0001d000, File offset: 00011e00; /81 : RVA: 0001e000, File offset: 00012200; /92 : RVA: 00021000, File offset: 00015200; /105 : RVA: 0002b000, File offset: 0001f200; Reading exports from section: .edata; Export table: sqlite3-core.dll; Ordinal base: 1; Ordinal table RVA: 00008038; Name table RVA: 0008030; Export address table RVA: 00008028LIBRARY sqlite3-core.dllEXPORTSemacs_module_init ; .text ; RVA 00001696plugin_is_GPL_compatible DATA ; no section ; RVA 000078f0 Please, notice that this time the plugin_is_GPL_compatible. The problem is now that the module can't be found when a sqlite3.dll symbol is used. Any Idea or suggestion? Thanks Levis On Saturday, October 1, 2016 5:40 PM, Eli Zaretskii <eliz@gnu.org> wrote: [Please don't cross post to help-gnu-emacs if you report bugs.] > Date: Sat, 1 Oct 2016 12:31:26 +0000 (UTC) > From: Mambo Levis <mambo.levis@gmail.com> > Cc: 24574@debbugs.gnu.org, help-gnu-emacs@gnu.org > > 1. I commented all module's functions related with sqlite3 library and only leave uncommented one of function > to verify if the module is working: > > /* emacs-sqlite-version*/ > static emacs_value > Femacs_sqlite_version (emacs_env *env, ptrdiff_t nargs, emacs_value args[], void *data) > { > const char* msg_docstr = "emacs-sqlite module version 0.1"; > return env->make_string (env, msg_docstr, strlen(msg_docstr)); > } > > When I require (emacs-sqlite-version) it works as expected. > > 2. I tested only two function: the previous one Femacs_sqlite_version and other associated with sqlite. Once I > consider a module function related to sqlite error message appears: > is not GPL compatible > > I think the error is related with the linking process of the sqlite3.lib . One possible test is not linking sqlite3.lib > and stead just using sqlite source code as a part of the module. > > Do you have any suggestion? I'd start by using the pexports program (or something similar) to see which symbols are exported by the sqlite DLL. [-- Attachment #2: Type: text/html, Size: 26739 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-01 20:28 ` Mambo Levis @ 2016-10-02 6:24 ` Eli Zaretskii 2016-10-02 15:53 ` Mambo Levis 0 siblings, 1 reply; 11+ messages in thread From: Eli Zaretskii @ 2016-10-02 6:24 UTC (permalink / raw) To: Mambo Levis; +Cc: 24574, a.s > Date: Sat, 1 Oct 2016 20:28:15 +0000 (UTC) > From: Mambo Levis <mambo.levis@gmail.com> > Cc: "a.s@realize.ch" <a.s@realize.ch>, > "24574@debbugs.gnu.org" <24574@debbugs.gnu.org> > > %.$(SO): %.o > $(LD) -shared $(LDFLAGS) -o $@ $< sqlite3.lib > [...] > Please, notice that this time the plugin_is_GPL_compatible. The problem is now that the module can't be > found when a sqlite3.dll symbol is used. > > Any Idea or suggestion? Add -Wl,-export-all-symbols to LDFLAGS. ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-02 6:24 ` Eli Zaretskii @ 2016-10-02 15:53 ` Mambo Levis 2016-10-05 2:48 ` npostavs 0 siblings, 1 reply; 11+ messages in thread From: Mambo Levis @ 2016-10-02 15:53 UTC (permalink / raw) To: Eli Zaretskii; +Cc: ofv@wanadoo.es, 24574@debbugs.gnu.org, a.s@realize.ch [-- Attachment #1: Type: text/plain, Size: 1295 bytes --] Hi, I found the problem: I checked everything again using the tool pexports, and both sqlite3-core.dll and sqlite3.dll were exporting all symbols. I compare all with the following article:http://gernotklingler.com/blog/creating-using-shared-libraries-different-compilers-different-operating-systems/ and I couldn't find any problem. The only thing left to do was to put sqlite.dll in the emacs\bin folder and Voilà, now it works. In fact I had already added the path and used to sqlite3.dll in my emacs init file, but the location was wrong; after my emacs-modules collection. Thank you for your feedback and support. Muchas gracias Oscar Fuentes por tu colaboración. Levis On Sunday, October 2, 2016 8:24 AM, Eli Zaretskii <eliz@gnu.org> wrote: > Date: Sat, 1 Oct 2016 20:28:15 +0000 (UTC) > From: Mambo Levis <mambo.levis@gmail.com> > Cc: "a.s@realize.ch" <a.s@realize.ch>, > "24574@debbugs.gnu.org" <24574@debbugs.gnu.org> > > %.$(SO): %.o > $(LD) -shared $(LDFLAGS) -o $@ $< sqlite3.lib > [...] > Please, notice that this time the plugin_is_GPL_compatible. The problem is now that the module can't be > found when a sqlite3.dll symbol is used. > > Any Idea or suggestion? Add -Wl,-export-all-symbols to LDFLAGS. [-- Attachment #2: Type: text/html, Size: 7402 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-02 15:53 ` Mambo Levis @ 2016-10-05 2:48 ` npostavs 2016-10-05 16:51 ` Mambo Levis 0 siblings, 1 reply; 11+ messages in thread From: npostavs @ 2016-10-05 2:48 UTC (permalink / raw) To: Mambo Levis; +Cc: ofv@wanadoo.es, 24574, a.s@realize.ch Mambo Levis <mambo.levis@gmail.com> writes: > Please, notice that this time the plugin_is_GPL_compatible. The > problem is now that the module can't be found when a sqlite3.dll > symbol is used. What was the difference between this time and the previous time? > > The only thing left to do was to put sqlite.dll in the emacs\bin > folder and Voilà, now it works. In fact I had already added the path > and used to sqlite3.dll in my emacs init file, but the location was > wrong; after my emacs-modules collection. So there is no bug after all? Should we just close this report, or is there perhaps some guidance we should add to the documentation about how to build modules on Windows? ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-05 2:48 ` npostavs @ 2016-10-05 16:51 ` Mambo Levis 2021-10-23 2:47 ` Stefan Kangas 0 siblings, 1 reply; 11+ messages in thread From: Mambo Levis @ 2016-10-05 16:51 UTC (permalink / raw) To: npostavs@users.sourceforge.net Cc: ofv@wanadoo.es, 24574@debbugs.gnu.org, a.s@realize.ch [-- Attachment #1.1: Type: text/plain, Size: 1811 bytes --] Hi, Yes, in summary there is no bug after all, yes you can close it. Recommendations for windows users: Problem 1: "The module is not GPL compatible". My suggestion is to provide a more generic Makefile able to link external libraries such Sqlite. Attached you can find the final version of the Makefile I used to build the module. Another recommendation is to test if DLL symbols are exported using tools such pexports or Dependecy walker. Problem 2: "The emacs module can't be found". This is easy to handle by adding the path to sqlite3.dll to windows environment variables. Other solution is put the sqlite3.dll in the same folder where the emacs.exe is located. In case that someone add the path to sqlite3.dll in emacs init file, it should be located before calling the emacs module. In my case, I move my windows path setup in emacsto the top of the init file. I think the most important was the support I receive from you, thank you. Levis On Wednesday, October 5, 2016 4:48 AM, "npostavs@users.sourceforge.net" <npostavs@users.sourceforge.net> wrote: Mambo Levis <mambo.levis@gmail.com> writes: > Please, notice that this time the plugin_is_GPL_compatible. The > problem is now that the module can't be found when a sqlite3.dll > symbol is used. What was the difference between this time and the previous time? > > The only thing left to do was to put sqlite.dll in the emacs\bin > folder and Voilà, now it works. In fact I had already added the path > and used to sqlite3.dll in my emacs init file, but the location was > wrong; after my emacs-modules collection. So there is no bug after all? Should we just close this report, or is there perhaps some guidance we should add to the documentation about how to build modules on Windows? [-- Attachment #1.2: Type: text/html, Size: 4521 bytes --] [-- Attachment #2: Makefile --] [-- Type: application/octet-stream, Size: 1404 bytes --] # Makefile V3 # Test GNU Emacs modules. # Copyright 2015-2016 Free Software Foundation, Inc. # This file is part of GNU Emacs. # GNU Emacs is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # GNU Emacs is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. EMACS = D:\user\emacs-src\emacs-25-branch-src INCLUDE = -I. -I$(CURDIR)\src -I$(EMACS)\src -I$(CURDIR)\lib LIB = $(CURDIR)\lib CC = gcc LD = gcc LDFLAGS = # On MS-Windows, say "make SO=dll" to build the module SO = dll # -fPIC is a no-op on Windows, but causes a compiler warning ifeq ($(SO),dll) CFLAGS = -std=gnu99 -ggdb3 else CFLAGS = -std=gnu99 -ggdb3 -fPIC endif all: sqlite3-core.$(SO) %.$(SO): %.o $(LD) -shared $(LDFLAGS) -o $@ $< $(LIB)\sqlite3.lib %.o: %.c $(CC) $(CFLAGS) $(INCLUDE) -c $< check: $(EMACS)/src/emacs -batch -l ert -l test.el -f ert-run-tests-batch-and-exit clean: rm -rf *.o *.dll *.a *.d ^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#24574: emacs-module is not GPL compatible (Windows) 2016-10-05 16:51 ` Mambo Levis @ 2021-10-23 2:47 ` Stefan Kangas 0 siblings, 0 replies; 11+ messages in thread From: Stefan Kangas @ 2021-10-23 2:47 UTC (permalink / raw) To: Mambo Levis Cc: ofv@wanadoo.es, a.s@realize.ch, 24574-done, npostavs@users.sourceforge.net Mambo Levis <mambo.levis@gmail.com> writes: > On Wednesday, October 5, 2016 4:48 AM, "npostavs@users.sourceforge.net" <npostavs@users.sourceforge.net> wrote: [...] >> So there is no bug after all? Should we just close this report, or is >> there perhaps some guidance we should add to the documentation about how >> to build modules on Windows? [...] > Yes, in summary there is no bug after all, yes you can close it. Thanks, I read this thread and I can't see what we can add here besides the usual "fiddle with paths, put stuff where it belongs". So I'm closing this bug report. ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-10-23 2:47 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1261593588.2422705.1475266631400.ref@mail.yahoo.com> 2016-09-30 20:17 ` emacs-module is not GPL compatible (Windows) Mambo Levis 2016-10-01 4:37 ` bug#24574: " Robert Cochran 2016-10-01 7:53 ` Alain Schneble 2016-10-01 12:31 ` Mambo Levis 2016-10-01 15:40 ` bug#24574: " Eli Zaretskii 2016-10-01 20:28 ` Mambo Levis 2016-10-02 6:24 ` Eli Zaretskii 2016-10-02 15:53 ` Mambo Levis 2016-10-05 2:48 ` npostavs 2016-10-05 16:51 ` Mambo Levis 2021-10-23 2:47 ` Stefan Kangas
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).