From: Peter Feiner <pfeiner@xxxxxxxxxx> 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. Signed-off-by: Peter Feiner <pfeiner@xxxxxxxxxx> Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx> --- lib/stdio.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 lib/stdio.h diff --git a/lib/stdio.h b/lib/stdio.h new file mode 100644 index 000000000000..7b30db93f7f1 --- /dev/null +++ b/lib/stdio.h @@ -0,0 +1,4 @@ +#ifndef LIBCFLAT_STDIO_H +#define LIBCFLAT_STDIO_H +#include "libcflat.h" +#endif -- 2.12.2.816.g2cccc81164-goog