Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259713 - honor CXXFLAGS=-ggdb by setting apropriate CMAKE_BUILD_TYPE
Summary: honor CXXFLAGS=-ggdb by setting apropriate CMAKE_BUILD_TYPE
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] KDE (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-20 13:31 UTC by Jan Kundrát (RETIRED)
Modified: 2009-02-27 16:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
kde4-enable-debug-symbols.patch (kde4-enable-debug-symbols.patch,619 bytes, patch)
2009-02-20 13:32 UTC, Jan Kundrát (RETIRED)
Details | Diff
cmake-debug.patch (cmake-debug.patch,962 bytes, patch)
2009-02-20 14:05 UTC, Jan Kundrát (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Kundrát (RETIRED) gentoo-dev 2009-02-20 13:31:51 UTC
Right now, I don't have debug symbols for my KDE4 system, despite $CXXFLAGS contains -ggdb. The attached patch fixes this issue.
Comment 1 Jan Kundrát (RETIRED) gentoo-dev 2009-02-20 13:32:09 UTC
Created attachment 182654 [details, diff]
kde4-enable-debug-symbols.patch
Comment 2 emerald 2009-02-20 13:40:32 UTC
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.
Comment 3 Jan Kundrát (RETIRED) gentoo-dev 2009-02-20 14:05:21 UTC
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.
Comment 4 Tomáš Chvátal (RETIRED) gentoo-dev 2009-02-20 17:36:34 UTC
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 :])
Comment 5 emerald 2009-02-20 19:35:01 UTC
> 
> > 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.
Comment 6 Maciej Mrozowski gentoo-dev 2009-02-27 16:36:31 UTC
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.