Subject: bin/14175: lint(1) isn't useful for cross-compiling
To: None <gnats-bugs@gnats.netbsd.org>
From: Ben Harris <bjh21@netbsd.org>
List: netbsd-bugs
Date: 10/06/2001 14:22:41
>Number:         14175
>Category:       bin
>Synopsis:       lint(1) isn't useful for cross-compiling
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 06 06:23:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ben Harris
>Release:        200110
>Organization:
>Environment:
NetBSD/powerpc cross-compiling to NetBSD/arm26 (ELF).

>Description:
lint bases its idea of the type of sizeof, and the type of the difference
of two pointers, on a load of #ifdefs in lint1/param.h.  Unfortunately,
these #ifdefs test the host platform, so linting code for another platform
(at least, one with a different ptrdiff_t or size_t from the host) doesn't
work.

Similarly, in lint1/decl.c, the sizes of the various types are set based
on the sizes of the host's types.

>How-To-Repeat:
On a powerpc system:

export USE_NEW_TOOLCHAIN=yes
export TOOLDIR=/usr/tools
export MACHINE=arm26
export MACHINE_ARCH=arm
export DESTDIR=/export/arm26
cd /usr/src/tools
make MKTOOLS=yes build
cd /usr/src/lib/libc
make getnameinfo.ln

Notice errors complaining (e.g.) about conversion (of sizeof output) to
unsigned long (size_t) due to prototype.

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: