Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fiona Klute via buildroot <buildroot@buildroot.org>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Fiona Klute via buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 1/1] package/kmod: fix build with musl
Date: Thu, 9 May 2024 23:52:39 +0200	[thread overview]
Message-ID: <42c07d69-06e4-4e94-a1b0-75db415b1cdb@gmx.de> (raw)
In-Reply-To: <20240509225126.6b340d1a@windsurf>

Hi Thomas!

Am 09.05.24 um 22:51 schrieb Thomas Petazzoni:
> Hello Fiona,
>
> On Fri, 26 Apr 2024 23:51:44 +0200
> Fiona Klute via buildroot <buildroot@buildroot.org> wrote:
>
>> From: Fiona Klute <fiona.klute+wiwa@gmx.de>
>>
>> Patch from upstream PR still being discussed:
>> https://github.com/kmod-project/kmod/pull/32
>>
>> Signed-off-by: Fiona Klute <fiona.klute+wiwa@gmx.de>
>
> Thanks for the patch. One thing that I find strange is that I cannot
> reproduce. Yes, I get warnings due to basename(), but not an actual
> build failure (I'm using a toolchain based on musl 1.2.5). There are
> also no build failures in our autobuilders.
>
> Here is the defconfig that I tested:
>
> BR2_arm=y
> BR2_cortex_a9=y
> BR2_ARM_ENABLE_VFP=y
> BR2_TOOLCHAIN_EXTERNAL=y
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
> BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7_EABIHF_MUSL_STABLE=y
> BR2_INIT_NONE=y
> BR2_SYSTEM_BIN_SH_NONE=y
> # BR2_PACKAGE_BUSYBOX is not set
> BR2_PACKAGE_KMOD=y
> BR2_PACKAGE_KMOD_TOOLS=y
> # BR2_TARGET_ROOTFS_TAR is not set
>
> I just get:
>
> tools/kmod.c: In function ‘kmod_help’:
> tools/kmod.c:71:40: warning: implicit declaration of function ‘basename’ [-Wimplicit-function-declaration]
>     71 |                         "Commands:\n", basename(argv[0]));
>        |                                        ^~~~~~~~
> tools/kmod.c:71:40: warning: nested extern declaration of ‘basename’ [-Wnested-externs]
> tools/kmod.c:65:16: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
>     65 |         printf("kmod - Manage kernel modules: list, load, unload, etc\n"
>        |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ......
>     71 |                         "Commands:\n", basename(argv[0]));
>        |                                        ~~~~~~~~~~~~~~~~~
>        |                                        |
>        |                                        int
>
>
> Thoughts?

That's exactly what I'm seeing too. The problem is that when you then
try to use the resulting binaries (e.g. modprobe) they segfault, because
what's expected to be a pointer is some other value (probably int, with
different length) and the result is an invalid pointer.

So the build passes, but the resulting kmod tools are unusable. That's
how I found the issue, I was wondering why no modules were loaded on my
board. I would've just switched to the Busybox equivalents, but they
can't handle compressed modules.

Sorry I wasn't clearer, I tried to keep the commit message short,
evidently too short.

Best regards,
Fiona

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2024-05-09 21:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 21:51 [Buildroot] [PATCH 1/1] package/kmod: fix build with musl Fiona Klute via buildroot
2024-05-09 20:51 ` Thomas Petazzoni via buildroot
2024-05-09 21:52   ` Fiona Klute via buildroot [this message]
2024-06-04 17:55 ` Yann E. MORIN
2024-06-04 18:01   ` Fiona Klute via buildroot
2024-06-04 19:14 ` Yann E. MORIN
2024-06-08 18:24   ` Peter Korsgaard

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=42c07d69-06e4-4e94-a1b0-75db415b1cdb@gmx.de \
    --to=buildroot@buildroot.org \
    --cc=fiona.klute@gmx.de \
    --cc=thomas.petazzoni@bootlin.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