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

-ltcg option on configure breaks build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • None
    • 6.5.3
    • Build System: CMake
    • None
    • Windows

    Description

      When I use this command:

      c:\Qt\6.5.3\Src\configure.bat -prefix c:\qt_static -ltcg -static -static-runtime -release -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtdatavis3d -skip qtdoc -skip qtgrpc -skip qtinsighttracker -skip qtmultimedia -skip qtquick3d -skip qtquick3dphysics -skip qtquicktimeline -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview -Wno-dev 
      

      and then try to build with:

      cmake --build . --parallel
      

      I get the following error:

      [579/7750] Linking CXX executable qtbase\bin\cmake_automoc_parser.exe
      FAILED: qtbase/bin/cmake_automoc_parser.exe
      C:\WINDOWS\system32\cmd.exe /C "cd . && C:\Qt\Tools\mingw1120_64\bin\c++.exe -DNDEBUG -O2 -flto=auto -fno-fat-lto-objects -static -Wl,--gc-sections qtbase/src/tools/cmake_automoc_parser/CMakeFiles/cmake_automoc_parser.dir/cmake_automoc_parser_resource.rc.obj qtbase/src/tools/cmake_automoc_parser/CMakeFiles/cmake_automoc_parser.dir/main.cpp.obj qtbase/src/tools/cmake_automoc_parser/CMakeFiles/cmake_automoc_parser.dir/cmake_automoc_parser_longpath.rc.obj -o qtbase\bin\cmake_automoc_parser.exe -Wl,--out-implib,qtbase\src\tools\cmake_automoc_parser\libcmake_automoc_parser.dll.a -Wl,--major-image-version,0,--minor-image-version,0  qtbase/src/tools/bootstrap/libBootstrap.a  -ladvapi32  -lnetapi32  -lole32  -lshell32  -luser32  -luuid  -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: qtbase/src/tools/cmake_automoc_parser/CMakeFiles/cmake_automoc_parser.dir/main.cpp.obj: plugin needed to handle lto object
      C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Qt/Tools/mingw1120_64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
      collect2.exe: error: ld returned 1 exit status
      [608/7750] Building CXX object qtbase/src/3rdparty/harfbuzz-ng/CMakeFiles/BundledHarfbuzz.dir/src/hb-subset.cc.obj
      ninja: build stopped: subcommand failed.
      

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            mzimmers Michael Zimmers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes