Patchwork [4/7] jffs2reader: get rid of linker error

login
register
mail settings
Submitter Andy Shevchenko
Date Sept. 19, 2011, 11:25 a.m.
Message ID <2f04ae27d2325fc2b3e6e5608691868367897579.1316431431.git.andriy.shevchenko@linux.intel.com>
Download mbox | patch
Permalink /patch/115334/
State Accepted
Commit cbfaa5b64f8bd9844094d49f42ff7620ec71418e
Headers show

Comments

Andy Shevchenko - Sept. 19, 2011, 11:25 a.m.
There is a linker errors:
	undefined reference to `target_endian'

This patch fixes the issue and turns on the jffs2reader build in the Makefile.

Signed-off-by: Alexey Dokuchaev <danfe@nsu.ru>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 Makefile      |    2 +-
 jffs2reader.c |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

Patch

diff --git a/Makefile b/Makefile
index 5a0044b..f067d86 100644
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,7 @@  MTD_BINS = \
 	nftldump nftl_format docfdisk \
 	rfddump rfdformat \
 	serve_image recv_image \
-	sumtool #jffs2reader
+	sumtool jffs2reader
 UBI_BINS = \
 	ubiupdatevol ubimkvol ubirmvol ubicrc32 ubinfo ubiattach \
 	ubidetach ubinize ubiformat ubirename mtdinfo ubirsvol
diff --git a/jffs2reader.c b/jffs2reader.c
index 9aee92c..52f8d34 100644
--- a/jffs2reader.c
+++ b/jffs2reader.c
@@ -102,6 +102,8 @@  struct dir {
 	char name[256];
 };
 
+int target_endian = __BYTE_ORDER;
+
 void putblock(char *, size_t, size_t *, struct jffs2_raw_inode *);
 struct dir *putdir(struct dir *, struct jffs2_raw_dirent *);
 void printdir(char *o, size_t size, struct dir *d, char *path,