Right now, I don't have debug symbols for my KDE4 system, despite $CXXFLAGS contains -ggdb. The attached patch fixes this issue.
Created attachment 182654 [details, diff] kde4-enable-debug-symbols.patch
This patch is probably wrong since it won't honor disabling debug via -g0 and neither watching out for compiler-flags like --param max-gcse-passes=n.
Created attachment 182656 [details, diff] cmake-debug.patch Okay. Tomas Chvatal also suggested that cmake-utils.eclass is a better place to fix this. The following patch changes behavior of any eclass using cmake to honor user's CFLAGS/CXXFLAGS, with the only exception being KDE4 stuff built with USE=debug which uses KDE's DebugFull flags as shipped by them. (In reply to comment #2) > This patch is probably wrong since it won't honor disabling debug via -g0 Why would a user have to specify that? Yes, that patch was a hack, but certainly better than not honoring user's flags at all. > neither watching out for compiler-flags like --param max-gcse-passes=n I'm not sure how is that relevant to debug symbols.
Ok added to kde-testing. In ~week it will blob to the main tree. Closing :] Thanks for the patch (@kde-base and various packages compiled fine :])
> > > neither watching out for compiler-flags like --param max-gcse-passes=n > > I'm not sure how is that relevant to debug symbols. It is not relevant to debug symbols but contains a '-g' so your grep expression meets this flag. Thats why the simple grep attempt like this is not appropriate, the expression should be a bit more specific.
I'm unable to reproduce that bug with cmake-utils.eclass from portage, hence above patches look irrelevant for me. Any steps to reproduce this bug? My CXXFLAGS from make.conf and from /etc/portage/env/ are preserved well. (btw, enable CMAKE_VERBOSE_MAKEFILES=on to see compiler command line parameters passed by cmake - one can interrupt building, navigate to BUILDDIR and set this variable there) This patch is wrong for other reason - it breaks IUSE debug in every cmake Gentoo package.