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

qtwebengine 6.3.1 fails to link against system nss

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.0 RC
    • 6.3.1
    • WebEngine
    • None
    • Guix System
    • Linux/X11
    • a21742ef6 (6.5), 75ae9b619 (dev), bc0b57435 (112-based), 14568476f (dev), 64279b0b0 (6.6)

    Description

      Hi,

      While updating the `qtwebengine` to version 6.3.1 on GNU Guix, I noticed that the build would fail to link against NSS, like so:

      [  6%] Automatic MOC for target WebEngineCore
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api && /gnu/store/j65q3aw414010gdfvmsynwpzfb2jyyd3-cmake-minimal-3.21.4/bin/cmake -E cmake_autogen /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/CMakeFiles/WebEngineCore_autogen.dir/AutogenInfo.json RelWithDebInfo
      make[2]: Leaving directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      [  6%] Built target WebEngineCore_autogen
      make  -f src/core/api/CMakeFiles/WebEngineCore_automoc_json_extraction.dir/build.make src/core/api/CMakeFiles/WebEngineCore_automoc_json_extraction.dir/depend
      make[2]: Entering directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build && /gnu/store/j65q3aw414010gdfvmsynwpzfb2jyyd3-cmake-minimal-3.21.4/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/guix-build-qtwebengine-6.3.1.drv-0/qtwebengine-everywhere-src-6.3.1 /tmp/guix-build-qtwebengine-6.3.1.drv-0/qtwebengine-everywhere-src-6.3.1/src/core/api /tmp/guix-build-qtwebengine-6.3.1.drv-0/build /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/CMakeFiles/WebEngineCore_automoc_json_extraction.dir/DependInfo.cmake --color=
      make[2]: Leaving directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      make  -f src/core/api/CMakeFiles/WebEngineCore_automoc_json_extraction.dir/build.make src/core/api/CMakeFiles/WebEngineCore_automoc_json_extraction.dir/build
      make[2]: Entering directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      [  6%] Running AUTOMOC file extraction for target WebEngineCore
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api && /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/qt6/libexec/cmake_automoc_parser --cmake-autogen-cache-file /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/CMakeFiles/WebEngineCore_autogen.dir/ParseCache.txt --cmake-autogen-info-file /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/CMakeFiles/WebEngineCore_autogen.dir/AutogenInfo.json --output-file-path /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/meta_types/WebEngineCore_json_file_list.txt --timestamp-file-path /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/meta_types/WebEngineCore_json_file_list.txt.timestamp --cmake-autogen-include-dir-path /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/WebEngineCore_autogen/include
      make[2]: Leaving directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      [  6%] Built target WebEngineCore_automoc_json_extraction
      make  -f src/core/api/CMakeFiles/WebEngineCore.dir/build.make src/core/api/CMakeFiles/WebEngineCore.dir/depend
      make[2]: Entering directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      [  6%] Running moc --collect-json for target WebEngineCore
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api && /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/qt6/libexec/moc -o /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/meta_types/qt6webenginecore_relwithdebinfo_metatypes.json.gen --collect-json @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/meta_types/WebEngineCore_json_file_list.txt
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api && /gnu/store/j65q3aw414010gdfvmsynwpzfb2jyyd3-cmake-minimal-3.21.4/bin/cmake -E copy_if_different /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/meta_types/qt6webenginecore_relwithdebinfo_metatypes.json.gen /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/meta_types/qt6webenginecore_relwithdebinfo_metatypes.json
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build && /gnu/store/j65q3aw414010gdfvmsynwpzfb2jyyd3-cmake-minimal-3.21.4/bin/cmake -E cmake_depends "Unix Makefiles" /tmp/guix-build-qtwebengine-6.3.1.drv-0/qtwebengine-everywhere-src-6.3.1 /tmp/guix-build-qtwebengine-6.3.1.drv-0/qtwebengine-everywhere-src-6.3.1/src/core/api /tmp/guix-build-qtwebengine-6.3.1.drv-0/build /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api/CMakeFiles/WebEngineCore.dir/DependInfo.cmake --color=
      Consolidate compiler generated dependencies of target WebEngineCore
      make[2]: Leaving directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      make  -f src/core/api/CMakeFiles/WebEngineCore.dir/build.make src/core/api/CMakeFiles/WebEngineCore.dir/build
      make[2]: Entering directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      [  6%] Linking CXX shared library ../../../lib/libQt6WebEngineCore.so
      cd /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/api && /gnu/store/j65q3aw414010gdfvmsynwpzfb2jyyd3-cmake-minimal-3.21.4/bin/cmake -E cmake_link_script CMakeFiles/WebEngineCore.dir/link.txt --verbose=1
      /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/linker_ulimit.sh /gnu/store/hcypy6mb3v19a58hvaf265283jgd37mm-clang-14.0.6/bin/clang++ -fPIC -g -DNDEBUG -O2 -Wl,--no-undefined @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/RelWithDebInfo/x86_64/QtWebEngineCore_objects.rsp -Wl,--enable-new-dtags -shared -Wl,-soname,libQt6WebEngineCore.so.6 -o ../../../lib/libQt6WebEngineCore.so.6.3.1 CMakeFiles/WebEngineCore.dir/WebEngineCore_autogen/mocs_compilation.cpp.o CMakeFiles/WebEngineCore.dir/qtwebenginecoreglobal.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginecertificateerror.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineclientcertificateselection.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineclientcertificatestore.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginecontextmenurequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginecookiestore.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginedownloadrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginefindtextresult.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginefullscreenrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginehistory.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginehttprequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineloadinginfo.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginemessagepumpscheduler.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginenavigationrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginenewwindowrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginenotification.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginepage.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineprofile.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginequotarequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineregisterprotocolhandlerrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginescript.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginescriptcollection.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginesettings.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlrequestinfo.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlrequestjob.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlscheme.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlschemehandler.cpp.o  -Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -Wl,--start-group @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/RelWithDebInfo/x86_64/QtWebEngineCore_archives.rsp -Wl,--end-group -Wl,--no-fatal-warnings @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/RelWithDebInfo/x86_64/QtWebEngineCore_libs.rsp -Wl,--no-fatal-warnings /gnu/store/5sdcrp4591sb2m3h6903vhpdb6zy1cnm-libxkbcommon-1.3.0/lib/libxkbcommon.so /gnu/store/r5xadr1xw9q4inzplh2p9jwbi5can6vh-qtdeclarative-6.3.1/lib/libQt6Quick.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6OpenGL.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6Gui.so.6.3.1 /gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8/lib/libGL.so /gnu/store/r5xadr1xw9q4inzplh2p9jwbi5can6vh-qtdeclarative-6.3.1/lib/libQt6QmlModels.so.6.3.1 /gnu/store/v7h4xgrfx8fpg7ywlmw95qnakzx4jc8g-qtwebchannel-6.3.1/lib/libQt6WebChannel.so.6.3.1 /gnu/store/r5xadr1xw9q4inzplh2p9jwbi5can6vh-qtdeclarative-6.3.1/lib/libQt6Qml.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6Network.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6Core.so.6.3.1 -pthread 
      ld.lld: error: unable to find library -lsmime3
      ld.lld: error: unable to find library -lnss3
      ld.lld: error: unable to find library -lnssutil3
      clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
      make[2]: *** [src/core/api/CMakeFiles/WebEngineCore.dir/build.make:556: lib/libQt6WebEngineCore.so.6.3.1] Error 1
      make[2]: Leaving directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      make[1]: *** [CMakeFiles/Makefile2:1664: src/core/api/CMakeFiles/WebEngineCore.dir/all] Error 2
      make[1]: Leaving directory '/tmp/guix-build-qtwebengine-6.3.1.drv-0/build'
      make: *** [Makefile:149: all] Error 2
      

      The build is configured directly via CMake (the `configure` script is not used).

      The build environment has the `nss` package installed and `pkg-config` as well. The nss pkg-config file on the system reads as:

      $ cat /gnu/store/4jwfs75934swmhdj0hvz06ychj1qda64-nss-3.72/lib/pkgconfig/nss.pc
      prefix=/gnu/store/4jwfs75934swmhdj0hvz06ychj1qda64-nss-3.72
      exec_prefix=${prefix}
      libdir=${prefix}/lib/nss
      includedir=${prefix}/include/nss
      
      

      It seems the link.txt file produced by CMake for the WebEngineCore binary looks like so:

      /tmp/guix-build-qtwebengine-6.3.1.drv-0/build/linker_ulimit.sh /gnu/store/hcypy6mb3v19a58hvaf265283jgd37mm-clang-14.0.6/bin/clang++  -fPIC -g -DNDEBUG -O2 -Wl,--no-undefined @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/RelWithDebInfo/x86_64/QtWebEngineCore_objects.rsp -Wl,--enable-new-dtags -shared -Wl,-soname,libQt6WebEngineCore.so.6 -o ../../../lib/libQt6WebEngineCore.so.6.3.1 CMakeFiles/WebEngineCore.dir/WebEngineCore_autogen/mocs_compilation.cpp.o CMakeFiles/WebEngineCore.dir/qtwebenginecoreglobal.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginecertificateerror.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineclientcertificateselection.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineclientcertificatestore.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginecontextmenurequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginecookiestore.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginedownloadrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginefindtextresult.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginefullscreenrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginehistory.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginehttprequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineloadinginfo.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginemessagepumpscheduler.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginenavigationrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginenewwindowrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginenotification.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginepage.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineprofile.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginequotarequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineregisterprotocolhandlerrequest.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginescript.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginescriptcollection.cpp.o CMakeFiles/WebEngineCore.dir/qwebenginesettings.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlrequestinfo.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlrequestjob.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlscheme.cpp.o CMakeFiles/WebEngineCore.dir/qwebengineurlschemehandler.cpp.o  -Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -Wl,--start-group @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/RelWithDebInfo/x86_64/QtWebEngineCore_archives.rsp -Wl,--end-group -Wl,--no-fatal-warnings @/tmp/guix-build-qtwebengine-6.3.1.drv-0/build/src/core/RelWithDebInfo/x86_64/QtWebEngineCore_libs.rsp -Wl,--no-fatal-warnings /gnu/store/5sdcrp4591sb2m3h6903vhpdb6zy1cnm-libxkbcommon-1.3.0/lib/libxkbcommon.so /gnu/store/r5xadr1xw9q4inzplh2p9jwbi5can6vh-qtdeclarative-6.3.1/lib/libQt6Quick.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6OpenGL.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6Gui.so.6.3.1 /gnu/store/wdm2s2si8fqsrcd5xpc29ivmpkf20s8d-mesa-21.3.8/lib/libGL.so /gnu/store/r5xadr1xw9q4inzplh2p9jwbi5can6vh-qtdeclarative-6.3.1/lib/libQt6QmlModels.so.6.3.1 /gnu/store/v7h4xgrfx8fpg7ywlmw95qnakzx4jc8g-qtwebchannel-6.3.1/lib/libQt6WebChannel.so.6.3.1 /gnu/store/r5xadr1xw9q4inzplh2p9jwbi5can6vh-qtdeclarative-6.3.1/lib/libQt6Qml.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6Network.so.6.3.1 /gnu/store/lzcpvqgaq45npwaiwrpyzlb5a8qm1yak-qtbase-6.3.1/lib/libQt6Core.so.6.3.1 -pthread
      

      I was able to work around the problem by adding the equivalent of `-L/gnu/store/4jwfs75934swmhdj0hvz06ychj1qda64-nss-3.72/lib/nss` via the `CMAKE_SHARED_LINKER_FLAGS` build option to resolve it.

      It seems the above target is lacking a proper link directive to nss? It's if's correctly discovered by pkg-config (there are traces in other build files that suggest it is), everything should be available in the nss library target.

      Thanks, I hope this report is useful!

      Attachments

        Issue Links

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

          Activity

            People

              qt_webengine_team Qt WebEngine Team
              apteryx Maxim Cournoyer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes