Openembedded Devel Discussions
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-systemd][PATCH V2 4/7] systemd: Use cross cpp
Date: Tue, 31 Jul 2012 11:56:14 -0700	[thread overview]
Message-ID: <1343760977-3290-4-git-send-email-raj.khem@gmail.com> (raw)
In-Reply-To: <1343760977-3290-1-git-send-email-raj.khem@gmail.com>

While building for non x86 arch (ppc) found that build
was using host's cpp which was not generating exact
syscall list for ppc since it was using the include files
from host

With this patch will use $(CPP) instead of hardcoding
cpp in makefile.am and then set CPP properly in recipe

Fixes build failures on cross builds

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../systemd/systemd/use-cross-cpp.patch            |   30 ++++++++++++++++++++
 meta-systemd/recipes-core/systemd/systemd_187.bb   |    5 +++
 2 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch

diff --git a/meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch b/meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch
new file mode 100644
index 0000000..8a4371e
--- /dev/null
+++ b/meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch
@@ -0,0 +1,30 @@
+hardcoding cpp does not work when cross compiling systemd.
+since it will use the include headers from host system and
+syscalls are different for different architectures.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: systemd-187/Makefile.am
+===================================================================
+--- systemd-187.orig/Makefile.am	2012-07-29 16:39:57.628405921 -0700
++++ systemd-187/Makefile.am	2012-07-29 16:40:37.248405921 -0700
+@@ -1026,7 +1026,7 @@
+ 	src/core/syscall-to-name.h
+ 
+ src/core/syscall-list.txt: Makefile
+-	$(AM_V_GEN)cpp $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
++	$(AM_V_GEN)$(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@
+ 
+ src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile
+ 	$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct syscall_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, __NR_%s\n", $$1, $$1 }' < $< > $@
+@@ -2199,7 +2199,7 @@
+ 
+ src/udev/keymap/keys.txt: Makefile
+ 	$(AM_V_at)mkdir -p src/udev/keymap
+-	$(AM_V_GEN)cpp $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
++	$(AM_V_GEN)$(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@
+ 
+ src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt Makefile
+ 	$(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@
diff --git a/meta-systemd/recipes-core/systemd/systemd_187.bb b/meta-systemd/recipes-core/systemd/systemd_187.bb
index a6f6281..a52e5a8 100644
--- a/meta-systemd/recipes-core/systemd/systemd_187.bb
+++ b/meta-systemd/recipes-core/systemd/systemd_187.bb
@@ -15,10 +15,14 @@ SERIAL_CONSOLE ?= "115200 /dev/ttyS0"
 
 SECTION = "base/shell"
 
+PR = "r1"
+
+
 inherit useradd pkgconfig autotools perlnative
 
 SRC_URI = "http://www.freedesktop.org/software/systemd/${P}.tar.xz \
            file://use-rootlibdir.patch \
+           file://use-cross-cpp.patch \
            file://gtk-doc.make \
            file://touchscreen.rules \
            file://modprobe.rules \
@@ -55,6 +59,7 @@ EXTRA_OECONF = " --with-distro=${SYSTEMDDISTRO} \
 
 # There's no docbook-xsl-native, so for the xsltproc check to false
 do_configure_prepend() {
+	export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
 	sed -i /xsltproc/d configure.ac
 
 	cp ${WORKDIR}/gtk-doc.make ${S}/docs/
-- 
1.7.5.4




  parent reply	other threads:[~2012-07-31 19:08 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-31 18:56 [meta-systemd][PATCH V2 1/7] systemd: Upgrade to 187 Khem Raj
2012-07-31 18:56 ` [meta-systemd][PATCH V2 2/7] busybox: stopping systemd-kmsg-syslogd is not needed Khem Raj
2012-07-31 18:56 ` [meta-systemd][PATCH V2 3/7] busybox-syslog.service.in: Create alias for syslog.service Khem Raj
2012-07-31 18:56 ` Khem Raj [this message]
2012-07-31 18:56 ` [meta-oe][PATCH V2 5/7] testlab.bbclass: Delete Khem Raj
2012-07-31 18:56 ` [meta-oe][PATCH V2 6/7] blacklist.bbclass: Move to meta-angstrom Khem Raj
2012-07-31 19:07   ` Koen Kooi
2012-07-31 19:24     ` Chris Larson
2012-07-31 19:43     ` Martin Jansa
2012-07-31 20:46       ` Khem Raj
2012-08-04 20:36   ` Koen Kooi
2012-08-04 20:47     ` Khem Raj
2012-08-04 21:56       ` Philip Balister
2012-08-05 11:41       ` Koen Kooi
2012-08-05 19:44         ` Khem Raj
2012-08-05 21:37         ` Chris Larson
2012-08-05 22:06           ` Khem Raj
2012-08-06  7:43           ` Koen Kooi
2012-08-07  2:38             ` Khem Raj
2012-07-31 18:56 ` [meta-oe][PATCH V2 7/7] kernel.bbclass: Rename to machine_kernel_pr.bbclass which provides added functionality Khem Raj
2012-08-01 17:38   ` Otavio Salvador
2012-08-01 22:31     ` Khem Raj
2012-08-01 15:11 ` [meta-systemd][PATCH V2 1/7] systemd: Upgrade to 187 Koen Kooi
2012-08-01 22:56   ` Khem Raj
2012-08-02  8:11     ` Paul Eggleton
2012-08-03 10:32       ` Khem Raj
2012-08-03 12:38         ` Koen Kooi
2012-08-03 14:41           ` Khem Raj
2012-08-03 15:36             ` Koen Kooi
2012-08-03 18:39               ` Khem Raj
2012-08-03 18:42                 ` Martin Jansa
2012-08-03 19:08                 ` Koen Kooi
2012-08-04 20:10               ` Khem Raj
2012-08-04 20:35                 ` Koen Kooi
2012-08-04 20:50                   ` Khem Raj
2012-08-05 11:42                     ` Koen Kooi
2012-08-05 11:53                       ` Philip Balister
2012-08-05 19:40                         ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343760977-3290-4-git-send-email-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox