path: root/src
diff options
authorLucas Wang <>2020-03-01 10:55:32 +0800
committerTor Arne Vestbø <>2020-03-15 00:02:45 +0100
commit9287447a67e8381e6cfd4bb2b143f522bb7969b1 (patch)
tree2585db40e6d5cc4a519e480ac1cabd38f3a411db /src
parent91436e2409f8950389ca959c00175bf91da2dafc (diff)
macOS: Ensure GL symbols are resolved from the OpenGL framework
The app or its dependencies may link against X11's libGL.1.dylib from XQuarz, to support GLX on macOS. Doing so may place libGL earlier in the load order than Apple's OpenGL framework, which results in dlsym picking symbols from libGL when using the RTLD_DEFAULT lookup strategy, breaking Qt's OpenGL support in various ways: QOpenGLShaderProgram: could not create shader program Warning: "" failed to compile! To fix this we use RTLD_NEXT, which looks up the symbol in dependency order of the image that called dlsym, rather than the global load order. Change-Id: I1ec3055a4ab0bb96566c7e196d301b30785f2dc0 Reviewed-by: Tor Arne Vestbø <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/ b/src/plugins/platforms/cocoa/
index 6db4bdb9fd..ccb6e20071 100644
--- a/src/plugins/platforms/cocoa/
+++ b/src/plugins/platforms/cocoa/
@@ -554,7 +554,7 @@ NSOpenGLContext *QCocoaGLContext::nativeContext() const
QFunctionPointer QCocoaGLContext::getProcAddress(const char *procName)
- return (QFunctionPointer)dlsym(RTLD_DEFAULT, procName);
+ return (QFunctionPointer)dlsym(RTLD_NEXT, procName);