[OE-core] [PATCH 1/1] lsof: fix LSOF_CCV in version.h

wenzong.fan at windriver.com wenzong.fan at windriver.com
Wed Oct 22 03:23:40 UTC 2014


From: Wenzong Fan <wenzong.fan at windriver.com>

When using cross compiler to build the package "lsof" on a host,
the value of LSOF_CCV in version.h genegrated by the Makefile
is the version of the compiler on the host while it should be
the version of cross compiler.

On Ubuntu host before fixed:
  #define LSOF_CCV        "4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) "

After fixed:
  #define	LSOF_CCV	"4.9.1 (GCC) "

Signed-off-by: Wenzong Fan <wenzong.fan at windriver.com>
---
 .../lsof/files/compiler-version-fault.patch        |   25 ++++++++++++++++++++
 meta/recipes-extended/lsof/lsof_4.87.bb            |    4 +++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-extended/lsof/files/compiler-version-fault.patch

diff --git a/meta/recipes-extended/lsof/files/compiler-version-fault.patch b/meta/recipes-extended/lsof/files/compiler-version-fault.patch
new file mode 100644
index 0000000..dd61376
--- /dev/null
+++ b/meta/recipes-extended/lsof/files/compiler-version-fault.patch
@@ -0,0 +1,25 @@
+lsof: fix LSOF_CCV in version.h
+
+When using cross compiler to build the package "lsof" on a host,
+the value of LSOF_CCV in version.h genegrated by the Makefile
+is the version of the compiler on the host while it should be
+the version of cross compiler.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jian Liu <jian.liu at windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan at windriver.com>
+================================
+diff -Nur lsof_4.87_src.orig/dialects/linux/Makefile lsof_4.87_src/dialects/linux/Makefile
+--- lsof_4.87_src.orig/dialects/linux/Makefile	2008-04-15 21:30:04.000000000 +0800
++++ lsof_4.87_src/dialects/linux/Makefile	2014-09-09 14:15:27.208165334 +0800
+@@ -77,7 +77,8 @@
+ 	@rm -f version.h
+ 	@echo '#define	LSOF_BLDCMT	"${LSOF_BLDCMT}"' > version.h;
+ 	@echo '#define	LSOF_CC		"${CC}"' >> version.h
+-	@echo '#define	LSOF_CCV	"${CCV}"' >> version.h
++	@LSOF_CCV=`${CC} -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p'` &&\
++	echo "#define	LSOF_CCV	\"$${LSOF_CCV}\"" >> version.h
+ 	@echo '#define	LSOF_CCDATE	"'`date`'"' >> version.h
+ 	@echo '#define	LSOF_CCFLAGS	"'`echo ${CFLAGS} | sed 's/\\\\(/\\(/g' | sed 's/\\\\)/\\)/g' | sed 's/"/\\\\"/g'`'"' >> version.h
+ 	@echo '#define	LSOF_CINFO	"${CINFO}"' >> version.h
diff --git a/meta/recipes-extended/lsof/lsof_4.87.bb b/meta/recipes-extended/lsof/lsof_4.87.bb
index e7a1eb2..e4ad4b4 100644
--- a/meta/recipes-extended/lsof/lsof_4.87.bb
+++ b/meta/recipes-extended/lsof/lsof_4.87.bb
@@ -4,7 +4,9 @@ Its name stands for LiSt Open Files, and it does just that."
 SECTION = "devel"
 LICENSE = "BSD"
 
-SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2"
+SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2 \
+           file://compiler-version-fault.patch \
+          "
 
 SRC_URI[md5sum] = "80e2a76d0e05826db910ec88e631296c"
 SRC_URI[sha256sum] = "dfdd3709d82bc79ccdf3e404b84aafa9aede5948642a824ecaefd0aac589da2c"
-- 
1.7.9.5




More information about the Openembedded-core mailing list