public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <petr.vorel@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [RFC PATCH 1/1] lapi: Add sysinfo.h to fix build with MUSL libc
Date: Fri, 2 Oct 2020 01:21:43 +0200	[thread overview]
Message-ID: <20201001232143.GA32085@dell5510> (raw)
In-Reply-To: <20201001231256.6930-1-petr.vorel@gmail.com>

Hi,

> The reason is to avoid indirect <linux/sysinfo.h> include when using
> some UAPI headers: <linux/netlink.h> or others -> <linux/kernel.h>
> -> <linux/sysinfo.h>

> This indirect include causes on MUSL redefinition of struct sysinfo when
> included both <sys/sysinfo.h> and some of UAPI headers:

> In file included from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/kernel.h:5,
>                  from x86_64-buildroot-linux-musl/sysroot/usr/include/linux/netlink.h:5,
>                  from ../include/tst_netlink.h:14,
>                  from tst_crypto.c:13:
> x86_64-buildroot-linux-musl/sysroot/usr/include/linux/sysinfo.h:8:8: error: redefinition of ?struct sysinfo?
>  struct sysinfo {
>         ^~~~~~~
> In file included from ../include/tst_safe_macros.h:15,
>                  from ../include/tst_test.h:93,
>                  from tst_crypto.c:11:
> x86_64-buildroot-linux-musl/sysroot/usr/include/sys/sysinfo.h:10:8: note: originally defined here

FYI commit which introduced the problem is 39aabfbd0 ("Add SAFE_SYSINFO() macro").

Alpine linux has patched kernel header, that's why our travis test didn't catch that.
https://git.alpinelinux.org/aports/tree/main/linux-headers/0003-remove-inclusion-of-sysinfo.h-in-kernel.h.patch

Kind regards,
Petr

  reply	other threads:[~2020-10-01 23:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 23:12 [LTP] [RFC PATCH 1/1] lapi: Add sysinfo.h to fix build with MUSL libc Petr Vorel
2020-10-01 23:21 ` Petr Vorel [this message]
2020-10-14 14:33 ` Cyril Hrubis
2020-10-15 19:06   ` Petr Vorel
2020-10-27 19:18     ` Petr Vorel
2023-04-27 18:54 ` Petr Vorel

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=20201001232143.GA32085@dell5510 \
    --to=petr.vorel@gmail.com \
    --cc=ltp@lists.linux.it \
    /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