Skip to content

Commit

Permalink
llvm: Switch from llvm-readelf to llvm-readobj
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Jun 13, 2022
1 parent b6f1e23 commit b483759
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion xbuild/src/command/doctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Default for Doctor {
Check::new("clang++", Some(VersionCheck::new("--version", 0, 2))),
Check::new("llvm-ar", None),
Check::new("llvm-lib", None),
Check::new("llvm-readelf", Some(VersionCheck::new("--version", 1, 4))),
Check::new("llvm-readobj", Some(VersionCheck::new("--version", 1, 4))),
Check::new("lld", Some(VersionCheck::new("-flavor ld --version", 0, 1))),
Check::new("lld-link", Some(VersionCheck::new("--version", 0, 1))),
Check::new("lldb", Some(VersionCheck::new("--version", 0, 2))),
Expand Down
4 changes: 2 additions & 2 deletions xcommon/src/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub fn list_needed_libs_recursively(

/// List all required shared libraries as per the dynamic section
fn list_needed_libs(library_path: &Path) -> Result<HashSet<String>> {
let mut readelf = Command::new("llvm-readelf");
let mut readelf = Command::new("llvm-readobj");
let readelf = readelf.arg("--needed-libs").arg(library_path);
let output = readelf
.output()
Expand All @@ -81,7 +81,7 @@ fn list_needed_libs(library_path: &Path) -> Result<HashSet<String>> {
output.status
);
let output = std::str::from_utf8(&output.stdout).unwrap();
let output = output.strip_prefix("NeededLibraries [\n").unwrap();
let (_, output) = output.split_once("NeededLibraries [\n").unwrap();
let output = output.strip_suffix("]\n").unwrap();
let mut needed = HashSet::new();

Expand Down

0 comments on commit b483759

Please sign in to comment.