diff mbox

[v6,1/3] rpi-userland: fix opengl library symlinks

Message ID 20170811013358.26864-2-gael.portay@savoirfairelinux.com
State Changes Requested
Headers show

Commit Message

Gaël PORTAY Aug. 11, 2017, 1:33 a.m. UTC
The Qt WebEngine module loads libEGL.so.1 and libGLESv2.so.2 libraries.
Path are hard-coded [1].

This patch sets up cmake to create those library links.

	# ls -l /usr/lib/lib*GL*
	lrwxrwxrwx    1 root     root            11 Mar 21 17:24 /usr/lib/libEGL.so -> libEGL.so.1
	lrwxrwxrwx    1 root     root            15 Mar 21 17:24 /usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
	-rwxr-xr-x    1 root     root        163152 Mar 22 14:56 /usr/lib/libEGL.so.1.0.0
	lrwxrwxrwx    1 root     root            14 Mar 21 17:24 /usr/lib/libGLESv2.so -> libGLESv2.so.2
	lrwxrwxrwx    1 root     root            18 Mar 21 17:24 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.0.0
	-rwxr-xr-x    1 root     root         78788 Mar 22 14:56 /usr/lib/libGLESv2.so.2.0.0

A pull request is pending [2].

[1] https://github.com/qt/qtwebengine/blob/5.8.0/src/core/surface_factory_qt.cpp#L76-L86
[2] https://github.com/raspberrypi/userland/pull/379

Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
---
 .../0007-Add-OpenGL-library-versioning.patch       | 37 ++++++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 package/rpi-userland/0007-Add-OpenGL-library-versioning.patch

Comments

Arnout Vandecappelle Aug. 12, 2017, 3:31 p.m. UTC | #1
Since you're probably going to send a v7 with the IA32 workaround, some
comments on this patch which I'd otherwise fix up while applying.

On 11-08-17 03:33, Gaël PORTAY wrote:
> The Qt WebEngine module loads libEGL.so.1 and libGLESv2.so.2 libraries.
> Path are hard-coded [1].
  Paths

