[U-Boot-Users] U-Boot V2: error: unable to open 'stdarg.h'

Nishanth Menon menon.nishanth at gmail.com
Thu May 1 04:57:23 CEST 2008


Hi Folks,

Been stumped with the sandbox a bit on getting sparse to check code,
with the issue being very similar to the thread here:
http://lkml.org/lkml/2005/5/17/222 though was unable to trace the thread
to a conclusion to the specific problem itself. other than pointing at a
bug in kbuild system as per http://lkml.org/lkml/2005/5/18/293. But
U-boot version of kbuild does really seem to do "gcc
--print-file-name=include"

Commands:
make sandbox_defconfig
make V=1 C=2
<snip>
  sparse -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise  
-nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.2.3/include
-Wp,-MD,common/.hush.o.d  -nostdinc -isystem
/usr/lib/gcc/x86_64-linux-gnu/4.2.3/include -D__KERNEL__ -D__U_BOOT__
-Iinclude  -include include/linux/autoconf.h -fno-builtin -ffreestanding
-nostdinc -Wall -pipe -fno-strict-aliasing -P -fno-common -Os
-Dmalloc=u_boot_malloc -Dfree=u_boot_free -Drealloc=u_boot_realloc
-Dread=u_boot_read -Dwrite=u_boot_write -Dopen=u_boot_open
-Dclose=u_boot_close -Dlseek=u_boot_lseek -Dperror=u_boot_perror
-Derrno=u_boot_errno -Dgetc=u_boot_getc -Dputc=u_boot_putc
-Dfgetc=u_boot_fgetc -Dfputc=u_boot_fputc -Dfgets=u_boot_fgets
-Dfputs=u_boot_fputs -Dsetenv=u_boot_setenv -Dgetenv=u_boot_getenv
-Dprintf=u_boot_printf -Dglob=u_boot_glob -Dglobfree=u_boot_globfree -g 
-fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign   
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(hush)" 
-D"KBUILD_MODNAME=KBUILD_STR(hush)" common/hush.c ;
include/stdio.h:4:11: error: unable to open 'stdarg.h'
make[1]: *** [common/hush.o] Error 1
make: *** [common] Error 2

Strace says:
<snip>
open("include/stdio.h", O_RDONLY)       = 4
read(4, "#ifndef __STDIO_H\n#define __STDI"..., 8192) = 1151
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fcfa8604000
mmap(NULL, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fcfa85fc000
read(4, "", 8192)                       = 0
close(4)                                = 0
open("include/stdarg.h", O_RDONLY)      = -1 ENOENT (No such file or
directory)
write(2, "include/stdio.h:4:11: error: una"..., 55include/stdio.h:4:11:
error: unable to open 'stdarg.h'

If I do a 'ln -s /usr/lib/gcc/x86_64-linux-gnu/4.2.3/include/stdarg.h
include/' it goes thru this specific issue. the next issue is that it
compiles on a 32bit FC5, but fails on 64bit Ubuntu8.04.

Version of U-Boot V2: latest in git.
machine, gcc and sparse versions:
uname -a: Linux xxxxx 2.6.24-16-generic #1 SMP Thu Apr 10 12:47:45 UTC
2008 x86_64 GNU/Linux
gcc --version: gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Sparse: tried with 2 of them:
[1] http://kernel.org/pub/software/devel/sparse/dist/sparse-0.4.1.tar.gz
[2]
http://www.codemonkey.org.uk/projects/git-snapshots/sparse/sparse-2008-05-01.tar.gz

Regards,
Nishanth Menon




More information about the U-Boot mailing list