bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH rust] Add new target for GNU/Hurd


From: Amos Jeffries
Subject: Re: [PATCH rust] Add new target for GNU/Hurd
Date: Mon, 10 Jul 2023 01:22:01 +1200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0

Yay! :-)

Armchair review comments inline..

On 9/07/23 22:05, Damien Zammit wrote:
This is not quite right for library/std, but applies clean to a 2021 tree
of rust on hash 25ea6be13e3 and allows up to the following stage1 build
until libstd breaks on hurd, (with the other patch for rust-libc).


...


diff --git a/compiler/rustc_codegen_llvm/Cargo.toml 
b/compiler/rustc_codegen_llvm/Cargo.toml
index 4999cb3c7ab..39e09a28692 100644
--- a/compiler/rustc_codegen_llvm/Cargo.toml
+++ b/compiler/rustc_codegen_llvm/Cargo.toml
@@ -11,7 +11,7 @@ doctest = false
  [dependencies]
  bitflags = "1.0"
  cstr = "0.2"
-libc = "0.2"
+libc = { path = "../../../rust-libc" }

Would it be possible for stage1 to simulate the library being in its normal place instead of patching the paths?



diff --git a/library/std/src/os/hurd/mod.rs b/library/std/src/os/hurd/mod.rs
new file mode 100644
index 00000000000..497a51a1df6
--- /dev/null
+++ b/library/std/src/os/hurd/mod.rs
@@ -0,0 +1,6 @@
+//! OpenBSD-specific definitions
+

 "OpenBSD" ?


+#![stable(feature = "raw_ext", since = "1.1.0")]
+
+pub mod fs;
+pub mod raw;
diff --git a/library/std/src/os/hurd/raw.rs b/library/std/src/os/hurd/raw.rs
new file mode 100644
index 00000000000..475fcdcc4aa
--- /dev/null
+++ b/library/std/src/os/hurd/raw.rs
@@ -0,0 +1,83 @@
+//! NetBSD-specific raw type definitions
+

 "NetBSD" ?


diff --git a/library/std/src/sys/unix/net.rs b/library/std/src/sys/unix/net.rs
index e6b61062d15..2b5f5b917e9 100644
--- a/library/std/src/sys/unix/net.rs
+++ b/library/std/src/sys/unix/net.rs

AFAICS, these should perhapse be in alphabetical order.


@@ -61,6 +61,7 @@ pub fn new_raw(fam: c_int, ty: c_int) -> io::Result<Socket> {
                      target_os = "freebsd",
                      target_os = "illumos",
                      target_os = "linux",
+                    target_os = "hurd",
                      target_os = "netbsd",
                      target_os = "opensbd",
                  ))] {
@@ -98,6 +99,7 @@ pub fn new_pair(fam: c_int, ty: c_int) -> io::Result<(Socket, 
Socket)> {
                      target_os = "freebsd",
                      target_os = "illumos",
                      target_os = "linux",
+                    target_os = "hurd",
                      target_os = "netbsd",
                      target_os = "opensbd",
                  ))] {
@@ -203,6 +205,7 @@ pub fn accept(&self, storage: *mut sockaddr, len: *mut socklen_t) 
-> io::Result<
                  target_os = "freebsd",
                  target_os = "illumos",
                  target_os = "linux",
+                target_os = "hurd",
                  target_os = "netbsd",
                  target_os = "opensbd",
              ))] {
@@ -278,6 +281,7 @@ pub fn recv_from(&self, buf: &mut [u8]) -> io::Result<(usize, 
SocketAddr)> {
          target_os = "emscripten",
          target_os = "freebsd",
          target_os = "linux",
+        target_os = "hurd",
          target_os = "netbsd",
          target_os = "openbsd",
      ))]
@@ -309,6 +313,7 @@ pub fn is_write_vectored(&self) -> bool {
          target_os = "emscripten",
          target_os = "freebsd",
          target_os = "linux",
+        target_os = "hurd",
          target_os = "netbsd",
          target_os = "openbsd",
      ))]


HTH
Amos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]