Hello!
Im working on custom Hardware, related to Beaglebone black. I compiled everything cross from source.
If I enable OpenGL and run an application, the screen turns black and nothing happens.
Here are my steps and environments:

Kernel:
3.12.15-rt25 (A testing 4.6.7 kernel behaves similar. Let me know, if you need kernel config or device tree options)


Steps to compile Qt:
Qt Code:
  1. wget http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz
  2. tar xf qt-everywhere-opensource-src-5.7.0.tar.gz
  3. cd qt-everywhere-opensource-src-5.7.0
  4. cat ../0001-patched-to-build-with-ELDK-5.3-and-Graphics_SDK_5_01.patch | patch -p1
  5. cd ..
  6. mkdir qt-everywhere-opensource-src-5.7.0-build
  7. cd qt-everywhere-opensource-src-5.7.0-build
  8.  
  9. export ARCH=arm
  10. export CROSS_COMPILE=armv7a-
  11. export PATH=/opt/eldk-5.3/armv7a/sysroots/i686-eldk-linux/usr/bin:/opt/eldk-5.3/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi:$PATH
  12.  
  13. ../qt-everywhere-opensource-src-5.7.0/configure -opensource -confirm-license -prefix /opt/qt-embedded-v5.7.0-armv7a -platform linux-g++-64 -xplatform devices/linux-beagleboard-g++ -device beagleboard -device-option CROSS_COMPILE=/opt/eldk-5.3/armv7a/sysroots/i686-eldk-linux/usr/bin/armv7a-vfp-neon-linux-gnueabi/armv7a- -nomake examples -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-pch -qt-libpng -qt-libjpeg -tslib -linuxfb -no-xcb -I$PWD/../../../packages/tslib-1.0/src -I/opt/Graphics_SDK_5_01_01_02/include/OGLES2/ -L$PWD/../../../packages/tslib-1.0/src/.libs -L/tftpboot/hh300/linux/rootfs/usr/lib -opengl -pkg-config -v
To copy to clipboard, switch view to plain text mode 

0001-patched-to-build-with-ELDK-5.3-and-Graphics_SDK_5_01.patch:
Qt Code:
  1. diff --git a/qtbase/mkspecs/common/g++-base.conf b/qtbase/mkspecs/common/g++-base.conf
  2. index c42c46b..ae22071 100644
  3. --- a/qtbase/mkspecs/common/g++-base.conf
  4. +++ b/qtbase/mkspecs/common/g++-base.conf
  5. @@ -27,7 +27,7 @@ QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE}
  6. QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
  7. QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
  8.  
  9. -QMAKE_CXXFLAGS_CXX11 = -std=c++11
  10. +QMAKE_CXXFLAGS_CXX11 = -std=c++0x
  11. QMAKE_CXXFLAGS_CXX14 = -std=c++1y
  12. QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
  13. QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
  14. diff --git a/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf b/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
  15. index 604da50..9d8db69 100644
  16. --- a/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
  17. +++ b/qtbase/mkspecs/devices/linux-beagleboard-g++/qmake.conf
  18. @@ -36,8 +36,8 @@ QMAKE_CXXFLAGS_RELEASE += -O3
  19. QMAKE_LIBS += -lrt -lpthread -ldl
  20.  
  21. # Extra stuff (OpenGL, DirectFB, ...)
  22. -QMAKE_INCDIR_EGL =
  23. -QMAKE_LIBDIR_EGL =
  24. +QMAKE_INCDIR_EGL = /opt/Graphics_SDK_5_01_01_02/include
  25. +QMAKE_LIBDIR_EGL = /opt/gfxlibraries/gfx_rel_es8.x
  26. QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
  27. QMAKE_LIBDIR_OPENGL_ES2 = $${QMAKE_LIBDIR_EGL}
  28. QMAKE_INCDIR_OPENVG = $${QMAKE_INCDIR_EGL}
  29. @@ -47,7 +47,7 @@ QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um
  30. QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 $${QMAKE_LIBS_EGL}
  31. QMAKE_LIBS_OPENVG = -lOpenVG $${QMAKE_LIBS_EGL}
  32.  
  33. -DISTRO_OPTS += hard-float
  34. +#DISTRO_OPTS += hard-float
  35.  
  36. # No need for any special EGL device integration.
  37. # Prioritize the default, compiled-in integration over any plugins.
To copy to clipboard, switch view to plain text mode 

