Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

kernel compiling - va_arg() not an expression ?!

daniel919
Beginner
755 Views
Hi,
As I reported I am trying to compile kernel 2.6.15.2 with ICC 9.0.
It's compiling nearly the complete kernel now, but stucks at this file:
/lib/vsprintf.c
It complains that va_arg() is not an expression, it does so in about 20 errors.
The first for example:
/lib/vsprintf.c(319): error: expected an expression
field_width = va_arg(args, int);
I don't get this fixed, so please help me, I would really appreciate it.
Daniel

Message Edited by Daniel919 on 02-13-2006 08:01 AM

0 Kudos
7 Replies
Feilong_H_Intel
Employee
755 Views

Hi Daniel,

Are youtrying to compiler the kernel onIA32, EM64T or IA64? Could you please preprocess /lib/vsprintf.c with icc -E andattach a preprocessed vsprintf.c, so that I can reproduce the problem?

Feilong

0 Kudos
daniel919
Beginner
755 Views
I am trying it on the IA32 architecture.
This is the command line "make CC=kicc V=1" parses to the kicc script:
kicc -Wp,-MD,lib/.vsprintf.o.d -nostdinc -isystem /usr/lib/gcc-lib/i486-linux/3.3.5/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer -pipe -msoft-float -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -DKBUILD_BASENAME=vsprintf -DKBUILD_MODNAME=vsprintf -c -o lib/.tmp_vsprintf.o lib/vsprintf.c
For preprocessing it (as you told me with icc -E) i did:
kicc -Wp,-MD,lib/.vsprintf.o.d -nostdinc -isystem /usr/lib/gcc-lib/i486-linux/3.3.5/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer -pipe -msoft-float -mpreferred-stack-boundary=2 -march=athlon -Iinclude/asm-i386/mach-default -DKBUILD_BASENAME=vsprintf -DKBUILD_MODNAME=vsprintf -c -E lib/vsprintf.c
I attached the output of it (vsprintf.log) and the
output of "make CC=kicc V=1" (make.log).
Would be really great if you could take a look at it.
0 Kudos
Feilong_H_Intel
Employee
755 Views

Daniel,

Thanks for providing the preprocessed code. I browsed the code and found that you are using stdarg.h comes with your system ("/usr/lib/gcc-lib/i486-linux/3.3.5/include/stdarg.h"). However, you are supposed to use stdarg.h comes with Intel compiler at /include/stdarg.h. This is probably because you haven't execute the iccvars.sh script before you use the compiler.

Please correct this and try again. Please let me know if this solves the problem.

Feilong

0 Kudos
daniel919
Beginner
755 Views
Ok, Idid what you suggested, I executed the iccvars.sh and retried to compile.
But it fails again with the same problems.
Anyway what is done in iccvars.sh (setting PATH and LD_LIBRARY_PATH) I already did myself before.
But you said I should use the stdarg.h provided with the icc. Soto make sure it does, I changed the #include line in vsprintf.c to the absolute path of the icc file (it's /opt/intel/cc/9.0/include/stdarg.h) (and one more #include line in this stdarg.h to use xarg.h from the same path, alsowith absolute path).
I tried to compile then ... but again it fails with the same problems.
Any more ideas ? Thanks
Daniel

Message Edited by Daniel919 on 02-21-2006 12:27 PM

0 Kudos
Feilong_H_Intel
Employee
755 Views

Could you please preprocess the code again and see if it really includes stdarg.h provided with the icc? If yes, please upload the preprocessed code in this thread. Thanks.

ps. I'm out of office this week. Please expect my slow response.

Regards,
Feilong
0 Kudos
daniel919
Beginner
755 Views
I preprocessed the file again (the output is attached).
Then I saw that it includes the file as I wants, butalsothe one from gcc (/usr/lib/gcc-lib/i486-linux/3.3.5/include/stdarg.h).
Ireplaced this file by a link to the intel stdarg.h andtried make again.
It started to compile the kernel from the beginning.
But stucks even before the vsprintf.c with an error in
arch/i386/kernel/vmlinux.lds:1276 Undefined symbol "jiffies_64" referenced in expression

Message Edited by Daniel919 on 02-24-2006 10:50 AM

0 Kudos
Otto_B_Intel
Employee
755 Views

Today I have struggled with exactly the same problem but on Itanium. The problem for me is theparameter combination'-isystem /path/to/this/gcc/specific/stdarg.h'. I dont know how to fix it myself except change the wrapper script and filter it out. I'll doublecheck to see where it comes from.

Hope this helps,

Otto

0 Kudos
Reply