unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* 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  1:14   ` Óscar Fuentes
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ 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] 6+ messages in thread

* Re: emacs-module is not GPL compatible (Windows)
  2016-09-30 20:17 ` emacs-module is not GPL compatible (Windows) Mambo Levis
@ 2016-10-01  1:14   ` Óscar Fuentes
  2016-10-01  1:21     ` Óscar Fuentes
  2016-10-01  4:37   ` bug#24574: " Robert Cochran
  2016-10-01  7:53   ` Alain Schneble
  2 siblings, 1 reply; 6+ messages in thread
From: Óscar Fuentes @ 2016-10-01  1:14 UTC (permalink / raw)
  To: Mambo Levis; +Cc: help-gnu-emacs@gnu.org

Mambo Levis <mambo.levis@gmail.com> writes:

First of all, please don't send usage questions to bug-gnu-emacs. That
list is for reporting defects, suggesting enhancements and submitting
patches.

> 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?

Which project?

> 2. Do you have any idea about the error message: sqlite3-core.dll is
> not GPL compatible?

Most likely the module does not define and export the symbol
plugin_is_GPL_compatible, as described here:

http://diobla.info/blog-archive/modules-tut.html#sec-2-2

> 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

Ah, *that* project :-)

> 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

The problem is that the code does not export the symbol
plugin_is_GPL_compatible. On GNU/Linux symbols are exported by default
when you build the shared library, but that's not the case of Windows
where you must export them explicitly.

Try changing

int plugin_is_GPL_compatible;

to

__declspec(dllimport) int plugin_is_GPL_compatible;

Probably you will also need to change

int
emacs_module_init(struct emacs_runtime *ert)

to

int __declspec(dllimport)
emacs_module_init(struct emacs_runtime *ert)

Hope this helps.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: emacs-module is not GPL compatible (Windows)
  2016-10-01  1:14   ` Óscar Fuentes
@ 2016-10-01  1:21     ` Óscar Fuentes
  0 siblings, 0 replies; 6+ messages in thread
From: Óscar Fuentes @ 2016-10-01  1:21 UTC (permalink / raw)
  To: Mambo Levis; +Cc: help-gnu-emacs@gnu.org

Óscar Fuentes <ofv@wanadoo.es> writes:

> Try changing
>
> int plugin_is_GPL_compatible;
>
> to
>
> __declspec(dllimport) int plugin_is_GPL_compatible;
>
> Probably you will also need to change
>
> int
> emacs_module_init(struct emacs_runtime *ert)
>
> to
>
> int __declspec(dllimport)
> emacs_module_init(struct emacs_runtime *ert)

Sorry. I'm half-asleep. Please change the dllimport above with
dllexport.




^ permalink raw reply	[flat|nested] 6+ 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  1:14   ` Óscar Fuentes
@ 2016-10-01  4:37   ` Robert Cochran
  2016-10-01  7:53   ` Alain Schneble
  2 siblings, 0 replies; 6+ 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] 6+ 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  1:14   ` Óscar Fuentes
  2016-10-01  4:37   ` bug#24574: " Robert Cochran
@ 2016-10-01  7:53   ` Alain Schneble
  2016-10-01 12:31     ` Mambo Levis
  2 siblings, 1 reply; 6+ 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] 6+ 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
  0 siblings, 0 replies; 6+ 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] 6+ messages in thread

end of thread, other threads:[~2016-10-01 12:31 UTC | newest]

Thread overview: 6+ 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  1:14   ` Óscar Fuentes
2016-10-01  1:21     ` Óscar Fuentes
2016-10-01  4:37   ` bug#24574: " Robert Cochran
2016-10-01  7:53   ` Alain Schneble
2016-10-01 12:31     ` Mambo Levis

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).