Skip to content

Conversation

@tpetazzoni
Copy link
Contributor

Modules/termios.c makes use of TCGETA, TCSETA, TCSETAF and TCSETAW if they are defined. They are defined by kernel headers on a limited set of CPU architectures, but require the "struct termio" definition to exist, and this structure definition has been removed from glibc as of version 2.42.

Since these are seldomly used, we take the approach of just dropping support for those, in order to fix the following build issue:

./Modules/termios.c:1119:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1119 | {"TCGETA", TCGETA},
| ^~~~~~
./Modules/termios.c:1131:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1131 | {"TCSETA", TCSETA},
| ^~~~~~
./Modules/termios.c:1134:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1134 | {"TCSETAF", TCSETAF},
| ^~~~~~~
./Modules/termios.c:1137:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
1137 | {"TCSETAW", TCSETAW},
| ^~~~~~~
make[1]: *** [Makefile:3403: Modules/termios.o] Error 1

This issue is observed at least on sparc64, but not on more "mainstream" CPU architectures, as they do not define TCGETA/TCSETA/TCSETAF/TCSETAW.

Modules/termios.c makes use of TCGETA, TCSETA, TCSETAF and TCSETAW if
they are defined. They are defined by kernel headers on a limited set
of CPU architectures, but require the "struct termio" definition to
exist, and this structure definition has been removed from glibc as of
version 2.42.

Since these are seldomly used, we take the approach of just dropping
support for those, in order to fix the following build issue:

./Modules/termios.c:1119:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1119 |     {"TCGETA", TCGETA},
      |                ^~~~~~
./Modules/termios.c:1131:16: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1131 |     {"TCSETA", TCSETA},
      |                ^~~~~~
./Modules/termios.c:1134:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1134 |     {"TCSETAF", TCSETAF},
      |                 ^~~~~~~
./Modules/termios.c:1137:17: error: invalid application of 'sizeof' to incomplete type 'struct termio'
 1137 |     {"TCSETAW", TCSETAW},
      |                 ^~~~~~~
make[1]: *** [Makefile:3403: Modules/termios.o] Error 1

This issue is observed at least on sparc64, but not on more
"mainstream" CPU architectures, as they do not define
TCGETA/TCSETA/TCSETAF/TCSETAW.

Signed-off-by: Thomas Petazzoni <[email protected]>
@python-cla-bot
Copy link

python-cla-bot bot commented Dec 5, 2025

The following commit authors need to sign the Contributor License Agreement:

CLA not signed

@picnixz
Copy link
Member

picnixz commented Dec 5, 2025

Please:

  • sign the CLA
  • open an issue for this change
  • change the fix: I think we should instead detect during configure whether those macros are correct or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants