Files
RedBear-OS/Cargo.toml
T
vasilito 80c26174bf relibc: pin libc to 0.2.149, fix 3 pre-existing ld_so/socket panic-sites
Three follow-up fixes that close the build-break cascade that was
left behind by the R17 'drop libc' commit (502c82bb):

1. Cargo.toml: pin __libc_only_for_layout_checks (libc dev-dep)
   to 0.2.149. The earlier 0.2.189 default pulled in a libc release
   whose layout constants diverge from Redox's release-abi, so
   the layout-only struct cross-checks reported false mismatches
   on x86_64-unknown-redox. 0.2.149 matches the Redox sysroot's
   libc.a.

2. ld_so/dso.rs: rewrite the panic!('static_relocate:
   unsupported relocation type') into Result::Error. The
   panicking call has been crashing the dynamic linker on any
   ELF DSO with an unsupported relocation kind; replacing it
   with None::<()>.read_error(...)? surfaces the same diagnostic
   as a Result::Err to the caller (program loader exits cleanly
   with 'cannot load libfoo.so' instead of dying with a SIGABRT
   panic message that crashes the parent init).

3. platform/redox/socket.rs: refresh the MSG_NOSIGNAL
   documentation in sendmsg + sendto. The actual implementation
   was already correct (forwards flags to netstack via metadata[1]
   and netstack performs signal-mask blocking at
   netstack/src/scheme/tcp.rs:66); the comments had gone stale
   and incorrectly described the previous 'strip the flag'
   workaround. Update them to describe the real architecture.

Verified by 'make prefix' from a state that previously reported
the three ld_so/socket errors; with these commits the relibc
lib target compiles clean and the prefix syncs without
diagnostics.

Closes the three pre-existing errors that round 17 explicitly
deferred to a future round. Verified end-to-end via
'repo cook relibc' in the cookbook.
2026-07-28 11:44:50 +09:00

155 lines
4.8 KiB
TOML

[package]
name = "relibc"
version = "0.2.5+rb0.3.1"
authors = ["Jeremy Soller <jackpot51@gmail.com>", "vasilito <adminpupkin@gmail.com>"]
edition = "2024"
[lib]
name = "relibc"
crate-type = ["staticlib"]
[workspace]
members = [
"src/crt0",
"src/crti",
"src/crtn",
"redox-rt",
"ld_so",
"generic-rt",
]
exclude = ["tests", "dlmalloc-rs"]
[workspace.lints.clippy]
borrow_as_ptr = "deny"
cast_lossless = "warn" # TODO review occurrences
cast_possible_truncation = "allow" # TODO review occurrences
cast_possible_wrap = "allow" # TODO review occurrences
cast_precision_loss = "allow" # TODO review occurrences
cast_ptr_alignment = "allow" # TODO review occurrences
cast_sign_loss = "allow" # TODO review occurrences
ignored_unit_patterns = "deny"
implicit_clone = "deny"
manual_let_else = "deny"
missing_errors_doc = "allow" # TODO review occurrences
missing_panics_doc = "allow" # TODO review occurrences
missing_safety_doc = "allow" # TODO review occurrences
mut_from_ref = "deny"
precedence = "deny"
ptr_as_ptr = "warn" # TODO review occurrences
ptr_cast_constness = "warn" # TODO review occurrences
ptr_offset_by_literal = "deny"
ref_as_ptr = "warn" # TODO review occurrences
type_complexity = "allow" # TODO review occurrences
upper_case_acronyms = "allow" # TODO review occurrences
zero_ptr = "deny" # must allow on public constants due to cbindgen issue
[workspace.lints.rust]
dangling_pointers_from_temporaries = "deny"
dead_code = "allow" # TODO review occuurences
deprecated = "deny"
improper_ctypes_definitions = "deny"
internal_features = "allow" # core_intrinsics and lang_items
irrefutable_let_patterns = "deny"
mismatched_lifetime_syntaxes = "deny"
non_camel_case_types = "allow" # needed for most POSIX type names
non_snake_case = "allow" # TODO review occuurences
non_upper_case_globals = "allow" # TODO review occuurences
unexpected_cfgs = "deny"
unpredictable_function_pointer_comparisons = "deny"
unreachable_code = "allow" # TODO review occuurences
unsafe_op_in_unsafe_fn = "deny"
unused_imports = "deny"
unused_must_use = "deny"
unused_mut = "deny"
unused_unsafe = "deny"
unused_variables = "allow" # TODO review occurrences (too many for now)
[lints]
workspace = true
[workspace.dependencies]
bitflags = "2"
ioslice = { version = "0.6", default-features = false }
plain = "0.2"
redox-path = "0.4.0"
redox_protocols = { package = "libredox", path = "../libredox", default-features = false, features = ["protocol"] }
redox_syscall = { path = "../syscall" }
[build-dependencies]
cc = "1"
[dependencies]
bitflags.workspace = true
arrayvec = { version = "0.7.6", default-features = false }
cbitset = "0.2"
posix-regex = { version = "0.1.4", features = ["no_std"] }
rand = { version = "0.10", default-features = false }
rand_xorshift = "0.5"
rand_jitter = "0.6"
memchr = { version = "2.2.0", default-features = false }
plain.workspace = true
unicode-width = "0.1"
__libc_only_for_layout_checks = { package = "libc", version = "0.2.149", optional = true }
md5-crypto = { package = "md-5", version = "0.10.6", default-features = false }
sha-crypt = { version = "0.5", default-features = false }
base64ct = { version = "1.6", default-features = false, features = ["alloc"] }
bcrypt-pbkdf = { version = "0.10", default-features = false, features = [
"alloc",
] }
scrypt = { version = "0.11", default-features = false, features = ["simple"] }
pbkdf2 = { version = "0.12", features = ["sha2"] }
sha2 = { version = "0.10", default-features = false }
generic-rt = { path = "generic-rt" }
chrono-tz = { version = "0.10", default-features = false }
chrono = { version = "0.4", default-features = false, features = ["alloc"] }
libm = "0.2"
log = "0.4"
spin = "0.9.8"
argon2 = "0.5.3"
[dependencies.dlmalloc]
path = "dlmalloc-rs"
default-features = false
features = ["c_api"]
[dependencies.object]
version = "0.36.7"
git = "https://gitlab.redox-os.org/andypython/object"
branch = "new"
default-features = false
features = ["elf", "read_core"]
[target.'cfg(target_os = "linux")'.dependencies]
sc = "0.2.7"
[target.'cfg(target_os = "redox")'.dependencies]
redox_syscall.workspace = true
redox-rt = { path = "redox-rt" }
redox-path.workspace = true
redox_event = { version = "0.4.8", default-features = false, features = ["redox_syscall"] }
ioslice.workspace = true
redox-ioctl = { path = "redox-ioctl" }
redox_protocols.workspace = true
[features]
# to enable trace level, take out this `no_trace`
default = ["check_against_libc_crate", "no_trace"]
check_against_libc_crate = ["__libc_only_for_layout_checks"]
math_libm = []
no_trace = ["log/release_max_level_debug"]
# for very verbose activity beyond trace level
trace_tls = []
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
[patch.crates-io]
cc-11 = { git = "https://github.com/tea/cc-rs", branch = "riscv-abi-arch-fix", package = "cc" }
redox_syscall = { path = "../syscall" }
libredox = { path = "../libredox" }