--- include/image.h
+++ include/image.h
@@ -24,6 +24,8 @@
 
 #ifdef USE_HOSTCC
 
+#include <sys/types.h>
+
 /* new uImage format support enabled on host */
 #define CONFIG_FIT		1
 #define CONFIG_OF_LIBFDT	1
--- tools/imagetool.h
+++ tools/imagetool.h
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <time.h>
 #include <unistd.h>
 #include <u-boot/sha1.h>
--- tools/mkimage.h
+++ tools/mkimage.h
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
+#include <sys/types.h>
 #include <time.h>
 #include <unistd.h>
 #include <u-boot/sha1.h>
--- tools/proftool.c
+++ tools/proftool.c
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <sys/param.h>
+#include <sys/types.h>
 
 #include <compiler.h>
 #include <trace.h>
