Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86868

"collect2: fatal error: ld terminated with signal 9 [Killed]" when building Qt statically

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.0 (Next Major Release)
    • Fix Version/s: None
    • Component/s: Build System
    • Labels:
      None
    • Environment:
      Ubuntu 18.04.3 LTS

      Description

      I'm trying to build Qt statically using the SHA-1s found here. I'm building qtbase, qtdeclarative, qtquickcontrols2 and qttools.

      -static
      -debug
      -no-optimize-debug
      -developer-build
      -opensource
      -confirm-license
      -nomake
      tests
      -nomake
      examples
      -silent
      -sanitize
      address
      

      Building with make -j 8. 16GB of memory is eventually exhausted, and the swap file (which I increased to 8GB from 1GB) is also exhausted. Then the build fails with:

      g++ -c -pipe -g -std=c++1z -fno-exceptions -fsanitize=address -fno-omit-frame-pointer -Wall -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Werror -Wno-error=cpp -Wno-error=deprecated-declarations -Wno-error=strict-overflow -ffunction-sections -fdata-sections -D_REENTRANT -fPIC -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_QUICK_LIB -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I/media/dev2/qt-dev/qtdeclarative/tools/qmleasing -I. -I/media/dev2/qt-dev-static-debug/qtbase/include -I/media/dev2/qt-dev-static-debug/qtbase/include/QtQuick -I/media/dev2/qt-dev-static-debug/qtbase/include/QtOpenGL -I/media/dev2/qt-dev-static-debug/qtbase/include/QtWidgets -I/media/dev2/qt-dev-static-debug/qtbase/include/QtGui -I/media/dev2/qt-dev-static-debug/qtbase/include/QtQmlModels -I/media/dev2/qt-dev-static-debug/qtbase/include/QtQml -I/media/dev2/qt-dev-static-debug/qtbase/include/QtNetwork -I/media/dev2/qt-dev-static-debug/qtbase/include/QtCore -I.moc -I/usr/include/libdrm -I.uic -I/media/dev2/qt-dev/qtbase/mkspecs/linux-g++ -o .obj/segmentproperties.o /media/dev2/qt-dev/qtdeclarative/tools/qmleasing/segmentproperties.cpp
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qmllint'
      g++ -fuse-ld=gold -Wl,--enable-new-dtags -Wl,--gdb-index -fsanitize=address -Wl,--gc-sections -o /media/dev2/qt-dev-static-debug/qtbase/bin/qmleasing .obj/main.o .obj/splineeditor.o .obj/mainwindow.o .obj/segmentproperties.o .obj/qmleasing_plugin_import.o .obj/qmleasing_qml_plugin_import.o .obj/qrc_resources.o   /media/dev2/qt-dev-static-debug/qtbase/plugins/platforms/libqxcb.a /media/dev2/qt-dev-static-debug/qtbase/plugins/xcbglintegrations/libqxcb-egl-integration.a /media/dev2/qt-dev-static-debug/qtbase/plugins/xcbglintegrations/libqxcb-glx-integration.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6XcbQpa.a -lxcb-glx -lxcb-icccm -lxcb-image -lxcb-shm -lxcb-keysyms -lxcb-randr -lxcb-render-util -lxcb-render -lxcb-shape -lxcb-sync -lxcb-xfixes -lxcb-xkb -lSM -lICE -lxkbcommon-x11 /media/dev2/qt-dev-static-debug/qtbase/plugins/imageformats/libqgif.a /media/dev2/qt-dev-static-debug/qtbase/plugins/imageformats/libqico.a /media/dev2/qt-dev-static-debug/qtbase/plugins/imageformats/libqjpeg.a -ljpeg /media/dev2/qt-dev-static-debug/qtbase/plugins/egldeviceintegrations/libqeglfs-emu-integration.a /media/dev2/qt-dev-static-debug/qtbase/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.a /media/dev2/qt-dev-static-debug/qtbase/plugins/egldeviceintegrations/libqeglfs-kms-integration.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6EglFsKmsSupport.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6KmsSupport.a -lgbm -ldrm /media/dev2/qt-dev-static-debug/qtbase/plugins/egldeviceintegrations/libqeglfs-x11-integration.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6EglFSDeviceIntegration.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6FbSupport.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6InputSupport.a -lmtdev -linput /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6DeviceDiscoverySupport.a -ludev -lX11-xcb -lxcb /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_debugger.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_inspector.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_local.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_messages.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_native.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_nativedebugger.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_preview.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_profiler.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_quickprofiler.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_server.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6PacketProtocol.a /media/dev2/qt-dev-static-debug/qtbase/plugins/qmltooling/libqmldbg_tcp.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6Widgets.a /media/dev2/qt-dev-static-debug/qtbase/qml/QtQuick/libqtquick2plugin.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6Quick.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6OpenGL.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6Gui.a -lEGL /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6DBus.a -ldbus-1 -lpng16 -lfontconfig -lfreetype /media/dev2/qt-dev-static-debug/qtbase/lib/libqtharfbuzz.a -lXext -lX11 /media/dev2/qt-dev-static-debug/qtbase/qml/QtQml/libqmlplugin.a /media/dev2/qt-dev-static-debug/qtbase/qml/QtQml/Models/libmodelsplugin.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6QmlModels.a /media/dev2/qt-dev-static-debug/qtbase/qml/QtQml/WorkerScript/libworkerscriptplugin.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6QmlWorkerScript.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6Qml.a -lrt /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6Network.a /media/dev2/qt-dev-static-debug/qtbase/lib/libQt6Core.a -lm -lz -ldouble-conversion -licui18n -licuuc -licudata -ldl /media/dev2/qt-dev-static-debug/qtbase/lib/libqtpcre2.a -lgthread-2.0 -lglib-2.0 -lGL -lpthread -lxkbcommon   
      collect2: fatal error: ld terminated with signal 9 [Killed]
      compilation terminated.
      Makefile:69: recipe for target '/media/dev2/qt-dev-static-debug/qtbase/bin/qmltestrunner' failed
      make[3]: *** [/media/dev2/qt-dev-static-debug/qtbase/bin/qmltestrunner] Error 1
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qmltestrunner'
      Makefile:255: recipe for target 'sub-qmltestrunner-make_first' failed
      make[2]: *** [sub-qmltestrunner-make_first] Error 2
      make[2]: *** Waiting for unfinished jobs....
      collect2: fatal error: ld terminated with signal 9 [Killed]
      compilation terminated.
      Makefile:77: recipe for target '/media/dev2/qt-dev-static-debug/qtbase/bin/qml' failed
      make[3]: *** [/media/dev2/qt-dev-static-debug/qtbase/bin/qml] Error 1
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qml'
      Makefile:155: recipe for target 'sub-qml-make_first' failed
      make[2]: *** [sub-qml-make_first] Error 2
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qmlprofiler'
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qmljs'
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qmlpreview'
      make[3]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools/qmleasing'
      make[2]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative/tools'
      Makefile:74: recipe for target 'sub-tools-make_first' failed
      make[1]: *** [sub-tools-make_first] Error 2
      make[1]: Leaving directory '/media/dev2/qt-dev-static-debug/qtdeclarative'
      Makefile:74: recipe for target 'module-qtdeclarative-make_first' failed
      make: *** [module-qtdeclarative-make_first] Error 2
      

      I've tried with the default linker and gold:

      mitch@mitch-ubuntu-18:/media/dev2/qt-dev-static-debug$ grep "gold" config.summary 
      Configuration: use_gold_linker sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl enable_gdb_index enable_new_dtags f16c largefile precompile_header rdrnd shani silent warnings_are_errors x86SimdAlways private_tests debug c++11 c++14 c++17 c++1z concurrent dbus reduce_exports reduce_relocations release_tools static stl
        Linker ................................. gold
      

      Storage drives:

      mitch@mitch-ubuntu-18:/media/dev2/qt-dev-static-debug$ df -h | grep sd
      Filesystem      Size  Used Avail Use% Mounted on
      [...]
      /dev/sda1       234G  202G   21G  91% /
      /dev/sdb1       234G  178G   45G  81% /media/dev2
      

      I'm building on /dev/sdb1, AKA /media/dev2, which has 45GB of free space remaining, and that's without removing the failed build, which is 16.7 GB. The OS is probably installed on /dev/sda1 if it makes a difference.

      Swap file details:

      mitch@mitch-ubuntu-18:/media/dev2/qt-dev-static-debug$ swapon -show
      Filename                                Type            Size    Used    Priority
      /swapfile                               file            8388604 1831056 -2
      

      System details:

      Ubuntu 18.04.3 LTS
      16 GB RAM
      Intel i7-4770 @ 3.40GHz x 8
      64-bit
      

      I don't think I've ever had this problem before when building statically on Ubuntu. The only possible difference I can think of is that I started building with -no-optimize-debug a while ago.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qtbuildsystem Qt Build System Team
            Reporter:
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes