Subject: Re: crossbuild of current failure
To: None <>
From: Valeriy E. Ushakov <>
List: current-users
Date: 04/02/2003 19:15:20
On Wed, Apr 02, 2003 at 15:53:11 +0100, Dunc wrote:

> sum.lo: In function `set_sunsum':
> sum.lo(.text+0x9c): undefined reference to `be16toh'
> sum.lo(.text+0xb9): undefined reference to `be16toh'
> bbinfo.lo: In function `shared_bbinfo_setboot':
> bbinfo.lo(.text+0x4b4): undefined reference to `le32toh'
> etc.....


    $ cd path/to/src-current
    $ egrep '[bl]e(16|32)toh' sys/sys/*
    sys/sys/endian.h:#define be16toh(x)     htobe16(x)
    sys/sys/endian.h:#define be32toh(x)     htobe32(x)
    sys/sys/endian.h:#define le16toh(x)     htole16(x)
    sys/sys/endian.h:#define le32toh(x)     htole32(x)

and on a NetBSD host <sys/endian.h> is pulled in by <sys/types.h>.

For other platforms we have this in tools/compat/compat_defs.h:

    #ifndef HAVE_SYS_ENDIAN_H
    #define htobe16(x)      (x)
    #define htobe16(x)      bswap16((u_int16_t)(x))
    #define be16toh(x)      htobe16(x)

and FreeBSD doesn't have <sys/endian.h>

I'll cvs update and try building tools.  I have 4.6-STABLE as of
mid-summer 2002, but I don't think that should be relevant.

At least if that indeed have been broken, we know it's been broken
within the past few days (as I said, I did a successful sparc build on
Mar 31).

SY, Uwe
--                         |       Zu Grunde kommen            |       Ist zu Grunde gehen