Subject: Re: Build error while compiling sys/arch/i386/stand (atomic.h related)
To: None <current-users@NetBSD.org>
From: Andrew Doran <ad@NetBSD.org>
List: current-users
Date: 12/24/2007 18:26:48
On Sun, Dec 23, 2007 at 06:08:24PM +0100, Bernd Ernesti wrote:

> a normal build in src/sys/arch/i386/stand fails with :
>=20
>     compile  kern/atomic_add_64_cas.o
> In file included from /src/sys/arch/i386/stand/boot/biosboot/../../../../=
..//lib/libkern/../../../common/lib/libc/atomic/atomic_add_64_cas.c:41:
> /src/sys/arch/i386/stand/boot/biosboot/../../../../../sys/atomic.h:44:20:=
 error: stdint.h: No such file or directory
> *** Error code 1
>=20
> This is the full output with compile flags:
>=20
> all =3D=3D=3D> boot/biosboot
> rm -f machine && ln -s /src/sys/arch/i386/stand/boot/biosboot/../../../..=
/..//arch/i386/include machine
> rm -f x86 && ln -s /src/sys/arch/i386/stand/boot/biosboot/../../../../../=
/arch/x86/include x86
> rm -f lib && ln -s /usr/obj/src/sys/arch/i386/stand/boot/lib lib
> mkdir -p /usr/obj/src/sys/arch/i386/stand/boot/lib
> making sure the i386 library is up to date...
> `libi386.a' is up to date.
> making sure the sa library is up to date...
> `libsa.a' is up to date.
> making sure the z library is up to date...
> `libz.a' is up to date.
> making sure the kern library is up to date...
> #   compile  kern/atomic_add_64_cas.o
> cc -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -Os -ffreestanding =
  -Werror -march=3Di386 -mtune=3Di386 -I/src/sys/arch/i386/stand/boot/biosb=
oot/../../../../..//lib/libkern/arch/i386 -I /src/sys/arch/i386/stand/boot/=
biosboot/.. -I /src/sys/arch/i386/stand/boot/biosboot/../../lib -I /src/sys=
/arch/i386/stand/boot/biosboot/../../../../..//lib/libsa -I /usr/obj/src/sy=
s/arch/i386/stand/boot/biosboot -nostdinc -D_STANDALONE -I/src/sys/arch/i38=
6/stand/boot/biosboot/../../../../../ -DSUPPORT_PS2 -DDIRECT_SERIAL -DSUPPO=
RT_SERIAL=3Dboot_params.bp_consdev -DCONSPEED=3Dboot_params.bp_conspeed -DC=
ONSADDR=3Dboot_params.bp_consaddr -DCONSOLE_KEYMAP=3Dboot_params.bp_keymap =
-DSUPPORT_CD9660 -DSUPPORT_USTARFS -DSUPPORT_DOSFS -DPASS_BIOSGEOM -DPASS_M=
EMMAP -DEPIA_HACK -Wno-pointer-sign -I/src/sys/arch/i386/stand/boot/biosboo=
t/../../../../..//lib/libkern/../../../common/lib/libc/quad -I/src/sys/arch=
/i386/stand/boot/biosboot/../../../../..//lib/libkern/../../../common/lib/l=
ibc/string -I/src/sys/arch/i386/stand/boot/biosboot/../../../../..//lib/lib=
kern/../../../common/lib/libc/arch/i386/string  -I/src/sys/arch/i386/stand/=
boot/biosboot/../../../../..//lib/libkern/../../../common/lib/libc/quad -I/=
src/sys/arch/i386/stand/boot/biosboot/../../../../..//lib/libkern/../../../=
common/lib/libc/string -I/src/sys/arch/i386/stand/boot/biosboot/../../../..=
/..//lib/libkern/../../../common/lib/libc/arch/i386/string -I/src/sys/arch/=
i386/stand/boot/biosboot/../../../../..//lib/libkern/../../../common/includ=
e    -c    /src/sys/arch/i386/stand/boot/biosboot/../../../../..//lib/libke=
rn/../../../common/lib/libc/atomic/atomic_add_64_cas.c -o atomic_add_64_cas=
.o
> In file included from /src/sys/arch/i386/stand/boot/biosboot/../../../../=
..//lib/libkern/../../../common/lib/libc/atomic/atomic_add_64_cas.c:41:
> /src/sys/arch/i386/stand/boot/biosboot/../../../../../sys/atomic.h:44:20:=
 error: stdint.h: No such file or directory
> *** Error code 1
>=20
> Hmm, do we need the same logic as in bootblock.h:
>=20
> #if defined(_KERNEL) || defined(_STANDALONE)
> #include <sys/stdint.h>
> #else=20
> #include <stdint.h>
> #endif
>=20
> If that works, I haven't tried it yet.

Oh, I didn't see that one. I'll have a look now.

Andrew