Eight coordinated fixes that restore the relibc build after the
operator's MSG_NOSIGNAL commit (ccd379c6) and ifaddrs commit
(d9760bdc) plus my R9/R10 fixes introduced std:: references, sc::
references, and incorrect error types that didn't compile in relibc's
no_std context.
1. Cargo.toml: added 'libc = { version = "0.2.189", optional = true }'
so the optional-feature lib (previously only available gated by
__libc_only_for_layout_checks) is now available to the no_std
code that uses libc::sigset_t/libc::pthread_sigmask. Bumped
__libc_only_for_layout_checks to 0.2.189 and added 'align' feature
for consistent layout checks.
2. src/ld_so/dso.rs: Round 10's fix used 'Err(format!("..."))' but
object::Result<T> = Result<T, object::Error> and object::Error wraps
&'static str, not String. Replaced the format!() calls with
object::Error("unsupported relocation type") at the two
catch-all relocation arms. Loss of the relocation-kind detail in
the error string is acceptable: the object file is corrupt at that
point and the message just needs to identify the failure mode.
3. src/ld_so/linker.rs: Round 9's RTLD_NOLOAD fix returned
'Ok(*id)' where id was a &usize — wrong return type (function
returns Result<Arc<DSO>>). Replaced with the full scope-upgrade
path from the non-RTLD_NOLOAD branch and proper Arc cloning. The
RTLD_NOLOAD path now correctly returns the already-loaded DSO
with appropriate scope promotion, matching the non-RTLD_NOLOAD
semantics.
4. src/header/ifaddrs/mod.rs: the operator's d9760bdc commit used
'sc::syscall3/1' but no 'sc' module exists in relibc. Replaced
all 6 occurrences with 'syscall::syscall3/1' (the proper
syscall-crate path) and added 'use syscall;' at the top of the
file. Fixed the info.name[..name.len()].copy_from_slice(&name)
call to convert from &[u8] to &[i8] before copying into the
[c_char; 64] (i8) field.
5. src/platform/redox/mod.rs: Round 17's clock_settime stub used
'tv_nsec as i64' but syscall::TimeSpec::tv_nsec is i32 (POSIX spec).
Fixed the cast to 'tv_nsec as i32' so the field width matches.
6. src/platform/redox/socket.rs: ccd379c6 used 'std::mem::zeroed()'
and 'std::ptr::null_mut()' in a no_std module. Replaced with
'core::mem::zeroed()' and 'core::ptr::null_mut()' (core is
already imported at line 2 of the file).
Files changed: 6 (incl Cargo.lock + Cargo.toml).
Sync the relibc fork with 50 upstream commits (socket layer rework,
exec/signal/ptrace/path/timer updates, pthread cleanup, ld_so lifecycle
work bringing mark_ready/run_fini into the tree, dynamically-linked
init support, start.rs allocator-model rewrite, test harness updates).
Satisfies the verify-fork-functions gate (2 previously-missing ld_so
functions now present).
Conflicts resolved (4 files; 46 auto-merged):
- src/start.rs: took upstream's version wholesale. Upstream moved
allocator/linker initialization into ld_so's new lifecycle (the
mark_ready/run_fini work this merge brings in), superseding the RB
alloc_init cluster; the old model's function was already merged out
and its lone call would not compile.
- redox-rt/src/sys.rs: kept the RB refresh flow with the non-fatal
lseek fallback (upstream adopted the refresh as a fatal '?' —
RB's conservative fallback protects spawn for uid-dropped /
namespace-restricted exec where the kernel cannot refresh).
- src/platform/redox/exec.rs: kept the RB root exec-permission bypass
(ruid/euid != 0 gate, Linux-matching behavior).
- Cargo.lock: syn 2.0.118 -> 2.0.119 (upstream).
Verified: repo cook relibc --force-rebuild successful;
verify-fork-functions.sh --no-fetch relibc passes;
all 9 forks now pass the gate.