> 
> This patch sets up cmake to create those library links.
> 
> 	# ls -l /usr/lib/lib*GL*
> 	lrwxrwxrwx    1 root     root            11 Mar 21 17:24 /usr/lib/libEGL.so -> libEGL.so.1
> 	lrwxrwxrwx    1 root     root            15 Mar 21 17:24 /usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
> 	-rwxr-xr-x    1 root     root        163152 Mar 22 14:56 /usr/lib/libEGL.so.1.0.0
> 	lrwxrwxrwx    1 root     root            14 Mar 21 17:24 /usr/lib/libGLESv2.so -> libGLESv2.so.2
> 	lrwxrwxrwx    1 root     root            18 Mar 21 17:24 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.0.0
> 	-rwxr-xr-x    1 root     root         78788 Mar 22 14:56 /usr/lib/libGLESv2.so.2.0.0

 If I read the code correctly (I didn't try to execute it), it will actually
create a link libEGL.so.1 -> libEGL.so, so where do you get the above?

> 
> A pull request is pending [2].
> 
> [1] https://github.com/qt/qtwebengine/blob/5.8.0/src/core/surface_factory_qt.cpp#L76-L86

 Perhaps use the 5.9.1 link now:
https://github.com/qt/qtwebengine/blob/v5.9.1/src/core/surface_factory_qt.cpp#L76-L86


> [2] https://github.com/raspberrypi/userland/pull/379

 This pull request URL should also be in the patch itself.

> 
> Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>

 Another question: do the other 10 providers of libGLES and libEGL do create the
correct symlinks? If some of them don't, then perhaps we should find a more
fundamental solution... That said, for now this is sufficient I think.

 Regards,
 Arnout

[snip]
Gaël PORTAY Aug. 12, 2017, 3:54 p.m. UTC | #2
Hello Arnout,

On Sat, Aug 12, 2017 at 05:31:16PM +0200, Arnout Vandecappelle wrote:
>  Since you're probably going to send a v7 with the IA32 workaround, some
> comments on this patch which I'd otherwise fix up while applying.
> 
> On 11-08-17 03:33, Gaël PORTAY wrote:
> > The Qt WebEngine module loads libEGL.so.1 and libGLESv2.so.2 libraries.
> > Path are hard-coded [1].
>   Paths
> 
> > 
> > This patch sets up cmake to create those library links.
> > 
> > 	# ls -l /usr/lib/lib*GL*
> > 	lrwxrwxrwx    1 root     root            11 Mar 21 17:24 /usr/lib/libEGL.so -> libEGL.so.1
> > 	lrwxrwxrwx    1 root     root            15 Mar 21 17:24 /usr/lib/libEGL.so.1 -> libEGL.so.1.0.0
> > 	-rwxr-xr-x    1 root     root        163152 Mar 22 14:56 /usr/lib/libEGL.so.1.0.0
> > 	lrwxrwxrwx    1 root     root            14 Mar 21 17:24 /usr/lib/libGLESv2.so -> libGLESv2.so.2
> > 	lrwxrwxrwx    1 root     root            18 Mar 21 17:24 /usr/lib/libGLESv2.so.2 -> libGLESv2.so.2.0.0
> > 	-rwxr-xr-x    1 root     root         78788 Mar 22 14:56 /usr/lib/libGLESv2.so.2.0.0
> 
>  If I read the code correctly (I didn't try to execute it), it will actually
> create a link libEGL.so.1 -> libEGL.so, so where do you get the above?

You are right, this output is outdated.

	$ ls -l /usr/lib/lib*GL*
	-rwxr-xr-x 1 gportay gportay 130032 Aug 10 21:16 libbrcmEGL.so
	-rwxr-xr-x 1 gportay gportay  71088 Aug 10 21:17 libbrcmGLESv2.so
	-rwxr-xr-x 1 gportay gportay 130032 Aug 10 21:17 libEGL.so
	lrwxrwxrwx 1 gportay gportay      9 Aug  9 12:30 libEGL.so.1 -> libEGL.so
	-rwxr-xr-x 1 gportay gportay  71088 Aug 10 21:16 libGLESv2.so
	lrwxrwxrwx 1 gportay gportay     12 Aug  9 12:30 libGLESv2.so.2 -> libGLESv2.so

> 
> > 
> > A pull request is pending [2].
> > 
> > [1] https://github.com/qt/qtwebengine/blob/5.8.0/src/core/surface_factory_qt.cpp#L76-L86
> 
>  Perhaps use the 5.9.1 link now:
> https://github.com/qt/qtwebengine/blob/v5.9.1/src/core/surface_factory_qt.cpp#L76-L86
> 
> 
> > [2] https://github.com/raspberrypi/userland/pull/379
> 
>  This pull request URL should also be in the patch itself.
> 
> > 
> > Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>

I will reword the commit.

> 
>  Another question: do the other 10 providers of libGLES and libEGL do create the
> correct symlinks? If some of them don't, then perhaps we should find a more
> fundamental solution... That said, for now this is sufficient I think.
> 

I will have a look to this.

>  Regards,
>  Arnout
> 

Regards,
Gael
diff mbox

Patch

diff --git a/package/rpi-userland/0007-Add-OpenGL-library-versioning.patch b/package/rpi-userland/0007-Add-OpenGL-library-versioning.patch
new file mode 100644
index 000000000..7024a7400
--- /dev/null
+++ b/package/rpi-userland/0007-Add-OpenGL-library-versioning.patch
@@ -0,0 +1,37 @@ 
+From bf388550943afc70798c497e3fc706303394cfdc Mon Sep 17 00:00:00 2001
+From: =?utf-8?q?Ga=C3=ABl=20PORTAY?= <gael.portay@savoirfairelinux.com>
+Date: Fri, 3 Mar 2017 17:28:41 -0500
+Subject: [PATCH] Add OpenGL library versioning
+
+Some applications like QtWebEngine dynamically load libraries using
+dlopen. The library name is hardcoded, and it includes the library
+version [1].
+
+This patch creates symlinks for EGL and GLES libraries.
+
+	libEGL.so.1 -> libEGL.so
+	libGLESv2.so.2 -> libGLESv2.so
+
+[1] https://github.com/qt/qtwebengine/blob/v5.8.0/src/core/surface_factory_qt.cpp#L76-L86
+
+Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
+---
+ host_applications/android/apps/vidtex/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/host_applications/android/apps/vidtex/CMakeLists.txt b/host_applications/android/apps/vidtex/CMakeLists.txt
+index 1f705ef..d68ae5f 100644
+--- a/host_applications/android/apps/vidtex/CMakeLists.txt
++++ b/host_applications/android/apps/vidtex/CMakeLists.txt
+@@ -10,3 +10,8 @@ set (VIDTEX_SOURCES
+    vidtex.c)
+ add_executable(vidtex ${VIDTEX_SOURCES})
+ target_link_libraries(vidtex GLESv2 EGL m bcm_host mmal_core mmal_components mmal_util mmal_vc_client vcos)
++
++set(DESTDIR \$ENV{DESTDIR})
++include(GNUInstallDirs)
++install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink libEGL.so ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libEGL.so.1)")
++install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink libGLESv2.so ${DESTDIR}/${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/libGLESv2.so.2)")
+-- 
+2.12.1
+