87339c6287
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'sd9760bdccommit 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:ccd379c6used '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).
156 lines
4.9 KiB
TOML
156 lines
4.9 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 = { version = "0.2.189", optional = true }
|
|
__libc_only_for_layout_checks = { package = "libc", version = "0.2.189", optional = true, features = ["align"] }
|
|
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" }
|