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

Cannot build Qt sources with Clang-10 on Ubuntu 18 when ASan is enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • None
    • 6.0
    • Build System: CMake
    • None
    • 303178748595f487cffc7249c8dc9bd46432253b (qt/qtbase/dev)

    Description

      Running make on Ubuntu fails to build Qt from sources with address sanitizer on. The messages I see:

      qt5/qtbase/src/corelib/kernel/qmetatype.cpp:115: undefined reference to `__asan_option_detect_stack_use_after_return'
      qt5/qtbase/src/corelib/kernel/qmetatype.cpp:115: undefined reference to `__asan_stack_malloc_2'
      qt5/qtbase/src/corelib/kernel/qmetatype.cpp:115: undefined reference to `__asan_report_store8'
      qt5/qtbase/src/corelib/kernel/qmetatype.cpp:118: undefined reference to `__asan_report_load8'
      

      So it looks like something is not linked to binaries when building.

      At the same time, GCC 7 with address sanitizer works without issues, so it seems that clang/llvm is problematic.

      My setup:

      Ubuntu 18.04

      Clang-10 (with LLVM 10 tools)

      CMake arguments to enable the ASan build:

      -DCMAKE_LINKER=lld-10 -DECM_ENABLE_SANITIZERS=address -DCMAKE_CXX_COMPILER=clang++-10 -DFEATURE_sanitize_address=ON -DCMAKE_C_COMPILER=clang-10
      

       

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              agolubev Andrei Golubev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes