python / python/cpython

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

未关闭
#142,379 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

build extension-modules OS-linux OS-unsupported type-bug
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 Modules/termios.c 中 TCGETA、TCSETA、TCSETAF 和 TCSETAW 条目附近开始,检查 glibc 2.42 在 alpha、hppa 和 sparc64 上的失败。如果可能,复现受影响的构建;当 CPython 能够在这些架构上成功构建且没有不完整 struct termio 错误时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, linux, python
领域
build-system, operating-systems
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。