[bug #40159] Premature exit with incorrect error message, or garbage output characters.

2013-10-03 Thread padavo
Follow-up Comment #10, bug #40159 (project make):

### Summary: 

** The procedure at comment #9 fixes the bug ! **

### Procedure #1: Without the patch, the bug occurs

apt-get build-dep make
apt-get source make
cd make-dfsg-3.81/
dpkg-buildpackage -nc -us -uc
./make -R -r -f /home/david/work/src/c/make/lab/80-bug/clean/Makefile
** /home/david/work/src/c/make/lab/80-bug/clean/Makefile:15: *** unterminated
variable reference.  Stop. **

### Procedure #2: After the patch is applied, the bug is gone

wget -O - https://savannah.gnu.org/patch/download.php?file_id=23309 | patch
-p1
make
./make -R -r -f /home/david/work/src/c/make/lab/80-bug/clean/Makefile
** bug/clean/Makefile:15:  i **
** (snip repeated lines) **
** make: Nothing to be done for `dummy'. **


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #40159] Premature exit with incorrect error message, or garbage output characters.

2013-10-03 Thread padavo
Follow-up Comment #11, bug #40159 (project make):

My apologies for the stupid broken markup ... I gambled and lost :)

This is a repost of comment #10.

Summary: 


The procedure at comment #9 fixes the bug !
I will submit a Debian bugreport.

Procedure #1: Without the patch, the bug occurs
---

apt-get build-dep make
apt-get source make
cd make-dfsg-3.81/
dpkg-buildpackage -nc -us -uc
./make -R -r -f /home/david/work/src/c/make/lab/80-bug/clean/Makefile
/home/david/work/src/c/make/lab/80-bug/clean/Makefile:15: *** unterminated
variable reference.  Stop.

Procedure #2: With the patch, the bug is gone
-

wget -O - https://savannah.gnu.org/patch/download.php?file_id=23309 | patch
-p1
make
./make -R -r -f /home/david/work/src/c/make/lab/80-bug/clean/Makefile
bug/clean/Makefile:15:  i
(snip repeated lines)
make: Nothing to be done for `dummy'.



___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


[bug #40159] Premature exit with incorrect error message, or garbage output characters.

2013-10-03 Thread Paul D. Smith
Update of bug #40159 (project make):

  Status:None => Duplicate  
 Open/Closed:Open => Closed 

___

Follow-up Comment #12:

Thanks for testing.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/


___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


"load" on Windows

2013-10-03 Thread Gisle Vanem

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




___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: "load" on Windows

2013-10-03 Thread Eli Zaretskii
> From: "Gisle Vanem" 
> Date: Thu, 3 Oct 2013 22:03:14 +0200
> 
> 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.

I don't understand the problem you are describing.  First, when Make
is built, it produces gnumake.exe, not make.exe.  And second, if
make.exe that runs is on PATH, rather than in the current directory,
it's a different executable, and there should be no problem linking
it.

So I guess you need to describe in more detail exactly what you did to
build a new make.exe.

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

How did you build your DLL?  In particular, did you link it against
libgnumake-1.dll.a, the import library produced by the build process?

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: "load" on Windows

2013-10-03 Thread Gisle Vanem

"Eli Zaretskii"  wrote:


I don't understand the problem you are describing.  First, when Make
is built, it produces gnumake.exe, not make.exe.  And second, if
make.exe that runs is on PATH, rather than in the current directory,
it's a different executable, and there should be no problem linking
it.


I simply rewrote the build process to generate make.exe instead of
gnumake.exe. But this is a minor issue. The "load" is what I want to
resolve.


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.


How did you build your DLL?  In particular, did you link it against
libgnumake-1.dll.a, the import library produced by the build process?


Yes, I modeled this after build_w32.bat. But I made this into a makefile 
with:


make.exe: $(OBJECTS) libsubproc.a
 $(CC) -o $@ $^ -Wl,--out-implib=libgnumake-1.dll.a -luser32 -ladvapi32

And the mk_test.dll:
  $(CC) $(CFLAGS) -shared mk_test.c -o mk_test.dll ./libgnumake-1.dll.a

The mk_test.dll looks okay and 'gnumake -d test_dll' produces no errors
like the one from load.c. That means the dll is okay AFAICS. And make.exe
works fine too. Except for the "load" statement.

Since I do get "Loaded modules: mk_test.dll" it mean it's loaded okay. But
it's never run. So it must be some issue with how I use the extension. I looked 
at section 12.2.4 in the docs and cooked it from that. 



--gv

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


Re: "load" on Windows

2013-10-03 Thread Eli Zaretskii
> From: "Gisle Vanem" 
> Date: Thu, 3 Oct 2013 23:07:50 +0200
> 
> Since I do get "Loaded modules: mk_test.dll" it mean it's loaded okay. But
> it's never run. So it must be some issue with how I use the extension. I 
> looked 
> at section 12.2.4 in the docs and cooked it from that. 

Well, the tests in the test suite that test this feature did work for
me at some point, so you may wish first to verify they do for you, and
then compare your extension with the ones used by the test suite, to
see what's different.

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make