Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.2.0
-
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: