bin/155000: make(1) doesn't handle .POSIX: correctly

Colin Percival cperciva at FreeBSD.org
Thu Feb 24 11:30:08 UTC 2011


>Number:         155000
>Category:       bin
>Synopsis:       make(1) doesn't handle .POSIX: correctly
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 24 11:30:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Colin Percival
>Release:        all FreeBSD releases
>Organization:
>Environment:
>Description:

make(1) doesn't handle .POSIX: correctly.  It sucks in sys.mk before it
reads the Makefile, and sys.mk has several instances of
.if defined(%POSIX)
to switch between POSIX and non-POSIX mode; because sys.mk is processed
first, there is no opportunity for a .POSIX: directive to take effect.

>How-To-Repeat:
$ echo .POSIX: > Makefile
$ make -V CC
(prints "cc"; it should print "c89".)

>Fix:

Before processing sys.mk, main() should "taste" the Makefile by looking
for .POSIX.  This is required to appear on the first non-comment line of
the Makefile, so we don't need to actually parse the Makefile in order
to check for this.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list