qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it
-
Let's sum up the situation:
- What exact version of MythTV and Qt is working on what device ?
- What is the target you are cross-compiling for ?
- What does this device run as Linux distribution ?
-
What exact version of MythTV and Qt is working on what device ?
-
works:
mythtv: current mythtv-master; last working qt is 5.4.2
device: I'm not using -device declarations at configure stage. Instead I'm creating custom platform with toolchain information -
not works:
mythtv: current mythtv-master; qt 5.5.0 or newer
device: see above
What is the target you are cross-compiling for ?
- currently x86_64 (future: i386; armv7; aarch64)
What does this device run as Linux distribution ?
- if got question correctly: minimyth2
Below is a bit more details how I'm building qt:
I'm cross-compiling Qt by creating dedicated platform with created custom qmake.
My custom qmake is based on qmake from "linux-g++-64".
Basically I do following:1.create mkspec/linux-g++-64-garhost/qmake.conf by
cat linux-g++-64/qmake.conf >> qmake.conf cat linux-g++-64/../common/linux.conf >> qmake.conf cat linux-g++-64/../common/unix.conf >> qmake.conf cat linux-g++-64/../common/gcc-base-unix.conf >> qmake.conf cat linux-g++-64/../common/gcc-base.conf >> qmake.conf cat linux-g++-64/../common/g++-unix.conf >> qmake.conf cat linux-g++-64/../common/g++-base.conf >> qmake.conf cat linux-g++-64/../common/shell-unix.conf >> qmake.conf
- Updating variables in created qmake. Following variables are updated to cross-compile toolchain:
QMAKE_COPY QMAKE_YACC QMAKE_CC QMAKE_CXX QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_AR QMAKE_RANLIB QMAKE_STRIP QMAKE_CFLAGS QMAKE_CFLAGS_RELEASE QMAKE_LFLAGS QMAKE_INCDIR QMAKE_LIBDIR QMAKE_INCDIR_X11 QMAKE_LIBDIR_X11 QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL QMAKE_LIBDIR_EGL
This process gives me custom qmake.conf. Here is file I'm using to build working 5.4.2 (and unfortunatelly no OpenGL 5.5.1):
[piotro@minimyth-dev linux-g++-64-garhost]$ cat qmake.conf QMAKE_CFLAGS_RELEASE = -pipe -pipe -march=x86-64 -mtune=generic -O3 -mfpmath=sse -m64 # # qmake configuration for linux-g++ # # Written for GNU/Linux platforms that have both lib and lib64 directories, # like the AMD Opteron. # MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS = -m64 QMAKE_LFLAGS = -Wl,--as-needed -pipe -pipe -march=x86-64 -mtune=generic -O3 -mfpmath=sse -m64 -m64 QMAKE_LIBDIR_X11 = /home/piotro/minimyth-dev/images/main/usr/lib QMAKE_LIBDIR_OPENGL = /home/piotro/minimyth-dev/images/main/usr/lib # # qmake configuration for common linux # QMAKE_PLATFORM += linux QMAKE_CFLAGS_THREAD += -D_REENTRANT QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections QMAKE_INCDIR =/home/piotro/minimyth-dev/images/main/usr/include QMAKE_LIBDIR =/home/piotro/minimyth-dev/images/main/usr/lib QMAKE_INCDIR_X11 =/home/piotro/minimyth-dev/images/main/usr/include QMAKE_LIBDIR_X11 =/home/piotro/minimyth-dev/images/main/usr/lib QMAKE_INCDIR_OPENGL =/home/piotro/minimyth-dev/images/main/usr/include QMAKE_LIBDIR_OPENGL =/home/piotro/minimyth-dev/images/main/usr/lib QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL =/home/piotro/minimyth-dev/images/main/usr/include QMAKE_LIBDIR_EGL =/home/piotro/minimyth-dev/images/main/usr/lib QMAKE_INCDIR_OPENVG = QMAKE_LIBDIR_OPENVG = QMAKE_LIBS = QMAKE_LIBS_DYNLOAD = -ldl QMAKE_LIBS_X11 = -lXext -lX11 -lm QMAKE_LIBS_NIS = -lnsl QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread QMAKE_LIBS_LIBUDEV = -ludev QMAKE_CFLAGS_WAYLAND = QMAKE_INCDIR_WAYLAND = QMAKE_LIBS_WAYLAND_CLIENT = -lwayland-client QMAKE_LIBS_WAYLAND_SERVER = -lwayland-server QMAKE_LIBDIR_WAYLAND = QMAKE_DEFINES_WAYLAND = QMAKE_WAYLAND_SCANNER = wayland-scanner QMAKE_CFLAGS_XCB = QMAKE_LIBS_XCB = QMAKE_DEFINES_XCB = QMAKE_AR = x86_64-minimyth-linux-gnu-ar cqs QMAKE_OBJCOPY = objcopy QMAKE_NM = nm -P QMAKE_RANLIB =x86_64-minimyth-linux-gnu-ranlib QMAKE_STRIP = x86_64-minimyth-linux-gnu-strip QMAKE_STRIPFLAGS_LIB += --strip-unneeded # # qmake configuration for common unix # QMAKE_PLATFORM += unix posix QMAKE_LEX = flex QMAKE_LEXFLAGS += QMAKE_YACC = bison -y QMAKE_YACCFLAGS += -d QMAKE_YACCFLAGS_MANGLE += -p $base -b $base QMAKE_YACC_HEADER = $base.tab.h QMAKE_YACC_SOURCE = $base.tab.c QMAKE_PREFIX_SHLIB = lib QMAKE_PREFIX_STATICLIB = lib QMAKE_EXTENSION_STATICLIB = a # # Base qmake configuration for GCC on *nix-systems # # Before making changes to this file, please read the comment in # gcc-base.conf, to make sure the change goes in the right place. # # To verify that your change has the desired effect on the final configuration # you can use the manual test in tests/manual/mkspecs. # QMAKE_LFLAGS_SHLIB += -shared QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_SONAME += -Wl,-soname, QMAKE_LFLAGS_THREAD += QMAKE_LFLAGS_RPATH = -Wl,-rpath, QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link, QMAKE_LFLAGS_NEW_DTAGS = -Wl,--enable-new-dtags QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold # -Bsymbolic-functions (ld) support QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list, # # This file is used as a basis for the following compilers: # # - The GNU C++ compiler (g++) # - LLVM # - Clang # # Platform-specific options shared by these compilers are put into: # # - gcc-base-mac.conf # - gcc-base-unix.conf # # These base files are then combined with configurations for each compiler: # # - g++-base.conf # - g++-macx.conf # - g++-unix.conf # - llvm.conf # - clang.conf # # The combination happens in the top level mkspec, by including a platform- # specific version of the base-file, for example gcc-base-mac.conf, and then # a (possibly platform-specific) version of the actual compiler configuration, # for example g++-macx.conf. # # If you are making changes to any of these files, please consider the # possible effect it may have due to these include-rules, and whether it # might make more sense to share the rule or make it more specific. # # To verify that your change has the desired effect on the final configuration # you can use the manual test in tests/manual/mkspecs. # QMAKE_CFLAGS_OPTIMIZE = -O2 QMAKE_CFLAGS_OPTIMIZE_FULL = -O3 QMAKE_CFLAGS += -pipe QMAKE_CFLAGS_DEPS += -M QMAKE_CFLAGS_WARN_ON += -Wall -W QMAKE_CFLAGS_WARN_OFF += -w QMAKE_CFLAGS_RELEASE += QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g QMAKE_CFLAGS_DEBUG += -g QMAKE_CFLAGS_SHLIB += -fPIC QMAKE_CFLAGS_STATIC_LIB += -fPIC QMAKE_CFLAGS_APP += -fPIC QMAKE_CFLAGS_ISYSTEM = QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions QMAKE_CFLAGS_SPLIT_SECTIONS += -ffunction-sections QMAKE_CFLAGS_LTCG = -flto -fno-fat-lto-objects QMAKE_CFLAGS_LTCG_FATOBJECTS = -ffat-lto-objects QMAKE_CFLAGS_DISABLE_LTCG = -fno-lto QMAKE_CXXFLAGS += $$QMAKE_CFLAGS QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden QMAKE_CXXFLAGS_EXCEPTIONS_OFF += $$QMAKE_CFLAGS_EXCEPTIONS_OFF QMAKE_CXXFLAGS_SPLIT_SECTIONS += $$QMAKE_CFLAGS_SPLIT_SECTIONS QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_LTCG_FATOBJECTS = $$QMAKE_CFLAGS_LTCG_FATOBJECTS QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG QMAKE_LFLAGS += QMAKE_LFLAGS_DEBUG += QMAKE_LFLAGS_APP += QMAKE_LFLAGS_RELEASE += QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += QMAKE_LFLAGS_EXCEPTIONS_OFF += QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG -fuse-linker-plugin QMAKE_CFLAGS_SSE2 += -msse2 QMAKE_CFLAGS_SSE3 += -msse3 QMAKE_CFLAGS_SSSE3 += -mssse3 QMAKE_CFLAGS_SSE4_1 += -msse4.1 QMAKE_CFLAGS_SSE4_2 += -msse4.2 QMAKE_CFLAGS_AVX += -mavx QMAKE_CFLAGS_AVX2 += -mavx2 QMAKE_CFLAGS_NEON += -mfpu=neon # Wrapper tools that understand .o/.a files with GIMPLE instead of machine code QMAKE_AR_LTCG = gcc-ar cqs QMAKE_NM_LTCG = gcc-nm -P QMAKE_RANLIB_LTCG = true # No need to run since gcc-ar has "s" # # Qmake configuration for the GNU C++ compiler on *nix-systems # # Before making changes to this file, please read the comment in # gcc-base.conf, to make sure the change goes in the right place. # # To verify that your change has the desired effect on the final configuration # you can use the manual test in tests/manual/mkspecs. # QMAKE_LFLAGS_RELEASE += -Wl,-O1 QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined # # Qmake configuration for the GNU C++ compiler # # Before making changes to this file, please read the comment in # gcc-base.conf, to make sure the change goes in the right place. # # To verify that your change has the desired effect on the final configuration # you can use the manual test in tests/manual/mkspecs. # QMAKE_COMPILER = gcc QMAKE_CC = x86_64-minimyth-linux-gnu-gcc QMAKE_LINK_C = $$QMAKE_CC QMAKE_LINK_C_SHLIB = $$QMAKE_CC QMAKE_CXX = x86_64-minimyth-linux-gnu-g++ QMAKE_LINK = x86_64-minimyth-linux-gnu-g++ QMAKE_LINK_SHLIB = x86_64-minimyth-linux-gnu-g++ QMAKE_PCH_OUTPUT_EXT = .gch QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE} QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE QMAKE_CXXFLAGS_CXX11 = -std=c++0x QMAKE_LFLAGS_CXX11 = warning("shell-unix.conf is deprecated and has no effect.") load(qt_config)
- Next I'm building qt with following configure parameters:
CONFIGURE_ARGS = \ -prefix $(DESTDIR)$(qt5prefix) \ -bindir $(DESTDIR)$(qt5bindir) \ -libdir $(DESTDIR)$(qt5libdir) \ -docdir $(DESTDIR)$(qt5prefix)/doc \ -headerdir $(DESTDIR)$(qt5includedir) \ -datadir $(DESTDIR)$(qt5libdir) \ -translationdir $(DESTDIR)$(qt5prefix)/translations \ -sysconfdir $(DESTDIR)$(qt5libdir)/settings \ -examplesdir $(DESTDIR)$(qt5prefix)/examples \ -hostprefix $(DESTDIR)$(qt5prefix) \ -platform linux-g++-64 \ -xplatform linux-g++-64-garhost \ -shared \ -largefile \ -confirm-license \ -release \ -opensource \ -opengl \ -no-rpath \ -no-optimized-qmake \ -plugin-sql-mysql \ -no-sql-db2 \ -no-sql-ibase \ -no-sql-oci \ -no-sql-odbc \ -no-sql-psql \ -no-sql-sqlite \ -no-sql-sqlite2 \ -no-sql-tds \ -no-compile-examples \ -no-gtkstyle \ -no-openvg \ -nomake tools \ -nomake examples \ -skip qttranslations \ -skip qtserialport \ -skip qtwebengine \ -skip qtwebkit-examples \ -verbose \
Above procedure works very well for qt up to 5.5.0 family. Since 5.5.0 build is perfectly clean - but opengl is not recognised by mythtv...
If anybody is interested - here are full build logs for 5.4.2 (opengl working) and 5.5.1 (OpenGL not working)
5.4.2 log
5.5.1 log -
-
Do you know how MythTV does the OpenGL detection.
From a quick look at the logs, there's some differences in the EGLFS and KMS in the output.
-
@SGaist said in qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it:
Do you know how MythTV does the OpenGL detection.
From a quick look at the logs, there's some differences in the EGLFS and KMS in the output.
Ah - Yes. Logs from 5.5.1 build are with improved custom qmake where I started to add dependencies in hope that it will help. Difference regarding EGLFS/KMS are result of adding EGL related includes/libs from mesa
QMAKE_INCDIR_EGL =/home/piotro/minimyth-dev/images/main/usr/include QMAKE_LIBDIR_EGL =/home/piotro/minimyth-dev/images/main/usr/lib
But this obviously not helps :-(
What intriguing me that:
-issue appearance is aligned exactly to qt release change: 5.4->5.5
-5.5.1 build from sources is perfectly clean (IMHO)
-prebuild 5.5.1 on achlinux with the same mythtv works OKI don't see issue with my approach of cross-compiling Qt (it is working for me since years starting with qt4.8 and latter with qt5.3 and 5.4) - but maybe changes in 5.5 are prohibiting my way? But why 5.5.1 build is so clean?
anyway: myth checking opengl here:
https://github.com/MythTV/mythtv/blob/bc20ba5a9a3bea4f5eb7ce5bf6c3e3f7e43f9e34/mythtv/libs/libmythui/mythmainwindow.cpp#L1142 -
Did you check whether the Archlinux version of Qt uses any special configuration stuff ?
-
@SGaist said in qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it:
Did you check whether the Archlinux version of Qt uses any special configuration stuff ?
Of course. Arch has no any special things except:
-archlinux is not cross-compiling
-it has enabled (+ required dependencies) for all graphics variants (wayland, etc)here is arch build script:
qt5.11 archlinux build script -
Strange, they disable the examples but still build the tests...
Anyway, from what architecture are you cross-compiling from ?
-
@SGaist said in qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it:
Strange, they disable the examples but still build the tests...
Anyway, from what architecture are you cross-compiling from ?
-
underlying os where build system runs is archlinux
-
build system is GAR (GAR it is make based environment to build since scratch complete toolchain and next cross build all packages to create target appliance called minimyth2
-
target system is minimyth2
Architecturally:
- underlying os is x86_64 (can be anything)
- GAR is x86_64
- minimyth2 can be: i386, x86_64, armv7 and aarch64
so far I have well working minimyth2 with qt5.4.1 for: i386, x86_64 and aarch64 (bcm2837). armv7 not tested yet.
So answering Your question: I'm cross compiling from x86_64 (GAR) to x86_64 (chosen minimyth2 target architecture in this exercise).
-
-
Ok, so in fact, your current test setup isn't really cross-compiling since you start and end with the exact same architecture.
What hardware are you using to run
minimyth2
? -
@SGaist said in qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it:
Ok, so in fact, your current test setup isn't really cross-compiling since you start and end with the exact same architecture.
Well - I would say: it IS cross compiling but in this exercise build, host and target are all x86_64. But only cpu arch is single common part.
All other vital components (gcc, glibc, binutils, kernel, qt, etc are different).So pls don't be mislead: situation that build and target have declared the same architecture not means that there is no cross-compile.
What hardware are you using to run
minimyth2
?It is any x86 or selected armv7 / aarch64 (bcm2837 tested)
For x86 I have users with: Intel NUC, ION1, ION2, multiple AMD (Kabini, Richland, etc).
Basically I'm supporting any x86 CPU and 1503 gfx cards out-of-box (with full auto detection and auto-configure) -
I started to play with myth code to see what qt5.10.1 provides.
After disabling OpenGL checks I started to see:QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Of course I have libglx.so in /home/piotro/minimyth-dev/images/main/usr/lib/xorg/modules/extensions.
qt config summary also says GLX on X11:yes
X11: Using system-provided XCB libraries .. yes EGL on X11 ........................... yes Xinput2 .............................. yes XCB XKB .............................. yes XLib ................................. yes XCB render ........................... yes XCB GLX .............................. yes XCB Xlib ............................. yes Using system-provided xkbcommon ...... yes Native painting (experimental) ....... yes
What are other possible reasons for such error?
-
I wonder if it's a question of libraries versions.
-
Consider running conifugre with verbose flag - you'll be able to see what libs it is looking for an maybe whether there are some warnings popping up.
-
@SGaist said in qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it:
I wonder if it's a question of libraries versions.
I was thinking about this as well.
I made test build with qt build-in xcb (assuming bundled xcb for sure is OK).
OpenGL still not works.
Currently I think qt5.5+ has changed opengl subsystem in a way that my cross-build procedure earlier described in this thread (my message from 8 days ago) will not work anymore.I think it is qt bug as:
- conceptually procedure is OK (IMHO)
- procedure works for qt5.4 and earlier
- qt5.10 configure says Yes in all places where needed
- qt5.10 build reports no errors nor related warnings
-
@sierdzio
Pls look at my earlier post where I put links to full build log with -verbose flag in configure.
Pls look at 5.5.1.log (as 5.5 is first qt ver. where opengl not works for me.)
Maybe You will discover something meaningful in build log.
I can't :-( -
ok - I found it.
Issue was typo in filename of xcbintegration libs in my install script. argh....
5.4.x family don't have those libs while 5.5+ has.
I added images of those libs to boot image - but 2 letters in filename were in reverse order....thx anybody who was trying to help me!
-
Glad you found out and thanks for sharing !
What was the additional file you had wrong ?
-
@SGaist said in qt5.4.1->qt5.5.1 [5.9.6; 5.10.1] - OpenGL builds OK but apps don't see it:
Glad you found out and thanks for sharing !
What was the additional file you had wrong ?
oh it was
libqxcb-glx-integration.so
in
/usr/lib/qt5/plugins/xcbglintegrations
dir
This .so is new addition since 5.5.
may ppl has issues with nonworking OpenGL due missing this library after upgrade to 5.5 but forgotten to install this lib. (there is also EGL version of this lib btw)
It is usually because packagers are frequently putting them the into separate package called usually xcbglintegrations plugins or similar.btw: I'm really impressed in increasing quality of qt regarding building process.