diff --git a/config/aarch64/ci.toml b/config/aarch64/ci.toml index b16b83a73..1c39e17df 100644 --- a/config/aarch64/ci.toml +++ b/config/aarch64/ci.toml @@ -95,6 +95,7 @@ python312 = {} redoxfs = {} relibc = {} ripgrep = {} +rldd = {} rsync = {} rust = {} rustpython = {} diff --git a/config/x86_64/ci.toml b/config/x86_64/ci.toml index 11f9d77f2..466a7c2b8 100644 --- a/config/x86_64/ci.toml +++ b/config/x86_64/ci.toml @@ -241,6 +241,7 @@ relibc = {} relibc-tests = {} relibc-tests-bins = {} ripgrep = {} +rldd = {} rodioplay = {} rs-nes = {} rsille = {} diff --git a/recipes/tools/rldd/ldd.sh b/recipes/tools/rldd/ldd.sh new file mode 100644 index 000000000..3bf57bea9 --- /dev/null +++ b/recipes/tools/rldd/ldd.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +rldd -l $1 diff --git a/recipes/tools/rldd/recipe.toml b/recipes/tools/rldd/recipe.toml new file mode 100644 index 000000000..80683c882 --- /dev/null +++ b/recipes/tools/rldd/recipe.toml @@ -0,0 +1,14 @@ +[source] +git = "https://github.com/zatrazz/rldd" +rev = "v0.4.0" +patches = [ "redox.patch" ] + +[build] +template = "custom" +script = """ +DYNAMIC_INIT +cookbook_cargo + +cp ${COOKBOOK_RECIPE}/ldd.sh ${COOKBOOK_STAGE}/usr/bin/ldd +chmod +x ${COOKBOOK_STAGE}/usr/bin/ldd +""" diff --git a/recipes/tools/rldd/redox.patch b/recipes/tools/rldd/redox.patch new file mode 100644 index 000000000..7000fadd1 --- /dev/null +++ b/recipes/tools/rldd/redox.patch @@ -0,0 +1,67 @@ +diff --git a/Cargo.toml b/Cargo.toml +index 0a346a7..14d9171 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -33,12 +33,3 @@ raw-cpuid = "11.6.0" + + [target.'cfg(target_os = "freebsd")'.dev-dependencies] + tempfile = "3.3.0" +- +-[profile.release] +-strip = true +-opt-level = "z" +-lto = true +-# Defaultimproves compile times, but prevents some optimizations. +-codegen-units = 1 +-# Remove stack unwinder and backtrace. +-panic = "abort" +diff --git a/src/deptree.rs b/src/deptree.rs +index c0f3f93..fc6a44d 100644 +--- a/src/deptree.rs ++++ b/src/deptree.rs +@@ -96,7 +96,7 @@ impl fmt::Display for DepMode { + DepMode::LdCache => write!(f, "[ld-so.hints]"), + #[cfg(target_os = "netbsd")] + DepMode::LdCache => write!(f, "[ld.so.conf]"), +- #[cfg(any(target_os = "illumos", target_os = "solaris"))] ++ #[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "redox"))] + DepMode::LdCache => write!(f, "[unknown]"), + #[cfg(target_os = "macos")] + DepMode::LdCache => write!(f, "[dyld cache]"), +diff --git a/src/elf.rs b/src/elf.rs +index 1b1add2..9b7e621 100644 +--- a/src/elf.rs ++++ b/src/elf.rs +@@ -526,6 +526,10 @@ fn check_elf_header(elc: &ElfInfo) -> bool { + fn check_elf_header(elc: &ElfInfo) -> bool { + elc.ei_osabi == ELFOSABI_SYSV || elc.ei_osabi == ELFOSABI_SOLARIS + } ++#[cfg(any(target_os = "redox"))] ++fn check_elf_header(elc: &ElfInfo) -> bool { ++ elc.ei_osabi == ELFOSABI_SYSV ++} + + fn match_elf_header(a1: &ElfInfo, a2: &ElfInfo) -> bool { + a1.ei_class == a2.ei_class && a1.ei_data == a2.ei_data && a1.e_machine == a2.e_machine +@@ -893,7 +897,7 @@ fn load_so_cache>(ld_cache: &mut Option, _binary: &P + *ld_cache = ld_so_conf_netbsd::parse_ld_so_conf(&Path::new("/etc/ld.so.conf")).ok() + } + } +-#[cfg(any(target_os = "illumos", target_os = "solaris"))] ++#[cfg(any(target_os = "illumos", target_os = "solaris", target_os = "redox"))] + fn load_so_cache>(_ld_cache: &mut Option, _binary: &P, _ecl: &ElfInfo) { + } + +diff --git a/src/elf/system_dirs.rs b/src/elf/system_dirs.rs +index 6641544..e19aebe 100644 +--- a/src/elf/system_dirs.rs ++++ b/src/elf/system_dirs.rs +@@ -245,7 +245,7 @@ pub fn get_system_dirs( + .collect()) + } + +-#[cfg(any(target_os = "openbsd", target_os = "netbsd"))] ++#[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "redox"))] + pub fn get_system_dirs( + _interp: &Option, + _is_musl: bool,