public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Koch, Stefan" <stefan-koch@siemens.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	"Kiszka, Jan" <jan.kiszka@siemens.com>,
	"MOESSBAUER, Felix" <felix.moessbauer@siemens.com>
Cc: "Sudler, Simon" <simon.sudler@siemens.com>,
	"Storm, Christian" <christian.storm@siemens.com>,
	"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>,
	"cedric.hombourger@siemens.com" <cedric.hombourger@siemens.com>,
	"Adler, Michael" <michael.adler@siemens.com>,
	"ubely@ilbers.de" <ubely@ilbers.de>
Subject: Re: custom-kernel headers: scripts are wrong architecture
Date: Tue, 30 Apr 2024 16:54:05 +0000	[thread overview]
Message-ID: <5869c37670d65ebe66ee1cbd7814da3931e4953c.camel@siemens.com> (raw)
In-Reply-To: <b600f17be7d35058705025706328389e509a097c.camel@siemens.com>

@Jan:
This is fixed by the patch "linux-module: Support emulated module build
with cross-compiled kernel"

On Wed, 2024-01-17 at 20:37 +0000, Moessbauer, Felix (T CED OES-DE)
wrote:
> Dear devs,
>
> while debugging a broken non-cross kernel module build, I found that
> there is a more generic issue about our linux-headers-${KERNEL_NAME}
> package: It might contain the kernel scripts (ELF binaries) in the
> wrong architecture. This only happens if the kernel itself is cross-
> compiled.
>
> Let's consider the following example, where we compile for a debian
> bookworm arm64 target. We further look at the 'fixdeps' script from
> the
> kernel tools (required during kmod builds).
>
> Example 1 (stock kernel):
>
> The script is located in package linux-kbuild-6.1 (dependency of
> linux-
> headers-<...>).
> - file /usr/lib/linux-kbuild-6.1/scripts/basic/fixdep: ELF 64-bit LSB
> pie executable, ARM aarch64, ...
> - linux-headers-arm64 : arm64
> - linux-kbuild-6.1 : arm64
>
> Example 2 (custom kernel):
>
> - file /usr/src/linux-headers-6.1.54-cip6-rt3/scripts/basic/fixdep:
> ELF
> 64-bit LSB pie executable, x86-64
> - linux-headers-iot2050-rt : arm64
>
> In example 2, the kmod build is obviously broken, as the emulated
> build
> will not be able to execute the x64 binary. Also, in an :arm64
> package,
> there must be no foreign architecture binaries.
>
> This behavior can also be reproduced, by cross-compiling a target
> with
> a custom kernel and disabling the cross-build for a module, using
> ISAR_CROSS_COMPILE="0" in the module build recipe.
>
> It would be great, if someone could have a look there. At a first
> glance, this issue looks closely related to "linux-custom: Split up
> binaries from kernel headers to kbuild packages". Maybe Stefan can
> comment on this as well.
>
> PS: This bug was uncovered today, as the cross-build of a kernel
> module
> on debian bookworm arm64 is currently broken in upstream debian. I
> already reported this bug in [1].
>
> [1]
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061075
>
> Best regards,
> Felix
>

--
Stefan Koch
Siemens AG
http://www.siemens.com/

      parent reply	other threads:[~2024-04-30 16:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-17 20:37 MOESSBAUER, Felix
2024-01-18  7:52 ` Jan Kiszka
2024-01-18  9:41   ` MOESSBAUER, Felix
2024-01-18  9:43     ` Jan Kiszka
2024-01-18  9:59     ` Koch, Stefan
2024-04-30 16:54 ` Koch, Stefan [this message]

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=5869c37670d65ebe66ee1cbd7814da3931e4953c.camel@siemens.com \
    --to=stefan-koch@siemens.com \
    --cc=adriaan.schmidt@siemens.com \
    --cc=cedric.hombourger@siemens.com \
    --cc=christian.storm@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=michael.adler@siemens.com \
    --cc=simon.sudler@siemens.com \
    --cc=ubely@ilbers.de \
    /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