Yocto Meta Virtualization
 help / color / mirror / Atom feed
From: "Martin Jansa" <Martin.Jansa@gmail.com>
To: meta-virtualization@lists.yoctoproject.org
Cc: Martin Jansa <Martin.Jansa@gmail.com>
Subject: [meta-virtualization][hardknott][PATCH 09/13] dev86: depend on dev86-native for ifdefg
Date: Wed,  1 Dec 2021 17:41:32 +0100	[thread overview]
Message-ID: <20211201164136.33802-9-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <20211201164136.33802-1-Martin.Jansa@gmail.com>

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 ...espect-LDFLAGS-when-building-bcc-cpp.patch | 23 ++++++++++++
 ...efg-from-dev86-native-instead-of-tar.patch | 36 +++++++++++++++++++
 recipes-extended/dev86/dev86_git.bb           | 17 ++++++---
 3 files changed, 71 insertions(+), 5 deletions(-)
 create mode 100644 recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch
 create mode 100644 recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch

diff --git a/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch b/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch
new file mode 100644
index 0000000..fc7fdd5
--- /dev/null
+++ b/recipes-extended/dev86/dev86/0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch
@@ -0,0 +1,23 @@
+From 12f3a54801e15f3bdd5222ca1487f2fe36141c5d Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 14 May 2021 06:30:18 -0700
+Subject: [PATCH] cpp/Makefile: respect LDFLAGS when building bcc-cpp
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ cpp/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpp/Makefile b/cpp/Makefile
+index 0ea43cc..303b43c 100644
+--- a/cpp/Makefile
++++ b/cpp/Makefile
+@@ -3,7 +3,7 @@ CFLAGS=-Wall -Wstrict-prototypes
+ all: bcc-cpp
+ 
+ bcc-cpp: main.o cpp.o hash.o token1.o token2.o
+-	$(CC) $(CFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o
++	$(CC) $(CFLAGS) $(LDFLAGS) -o bcc-cpp main.o cpp.o hash.o token1.o token2.o
+ 
+ clean realclean:
+ 	rm -f bcc-cpp main.o cpp.o hash.o token1.o token2.o tmp.h
diff --git a/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch b/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
new file mode 100644
index 0000000..52d5d59
--- /dev/null
+++ b/recipes-extended/dev86/dev86/0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch
@@ -0,0 +1,36 @@
+From 9b347a5ee9604d4ec972506328ee44a0d8eb1bf0 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 14 May 2021 06:32:02 -0700
+Subject: [PATCH] Makefile: use ifdefg from dev86-native instead of target
+
+* recipe is restricted to:
+  COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
+  so it's less likely to reproduce invalid combination of
+  host and target, but I guess if you have aarch64 build
+  machine and build for x86 then it might fail as for Bruce:
+
+| ./ifdefg -MU  makefile.in >tmp.mak
+| /bin/sh: 1: ./ifdefg: not found
+| make[1]: *** [Makefile:46: make.fil] Error 127
+
+  use ifdefg from native build to increase chances that it
+  will be compatible with your host system
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8a61b65..7fdf861 100644
+--- a/Makefile
++++ b/Makefile
+@@ -43,7 +43,7 @@ realclean:
+ 	-for X in */; do cd $$X && make clean; cd $(WD); done
+ 
+ make.fil: $(IFDEFNAME) makefile.in
+-	./$(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
++	$(IFDEFNAME) -MU $(IFDEFOPTS) makefile.in >tmp.mak
+ 	echo > tmp.sed
+ 	[ "$(BINDIR)" != "//bin" ] || echo >> tmp.sed "s:%BINDIR%:/bin:"
+ 	[ "$(LIBDIR)" != "//lib/bcc" ] || echo >> tmp.sed "s:%LIBDIR%:/lib/bcc:"
diff --git a/recipes-extended/dev86/dev86_git.bb b/recipes-extended/dev86/dev86_git.bb
index 476bf38..c987342 100644
--- a/recipes-extended/dev86/dev86_git.bb
+++ b/recipes-extended/dev86/dev86_git.bb
@@ -7,21 +7,23 @@ SECTION = "console/tools"
 BASE_PV="0.16.21"
 PV = "${BASE_PV}+git${SRCPV}"
 SRCREV = "e254e0b19651d3b8a20225b40281c9974a95dec4"
-SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https"
+SRC_URI = "git://github.com/jbruchon/${BPN}.git;protocol=https \
+    file://0001-cpp-Makefile-respect-LDFLAGS-when-building-bcc-cpp.patch \
+"
+SRC_URI_append_class-target = " \
+    file://0002-Makefile-use-ifdefg-from-dev86-native-instead-of-tar.patch \
+"
 
 S = "${WORKDIR}/git"
 
-DEPENDS = "gperf-native"
+DEPENDS = "gperf-native dev86-native"
 
 BBCLASSEXTEND = "native"
 EXTRA_OEMAKE = "VERSION=${BASE_PV} PREFIX=${prefix} DIST=${D} LDFLAGS='${LDFLAGS}'"
 
 do_compile() {
-	# ${S}/Makefile does respect LDFLAGS, but ${S}/cpp/Makefile doesn't when building bcc-cpp
-	sed -i 's#$(CC) $(CFLAGS) -o bcc-cpp#$(CC) $(CFLAGS) $(LDFLAGS) -o bcc-cpp#g' ${S}/cpp/Makefile
 	oe_runmake make.fil
 	oe_runmake -f make.fil bcc86 as86 ld86
-
 }
 
 do_install() {
@@ -33,8 +35,13 @@ do_install() {
 	oe_runmake install-bcc
 	ln -s ../lib/bcc/bcc-cpp ${D}${prefix}/bin/bcc-cpp
 	ln -s ../lib/bcc/bcc-cc1 ${D}${prefix}/bin/bcc-cc1
+}
 
+do_install_append_class-native() {
+        install -v -m 755 ${B}/ifdefg ${D}${bindir}
 }
+
 COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
 FILES_${PN} += "${libdir}/bcc"
+
 INSANE_SKIP_${PN} = "already-stripped"
-- 
2.32.0


  parent reply	other threads:[~2021-12-01 16:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-01 16:41 [meta-virtualization][hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8 Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 02/13] uxen-guest-tools: fix build against kernels 5.4+ Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 03/13] uxen-guest-tools: fix build against kernels 5.15+ Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 04/13] uxen-guest-tools: fix -DMODULE not working when building uxenhc module Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 05/13] xvisor: uprev to latest master and fix python reference Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 06/13] xvisor: set PV Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 07/13] dev86: add dependency on gperf-native Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 08/13] dev86: switch to still maintained fork of dev86 Martin Jansa
2021-12-01 16:41 ` Martin Jansa [this message]
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 10/13] dev86: fix compatibility with gperf-3.1 Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 11/13] dev86: remove the pre-generated token[12].h and force gperf to generate them in do_compile Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 12/13] dev86: work on all hosts, other cleanups Martin Jansa
2021-12-01 16:41 ` [meta-virtualization][hardknott][PATCH 13/13] dev86: don't require dev86-native to build dev86 Martin Jansa
2021-12-02  4:05 ` [meta-virtualization][hardknott][PATCH 01/13] uxen: update guest tools to 4.1.8 Bruce Ashfield

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=20211201164136.33802-9-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.com \
    --cc=meta-virtualization@lists.yoctoproject.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