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

separate-debug-info condition check fails when compiling Qt from source

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.5.2
    • Build System
    • None
    • Windows

      Hi, this may be a quick fix, but I am encountering issues when trying to compile Qt6.5.2 on Windows using MSVC. 

      setlocal
      @call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
      call ..\configure.bat -prefix ..\install -commercial -confirm-license -debug-and-release -force-debug-info -separate-debug-info  
      endlocal 

      and I get:

      ERROR: Feature "separate_debug_info": Forcing to "ON" breaks its condition:    ( QT_FEATURE_shared ) AND ( QT_FEATURE_debug OR QT_FEATURE_debug_and_release OR QT_FEATURE_force_debug_info ) AND ( APPLE OR TEST_separate_debug_info )
      Condition values dump:    
      QT_FEATURE_shared = "ON"    
      QT_FEATURE_debug = "ON"    
      QT_FEATURE_debug_and_release = "ON"    
      QT_FEATURE_force_debug_info not evaluated    
      APPLE = ""    
      TEST_separate_debug_info = "FALSE" 

      It seems the test is failing for separate_debug_info and with some additional debug output:

      [QtBase] FAILED: RelWithDebInfo/objcopytest.exe
      [QtBase] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\objcopytest.dir\RelWithDebInfo --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100203~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100203~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo CMakeFiles\objcopytest.dir\RelWithDebInfo\main.cpp.obj  /out:RelWithDebInfo\objcopytest.exe /implib:RelWithDebInfo\objcopytest.lib /pdb:RelWithDebInfo\objcopytest.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\qt6\build\config.tests\separate_debug_info && --only-keep-debug C:/qt6/build/config.tests/separate_debug_info/RelWithDebInfo/objcopytest.exe objcopytest.debug && --strip-debug C:/qt6/build/config.tests/separate_debug_info/RelWithDebInfo/objcopytest.exe && --add-gnu-debuglink=objcopytest.debug C:/qt6/build/config.tests/separate_debug_info/RelWithDebInfo/objcopytest.exe""
      [QtBase] '--only-keep-debug' is not recognized as an internal or external command,
      [QtBase] operable program or batch file.[QtBase] ninja: build stopped: subcommand failed.

      .. the compile step of the program is failing because `CMAKE_OBJCOPY` is empty (src/qtbase/config.tests/separate_debug_info/CMakeLists.txt:11). So, I get my hands on a 64 bit mingw objcopy and put it on my path. Now, the build seems to find it, but I get (with the compile command):

      [QtBase] FAILED: RelWithDebInfo/objcopytest.exe
      [QtBase] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\objcopytest.dir\RelWithDebInfo --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100203~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100203~1.0\x64\mt.exe --manifests  -- C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx64\x64\link.exe /nologo CMakeFiles\objcopytest.dir\RelWithDebInfo\main.cpp.obj  /out:RelWithDebInfo\objcopytest.exe /implib:RelWithDebInfo\objcopytest.lib /pdb:RelWithDebInfo\objcopytest.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D C:\qt6\build\config.tests\separate_debug_info && C:\mingw\objcopy.exe --only-keep-debug C:/qt6/build/config.tests/separate_debug_info/RelWithDebInfo/objcopytest.exe objcopytest.debug && C:\mingw\objcopy.exe --strip-debug C:/qt6/build/config.tests/separate_debug_info/RelWithDebInfo/objcopytest.exe && C:\mingw\objcopy.exe --add-gnu-debuglink=objcopytest.debug C:/qt6/build/config.tests/separate_debug_info/RelWithDebInfo/objcopytest.exe""
      [QtBase] C:\mingw\objcopy.exe: objcopytest.debug: failed to read debug data section
      [QtBase] C:\mingw\objcopy.exe: objcopytest.debug: error copying private BFD data: cause of error unknown
      [QtBase] ninja: build stopped: subcommand failed. 

      I feel like I'm going in the wrong direction here. Do I really need objcopy for this feature? If so, where from?

        1. buildlog.txt
          31 kB
          Alex Malynovsky
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtbuildsystem Qt Build System Team
            alex-mal Alex Malynovsky
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes