12#include "llvm/ADT/SmallVector.h"
13#include "llvm/ADT/StringRef.h"
23 arch_32.
GetTriple().setEnvironment(llvm::Triple::Android);
26 arch_64.
GetTriple().setEnvironment(llvm::Triple::Android);
36 static const char *
const ld_library_path_separator =
":";
37 static const char *
const default_lib32_path[] = {
"/vendor/lib",
"/system/lib",
39 static const char *
const default_lib64_path[] = {
"/vendor/lib64",
40 "/system/lib64",
nullptr};
42 if (module_path.empty() || module_path[0] ==
'/') {
43 FileSpec file_spec(module_path.c_str());
48 SmallVector<StringRef, 4> ld_paths;
50 if (
const char *ld_library_path = ::getenv(
"LD_LIBRARY_PATH"))
51 StringRef(ld_library_path)
52 .split(ld_paths, StringRef(ld_library_path_separator), -1,
false);
54 const char *
const *default_lib_path =
nullptr;
57 default_lib_path = default_lib32_path;
60 default_lib_path = default_lib64_path;
63 assert(
false &&
"Unknown address byte size");
67 for (
const char *
const *it = default_lib_path; *it; ++it)
68 ld_paths.push_back(StringRef(*it));
70 for (
const StringRef &path : ld_paths) {
71 FileSpec file_candidate(path.str().c_str());
76 return file_candidate;
91 file_spec =
FileSpec(
"/data/local/tmp");
An architecture specification class.
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
bool IsValid() const
Tests if this ArchSpec is valid.
llvm::Triple & GetTriple()
Architecture triple accessor.
void AppendPathComponent(llvm::StringRef component)
void Resolve(llvm::SmallVectorImpl< char > &path)
Resolve path to make it canonical.
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
static FileSystem & Instance()
static bool ComputeTempFileBaseDirectory(FileSpec &file_spec)
static FileSpec ResolveLibraryPath(const std::string &path, const ArchSpec &arch)
static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64)
static FileSpec GetDefaultShell()
static bool ComputeTempFileBaseDirectory(FileSpec &file_spec)
static void ComputeHostArchitectureSupport(ArchSpec &arch_32, ArchSpec &arch_64)
A class that represents a running process on the host machine.