NetBSD-Bugs archive

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

bin/45875: usr.bin/make: make -B not using a shell for every command



>Number:         45875
>Category:       bin
>Synopsis:       usr.bin/make: make -B not using a shell for every command
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 26 18:10:00 +0000 2012
>Originator:     Marko Schütz-Schmuck
>Release:        NetBSD 5.1/amd64
>Organization:
individual
>Environment:
NetBSD  5.1 NetBSD 5.1 (GENERIC) #0: Sat Nov  6 13:19:33 UTC 2010  
builds%b6.netbsd.org@localhost:/home/builds/ab/netbsd-5-1-RELEASE/amd64/201011061943Z-obj/home/builds/ab/netbsd-5-1-RELEASE/src/sys/arch/amd64/compile/GENERIC
 amd64

>Description:
from `man make`
     -B      Try to be backwards compatible by executing a single shell per
             command and by executing the commands to make the sources of a
             dependency line in sequence.

make -B does not use a single shell per command.
>How-To-Repeat:
- edit hello.c:

 #include <stdio.h>
int main() {
  printf("Hello\n");
}

- edit Makefile:

hello: hello.c
        echo compiling hello.c
        cc -o hello hello.c


% ktrace -i -t acv make -B
% kdump | more
[..]
  3834      1 make     CALL  
execve(0x7f7fffffc7e0,0x7f7ffd8211c0,0x7f7ffd81d0c0)
  3834      1 make     ARG   "cc"
  3834      1 make     ARG   "-o"
  3834      1 make     ARG   "hello"
  3834      1 make     ARG   "hello.c"
[..]


>Fix:
cd .../src/usr.bin/make
$ cvs diff ./compat.c
Index: compat.c
===================================================================
RCS file: /home/marko/netbsd-cvs/src/usr.bin/make/compat.c,v
retrieving revision 1.84
diff -r1.84 compat.c
296c296
<     useShell = (*cp != '\0');
---
>     useShell = (*cp != '\0') || compatMake;



Home | Main Index | Thread Index | Old Index