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

qdoc is missing -fvisibility option when using GCC standard headers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.15.0 Beta2
    • 5.11.1
    • Build tools: qdoc
    • None
    • Linux, Ubuntu 64-bit, GCC 7/Clang6
    • Linux/X11
    • 5
    • ee49537f31aff32fa674292d3d413d8d40f661a7 (qt/qttools/5.15)
    • DaVinci sprint 3, DaVinci sprint 4, DaVinci sprint 5

      So I encountered another issue where previously working setup of qdoc suddenly stopped working. I narrowed it down to GCC standard headers, specifically macro:

      _GLIBCXX_VISIBILITY(default)

      The problem is, that there is no definition for this macro anywhere since it comes from command line option:

      -fvisibility=default

      When qdoc parses the files using clang this option seems not to be present and qdoc (or rather clang) fails to parse the files.

      Workaround for this would be to define this macro either in qdocconf or in one of the headers, possibly as the first thing in the module header to be safe.

      EDIT: Neither works because it is defined like this in its header:

      {code}

      #define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY 1

      #if _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY

          #define GLIBCXX_VISIBILITY(V) __attribute_ ((_visibility_ (#V)))
      #else
      // If this is not supplied by the OS-specific or CPU-specific
      // headers included below, it will be defined to an empty default.

          #define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
      #endif

      {code}

      Not sure why it causes problems for clang...

      Proper fix however should be to use the mentioned flag when running clang by qdoc.

        For Gerrit Dashboard: QTBUG-69560
        # Subject Branch Project Status CR V

            treinio Topi Reiniö
            resurr3ction Michael Vlach
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes