Debian Codegraph @

debian/patches/fix-ppc64el-baudrate.diff

raw
1 Description: Fix ppc64el build by treating little-endian powerpc64 like big-endian
2 On powerpc, powerpc64 (BE), and powerpc64le, nix::sys::termios::cfgetospeed
3 returns a BaudRate enum (not a u32). The display branch only excluded
4 powerpc and big-endian powerpc64, leaving ppc64el to take the u32 branch
5 and fail to compile (`BaudRate: std::fmt::Display` not satisfied).
6 .
7 Treat all powerpc/powerpc64 variants the same: use the BAUD_RATES table
8 to look up the matching display string.
9 Author: Sylvestre Ledru <[email protected]>
10 Forwarded: no
11 Last-Update: 2026-05-13
12
13 ===================================================================
14 --- a/src/uu/stty/src/stty.rs
15 +++ b/src/uu/stty/src/stty.rs
16 @@ -648,20 +648,20 @@ fn print_terminal_size(
17
18 let mut printer = WrappedPrinter::new(window_size);
19
20 - // BSDs and Linux (not ppc/big-endian ppc64) use a u32 for the baud rate, so we can simply
21 - // print it.
22 + // BSDs and Linux (not powerpc/powerpc64) use a u32 for the baud rate, so we can
23 + // simply print it.
24 #[cfg(any(target_os = "linux", bsd))]
25 #[cfg(all(
26 not(target_arch = "powerpc"),
27 - not(all(target_arch = "powerpc64", target_endian = "big"))
28 + not(target_arch = "powerpc64")
29 ))]
30 printer.print(&translate!("stty-output-speed", "speed" => speed));
31
32 - // Big-endian Linux PowerPC uses BaudRate enum, need to convert to display format
33 + // Linux PowerPC (32-bit and 64-bit, both endians) uses BaudRate enum, need to convert
34 #[cfg(target_os = "linux")]
35 #[cfg(any(
36 target_arch = "powerpc",
37 - all(target_arch = "powerpc64", target_endian = "big")
38 + target_arch = "powerpc64"
39 ))]
40 {
41 // On PowerPC, find the corresponding baud rate string for display