mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-04 19:56:36 +08:00
Merge branch 'rldd' into 'master'
Port rldd See merge request redox-os/redox!2315
This commit is contained in:
commit
090bb9214b
@ -95,6 +95,7 @@ python312 = {}
|
||||
redoxfs = {}
|
||||
relibc = {}
|
||||
ripgrep = {}
|
||||
rldd = {}
|
||||
rsync = {}
|
||||
rust = {}
|
||||
rustpython = {}
|
||||
|
||||
@ -241,6 +241,7 @@ relibc = {}
|
||||
relibc-tests = {}
|
||||
relibc-tests-bins = {}
|
||||
ripgrep = {}
|
||||
rldd = {}
|
||||
rodioplay = {}
|
||||
rs-nes = {}
|
||||
rsille = {}
|
||||
|
||||
3
recipes/tools/rldd/ldd.sh
Normal file
3
recipes/tools/rldd/ldd.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rldd -l $1
|
||||
14
recipes/tools/rldd/recipe.toml
Normal file
14
recipes/tools/rldd/recipe.toml
Normal file
@ -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
|
||||
"""
|
||||
67
recipes/tools/rldd/redox.patch
Normal file
67
recipes/tools/rldd/redox.patch
Normal file
@ -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<P: AsRef<Path>>(ld_cache: &mut Option<LoaderCache>, _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<P: AsRef<Path>>(_ld_cache: &mut Option<LoaderCache>, _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<String>,
|
||||
_is_musl: bool,
|
||||
Loading…
Reference in New Issue
Block a user