The code/build explicitly links to the GL library names instead of their
sonames. Update the names that are used for linking so the libraries are
found at runtime.

Signed-off-by: Trevor Woerner <twoer...@gmail.com>
---
 ...0001-use-library-sonames-for-linking.patch | 126 ++++++++++++++++++
 .../vk-gl-cts/khronos-cts.inc                 |   1 +
 2 files changed, 127 insertions(+)
 create mode 100644 
meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch

diff --git 
a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch
 
b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch
new file mode 100644
index 000000000..cb396c37d
--- /dev/null
+++ 
b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch
@@ -0,0 +1,126 @@
+From acd25c4b8d5b7e420a7a89bdfd6551c70de828b3 Mon Sep 17 00:00:00 2001
+From: Trevor Woerner <twoer...@gmail.com>
+Date: Thu, 23 Sep 2021 19:36:43 -0400
+Subject: [PATCH] use library sonames for linking
+
+The recommended "best practices" for applications is to link to library
+sonames (e.g. libGL.so.1) instead of library names (e.g. libGL.so). This
+ensures that applications don't try to use libraries if an incompatible ABI
+change occurs.
+
+Upstream-Status: Submitted [https://github.com/KhronosGroup/VK-GL-CTS/pull/288]
+Signed-off-by: Trevor Woerner <twoer...@gmail.com>
+---
+ framework/egl/egluGLContextFactory.cpp                      | 4 ++--
+ framework/egl/wrapper/eglwLibrary.cpp                       | 2 +-
+ framework/platform/android/tcuAndroidPlatform.cpp           | 2 +-
+ framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp   | 2 +-
+ .../platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp | 2 +-
+ framework/platform/surfaceless/tcuSurfacelessPlatform.cpp   | 6 +++---
+ 6 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/framework/egl/egluGLContextFactory.cpp 
b/framework/egl/egluGLContextFactory.cpp
+index 8fbea2af1..8d42f19eb 100644
+--- a/framework/egl/egluGLContextFactory.cpp
++++ b/framework/egl/egluGLContextFactory.cpp
+@@ -63,7 +63,7 @@ using std::vector;
+ #     if (DE_OS == DE_OS_WIN32)
+ #             define DEQP_GLES2_LIBRARY_PATH "libGLESv2.dll"
+ #     else
+-#             define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so"
++#             define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so.2"
+ #     endif
+ #endif
+ 
+@@ -75,7 +75,7 @@ using std::vector;
+ #     if (DE_OS == DE_OS_WIN32)
+ #             define DEQP_OPENGL_LIBRARY_PATH "opengl32.dll"
+ #     else
+-#             define DEQP_OPENGL_LIBRARY_PATH "libGL.so"
++#             define DEQP_OPENGL_LIBRARY_PATH "libGL.so.1"
+ #     endif
+ #endif
+ 
+diff --git a/framework/egl/wrapper/eglwLibrary.cpp 
b/framework/egl/wrapper/eglwLibrary.cpp
+index d7e07fe18..ebdf68b14 100644
+--- a/framework/egl/wrapper/eglwLibrary.cpp
++++ b/framework/egl/wrapper/eglwLibrary.cpp
+@@ -148,7 +148,7 @@ DefaultLibrary::~DefaultLibrary (void)
+ const char* DefaultLibrary::getLibraryFileName (void)
+ {
+ #if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX)
+-      return "libEGL.so";
++      return "libEGL.so.1";
+ #elif (DE_OS == DE_OS_WIN32)
+       return "libEGL.dll";
+ #else
+diff --git a/framework/platform/android/tcuAndroidPlatform.cpp 
b/framework/platform/android/tcuAndroidPlatform.cpp
+index b9a4c716f..05cec0b49 100644
+--- a/framework/platform/android/tcuAndroidPlatform.cpp
++++ b/framework/platform/android/tcuAndroidPlatform.cpp
+@@ -57,7 +57,7 @@ static const eglu::NativeWindow::Capability          
WINDOW_CAPABILITIES             = (eglu::Nativ
+ class NativeDisplay : public eglu::NativeDisplay
+ {
+ public:
+-                                                                      
NativeDisplay                   (void) : 
eglu::NativeDisplay(DISPLAY_CAPABILITIES), m_library("libEGL.so") {}
++                                                                      
NativeDisplay                   (void) : 
eglu::NativeDisplay(DISPLAY_CAPABILITIES), m_library("libEGL.so.1") {}
+       virtual                                                 ~NativeDisplay  
                (void) {}
+ 
+       virtual EGLNativeDisplayType    getLegacyNative                 (void)  
                { return EGL_DEFAULT_DISPLAY;   }
+diff --git a/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp 
b/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp
+index 009c05e18..237c5e16f 100644
+--- a/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp
++++ b/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp
+@@ -75,7 +75,7 @@ class Library : public eglw::DefaultLibrary
+ {
+ public:
+       Library (void)
+-              : eglw::DefaultLibrary("libEGL.so")
++              : eglw::DefaultLibrary("libEGL.so.1")
+       {
+       }
+ 
+diff --git a/framework/platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp 
b/framework/platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
+index 97bc3a0ed..3a20d63d3 100644
+--- a/framework/platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
++++ b/framework/platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
+@@ -66,7 +66,7 @@ public:
+                                                                               
                         EGL_PLATFORM_WAYLAND_KHR,
+                                                                               
                         "EGL_KHR_platform_wayland")
+                                                                       , 
m_display             (waylandDisplay)
+-                                                                      , 
m_library             ("libEGL.so") {}
++                                                                      , 
m_library             ("libEGL.so.1") {}
+ 
+       ~Display(void) {}
+       wayland::Display&                       getWaylandDisplay       (void)  
{ return *m_display; }
+diff --git a/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp 
b/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
+index 9783eaeab..a1d8ac667 100644
+--- a/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
++++ b/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
+@@ -69,7 +69,7 @@ using std::vector;
+ 
+ // Default library names
+ #if !defined(DEQP_GLES2_LIBRARY_PATH)
+-#     define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so"
++#     define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so.2"
+ #endif
+ 
+ #if !defined(DEQP_GLES3_LIBRARY_PATH)
+@@ -77,7 +77,7 @@ using std::vector;
+ #endif
+ 
+ #if !defined(DEQP_OPENGL_LIBRARY_PATH)
+-#     define DEQP_OPENGL_LIBRARY_PATH "libGL.so"
++#     define DEQP_OPENGL_LIBRARY_PATH "libGL.so.1"
+ #endif
+ 
+ namespace tcu
+@@ -238,7 +238,7 @@ glu::RenderContext* ContextFactory::createContext(const 
glu::RenderConfig& confi
+ }
+ 
+ EglRenderContext::EglRenderContext(const glu::RenderConfig& config, const 
tcu::CommandLine& cmdLine)
+-      : m_egl("libEGL.so")
++      : m_egl("libEGL.so.1")
+       , m_contextType(config.type)
+       , m_eglDisplay(EGL_NO_DISPLAY)
+       , m_eglContext(EGL_NO_CONTEXT)
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc 
b/meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc
index 881d6ca82..1faee4d3a 100644
--- a/meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc
+++ b/meta-oe/recipes-graphics/vk-gl-cts/khronos-cts.inc
@@ -25,6 +25,7 @@ DEPENDS += "libpng zlib virtual/libgles2"
 SRC_URI += 
"file://0001-Workaround-for-GCC-11-uninit-variable-warnings-946.patch;patchdir=external/amber/src
 \
             
file://0001-Include-limits-header-for-numeric_limits.patch;patchdir=external/vulkancts
 \
             file://0001-vulkancts.patch \
+            file://0001-use-library-sonames-for-linking.patch \
 "
 
 SRC_URI:append:libc-musl = "\
-- 
2.30.0.rc0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#93113): 
https://lists.openembedded.org/g/openembedded-devel/message/93113
Mute This Topic: https://lists.openembedded.org/mt/85830586/21656
Group Owner: openembedded-devel+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to