Subject: Re: Problem linting libkafs - make guru needed
To: Gary D. Duzan <gary@wheel.tiac.net>
From: Bill Studenmund <skippy@macro.stanford.edu>
List: current-users
Date: 10/05/1998 13:35:40
On Mon, 5 Oct 1998, Gary D. Duzan wrote:

> In Message <199810051752.NAA22516@jekyll.piermont.com> ,
>    "Perry E. Metzger" <perry@piermont.com> wrote:
> 
> =>
> =>Somehow, I do make build's all the time without any of these biting me 
> =>at all. <shrug>.
> =>
> =>Any idea why?
> 
>    I believe it has to do with doing a "make build" with DESTDIR set.
> Most likely the build is trying to link against EGCS libraries in
> the DESTDIR area while still running the main system compiler. In a
> normal build, the compiler and libraries should be installed first,
> so it isn't a problem.

Nope. For two reasons. 1) w/ a DESTDIR set, you should be linking against
the DESTDIR libraries, not the main ones. 2) It's not a link error. :-)

> 
> =>Frederick Bruckman writes:
> =>> On Sun, 4 Oct 1998, Mason Loring Bliss wrote:
> =>> 
> =>> > `make build` dies with the following:
> =>> > 
> =>> > afssys.c(48): warning: username unused in function k_afsklog
> =>> > afssys.c(141): warning: argument a_path unused in function k_pioctl
> =>> > afssys.c(141): warning: argument o_opcode unused in function k_pioctl
> =>> > afssys.c(141): warning: argument a_paramsP unused in function k_pioctl
> =>> > afssys.c(141): warning: argument a_followSymlinks unused in function k_pi
> oc
> =>tl
> =>> > afssys.c(179): warning: pointer casts may be troublesome
> =>> > afssys.c(180): warning: conversion to 'int' due to prototype, arg #2
> =>> > afssys.c(180): warning: conversion of 'unsigned int' to 'int' is out of r
> an
> =>ge, arg #2
> =>> > afssys.c(298): warning: done unused in function k_hasafs
> =>> 
> =>> Don't know.
> =>> 
> =>> > building llib-lkafs.ln
> =>> > Lint pass2:
> =>> > lint2: cannot open get_in_tkt.ln: No such file or directory
> =>> 
> =>> I submitted a pr on this one a couple of weeks ago, along with a
> =>> fix/work-around/kludge.
> =>> <http://www.NetBSD.org/cgi-bin/query-pr-single.pl?number=6193>

I too am not having this problem. So that's two who are, and two who
aren't.

Perry, are you using obj dir's? I am. Mason, Frederick, are y'all not
using obj dirs? I bet that's the reason for the observed difference.

I bet the answer's that Frederick's right. make is seeing the .ln in
/src/domestic/lib/libkrb and deciding that .ln's around (so it doesn't
need to build it). But lint's not seeing it. 

I'd guess the reason we've not seen the problem before is that this might
be the first time a library PATH's in files. ??

If I make a symbolic link in lib/libkrb to obj.i386/get_in_tkt.ln, I can
generate this error.

vespasia# make -m /src/share/mk
building llib-lkafs.ln
lint -Ckafs  afssys.ln get_in_tkt.ln -lc
Lint pass2:
lint2: cannot open get_in_tkt.ln: No such file or directory
*** Error code 1

Stop.
(this is with a locally-patched bsd.lib.mk which doesn't suppress the lint
command).

The problem's somewhere in how we get LOBJS made. We base them on the
source name, not where the source file is in our pathing.

We either need to teach LOBJS how to find the files, or .NOPATH all the
things in LOBJS.

Would this work?

llib-l${LIB}.ln: ${LOBJS}
        @echo building llib-l${LIB}.ln
        @rm -f llib-l${LIB}.ln
        @${LINT} -C${LIB} ${.IMPSRC} ${LLIBS}

??

Take care,

Bill