bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"load" on Windows


From: Gisle Vanem
Subject: "load" on Windows
Date: Thu, 3 Oct 2013 22:03:14 +0200

Hi list.

I just built GNU make 3.99.93 using MingW. I tried long and
hard to get the "load" feature to give me anything useful. But no
success so far with a very simple mk_test.dll.

In my Makefile, I have this:

VERSION = 3.99.93
ifeq ($(MAKE_VERSION),$(VERSION))
-load ./mk_test.dll
endif

The above was needed since I needed to use mingw-make version 3.82.90
to build this new make.exe. Windows doesn't allow make.exe to be linked
while make.exe is running. Duh! How do you Unix guys solve that?
And:

test_dll: @echo 'Loaded modules: $(.LOADED)' @echo 'Make version: $(MAKE_VERSION)' @echo 'FEATURES: $(.FEATURES)' ; \
 @echo 'Calling mk_test: $(mk_test "Hello world")'

The output is:
 Loaded modules: mk_test.dll
 Make version: 3.99.93
FEATURES: target-specific order-only second-expansion else-if shortest-stem undefine oneshell archives jobserver output-sync load
 Calling mk_test:

See? "load" is there and mk_test.dll is loaded.

--------

My little mk_test.dll is simply trying to echo back some text, but my
function is never called. I checked with "pedump mk_test.dll" that the symbols "mk_test_gmk_setup" and "plugin_is_GPL_compatible" are exported.

Here is some of mk_test.c:

#define EXPORT __declspec(dllexport)

EXPORT int plugin_is_GPL_compatible;

char *say_hello (const char *name, int argc, char **argv)
{
  char *buf = gmk_alloc(1000), *p = buf;

 *(int*)-1 = 1;
..
}

EXPORT int mk_test_gmk_setup (void)
{
 gmk_add_function ("mk_test", say_hello, 1, 255, 0);
 return (1);
}

The "*(int*)-1 = 1" is just to prove for myself it's called. But it isn't.
What could be the propblem?

--gv






reply via email to

[Prev in Thread] Current Thread [Next in Thread]