File: hurd-Fix-build-from-missing-fpos_t.patch

package info (click to toggle)
rustc 1.88.0%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 934,168 kB
  • sloc: xml: 158,127; python: 36,062; javascript: 19,855; sh: 19,700; cpp: 18,947; ansic: 12,993; asm: 4,792; makefile: 690; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (38 lines) | stat: -rw-r--r-- 1,456 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Trevor Gross <tmgross@umich.edu>
Date: Mon, 2 Jun 2025 05:37:38 +0000
Subject: hurd: Fix build from missing `fpos_t`
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

In 872642ad ("gnu: Add proper structs for fpos_t and fpos64_t"),
`fpos_t` was changed from an opaque struct to one with a definition on
Linux GNU, with the Unix fallback configured as for targets without a
GNU `target_env`. However, GNU hurd matches `target_env = "gnu"`, but
doesn't have a `fpos` implementation.

Fix the build by adjusting the fallback `cfg` to be more specific.
Eventually we probably want the same definition on Hurd as on Linux.

Forwarded: https://github.com/rust-lang/libc/pull/4472

Can be dropped once libc is upgraded to 0.2.173+

Signed-off-by: Fabian Grünbichler <git@fabian.gruenbichler.email>
---
 vendor/libc-0.2.172/src/unix/mod.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vendor/libc-0.2.172/src/unix/mod.rs b/vendor/libc-0.2.172/src/unix/mod.rs
index 433eeec..f207377 100644
--- a/vendor/libc-0.2.172/src/unix/mod.rs
+++ b/vendor/libc-0.2.172/src/unix/mod.rs
@@ -559,7 +559,7 @@ cfg_if! {
 }
 
 cfg_if! {
-    if #[cfg(not(target_env = "gnu"))] {
+    if #[cfg(not(all(target_os = "linux", target_env = "gnu")))] {
         missing! {
             #[cfg_attr(feature = "extra_traits", derive(Debug))]
             pub enum fpos_t {} // FIXME(unix): fill this out with a struct