Skip to content

Commit 481a6ce

Browse files
committed
Fix issues and re-enable tests disabled in PR llvm#165983 (from PR llvm#165360)
1 parent 40a042e commit 481a6ce

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

llvm/lib/ExecutionEngine/Orc/TargetProcess/LibraryScanner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void handleError(Error Err, StringRef context = "") {
5050
}
5151

5252
bool ObjectFileLoader::isArchitectureCompatible(const object::ObjectFile &Obj) {
53-
Triple HostTriple(sys::getDefaultTargetTriple());
53+
Triple HostTriple(sys::getProcessTriple());
5454
Triple ObjTriple = Obj.makeTriple();
5555

5656
LLVM_DEBUG({

llvm/unittests/ExecutionEngine/Orc/LibraryResolverTest.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
using namespace llvm;
3131
using namespace llvm::orc;
3232

33-
// Disabled due to test setup issue — YAML to shared library creation seems
34-
// invalid on some build bots. (PR #165360) Not related to code logic.
35-
#if 0
33+
#if defined(__APPLE__) || defined(__linux__)
3634
// TODO: Add COFF (Windows) support for these tests.
3735
// this facility also works correctly on Windows (COFF),
3836
// so we should eventually enable and run these tests for that platform as well.
@@ -105,8 +103,9 @@ class LibraryTestEnvironment : public ::testing::Environment {
105103
if (!sys::fs::exists(InputDirPath))
106104
return;
107105

108-
SmallString<128> UniqueDir;
109-
sys::path::append(UniqueDir, InputDirPath);
106+
SmallString<512> ExecPath(sys::fs::getMainExecutable(nullptr, nullptr));
107+
sys::path::remove_filename(ExecPath);
108+
SmallString<128> UniqueDir(ExecPath);
110109
std::error_code EC = sys::fs::createUniqueDirectory(UniqueDir, DirPath);
111110

112111
if (EC)

0 commit comments

Comments
 (0)