[oe] [meta-oe][PATCH] libutempter: Fix compile error on arm

Qian Lei qianl.fnst at cn.fujitsu.com
Thu Jan 8 09:25:47 UTC 2015


| iface.c: In function 'utempter_add_record':
| <command-line>:0:12: error: expected expression before '/' token
| iface.c:46:35: note: in expansion of macro 'LIBEXECDIR'
|  #define UTEMPTER_DEFAULT_PATHNAME LIBEXECDIR "/utempter/utempter"

Signed-off-by: Qian Lei <qianl.fnst at cn.fujitsu.com>
---
 .../libutempter/0001-Modify-macro.patch            | 28 ++++++++++++++++++++++
 .../libutempter/libutempter-pierelro.patch         | 23 ++++++++++++++++++
 .../libutempter/libutempter_1.1.6.bb               | 11 ++++-----
 3 files changed, 56 insertions(+), 6 deletions(-)
 create mode 100644 meta-oe/recipes-support/libutempter/libutempter/0001-Modify-macro.patch
 create mode 100644 meta-oe/recipes-support/libutempter/libutempter/libutempter-pierelro.patch

diff --git a/meta-oe/recipes-support/libutempter/libutempter/0001-Modify-macro.patch b/meta-oe/recipes-support/libutempter/libutempter/0001-Modify-macro.patch
new file mode 100644
index 0000000..b5c518f
--- /dev/null
+++ b/meta-oe/recipes-support/libutempter/libutempter/0001-Modify-macro.patch
@@ -0,0 +1,28 @@
+From fe0721e3f533b54ed2f916365c0458aa2069c924 Mon Sep 17 00:00:00 2001
+From: Qian Lei <qianl.fnst at cn.fujitsu.com>
+Date: Thu, 8 Jan 2015 16:34:09 +0900
+Subject: [PATCH] Remove macro and use hardcode.
+
+Upstream-Status: Pending
+Signed-off-by: Qian Lei <qianl.fnst at cn.fujitsu.com>
+
+---
+ iface.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iface.c b/iface.c
+index 5951d81..928ebfd 100644
+--- a/iface.c
++++ b/iface.c
+@@ -43,7 +43,7 @@
+        __result; }))
+ #endif
+ 
+-#define	UTEMPTER_DEFAULT_PATHNAME	LIBEXECDIR "/utempter/utempter"
++#define	UTEMPTER_DEFAULT_PATHNAME	"/usr/lib/libutempter/utempter/utempter"
+ 
+ static const char *utempter_pathname;
+ static int saved_fd = -1;
+-- 
+1.8.4.2
+
diff --git a/meta-oe/recipes-support/libutempter/libutempter/libutempter-pierelro.patch b/meta-oe/recipes-support/libutempter/libutempter/libutempter-pierelro.patch
new file mode 100644
index 0000000..c30a92d
--- /dev/null
+++ b/meta-oe/recipes-support/libutempter/libutempter/libutempter-pierelro.patch
@@ -0,0 +1,23 @@
+Port from fedora20
+
+Upstream-Status: Pending
+Signed-off-by: Qian Lei <qianl.fnst at cn.fujitsu.com>
+
+diff -up libutempter-1.1.6/Makefile.pierelro libutempter-1.1.6/Makefile
+--- libutempter-1.1.6/Makefile.pierelro	2010-11-04 18:14:53.000000000 +0100
++++ libutempter-1.1.6/Makefile	2013-01-24 15:58:06.241865564 +0100
+@@ -52,11 +52,12 @@ all: $(TARGETS)
+ 	$(COMPILE.c) -fPIC $< $(OUTPUT_OPTION)
+ 
+ $(PROJECT): utempter.c
+-	$(LINK.c) -Wl,-z,now,-stats $(LDLIBS) $< $(OUTPUT_OPTION)
++	$(LINK.c) -pie -fPIE -Wl,-z,relro,-z,now,-stats $(LDLIBS) \
++		$< $(OUTPUT_OPTION)
+ 
+ $(SHAREDLIB): iface.os $(MAP)
+ 	$(LINK.o) -shared \
+-		-Wl,-soname,$(SONAME),--version-script=$(MAP),-z,defs,-stats \
++		-Wl,-soname,$(SONAME),--version-script=$(MAP),-z,relro,-z,defs,-stats \
+ 		-lc $< $(OUTPUT_OPTION)
+ 
+ $(STATICLIB): iface.o
diff --git a/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb b/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb
index e1dccd6..6df0f19 100644
--- a/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb
+++ b/meta-oe/recipes-support/libutempter/libutempter_1.1.6.bb
@@ -4,15 +4,15 @@ This library provides interface for terminal emulators such as \
 screen and xterm to record user sessions to utmp and wtmp files."
 HOMEPAGE = "ftp://ftp.altlinux.org/pub/people/ldv/utempter"
 SECTION = "System Environment/Libraries"
-LICENSE = "GPLv2 GPLv2+ LGPLv2 MIT"
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2 & MIT"
 LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
 
-SRC_URI = "ftp://ftp.altlinux.org/pub/people/ldv/utempter/${BP}.tar.bz2"
+SRC_URI = "ftp://ftp.altlinux.org/pub/people/ldv/utempter/${BP}.tar.bz2 \
+           file://0001-Modify-macro.patch \
+           file://libutempter-pierelro.patch"
 SRC_URI[md5sum] = "b43827806923903aba2bc7cd3a2d45b7"
 SRC_URI[sha256sum] = "b898565f31ced7e5c1fa0a2eaa0f6ff0ed862b5fe375d26375b64bfbdfeac397"
 
-CFLAGS += "-DLIBEXECDIR=$(libexecdir)"
-
 do_compile() {
     oe_runmake                      \
         libdir=${libdir}            \
@@ -27,10 +27,9 @@ do_install() {
         includedir=${includedir}    \
         mandir=${mandir}
 
-        rm -f ${D}${libdir}/*.a
+    rm -f ${D}${libdir}/*.a
 }
 
 FILES_${PN} = "${libdir}/*.so.*"
 FILES_${PN} += "${libexecdir}/utempter/utempter"
-
 FILES_${PN}-dbg += "${libexecdir}/utempter/.debug/utempter"
-- 
1.8.3.1




More information about the Openembedded-devel mailing list