Subject: bin/9393: rev 1.25 of make.c breaks compiling of non-existent libs
To: None <gnats-bugs@gnats.netbsd.org>
From: Bill Squier <groo@woodpecker.cs.stevens-tech.edu>
List: netbsd-bugs
Date: 02/11/2000 13:57:39
>Number:         9393
>Category:       bin
>Synopsis:       rev 1.25 of make.c breaks compiling of non-existent libs
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Feb 11 13:57:00 2000
>Last-Modified:
>Originator:     Charlie Root
>Organization:
        
>Release:        -current (1.4S)
>Environment:
        
System: NetBSD 1.4S NetBSD 1.4S (GENERIC) #3: Thu Feb 10 23:21:16 EST 2000 root@
:/home/groo/netbsd/src/sys/arch/i386/compile/GENERIC i386


>Description:
        Line 205 of make.c (Make_OODate) used to read (in 1.24):

        } else if ((gn->type & OP_LIB) && Arch_IsLib(gn)) {
                ...

        Allowing the code to test whether a lib was up to date by
        various means.

        In 1.25, it reads:

        } else if ((gn->type & OP_LIB) &&
                  ((gn->mtime==0) || Arch_IsLib(gn))) { 

        which allows this code path to be entered when the library
        in question *DO NOT EXIST*.  This case is not handled in the
        subsequent code properly.

        Ostensibly, the change is a good one, since one cannot check the
        archive header of a non-existent file.  However, this code path
        must now be enhanced to handle the non-existent case.

        There are 3 distinct ways to do this (that I see).

        1)  Avoid the evil of using short-circuit evaluation as a substitute
            for control structure.  This requires reworking a lot of this
            function.

        2)  Change line 215 to begin:

            oodate = (gn->mtime == 0) || Arch_LibOODate(gn) ...

        3)  Modify Arch_LibOODate() to handle non-existent libraries.


        I'm not familiar enough with make(1) to put this change at
        the appropriate abstraction layer.


>How-To-Repeat:
        cd /usr/pkgsrc/security/ssh ; make -d m

        Watch in horror as it builds ``ssh'' and then prints:

   "Examining gmp-2.0.2-ssh-2/libgmp.a...non-existent...library...up-to-date"

>Fix:
        see desc.

>Audit-Trail:
>Unformatted: