64f4f6de0c
qt5base: - removed 0001-Fix-error-attribute-target-crc-is-unknown.patch (upstream committed, see [1]) - removed 0002-examples-fix-compile-without-opengl-support.patch (upstream committed, see [2]) qt5declarative: - removed 0001-Fix-alignment-issue-on-ARMv7.patch (upstream committed, see [3]) - moved 0001-examples-photoviewer-needs-widgets-support.patch to 5.6.2 only (upstream 5.9.2 committed, see [4]) - moved 0002-examples-qquickviewcomparison-and-quickwidget-needs-.patch to 5.6.2 only (similare patch upstream committed, see [5]) qt5location: - removed 0001-Fix-plugins-build-dependency.patch (upstream committed, see [6]) qt5webchannel: - fix webchannel.js installation to target (the locatinon of the file webchannel.js changed from src/webchannel/qwebchannel.js to examples/webchannel/shared/qwebchannel.js, see commit [7]) qt5webengine: - removed 0001-Always-compile-QWebEnginePage-print.patch (upstream committed, see [8]) - keep 0002-Load-libEGL-and-libGLES2-symbols-implicitly.patch (upstream committed, see [9], but reverted afterwards, see [10]) qt5webkit: - fall back to 5.9.1 (no 5.9.2 package provided, see [11] and [12]). [1] http://code.qt.io/cgit/qt/qtbase.git/commit/?id=b7722c251c3a0938c7c71fc3da47fdbe920060b7 [2] http://code.qt.io/cgit/qt/qtbase.git/commit/?id=6ce4b680cdde7827a6ed4d00dbeb7e7e91569433 [3] http://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=03c2661b1243cc529fc3d8cfa65073f1da420307 [4] http://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=452a78d0ac4a1579733a8ab641be24c9b7c0dd96 [5] http://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=fa52bb665d6beb77a951c14c8edcba3541850afc [6] http://code.qt.io/cgit/qt/qtlocation.git/commit/?id=3ac051c4549575634cecc706175b019f4ed4c3bf [7] https://code.qt.io/cgit/qt/qtwebchannel.git/commit/?id=e7f150abaa8e81d3e404e9631a49341a7f7623d1 [8] http://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=085c2c529473bbe9dd7c8c5698a45053520cc423 [9] http://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=d4c621f6a6b87f2a86069fa393b9f7c4f9e7b9ad [10] http://code.qt.io/cgit/qt/qtwebengine.git/commit/?id=c11c2c8981e647c1eb2c6753ce77d436b92fff87 [11] https://blog.qt.io/blog/2017/10/06/qt-5-9-2-released/#comment-1200724 [12] https://blog.qt.io/blog/2017/10/06/qt-5-9-2-released/#comment-1200746 Signed-off-by: Peter Seiderer <ps.report@gmx.net> Tested-by: Joshua Henderson <joshua.henderson@microchip.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
90 lines
3.3 KiB
Diff
90 lines
3.3 KiB
Diff
From d4c621f6a6b87f2a86069fa393b9f7c4f9e7b9ad Mon Sep 17 00:00:00 2001
|
|
From: Viktor Engelmann <viktor.engelmann@qt.io>
|
|
Date: Fri, 7 Jul 2017 12:56:19 +0200
|
|
Subject: [PATCH] Load libEGL and libGLES2 symbols implicitly
|
|
|
|
Instead of explicitly loading libraries from hard-coded locations,
|
|
we now just call dlopen(NULL, RTLD_LAZY). This returns a handle to
|
|
the host process'es context, which already contains the symbols of
|
|
both these libraries, because we link against them.
|
|
It was necessary to bypass LoadLibrary, because that expects a non-NULL
|
|
file path, so we couldn't pass NULL through that interface.
|
|
|
|
Task-number: QTBUG-57761
|
|
Change-Id: I29f037dfe542222b5188a33c7727c81a464a87bb
|
|
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
|
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
|
|
Upstream-Status: Merged
|
|
Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com>
|
|
---
|
|
src/core/surface_factory_qt.cpp | 40 ++++++++--------------------------------
|
|
1 file changed, 8 insertions(+), 32 deletions(-)
|
|
|
|
diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp
|
|
index 36c05ec5..e8be8480 100644
|
|
--- a/src/core/surface_factory_qt.cpp
|
|
+++ b/src/core/surface_factory_qt.cpp
|
|
@@ -51,51 +51,27 @@
|
|
#if defined(USE_OZONE)
|
|
|
|
#include <EGL/egl.h>
|
|
-
|
|
-#ifndef QT_LIBDIR_EGL
|
|
-#define QT_LIBDIR_EGL "/usr/lib"
|
|
-#endif
|
|
-#ifndef QT_LIBDIR_GLES2
|
|
-#define QT_LIBDIR_GLES2 QT_LIBDIR_EGL
|
|
-#endif
|
|
+#include <dlfcn.h>
|
|
|
|
namespace QtWebEngineCore {
|
|
|
|
-base::NativeLibrary LoadLibrary(const base::FilePath& filename) {
|
|
- base::NativeLibraryLoadError error;
|
|
- base::NativeLibrary library = base::LoadNativeLibrary(filename, &error);
|
|
- if (!library) {
|
|
- LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " << error.ToString();
|
|
- return NULL;
|
|
- }
|
|
- return library;
|
|
-}
|
|
-
|
|
bool SurfaceFactoryQt::LoadEGLGLES2Bindings()
|
|
{
|
|
- base::FilePath libEGLPath = QtWebEngineCore::toFilePath(QT_LIBDIR_EGL);
|
|
- libEGLPath = libEGLPath.Append("libEGL.so.1");
|
|
- base::NativeLibrary eglLibrary = LoadLibrary(libEGLPath);
|
|
- if (!eglLibrary)
|
|
- return false;
|
|
-
|
|
- base::FilePath libGLES2Path = QtWebEngineCore::toFilePath(QT_LIBDIR_GLES2);
|
|
- libGLES2Path = libGLES2Path.Append("libGLESv2.so.2");
|
|
- base::NativeLibrary gles2Library = LoadLibrary(libGLES2Path);
|
|
- if (!gles2Library)
|
|
+ base::NativeLibrary eglgles2Library = dlopen(NULL, RTLD_LAZY);
|
|
+ if (!eglgles2Library) {
|
|
+ LOG(ERROR) << "Failed to open EGL/GLES2 context " << dlerror();
|
|
return false;
|
|
+ }
|
|
|
|
- gl::GLGetProcAddressProc get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(base::GetFunctionPointerFromNativeLibrary(eglLibrary, "eglGetProcAddress"));
|
|
+ gl::GLGetProcAddressProc get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(base::GetFunctionPointerFromNativeLibrary(eglgles2Library, "eglGetProcAddress"));
|
|
if (!get_proc_address) {
|
|
LOG(ERROR) << "eglGetProcAddress not found.";
|
|
- base::UnloadNativeLibrary(eglLibrary);
|
|
- base::UnloadNativeLibrary(gles2Library);
|
|
+ base::UnloadNativeLibrary(eglgles2Library);
|
|
return false;
|
|
}
|
|
|
|
gl::SetGLGetProcAddressProc(get_proc_address);
|
|
- gl::AddGLNativeLibrary(eglLibrary);
|
|
- gl::AddGLNativeLibrary(gles2Library);
|
|
+ gl::AddGLNativeLibrary(eglgles2Library);
|
|
return true;
|
|
}
|
|
|
|
--
|
|
2.13.2
|
|
|