On line 1016 of FindKDE4Internal.cmake, there is set(CMAKE_CXX_FLAGS_DEBUG "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") It is an incredibly bad idea to set -O2 at debug level as it completely disables debugging (line info in gdb jump around etc) I don't know whether this bug comes from kde or from gentoo, so I report here Reproducible: Always
Since i have same values and i didnt find any seding on this we do in eclass or anywhere else i would recommend you to report it to the upstream :] http://websvn.kde.org/trunk/KDE/kdelibs/cmake/modules/FindKDE4Internal.cmake?revision=1049726&view=markup The above file shows they really have it in their trunk version of that file. So recommendation is to go onto http://bugs.kde.org/ and fill bug there requesting their useflags update.
damn wrong resolution