Configurte output:
Qt Code:
  1. Build options:
  2. Configuration .......... audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile dbus doubleconversion egl eglfs enable_new_dtags evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config libudev linuxfb medium-config minimal-config mremap neon nis opengl opengles2 openssl pcre png poll_poll posix_fallocate qpa qpa reduce_exports release rpath shared small-config system-zlib threadsafe-cloexec tslib xinput2 xlib xrender
  3. Build parts ............ libs
  4. Mode ................... release
  5. Using sanitizer(s)...... none
  6. Using C++ standard ..... c++11
  7. Using gold linker....... no
  8. Using new DTAGS ........ yes
  9. Using PCH .............. no
  10. Using LTCG ............. no
  11. Target compiler supports:
  12. Neon ................. yes
  13.  
  14. Qt modules and options:
  15. Qt D-Bus ............... yes (loading dbus-1 at runtime)
  16. Qt Concurrent .......... yes
  17. Qt GUI ................. yes
  18. Qt Widgets ............. yes
  19. Large File ............. no
  20. QML debugging .......... yes
  21. Use system proxies ..... no
  22.  
  23. Support enabled for:
  24. Accessibility .......... no
  25. ALSA ................... no
  26. CUPS ................... no
  27. DoubleConversion........ yes (bundled copy)
  28. Evdev .................. yes
  29. FontConfig ............. no
  30. FreeType ............... yes (bundled copy)
  31. Glib ................... no
  32. GStreamer .............. no
  33. GTK platformtheme ...... no
  34. HarfBuzz ............... yes (bundled copy)
  35. Iconv .................. yes
  36. ICU .................... no
  37. Image formats:
  38. GIF .................. yes (plugin, using bundled copy)
  39. JPEG ................. yes (plugin, using bundled copy)
  40. PNG .................. yes (in QtGui, using bundled copy)
  41. libinput................ no
  42. Logging backends:
  43. journald ............... no
  44. syslog ............... no
  45. mtdev .................. no
  46. Networking:
  47. getaddrinfo .......... yes
  48. getifaddrs ........... yes
  49. IPv6 ifname .......... yes
  50. libproxy.............. no
  51. OpenSSL .............. yes (loading libraries at run-time)
  52. NIS .................... yes
  53. OpenGL / OpenVG:
  54. EGL .................. yes
  55. OpenGL ............... yes (OpenGL ES 2.0+)
  56. OpenVG ............... no
  57. PCRE ................... yes (bundled copy)
  58. pkg-config ............. yes
  59. PulseAudio ............. no
  60. QPA backends:
  61. DirectFB ............. no
  62. EGLFS ................ yes
  63. EGLFS i.MX6 ........ no
  64. EGLFS i.MX6 Wayland. no
  65. EGLFS EGLDevice .... no
  66. EGLFS GBM .......... no
  67. EGLFS Mali ......... no
  68. EGLFS Raspberry Pi . no
  69. EGLFS X11 .......... no
  70. LinuxFB .............. yes
  71. Mir client............ no
  72. XCB .................. no
  73. Session management ..... yes
  74. SQL drivers:
  75. DB2 .................. no
  76. InterBase ............ no
  77. MySQL ................ no
  78. OCI .................. no
  79. ODBC ................. no
  80. PostgreSQL ........... no
  81. SQLite 2 ............. no
  82. SQLite ............... yes (plugin, using bundled copy)
  83. TDS .................. no
  84. tslib .................. yes
  85. udev ................... yes
  86. xkbcommon-x11........... no
  87. xkbcommon-evdev......... no
  88. zlib ................... yes (system library)
To copy to clipboard, switch view to plain text mode 

Target environment (shorted):
Qt Code:
  1. TSLIB_CONFFILE=/etc/ts.conf
  2. POINTERCAL_FILE=/app/pointercal
  3. TSLIB_CALIBFILE=/app/pointercal
  4. LD_LIBRARY_PATH=/opt/qt-embedded-v5.7.0-armv7a/lib:/opt/qt-embedded-v5.7.0-armv7a/plugins/platforms/
  5. QWS_MOUSE_PROTO=Tslib:/dev/input/by-path/platform-44e0b000.i2c-event-mouse
  6. PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
  7. QTARGS=--platform eglfs -plugin tslib
  8. TSLIB_TSDEVICE=/dev/input/by-path/platform-44e0b000.i2c-event-mouse
  9. QWS_DISPLAY=Multi: LinuxFb: VNC::size=1024x768
To copy to clipboard, switch view to plain text mode 

ldd on hellogl2 example:
Qt Code:
  1. root@ppc3xx:/app# ldd hellogl2
  2. libQt5Widgets.so.5 => /opt/qt-embedded-v5.7.0-armv7a/lib/libQt5Widgets.so.5 (0xb6b99000)
  3. libQt5Gui.so.5 => /opt/qt-embedded-v5.7.0-armv7a/lib/libQt5Gui.so.5 (0xb683d000)
  4. libQt5Core.so.5 => /opt/qt-embedded-v5.7.0-armv7a/lib/libQt5Core.so.5 (0xb6429000)
  5. librt.so.1 => /lib/librt.so.1 (0x4b9d8000)
  6. libdl.so.2 => /lib/libdl.so.2 (0x4b840000)
  7. libGLESv2.so => /usr/lib/libGLESv2.so (0xb63b4000)
  8. libEGL.so => /usr/lib/libEGL.so (0xb63a9000)
  9. libIMGegl.so => /usr/lib/libIMGegl.so (0xb638f000)
  10. libsrv_um.so => /usr/lib/libsrv_um.so (0xb635c000)
  11. libpthread.so.0 => /lib/libpthread.so.0 (0x4b9b0000)
  12. libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x4ba88000)
  13. libm.so.6 => /lib/libm.so.6 (0x4ba10000)
  14. libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x4b988000)
  15. libc.so.6 => /lib/libc.so.6 (0x4b850000)
  16. libz.so.1 => /usr/lib/libz.so.1 (0x4b9f0000)
  17. /lib/ld-linux.so.3 (0x4b810000)
  18. ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0xb6333000)
To copy to clipboard, switch view to plain text mode 
(Why doesn't it depend on libQt5OpenGL.so.5?)


starting hellogl2 example:
Qt Code:
  1. root@ppc3xx:/app# ./hellogl2
  2. QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
  3. QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
  4. Unable to query physical screen size, defaulting to 100 dpi.
  5. To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
To copy to clipboard, switch view to plain text mode 

At this point, nothing else happens and Display tungs black.
Let me know, if you need any more infos to solve the problem.

Kind Regards, Daniel