1 |
On Monday 01 of December 2008 09:36:12 Diego 'Flameeyes' Pettenò wrote: |
2 |
> > - USE=debug is useless when CFLAGS/LDFLAGS or FEATURES are not |
3 |
> > appropriate |
4 |
> What are you saying here? I'm afraid you're mistaken here. |
5 |
|
6 |
The point is to look at this from users' (well, a bit) point of view - |
7 |
USE=debug variable is ambiguous in it's meaning. While it enables only |
8 |
codepaths (asserts, #ifdefs and similar) it suggests (by name and for some |
9 |
packages not only suggests) enabling debug symbols. |
10 |
And policy is to enforce CFLAGS from make.conf and wipe out every package- |
11 |
defined flags as far as I know. |
12 |
|
13 |
> For the most part, USE=debug means "enable debug code paths", which for |
14 |
> lots of projects simply means "enable assertions"; there are packages |
15 |
> that take this as "enable debug symbols too" but I don't think that's |
16 |
> very valid since users might want debug code paths but not symbols and |
17 |
> vice-versa (I indeed have debug symbols bug no debug codepaths enabled). |
18 |
|
19 |
That's correct, the problem is - Gentoo does not provide officially supported |
20 |
mechanism of enabling both or just debug symbols per package basis - it |
21 |
doesn't even provide any supported/documented mechanism for per package |
22 |
CFLAGS, FEATURES and similar. |
23 |
If /etc/portage/env hack/feature could be made official (for CFLAGS,LDFLAGS |
24 |
and bash-domain FEATURES) - it could address this issue good enough, because |
25 |
with proper smart combination of symlinks/files the "ultimate configuration" |
26 |
power would be delivered, not just "cleaning/workaround" I am actually |
27 |
proposing. Per package debug/release/profile/or_any_other configuration is |
28 |
what I would pursue, and in my proposal I used USE=debug as existing and |
29 |
supported way of achieving this. |
30 |
|
31 |
While I don't like hack @pve uses (I prefer portage/env as more convenient |
32 |
way), his idea about emerge --info <pkg> seems interesting. |
33 |
|
34 |
> - -ggdb *does not have any runtime performance hit*; neither in |
35 |
|
36 |
Yes, I'm well aware of that, though it increases disk space requirements a bit |
37 |
as it's applied to all libs/bins. |
38 |
|
39 |
> - -O0 is not always a good idea; beside bugs in packages concealed by |
40 |
> -O1+ [1] |
41 |
|
42 |
[1] is a pathology and should be fought against, -O1+ may leave frame stack |
43 |
useless for debugging due to inline optimizations in some places (especially |
44 |
debugging inline class implementations is limited, which affects Qt/KDE) - |
45 |
besides - I may not stated it clear - those default values would be defined in |
46 |
the very same make.conf, so it could be: |
47 |
|
48 |
CHOST="x86_64-pc-linux-gnu" |
49 |
CFLAGS="-march=nocona -O2 -pipe -msse3 -ftree-vectorize" |
50 |
CXXFLAGS="${CFLAGS}" |
51 |
|
52 |
CFLAGS_DEBUG="-O2 -ggdb" |
53 |
|
54 |
Yet, I still cannot think of this proposal other way like of dirty workaround |
55 |
for the problem, that doesn't really exist (well, at least for developers, who |
56 |
have meta-distribution and ultimate freedom for user in mind). For the users |
57 |
the problem is real, of course it's usually a consequence of either not being |
58 |
aware of those mechanisms or as a result of ambiguous semantics of USE=debug. |
59 |
|
60 |
And what about pushing some bash-domain FEATURES to USE flags? Like nostrip, |
61 |
splitdebug? I guess being able to set it per package is important. |
62 |
|
63 |
-- |
64 |
regards |
65 |
MM |