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

[Win] If Qt is built with ASAN then end-user applications must also be built with ASAN

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6
    • Build System
    • None

    Description

      I have a MSVC build of Qt with address sanitizer enabled. Upon building an application using this build of Qt with QMake I am faced with these linker errors:

      Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: unresolved external symbol __asan_report_load4 referenced in function "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ)
      Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: unresolved external symbol __asan_report_load8 referenced in function "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ)
      Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: unresolved external symbol __asan_report_store4 referenced in function "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ)
      Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: unresolved external symbol __asan_report_store8 referenced in function "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ)
      Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: unresolved external symbol __asan_set_shadow_00 referenced in function "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ)
      Qt6EntryPointd.lib(qtentrypoint_win.cpp.obj) : error LNK2019: unresolved external symbol __asan_shadow_memory_dynamic_address referenced in function "int __cdecl qtEntryPoint(void)" (?qtEntryPoint@@YAHXZ)
      VCASAND.lib(vcasan.obj) : error LNK2019: unresolved external symbol __asan_get_report_description referenced in function "void __cdecl __vcasan::ReportCallback(char const *)" (?ReportCallback@__vcasan@@YAXPEBD@Z)
      VCASAND.lib(vcasan.obj) : error LNK2019: unresolved external symbol __asan_set_error_report_callback referenced in function "public: __cdecl __vcasan::VSErrorReportingInit::VSErrorReportingInit(void)" (??0VSErrorReportingInit@__vcasan@@QEAA@XZ)
      

      The solution is to add -fsanitize to the command line.

      QMAKE_CFLAGS   += -fsanitize=address
      QMAKE_CXXFLAGS += -fsanitize=address
      

      But optimally the application would either inherit this, or the entry point lib would not be compiled with these symbols.

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              manordheim MÃ¥rten Nordheim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes