Skip to contentSkip to conversation

cgcc: please support -iwithprefix

DISCUSSION H. Peter Anvin 1 participant 1 message Jan 18, 2014 Sparse checker

lore
Share & tools
lore
#0 lore raw

When doing embedded work, like kernels or other nonstandard environments, we want to exclude the standard library with -nostdinc, but that also excludes header files intrinsic to the *compiler* such as <stdarg.h>.

gcc uses the option -iwithprefix for that, in particular "-iwithprefix include" adds those compiler-specific header files back into the include path. cgcc doesn't seem to understand that and instead interprets the option argument as an additional file.

It is unsual in gcc for an option argument to be separate, but it isn't unique:

-idirafter DIR
-include FILE -imacros FILE
-iprefix FILE -iwithprefix DIR
-iwithprefixbefore DIR -isystem DIR
-imultilib DIR -isysroot DIR
-Xpreprocessor OPTION
-Xassembler OPTION
-T SCRIPT
-Xlinker OPTION