u-boot fails to build on sparc64 due redefinition of 'struct termio'

Hello!
On Linux sparc64, building u-boot fails with [1]:
cc -o tools/mkenvimage tools/mkenvimage.o tools/os_support.o tools/lib/crc32.o In file included from /<<PKGBUILDDIR>>/tools/termios_linux.h:33, from /<<PKGBUILDDIR>>/tools/kwboot.c:153: /usr/include/sparc64-linux-gnu/asm/termbits.h:14:8: error: redefinition of 'struct termio' 14 | struct termio { | ^~~~~~ In file included from /usr/include/sparc64-linux-gnu/sys/ioctl.h:29, from /<<PKGBUILDDIR>>/tools/termios_linux.h:30: /usr/include/sparc64-linux-gnu/bits/ioctl-types.h:36:8: note: originally defined here 36 | struct termio | ^~~~~~
Reading through tools/termios_linux.h, it seems like the problem is that <asm/ioctl.h> and <asm/termbits.h> are included at the same time. Not sure whether this is allowed according to the glibc documentation.
Full build log available in [1].
Adrian
[1] https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=sparc64&v... Bdfsg-1&stamp=1699723544&raw=0

Hi Adrian,
On Wed, 15 Nov 2023 at 00:27, John Paul Adrian Glaubitz glaubitz@physik.fu-berlin.de wrote:
Hello!
On Linux sparc64, building u-boot fails with [1]:
cc -o tools/mkenvimage tools/mkenvimage.o tools/os_support.o tools/lib/crc32.o In file included from /<<PKGBUILDDIR>>/tools/termios_linux.h:33, from /<<PKGBUILDDIR>>/tools/kwboot.c:153: /usr/include/sparc64-linux-gnu/asm/termbits.h:14:8: error: redefinition of 'struct termio' 14 | struct termio { | ^~~~~~ In file included from /usr/include/sparc64-linux-gnu/sys/ioctl.h:29, from /<<PKGBUILDDIR>>/tools/termios_linux.h:30: /usr/include/sparc64-linux-gnu/bits/ioctl-types.h:36:8: note: originally defined here 36 | struct termio | ^~~~~~
Reading through tools/termios_linux.h, it seems like the problem is that <asm/ioctl.h> and <asm/termbits.h> are included at the same time. Not sure whether this is allowed according to the glibc documentation.
Can you send a patch to fix it?
(BTW gmail tells me you are John when I start the email, but I noticed it this time and changed it)
Regards, Simon
Full build log available in [1].
Adrian
[1] https://buildd.debian.org/status/fetch.php?pkg=u-boot&arch=sparc64&v... Bdfsg-1&stamp=1699723544&raw=0
-- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

Hi Simon,
On Wed, 2023-11-15 at 06:40 -0700, Simon Glass wrote:
Hi Adrian,
On Wed, 15 Nov 2023 at 00:27, John Paul Adrian Glaubitz glaubitz@physik.fu-berlin.de wrote:
Hello!
On Linux sparc64, building u-boot fails with [1]:
cc -o tools/mkenvimage tools/mkenvimage.o tools/os_support.o tools/lib/crc32.o In file included from /<<PKGBUILDDIR>>/tools/termios_linux.h:33, from /<<PKGBUILDDIR>>/tools/kwboot.c:153: /usr/include/sparc64-linux-gnu/asm/termbits.h:14:8: error: redefinition of 'struct termio' 14 | struct termio { | ^~~~~~ In file included from /usr/include/sparc64-linux-gnu/sys/ioctl.h:29, from /<<PKGBUILDDIR>>/tools/termios_linux.h:30: /usr/include/sparc64-linux-gnu/bits/ioctl-types.h:36:8: note: originally defined here 36 | struct termio | ^~~~~~
Reading through tools/termios_linux.h, it seems like the problem is that <asm/ioctl.h> and <asm/termbits.h> are included at the same time. Not sure whether this is allowed according to the glibc documentation.
Can you send a patch to fix it?
I have not yet fully understood whether the headers are being used incorrectly or not but I assume yes since glibc usually does not have such fundamental bugs. I will consult glibc upstream first, in any case. They should know.
I have just posted it here first because I hoped someone might have caught an obvious issue.
(BTW gmail tells me you are John when I start the email, but I noticed it this time and changed it)
My name is "John Paul Adrian", but I am officially called "Adrian" because my mother thought that would be good idea. Don't ask ;-).
Thanks, Adrian
participants (2)
-
John Paul Adrian Glaubitz
-
Simon Glass