public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 3/5] meta: Allow cross-compilation for RISC-V
Date: Fri, 10 Jan 2020 18:26:04 +0100	[thread overview]
Message-ID: <e52cc7aeafac983ccca456e0cb001d299ffc8b33.1578677166.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1578677166.git.jan.kiszka@siemens.com>
In-Reply-To: <cover.1578677166.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

This arch still lacks crossbuild-essential-riscv64, so we need to stub
some pieces. Specifically, we have to create a dummy package of the same
name so that mk-build-deps works fine. For buildchroot-host, we replace
the package by open-coding its dependencies.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/dpkg-base.bbclass                                    | 2 ++
 meta/recipes-devtools/buildchroot/buildchroot-host.bb             | 7 +++++++
 .../crossbuild-essential-riscv64_0.1-isar.bb                      | 8 ++++++++
 3 files changed, 17 insertions(+)
 create mode 100644 meta/recipes-devtools/crossbuild-essential-riscv64/crossbuild-essential-riscv64_0.1-isar.bb

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index af9c9840..1decf587 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -10,6 +10,8 @@ inherit terminal
 
 DEPENDS ?= ""
 
+DEPENDS_append_riscv64 = "${@' crossbuild-essential-riscv64' if d.getVar('ISAR_CROSS_COMPILE', True) == '1' and d.getVar('PN') != 'crossbuild-essential-riscv64' else ''}"
+
 python do_adjust_git() {
     import subprocess
 
diff --git a/meta/recipes-devtools/buildchroot/buildchroot-host.bb b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
index 408ad393..8e3a52cf 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot-host.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot-host.bb
@@ -15,3 +15,10 @@ BUILDCHROOT_PREINSTALL ?= " \
     ${BUILDCHROOT_PREINSTALL_COMMON} \
     libc6:${DISTRO_ARCH} \
     crossbuild-essential-${DISTRO_ARCH}"
+
+BUILDCHROOT_PREINSTALL_riscv64 ?= " \
+    ${BUILDCHROOT_PREINSTALL_COMMON} \
+    libc6:${DISTRO_ARCH} \
+    gcc-riscv64-linux-gnu:native \
+    g++-riscv64-linux-gnu:native \
+    dpkg-cross:native"
diff --git a/meta/recipes-devtools/crossbuild-essential-riscv64/crossbuild-essential-riscv64_0.1-isar.bb b/meta/recipes-devtools/crossbuild-essential-riscv64/crossbuild-essential-riscv64_0.1-isar.bb
new file mode 100644
index 00000000..39f6a59a
--- /dev/null
+++ b/meta/recipes-devtools/crossbuild-essential-riscv64/crossbuild-essential-riscv64_0.1-isar.bb
@@ -0,0 +1,8 @@
+# This software is a part of ISAR.
+# Copyright (C) 2020 Siemens AG
+
+inherit dpkg-raw
+
+DPKG_ARCH = "all"
+
+ISAR_CROSS_BUILD = "0"
-- 
2.16.4


  parent reply	other threads:[~2020-01-10 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 17:26 [PATCH 0/5] RISC-V support Jan Kiszka
2020-01-10 17:26 ` [PATCH 1/5] meta: Add debian-sid-ports distro config Jan Kiszka
2020-01-10 17:26 ` [PATCH 2/5] meta: base/isar-apt: Add RISC-V architecture Jan Kiszka
2020-01-10 17:26 ` Jan Kiszka [this message]
2020-01-10 17:26 ` [PATCH 4/5] start_vm: Add RISC-V 64-bit support Jan Kiszka
2020-01-10 17:26 ` [PATCH 5/5] meta-isar: Add qemuriscv64 virtual target Jan Kiszka

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=e52cc7aeafac983ccca456e0cb001d299ffc8b33.1578677166.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=isar-users@googlegroups.com \
    /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