Commit f8d5d5ed by Yuly Novikov Committed by Angle LUCI CQ

Revert "Add SearchType to OpenSharedLibraryWithExtension."

This reverts commit 18e99f4a. Reason for revert: breaks Mac, e.g. https://ci.chromium.org/ui/p/chromium/builders/ci/mac-arm64-rel-tests/2197/overview Original change's description: > Add SearchType to OpenSharedLibraryWithExtension. > > This fixes a bug in SystemInfo_vulkan where we were using the > System search path for the Vulkan loader when we prefer using the > custom ANGLE loader. > > Bug: chromium:1219969 > Change-Id: Iedf0fd11fe9ed8cc020b445ea9e12a7936937361 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2988791 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> Bug: chromium:1219969, chromium:1225040, chromium:1226675 Change-Id: I7a7e329181b69b0fb546e5245d8842723077126f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3006320 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 0beafe86
......@@ -120,8 +120,8 @@ SampleApplication::SampleApplication(std::string name,
mDriverType = angle::GLESDriverType::SystemWGL;
#else
mGLWindow = EGLWindow::New(glesMajorVersion, glesMinorVersion);
mEntryPointsLib.reset(angle::OpenSharedLibraryWithExtension(
angle::GetNativeEGLLibraryNameWithExtension(), angle::SearchType::SystemDir));
mEntryPointsLib.reset(
angle::OpenSharedLibraryWithExtension(angle::GetNativeEGLLibraryNameWithExtension()));
mDriverType = angle::GLESDriverType::SystemEGL;
#endif // defined(ANGLE_PLATFORM_WINDOWS)
}
......
......@@ -79,7 +79,7 @@ enum class SearchType
};
Library *OpenSharedLibrary(const char *libraryName, SearchType searchType);
Library *OpenSharedLibraryWithExtension(const char *libraryName, SearchType searchType);
Library *OpenSharedLibraryWithExtension(const char *libraryName);
// Returns true if the process is currently being debugged.
bool IsDebuggerAttached();
......
......@@ -108,12 +108,6 @@ class PosixLibrary : public Library
Library *OpenSharedLibrary(const char *libraryName, SearchType searchType)
{
std::string nameWithExt = std::string(libraryName) + "." + GetSharedLibraryExtension();
return OpenSharedLibraryWithExtension(nameWithExt.c_str(), searchType);
}
Library *OpenSharedLibraryWithExtension(const char *libraryName, SearchType searchType)
{
std::string directory;
if (searchType == SearchType::ApplicationDir)
{
......@@ -131,12 +125,17 @@ Library *OpenSharedLibraryWithExtension(const char *libraryName, SearchType sear
extraFlags = RTLD_NOLOAD;
}
std::string fullPath = directory + libraryName;
std::string fullPath = directory + libraryName + "." + GetSharedLibraryExtension();
#if ANGLE_PLATFORM_IOS
// On iOS, dlopen needs a suffix on the framework name to work.
fullPath = fullPath + "/" + libraryName;
#endif
return new PosixLibrary(libraryName, extraFlags);
return new PosixLibrary(fullPath, extraFlags);
}
Library *OpenSharedLibraryWithExtension(const char *libraryName)
{
return new PosixLibrary(libraryName, 0);
}
bool IsDirectory(const char *filename)
......
......@@ -96,8 +96,8 @@ Library *OpenSharedLibrary(const char *libraryName, SearchType searchType)
}
}
Library *OpenSharedLibraryWithExtension(const char *libraryName, SearchType searchType)
Library *OpenSharedLibraryWithExtension(const char *libraryName)
{
return new Win32Library(libraryName, searchType);
return new Win32Library(libraryName, SearchType::SystemDir);
}
} // namespace angle
......@@ -47,7 +47,7 @@ class VulkanLibrary final : NonCopyable
{
for (const char *libraryName : kLibVulkanNames)
{
mLibVulkan = OpenSharedLibraryWithExtension(libraryName, SearchType::ApplicationDir);
mLibVulkan = OpenSharedLibraryWithExtension(libraryName);
if (mLibVulkan)
{
if (mLibVulkan->getNative())
......
......@@ -605,8 +605,8 @@ ANGLERenderTest::ANGLERenderTest(const std::string &name,
case angle::GLESDriverType::SystemEGL:
#if defined(ANGLE_USE_UTIL_LOADER) && !defined(ANGLE_PLATFORM_WINDOWS)
mGLWindow = EGLWindow::New(testParams.majorVersion, testParams.minorVersion);
mEntryPointsLib.reset(angle::OpenSharedLibraryWithExtension(
GetNativeEGLLibraryNameWithExtension(), SearchType::SystemDir));
mEntryPointsLib.reset(
angle::OpenSharedLibraryWithExtension(GetNativeEGLLibraryNameWithExtension()));
#else
std::cerr << "Not implemented." << std::endl;
mSkipTest = true;
......
......@@ -1487,8 +1487,8 @@ Library *ANGLETestEnvironment::GetSystemEGLLibrary()
#if defined(ANGLE_USE_UTIL_LOADER)
if (!gSystemEGLLibrary)
{
gSystemEGLLibrary.reset(OpenSharedLibraryWithExtension(
GetNativeEGLLibraryNameWithExtension(), SearchType::SystemDir));
gSystemEGLLibrary.reset(
OpenSharedLibraryWithExtension(GetNativeEGLLibraryNameWithExtension()));
}
#endif // defined(ANGLE_USE_UTIL_LOADER)
return gSystemEGLLibrary.get();
......
......@@ -81,8 +81,7 @@ bool IsSystemEGLConfigSupported(const PlatformParameters &param, OSWindow *osWin
#if defined(ANGLE_USE_UTIL_LOADER)
std::unique_ptr<angle::Library> eglLibrary;
eglLibrary.reset(OpenSharedLibraryWithExtension(GetNativeEGLLibraryNameWithExtension(),
SearchType::SystemDir));
eglLibrary.reset(OpenSharedLibraryWithExtension(GetNativeEGLLibraryNameWithExtension()));
EGLWindow *eglWindow = EGLWindow::New(param.majorVersion, param.minorVersion);
ConfigParameters configParams;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment