Skip to contentSkip to conversation

package/python3: fix build on Sparc64 due to glibc 2.42 bump

PATCH Superseded Thomas Petazzoni via buildroot 1 participant 1 message Dec 5, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/python3: fix build on Sparc64 due to glibc 2.42 bump

Since we bumped to glibc 2.42, the build of Python 3 is failing on Sparc64 due to the removal of the "struct termio" definition from glibc. Since this only affects a small number of termio operations, we simply drop support for them, since they basically can't be used anymore (and we don't really care that much about those specific operations that only exist on Sparc64).

Fixes:

https://autobuild.buildroot.net/results/28fee0f8368ae3dc1d607ebad4881b736e360f07/

---
 ...c-stop-using-TC-operations-that-need.patch | 72 +++++++++++++++++++
 1 file changed, 72 insertions(+)
 create mode 100644 package/python3/0009-Modules-termios.c-stop-using-TC-operations-that-need.patch
package/python3/0009-Modules-termios.c-stop-using-TC-operations-that-need.patch new file +72 -0
new file mode 100644
index 0000000000..0381a1c54b
@@ -0,0 +1,72 @@
+From e4210a767ca27689cee8db84ce2854d1dde917c3 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Fri, 12 Sep 2025 21:04:24 +0200
+Subject: [PATCH] Modules/termios.c: stop using TC operations that need
+ termio.h
+
+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.
+
+Upstream: https://github.com/python/cpython/pull/142326
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ Modules/termios.c | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/Modules/termios.c b/Modules/termios.c
+index f2c5a4bafa7..43a7893c5d5 100644
+--- a/Modules/termios.c
++++ b/Modules/termios.c
+@@ -1115,9 +1115,6 @@ static struct constant {
+ #ifdef TCFLSH
+     {"TCFLSH", TCFLSH},
+ #endif
+-#ifdef TCGETA
+-    {"TCGETA", TCGETA},
+-#endif
+ #ifdef TCGETS
+     {"TCGETS", TCGETS},
+ #endif
+@@ -1127,15 +1124,6 @@ static struct constant {
+ #ifdef TCSBRKP
+     {"TCSBRKP", TCSBRKP},
+ #endif
+-#ifdef TCSETA
+-    {"TCSETA", TCSETA},
+-#endif
+-#ifdef TCSETAF
+-    {"TCSETAF", TCSETAF},
+-#endif
+-#ifdef TCSETAW
+-    {"TCSETAW", TCSETAW},
+-#endif
+ #ifdef TCSETS
+     {"TCSETS", TCSETS},
+ #endif
+-- 
+2.51.1
+
Signature · 6 lines
2.51.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot