From 5699895a37ca47a6135206ac8387bf00da92cf61 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 1 May 2022 21:08:02 +0200 Subject: [PATCH] Add extra prefix to static-compat libs to avoid confusion with normal libs --- libpkg/parser/binary.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libpkg/parser/binary.cpp b/libpkg/parser/binary.cpp index f66800b..b1d9b90 100644 --- a/libpkg/parser/binary.cpp +++ b/libpkg/parser/binary.cpp @@ -216,11 +216,13 @@ void Binary::load(std::string_view fileContent, std::string_view fileName, std:: if (name.empty() && isRegularFile && fileName.ends_with(".so")) { name = fileName; } - // add prefix to Android libs to avoid confusion with normal GNU/Linux ELFs + // add prefix to Android and compat libs to avoid confusion with normal GNU/Linux ELFs // note: Relying on the path is not nice. Have Android libs any special header to be distinguishable? if (directoryPath.starts_with("opt/android-libs") || (directoryPath.starts_with("opt/android-ndk") && directoryPath.find("/sysroot/") != std::string::npos)) { extraPrefix = "android-"; + } else if (directoryPath.starts_with("usr/static-compat/lib") && fileName.find(".so") != std::string::npos) { + extraPrefix = "static-compat-"; } break; default:;