sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Petr Vorel <petr.vorel@gmail.com>
To: buildroot@buildroot.org
Cc: ltp@lists.linux.it, Cyril Hrubis <chrubis@suse.cz>,
	Martin Doucha <martin.doucha@suse.com>,
	sparclinux@vger.kernel.org, Mike Gilbert <floppym@gentoo.org>,
	Andreas Larsson <andreas@gaisler.com>,
	James Hilliard <james.hilliard1@gmail.com>
Subject: Re: [LTP] [PATCH] ioctl02: Use correct termios structure
Date: Wed, 29 Jan 2025 22:42:19 +0100	[thread overview]
Message-ID: <20250129214219.GA447474@pevik> (raw)
In-Reply-To: <20240226155137.25523-1-mdoucha@suse.cz>

Hi all,

FYI this LTP commit merged as 697a06a827 [1] which is needed to fix ioctl02.c
test on ppc64le on all kernel versions breaks compilation on Buildroot
bootlin-sparc64-glibc toolchain (gcc: 13.3.0, kernel headers: 4.19.255, glibc: 2.39):

	In file included from br-test-pkg/bootlin-sparc64-glibc/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/sys/ioctl.h:29,
					 from ../../../../include/lapi/ioctl.h:11,
					 from ioctl02.c:31:
	br-test-pkg/bootlin-sparc64-glibc/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/bits/ioctl-types.h:36:8: error: redefinition of ‘struct termio’
	   36 | struct termio
		  |        ^~~~~~
	In file included from ioctl02.c:29:
	br-test-pkg/bootlin-sparc64-glibc/host/sparc64-buildroot-linux-gnu/sysroot/usr/include/asm/termbits.h:17:8: note: originally defined here
	   17 | struct termio {

The problem is with kernel <asm/termbits.h> incompatibility with glibc
<bits/ioctl-types.h> included via <sys/ioctl.h> which is needed by ioctl02.c
and also by LTP library include/safe_macros_fn.h.

This problem was fixed a year ago in kernel v6.10-rc1 in commit c32d18e7942d
("sparc: move struct termio to asm/termios.h") [2].

Because nobody noticed this change I suppose nobody uses LTP on sparc64
or people compile LTP on sparc64 with new kernel headers.

@Cyril @Martin FYI another example of conflicting glibc and kernel headers (not
listed in [3]). IMHO nothing to be done on LTP side unless we can magically put
back <termios.h> and have ppc64le working with it.

@Buildroot As I wrote, because LTP needs this fix for ppc64le (arch actually
tested by LTP developers), the only solution for Buildroot is to require
toolchain based on v6.10 kernel headers for sparc64 (quite a big limitation for
several cross compilation toolchain, some are based on 4.19 kernel headers,
5.11 requirement for musl effectively disables LTP on Buildroot on musl).

Kind regards,
Petr

[1] https://github.com/linux-test-project/ltp/commit/697a06a827978887e4c88710dc7d31d6f3ee816a
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c32d18e7942d7589b62e301eb426b32623366565
[3] https://sourceware.org/glibc/wiki/Synchronizing_Headers

> The termios structure definition in <termios.h> is incompatible
> with direct ioctl() calls. The correct definition is in <asm/termbits.h>

> Signed-off-by: Martin Doucha <mdoucha@suse.cz>
> ---
>  testcases/kernel/syscalls/ioctl/ioctl02.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

> diff --git a/testcases/kernel/syscalls/ioctl/ioctl02.c b/testcases/kernel/syscalls/ioctl/ioctl02.c
> index aab80b251..f3bfb239a 100644
> --- a/testcases/kernel/syscalls/ioctl/ioctl02.c
> +++ b/testcases/kernel/syscalls/ioctl/ioctl02.c
> @@ -26,7 +26,7 @@

>  #include <stdio.h>
>  #include <stdlib.h>
> -#include <termios.h>
> +#include <asm/termbits.h>

>  #include "lapi/ioctl.h"
>  #include "tst_test.h"


       reply	other threads:[~2025-01-29 21:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240226155137.25523-1-mdoucha@suse.cz>
2025-01-29 21:42 ` Petr Vorel [this message]
2025-01-30  7:39   ` [LTP] [PATCH] ioctl02: Use correct termios structure Andreas Larsson

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=20250129214219.GA447474@pevik \
    --to=petr.vorel@gmail.com \
    --cc=andreas@gaisler.com \
    --cc=buildroot@buildroot.org \
    --cc=chrubis@suse.cz \
    --cc=floppym@gentoo.org \
    --cc=james.hilliard1@gmail.com \
    --cc=ltp@lists.linux.it \
    --cc=martin.doucha@suse.com \
    --cc=sparclinux@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).