python / python/cpython

TCGETA, TCSETA, TCSETAF, TCSETAW termios ioctl no longer usable on all architectures with glibc 2.42

Open
#142,379 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build extension-modules OS-linux OS-unsupported type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

The build of cpython is broken with glibc 2.42 on at least the alpha, hppa and sparc64 architectures, as reported for example on Gentoo: https://bugs.gentoo.org/962600, but also affecting Buildroot: https://autobuild.buildroot.net/results/e7d/e7d951b06e9338e622fe96b0fb02823b1ef5235c/build-end.log. The build failure looks like this:

./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},
      |                 ^~~~~~~

The problem is that on those architectures, ioctls.h reference "struct termio", which has been removed from glibc 2.42. https://lists.gnu.org/archive/html/info-gnu/2025-07/msg00011.html.

While the issue is being fixed in the upstream Linux kernel, it will take time for those fixes to propagate, and a fix in Python would be relevant. PR coming.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs
  • gh-142380

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Modules/termios.c around the TCGETA, TCSETA, TCSETAF, and TCSETAW entries and review the glibc 2.42 failure on alpha, hppa, and sparc64. Reproduce the affected build if possible; done means CPython builds successfully on those architectures without the incomplete struct termio errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux, python
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.