Skip to contentSkip to conversation

lsof: fix LSOF_CCV in version.h

PATCH Superseded [email protected] 2 participants 4 messages Oct 22, 2014 – Oct 23, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover lsof: fix LSOF_CCV in version.h

From: Wenzong Fan <[email protected]>

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) "

The following changes since commit 924da20c6f2f183fa7e930e4c3c6b14c090acbe5:

build-appliance-image: Update to dizzy head revision (2014-10-18 16:16:38 +0200)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib wenzong/lsof
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=wenzong/lsof

Wenzong Fan (1):
lsof: fix LSOF_CCV in version.h

 .../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
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 lsof: fix LSOF_CCV in version.h

From: Wenzong Fan <[email protected]>

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) "

---
 .../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
meta/recipes-extended/lsof/files/compiler-version-fault.patch new file +25 -0
new file mode 100644
index 0000000..dd61376
@@ -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 <[email protected]>
+Signed-off-by: Wenzong Fan <[email protected]>
+================================
+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
meta/recipes-extended/lsof/lsof_4.87.bb +3 -1
index e7a1eb2..e4ad4b4 100644
@@ -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"
Signature · 1 line
1.7.9.5
#2 lore raw
Quoted 4 lines · On 22 October 2014 04:23, <[email protected]> wrote:
+-      @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

It seems that a better (and importantly, upstreamable) fix would be to pass LSOF_CC correctly to ./Configure instead of overriding in do_compile(), and change the LSOF_CCV assignment to run LSOF_CC if _CCV isn't already set.

(My general approach here is spend a little more time getting a fix upstreamed so that we're not fixing our patch every few months)

Ross

#3 lore raw
Quoted 9 lines · Ross

On 22 October 2014 04:23, <[email protected] <mailto:[email protected]>> wrote:

    +-      @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
Quoted 4 lines

It seems that a better (and importantly, upstreamable) fix would be to pass LSOF_CC correctly to ./Configure instead of overriding in do_compile(), and change the LSOF_CCV assignment to run LSOF_CC if _CCV isn't already set.

Ok, I'll redo the patch and send V2.

Thanks
Wenzong

Quoted 6 lines

(My general approach here is spend a little more time getting a fix upstreamed so that we're not fixing our patch every few months)

Ross