Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt5-base 5.15 build fails with llvm+clang
I'm attempting to build qt5-base on a Linux machine. I previously could build successfully using GCC 10. I recently switched the whole system to LLVM (clang, lld, etc.) and am hitting a build error I'm not sure how to tackle.
Below is the build log.
The specific error occurs in QtNetwork:
src/network/socket/qnet_unix_p.h:120:29: error: cannot initialize a parameter of type 'socklen_t *' (aka 'unsigned int *') with an rvalue of type 'int *'
Unfortunately I don't know C(PP), do I can't particularly parse this.
I'm using llvm 10. To avoid other errors I found I had to manually specify the platform as linux-clang-libc++.
Hi and welcome to devnet,
Can you give more information about your Linux setup ?
What distribution ?
What package did you install ?
What configure options did you use exactly ?
I'm using KISS linux, just a simple musl-based, source distro.
I'm building qt5 from source (qt5-base-everywhere-src-5.15.0.tar.xz); this is exactly what I'm doing to build it:
# Don't link against execinfo.h. sed -i 's/define QLOG/define N/g' \ ./src/corelib/global/qlogging.cpp ./configure \ -confirm-license \ -opensource \ -prefix /usr \ -docdir /usr/share/doc/qt \ -headerdir /usr/include/qt \ -archdatadir /usr/lib/qt \ -datadir /usr/share/qt \ -sysconfdir /etc/xdg \ -examplesdir /usr/share/doc/qt/examples \ -nomake examples \ -nomake tests \ -platform linux-clang-libc++ \ -optimized-qmake \ -no-libudev \ -no-separate-debug-info \ -no-pch \ -no-dbus \ -no-accessibility \ -no-gtk \ -no-glib \ -system-libjpeg \ -system-libpng \ -system-sqlite \ -system-zlib \ -system-freetype \ -system-harfbuzz \ -silent make make INSTALL_ROOT="$1" install
These are the dependencies we have listed for qt5-base (although from testing it seems ICU is also required; but that eror message occurs in Widgets)
bison make flex make freetype-harfbuzz gperf make libICE libSM libX11 libXext libXi libXrandr libXrender libXslt libinput libjpeg-turbo libpng libxkbcommon linux-headers make mesa mtdev perl make sqlite xcb-util xcb-util-image xcb-util-keysyms xcb-util-wm xcb-util-renderutil zlib
The only real thing that has changed on my system since the last time I built qt5 is dropping gcc for llvm (clang, libc++, compiler-rt, lld, etc). I've rebuilt basically the entire system after this with only a few hiccups.
I've tried choosing different platforms as well. linux-clang results in an identical error message. Interestingly, autodetection acts as if I'm using gcc still. Which may be a clue?
We DO use libressl instead of openssl (and indeed we apply patches to qt5 to enable ssl support), but considering I've built 5.15 previously with gcc that doesn't appear to be the issue.
I would check the bug report system. They might have not used LLVM 10.
Did you check with LLVM 9 ?
Thanks for the link; I have posted a bug report.
I have not tested with llvm 9; I will try it out, it'll take a while to see though. I'll report back when it's done.
Update: also fails with an identical error using llvm 9.0.1.
I'm going to continue troubleshooting this, see if I can get some other people to reproduce it.