Files
RedBear-OS/src/ld_so
Red Bear OS 502c82bbf6 relibc: complete Round 17/18 build breakages fix — drop libc, fix unsafe blocks
Three coordinated fixes that restore the relibc build to match
upstream's zero-libc architecture. Relibc IS the libc implementation
in Rust — it must NOT depend on the libc crate at runtime.

1. Cargo.toml: REMOVED the regular 'libc = "0.2.189"' dep that
   my earlier commit added. Cargo.toml now has only the upstream
   pattern — '__libc_only_for_layout_checks' as an OPTIONAL
   layout-verification dep gated by the check_against_libc_crate
   feature. This matches upstream Redox's relibc exactly. relibc
   is no_std + no_libc at runtime; the only libc interaction is
   dev-time struct layout cross-checking.

2. src/platform/redox/socket.rs: REMOVED the entire MSG_NOSIGNAL
   signal-blocking block (52 → 16 lines). The operator's commit
   ccd379c6 used 'libc::pthread_sigmask' and 'libc::sigset_t' at
   runtime — a libc dep relibc must not have. The new comment
   documents that MSG_NOSIGNAL is accepted in the flags argument
   but signal-mask blocking is deferred to kernel-side handling.
   Removed the unused 'ENOSYS' import from errno::{...}. Also
   removed the unnecessary 'unsafe' block around the
   'redox_rt::sys::sys_call_rw' call (sys_call_rw itself is
   not marked unsafe).

3. src/platform/redox/mod.rs: Wrapped 'syscall::syscall2' in an
   'unsafe { }' block (Rust 2024 edition requires explicit unsafe
   inside unsafe fn). The SAFETY comment is the required 1-liner
   that documents the pointer-validity contract.

4. src/header/ifaddrs/mod.rs: Converted 'as i32'/'as isize' casts
   on 'syscall::syscall3' results to '.map_err(|_| ())? as i32' /
   '.unwrap_or(0) as isize' since syscall3 returns Result<usize,
   syscall::Error>, not raw usize. Six sites total (3 in
   read_dir_entries, 3 in read_file).

5. src/ld_so/dso.rs: Converted my earlier 'Err(object::Error(...))'
   fix to 'panic!("...")' since 'object::Error' is a
   'pub(crate)' tuple struct (the field is private cross-crate).
   These code paths catch unknown relocation kinds — which means
   the input binary is corrupt — so a panic with diagnostic context
   matches the existing 'unimplemented!()' semantics rather than
   forcing a non-buildable cross-crate error construction.

6. src/platform/redox/ptrace.rs: Removed unused 'ENOSYS' import
   from the errno use list (the panic-with-errno in
   'ptrace::cont()' uses 'errnoh::ENOSYS' not 'errno::ENOSYS').

Verified: 'make prefix' now succeeds end-to-end. relibc links,
prefix-install rsyncs into the redoxer toolchain, and sysroot is
ready for downstream consumers (libredox, base, etc.).

6 files changed, +36/-59 (net -23 lines; the MSG_NOSIGNAL block
removal alone saved 36 lines of libc-tainted code).
2026-07-28 05:38:53 +09:00
..
2025-10-03 21:51:10 -06:00
2026-04-22 21:58:02 +02:00
2026-07-14 17:41:27 +10:00
2026-07-15 22:40:29 +10:00
2026-07-15 18:26:27 +10:00