Compiling QtBase 5.15.5 fails when linking qmake for linux-clang-libc++
-
Hey y'all,
I'm currently working on a fuzzing project and for that I need a static install of qtbase5 inside my docker container.
For that i opted for this release: https://download.qt.io/archive/qt/5.15/5.15.5/submodules/qtbase-everywhere-opensource-src-5.15.5.tar.xz
I use the following configure command:
configure -v -platform linux-clang-libc++ -prefix $SRC/Qt-5.15.5/ -static -opensource -confirm-license -release -no-compile-examples -nomake examples -nomake tests -qt-pcre -qt-zlib -qt-freetype -qt-harfbuzz -xcb -qt-libpng -qt-libjpeg -qt-sqliteBefore that I installed all the dependencies by running the following in my Dockerfile:
RUN cp /etc/apt/sources.list /etc/apt/sources.list~ && sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list && apt-get update RUN apt-get build-dep -y qtbase5-devAfter just a while without any error the linking command:
clang++ -o "../bin/qmake" main.o meta.o option.o project.o property.o ioutils.o proitems.o qmakebuiltins.o qmakeevaluator.o qmakeglobals.o qmakeparser.o qmakevfs.o pbuilder_pbx.o makefile.o makefiledeps.o metamakefile.o projectgenerator.o unixmake2.o unixmake.o mingw_make.o msbuild_objectmodel.o msvc_nmake.o msvc_objectmodel.o msvc_vcproj.o msvc_vcxproj.o winmakefile.o xmloutput.o qutfcodec.o qendian.o qglobal.o qlogging.o qmalloc.o qnumeric.o qoperatingsystemversion.o qrandom.o qabstractfileengine.o qbuffer.o qdatastream.o qdebug.o qdir.o qdiriterator.o qfile.o qfiledevice.o qfileinfo.o qfilesystemengine.o qfilesystementry.o qfsfileengine.o qfsfileengine_iterator.o qiodevice.o qsettings.o qtemporaryfile.o qtextstream.o qcborstreamwriter.o qcborvalue.o qjsoncbor.o qjsonarray.o qjsondocument.o qjsonobject.o qjsonparser.o qjsonvalue.o qmetatype.o qsystemerror.o qvariant.o quuid.o qarraydata.o qbitarray.o qbytearray.o qbytearraylist.o qbytearraymatcher.o qcalendar.o qgregoriancalendar.o qromancalendar.o qcryptographichash.o qdatetime.o qhash.o qlist.o qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o qstringbuilder.o qstring.o qstringlist.o qversionnumber.o qvsnprintf.o qxmlstream.o qxmlutils.o qcore_unix.o qfilesystemengine_unix.o qfilesystemiterator_unix.o qfsfileengine_unix.o qlocale_unix.o qlibraryinfo.o -ccc-gcc-name g++ -stdlib=libc++ -Wl,--gc-sectionsproduces the following errors:
/usr/bin/ld: /usr/local/bin/../lib/libc++.a(cxa_exception_storage.cpp.o): in function `__cxa_get_globals': cxa_exception_storage.cpp:(.text.__cxa_get_globals+0x10): undefined reference to `pthread_once' /usr/bin/ld: cxa_exception_storage.cpp:(.text.__cxa_get_globals+0x1f): undefined reference to `pthread_getspecific' /usr/bin/ld: cxa_exception_storage.cpp:(.text.__cxa_get_globals+0x4c): undefined reference to `pthread_setspecific' /usr/bin/ld: /usr/local/bin/../lib/libc++.a(cxa_exception_storage.cpp.o): in function `__cxa_get_globals_fast': cxa_exception_storage.cpp:(.text.__cxa_get_globals_fast+0x10): undefined reference to `pthread_once' /usr/bin/ld: cxa_exception_storage.cpp:(.text.__cxa_get_globals_fast+0x20): undefined reference to `pthread_getspecific' /usr/bin/ld: /usr/local/bin/../lib/libc++.a(cxa_exception_storage.cpp.o): in function `__cxxabiv1::(anonymous namespace)::construct_()': cxa_exception_storage.cpp:(.text._ZN10__cxxabiv112_GLOBAL__N_110construct_Ev+0x10): undefined reference to `pthread_key_create' /usr/bin/ld: /usr/local/bin/../lib/libc++.a(cxa_exception_storage.cpp.o): in function `__cxxabiv1::(anonymous namespace)::destruct_(void*)': cxa_exception_storage.cpp:(.text._ZN10__cxxabiv112_GLOBAL__N_19destruct_EPv+0xf): undefined reference to `pthread_setspecific' clang-14: error: linker command failed with exit code 1 (use -v to see invocation)Here is a link to my github repo containing both the Dockerfile and the build.sh-file which gets called inside the running container.
I hope someone has an idea about what's wrong here :D