Re: [LTP] [PATCH] ioctl02: Use correct termios structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2025-01-29 22:42, Petr Vorel wrote:
> 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 patch in [2] was also applied to stable branches, so it is also
included in v6.6.74, v6.1.127, v5.15.177, v5.10.233, and v5.4.289 
kernel versions that are currently used by Buildroot master.

For the 4.19 kernel it is in place since v4.19.316.

Cheers,
Andreas





[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux