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

MacOSX mkspecs for clang do not honour WITH_DEBUGINFO

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0 Beta
    • 5.2.0
    • Build tools: qmake
    • None
    • MacOSX 10.9
    • 988c2d041c5801fe87586200a08ef81e137b10f4

    Description

      The methods documented for causing an app build to get debug symbols generated for a release build do not work if the clang compiler is used, for example via:

      qmake myapp.pro -spec macx-clang CONFIG+=release

      The approved method is to use the (fairly obscure) qmake variables

      QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
      QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
      QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO
      QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO

      These are defined for the mkspec g++-macx and for several other toolchains, but not for clang. It seems as though clang is the default compiler on Mac for Qt at present so the above might even be an issue if the -spec switch is not used.

      Update: QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO does not seem to be defined at all in the mkspecs for Qt 5.2.

      I tried add "-g" to all these vars in mkspecs/common/clang.conf (as attached) and it seemed to make the "dsymutil" tool happy. The doc for clang says that "-g" is the switch to use and that -O0 is the correct optimisation level (otherwise only line numbers are used).

      References:

      Attachments

        1. clang.conf
          0.9 kB
        2. clang.conf
          0.9 kB
        3. default_post.prf
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            allan.jensen Allan Sandfeld Jensen
            sez Sarah Jane Smith
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes