Patchwork [U-Boot] SMDKV310: Fix host compilation of mkv310_image

login
register
mail settings
Submitter Dirk Behme
Date July 10, 2011, 7:01 a.m.
Message ID <1310281314-5149-1-git-send-email-dirk.behme@gmail.com>
Download mbox | patch
Permalink /patch/104047/
State Changes Requested
Delegated to: Minkyu Kang
Headers show

Comments

Dirk Behme - July 10, 2011, 7:01 a.m.
From: Dirk Behme <dirk.behme@googlemail.com>

Fix compilation of mkv310_image host tool

tools/mkv310_image.c: In function 'main':
tools/mkv310_image.c:67: error: 'S_IRUSR' undeclared (first use in this function)
tools/mkv310_image.c:67: error: (Each undeclared identifier is reported only once
tools/mkv310_image.c:67: error: for each function it appears in.)
tools/mkv310_image.c:67: error: 'S_IWUSR' undeclared (first use in this function)
tools/mkv310_image.c:67: error: 'S_IRGRP' undeclared (first use in this function)
tools/mkv310_image.c:67: error: 'S_IWGRP' undeclared (first use in this function)
tools/mkv310_image.c:67: error: 'S_IROTH' undeclared (first use in this function)
tools/mkv310_image.c:67: error: 'S_IWOTH' undeclared (first use in this function)

resulting from a 'make smdkv310_config'.

Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>

---
Note: mkv310_image is compiled for the host by the host's gcc:

cd mmc_spl/board/samsung/smdkv310
gcc tools/mkv310_image.c -o tools/mkv310_mmc_spl_exec

At my system S_IRUSR & friends are defined in linux/stat.h and are
wrapped by a #if defined(__KERNEL__). On other hosts this might be
Mike Frysinger - July 11, 2011, 2:22 a.m.
On Sunday, July 10, 2011 03:01:54 Dirk Behme wrote:
> --- u-boot.git.orig/mmc_spl/board/samsung/smdkv310/tools/mkv310_image.c
> +++ u-boot.git/mmc_spl/board/samsung/smdkv310/tools/mkv310_image.c
> @@ -26,6 +26,8 @@
>  #include <fcntl.h>
>  #include <errno.h>
>  #include <string.h>
> +#define __KERNEL__
> +#include <linux/stat.h>

yikes, no.  use standard sys/stat.h.
-mike

Patch

different (?)

 mmc_spl/board/samsung/smdkv310/tools/mkv310_image.c |    2 ++
 1 file changed, 2 insertions(+)

Index: u-boot.git/mmc_spl/board/samsung/smdkv310/tools/mkv310_image.c
===================================================================
--- u-boot.git.orig/mmc_spl/board/samsung/smdkv310/tools/mkv310_image.c
+++ u-boot.git/mmc_spl/board/samsung/smdkv310/tools/mkv310_image.c
@@ -26,6 +26,8 @@ 
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
+#define __KERNEL__
+#include <linux/stat.h>
 
 #define CHECKSUM_OFFSET		(14*1024-4)
 #define BUFSIZE			(16*1024)