On 21/04/2017 09:16, Andrew Jones wrote: >> >> kvm-unit-tests builds with the odd combination of system include files >> but not system libraries. That is, -nostdlib is specified but >> -nostdinc isn't! Problems arise when the include files don't match the >> libraries, e.g., printf() in some versions of glibc linking in a >> __printf_chk symbol that libcflat doesn't have. This patch fixes the >> problem with printf by pointing '#include "stdio.h"' to >> lib/libcflat.h, where a printf declaration that libcflat actually >> implements exists, rather than letting /usr/include/stdio.h get >> included. This patch does not solve the general problem of potential >> mismatches between libcflat and the compiler's notion standard include >> files; doing so would require rewriting stdarg.h, stdint.h, and >> several others in libcflat. > > Yeah, I'm not sure rewriting those would be worth being able to add > -nostdinc. When we cross compile ARM and POWER those few headers are > some of the ones provided by the cross compiler. I think -sysroot=`pwd` would keep the usual compiler include path, and remove /usr/include. Paolo