summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhey Popovych <serhe.popovych@gmail.com>2018-10-31 16:55:47 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-07 23:08:55 +0000
commita7bf511703d67af956e8d8152a53ec1a58b31ee1 (patch)
tree409e9169db87320564482716f0c64c1f538470f2
parent8929ffd67c6de431c2561f63c5427df6c354d30f (diff)
downloadpoky-a7bf511703d67af956e8d8152a53ec1a58b31ee1.tar.gz
v86d: Make cross compilation working on more architectures
Since commit 709c603dec19 ("v86d: Accept aarch64 as build host") we support cross compilation on aarch64 host in addition to x86 host. However building on hosts different than two above will fail. Make cross compilation support more generic by checking for TARGET_ARCH in v86d configure script with fallback to `uname -m` when not present in environment and pass TARGET_ARCH explicitly in do_configure(). Cross build for x86 tested on IBM Power 8 machine with RHEL7. Should work on aarch64 and rest too. (From OE-Core rev: 69f7579eb36c00b557225377e1a3cc61b103be23) Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-bsp/v86d/v86d/Support-for-cross-compilation.patch34
-rw-r--r--meta/recipes-bsp/v86d/v86d/aarch64-host.patch18
-rw-r--r--meta/recipes-bsp/v86d/v86d_0.1.10.bb4
3 files changed, 36 insertions, 20 deletions
diff --git a/meta/recipes-bsp/v86d/v86d/Support-for-cross-compilation.patch b/meta/recipes-bsp/v86d/v86d/Support-for-cross-compilation.patch
new file mode 100644
index 0000000000..15f70a59aa
--- /dev/null
+++ b/meta/recipes-bsp/v86d/v86d/Support-for-cross-compilation.patch
@@ -0,0 +1,34 @@
1From 8eda59654fd31416164c78f6068715b01767ed4e Mon Sep 17 00:00:00 2001
2From: Serhey Popovych <serhe.popovych@gmail.com>
3Date: Wed, 31 Oct 2018 07:31:47 -0400
4Subject: v86d: Support for cross compilation
5
6It is common to build on one system for another (e.g. on IBM Power
7machine for Intel x86) where HOST_ARCH (uname -m) != TARGET_ARCH.
8
9Take TARGET_ARCH from environment if it is given, otherwise fall back
10to `uname -m`.
11
12Upstream-Status: Pending
13Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com>
14---
15 configure | 3 ++-
16 1 file changed, 2 insertions(+), 1 deletion(-)
17
18diff --git a/configure b/configure
19index cbbd6b3..046aa99 100755
20--- a/configure
21+++ b/configure
22@@ -23,7 +23,8 @@ copt_x86emu_type="bool"
23 copt_x86emu_def=auto
24 copt_x86emu_test()
25 {
26- local m=`uname -m`
27+ local m="${TARGET_ARCH:-$(uname -m)}"
28+
29 if [ "$m" = "i686" -o "$m" = "i586" -o "$m" = "i486" -o "$m" = "i386" ]; then
30 echo "n";
31 elif [ "$m" = "x86_64" ]; then
32--
331.8.3.1
34
diff --git a/meta/recipes-bsp/v86d/v86d/aarch64-host.patch b/meta/recipes-bsp/v86d/v86d/aarch64-host.patch
deleted file mode 100644
index 701fed7b5d..0000000000
--- a/meta/recipes-bsp/v86d/v86d/aarch64-host.patch
+++ /dev/null
@@ -1,18 +0,0 @@
1Accept aarch64 as valid build host
2
3Upstream-Status: Pending
4Signed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Index: v86d-0.1.10/configure
7===================================================================
8--- v86d-0.1.10.orig/configure
9+++ v86d-0.1.10/configure
10@@ -26,7 +26,7 @@ copt_x86emu_test()
11 local m=`uname -m`
12 if [ "$m" = "i686" -o "$m" = "i586" -o "$m" = "i486" -o "$m" = "i386" ]; then
13 echo "n";
14- elif [ "$m" = "x86_64" ]; then
15+ elif [ "$m" = "x86_64" -o "$m" = "aarch64" ]; then
16 echo "y";
17 else
18 echo "It looks like your architecture '$m' isn't supported by this version of v86d." >&2
diff --git a/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/meta/recipes-bsp/v86d/v86d_0.1.10.bb
index f97b80d08f..84e27d2007 100644
--- a/meta/recipes-bsp/v86d/v86d_0.1.10.bb
+++ b/meta/recipes-bsp/v86d/v86d_0.1.10.bb
@@ -12,7 +12,7 @@ PR = "r2"
12SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \ 12SRC_URI = "http://snapshot.debian.org/archive/debian/20110427T035506Z/pool/main/v/${BPN}/${BPN}_${PV}.orig.tar.gz \
13 file://Update-x86emu-from-X.org.patch \ 13 file://Update-x86emu-from-X.org.patch \
14 file://ar-from-env.patch \ 14 file://ar-from-env.patch \
15 file://aarch64-host.patch \ 15 file://Support-for-cross-compilation.patch \
16" 16"
17 17
18SRC_URI[md5sum] = "889686ec8424468fe0d205742e77a4c2" 18SRC_URI[md5sum] = "889686ec8424468fe0d205742e77a4c2"
@@ -22,7 +22,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
22COMPATIBLE_HOST = '(i.86|x86_64).*-linux' 22COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
23 23
24do_configure () { 24do_configure () {
25 ./configure --with-x86emu 25 TARGET_ARCH="${TARGET_ARCH}" ./configure --with-x86emu
26} 26}
27 27
28do_compile () { 28do_compile () {