From 481a6ce63358a12f062ab1e66bbe38d73d5fa666 Mon Sep 17 00:00:00 2001 From: SahilPatidar Date: Mon, 3 Nov 2025 15:11:34 +0530 Subject: [PATCH] Fix issues and re-enable tests disabled in PR #165983 (from PR #165360) --- .../ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp | 2 +- .../ExecutionEngine/Orc/LibraryResolverTest.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp index d93f68622fcc2..32f6dbefb8480 100644 --- a/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp +++ b/llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp @@ -50,7 +50,7 @@ void handleError(Error Err, StringRef context = "") { } bool ObjectFileLoader::isArchitectureCompatible(const object::ObjectFile &Obj) { - Triple HostTriple(sys::getDefaultTargetTriple()); + Triple HostTriple(sys::getProcessTriple()); Triple ObjTriple = Obj.makeTriple(); LLVM_DEBUG({ diff --git a/llvm/unittests/ExecutionEngine/Orc/LibraryResolverTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LibraryResolverTest.cpp index 2a396da397eb5..b40b61e7a4a6f 100644 --- a/llvm/unittests/ExecutionEngine/Orc/LibraryResolverTest.cpp +++ b/llvm/unittests/ExecutionEngine/Orc/LibraryResolverTest.cpp @@ -30,9 +30,7 @@ using namespace llvm; using namespace llvm::orc; -// Disabled due to test setup issue — YAML to shared library creation seems -// invalid on some build bots. (PR #165360) Not related to code logic. -#if 0 +#if defined(__APPLE__) || defined(__linux__) // TODO: Add COFF (Windows) support for these tests. // this facility also works correctly on Windows (COFF), // so we should eventually enable and run these tests for that platform as well. @@ -105,8 +103,9 @@ class LibraryTestEnvironment : public ::testing::Environment { if (!sys::fs::exists(InputDirPath)) return; - SmallString<128> UniqueDir; - sys::path::append(UniqueDir, InputDirPath); + SmallString<512> ExecPath(sys::fs::getMainExecutable(nullptr, nullptr)); + sys::path::remove_filename(ExecPath); + SmallString<128> UniqueDir(ExecPath); std::error_code EC = sys::fs::createUniqueDirectory(UniqueDir, DirPath); if (EC)