From: Jan Kiszka <jan.kiszka@siemens.com>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
isar-users@googlegroups.com
Subject: Re: [PATCH 2/2] add example how to use derived sbuild chroots
Date: Fri, 14 Apr 2023 10:46:55 +0200 [thread overview]
Message-ID: <99d14d02-0740-a5d4-ad57-91e8b54a4e29@siemens.com> (raw)
In-Reply-To: <20230413070026.3511123-2-felix.moessbauer@siemens.com>
On 13.04.23 09:00, Felix Moessbauer wrote:
> This patch extends the samefile recipe to use a derived sbuild chroot to
> compile the tool using clang instead of gcc. While there are easier ways
> to achive this goal, it is still valuable to demonstrate how to use the
> infrastructure.
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> meta-isar/recipes-app/samefile/samefile_2.14.bb | 8 ++++++++
> .../sbuild-chroot/sbuild-chroot-target-clang.bb | 11 +++++++++++
> 2 files changed, 19 insertions(+)
> create mode 100644 meta-isar/recipes-devtools/sbuild-chroot/sbuild-chroot-target-clang.bb
>
> diff --git a/meta-isar/recipes-app/samefile/samefile_2.14.bb b/meta-isar/recipes-app/samefile/samefile_2.14.bb
> index c53c9445..989e1983 100644
> --- a/meta-isar/recipes-app/samefile/samefile_2.14.bb
> +++ b/meta-isar/recipes-app/samefile/samefile_2.14.bb
> @@ -5,6 +5,9 @@
>
> inherit dpkg
>
> +# for demo reasons, we compile with clang if not cross-compiling
> +SBUILD_FLAVOR = "${@ 'clang' if d.getVar('ISAR_CROSS_COMPILE') != '1' else '' }"
> +
> DEBIAN_DEPENDS = "\${misc:Depends}"
> DESCRIPTION = "utility that finds files with identical contents"
>
> @@ -42,4 +45,9 @@ EOF
>
> # We can also customize afterwards, in this case change the package section.
> sed -i -e 's/Section: misc/Section: utils/g' ${S}/debian/control
> +
> + # use clang to compile (no cross support yet)
> + if [ "${SBUILD_FLAVOR}" = "clang" ]; then
> + sed -i -e 's/\(#\!.*\)/\1\nexport CC=clang/g' ${S}/debian/rules
> + fi
> }
> diff --git a/meta-isar/recipes-devtools/sbuild-chroot/sbuild-chroot-target-clang.bb b/meta-isar/recipes-devtools/sbuild-chroot/sbuild-chroot-target-clang.bb
> new file mode 100644
> index 00000000..3df16368
> --- /dev/null
> +++ b/meta-isar/recipes-devtools/sbuild-chroot/sbuild-chroot-target-clang.bb
> @@ -0,0 +1,11 @@
> +# Root filesystem for packages building with clang
> +#
> +# This software is a part of ISAR.
> +# Copyright (C) 2023 Siemens AG
> +
> +DESCRIPTION = "Isar sbuild/schroot filesystem for target (clang variant)"
> +
> +require recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
> +
> +SBUILD_FLAVOR = "clang"
Could this be auto-derived from a helper-include by taking the recipe
name and sub-tracting a conventional prefix?
Jan
> +SBUILD_CHROOT_PREINSTALL_COMMON += "clang"
--
Siemens AG, Technology
Competence Center Embedded Linux
next prev parent reply other threads:[~2023-04-14 8:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-13 7:00 [PATCH 1/2] add support for " Felix Moessbauer
2023-04-13 7:00 ` [PATCH 2/2] add example how to use " Felix Moessbauer
2023-04-14 8:46 ` Jan Kiszka [this message]
2023-06-21 12:33 ` Henning Schild
2023-05-29 7:14 ` [PATCH 1/2] add support for " Uladzimir Bely
2023-06-13 6:24 ` Uladzimir Bely
2023-06-19 5:58 ` Jan Kiszka
2023-06-19 13:10 ` Moessbauer Felix
2023-06-20 6:25 ` Uladzimir Bely
2023-06-20 8:05 ` Uladzimir Bely
2023-06-20 8:51 ` Moessbauer Felix
2023-06-21 12:42 ` Henning Schild
2023-06-21 13:22 ` Moessbauer Felix
2023-06-21 13:34 ` Henning Schild
2023-06-21 13:54 ` Henning Schild
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=99d14d02-0740-a5d4-ad57-91e8b54a4e29@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=felix.moessbauer@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