Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] fix binary debug support, part elevenity billion + 1
Date: Wed, 07 Jun 2006 15:23:45
Message-Id: 20060607151325.GA27076@nightcrawler
1 Resurrecting this issue (yet another round) since FEATURES=debug-build
2 was shoved in...
3
4 Background info-
5 http://thread.gmane.org/gmane.linux.gentoo.devel/35202/focus=35212
6
7 Quick summary, there needs to be an easy way to flag on essentially
8 "leave the symbols intact/don't mangle the code too much for this build";
9 needs a few things-
10 1) flip on nostrip in the restrict.
11 2) adjust CX*FLAGS, LDFLAGS
12
13 For #1, use conditional support was added to portage somewhere around
14 2.0.51_pre18; support is still there, so you can use
15 RESTRICT="debug-build? ( nostrip )" now.
16
17 As for #2, we already have eclasses mangling flags, this is no
18 different.
19
20 Two approaches to this-
21 1) FEATURES="debug-build".
22 pros:
23 1) doesn't require modifying anything in the tree.
24 cons:
25 1) no way to know if the feature will actually affect a pkg (won't
26 do jack to a pure python/perl/shell/ruby pkg, no point in even
27 trying)
28 2) FEATURES are not controllable via any package.* file.
29 3) pkgs that support debug builds, but are not affected by trying to
30 set a default set of *FLAGS have to now go and check FEATURES to
31 discern if they should produce a debug build.
32 4) no way to make the debug-build option associative to deps; simple
33 example, consider mysql python bindings. Debug info there quite
34 likely isn't all that useful for a segfault- if the horkage occurs
35 in mysql, you just get the usual ?? backtrace, and wind up having
36 to take a second manual step of rebuilding mysql with debug
37 enabled.
38 5) cannot control the setting per package.
39 2) USE="debug-build"
40 pros:
41 1) it's explicit. if the package can generate a debug-build version
42 of itself, you see the debug-build flag in it's IUSE.
43 2) appropriate designed eclass, ebuild can specify up front any
44 nonstandard *flags additions that should be made- for example,
45 ciaran's suggestion to mangle CXXFLAGS when dealing with STL so
46 that the result is useful. Possible via FEATURES, but ebuild would
47 have to test features for it (something it should be mostly unaware
48 of, features are mainly pkg manager directives, not ebuild).
49 3) via use deps, it's possible to address 1.4 from above-
50 python-mysql can just slip in a
51 "debug-build? ( dev-db/mysql[debug-build] )", one less manual step
52 required.
53 4) use flags can be controlled per package via package.use; you can
54 force $YOUR_PERSONAL_PROJECT to always be built with debug symbols
55 cleanly.
56 cons:
57 1) requires modifying the tree, and introduction of eclass for it.
58 2) existing USE="debug" (namely nano) is used to enable runtime
59 changes, asserts, etc; would have two sets of flags, debug-build
60 and runtime changes (debug flag).
61
62 Now... not to hard to figure out from above which route I prefer, but
63 that *should* be an accurate pro/con of the two routes for this.
64
65 Note also that common pros/cons are exempted; fex, ability to specify
66 via profile default debug *flags.
67
68 So... kindly state which you view as best.
69
70 Thoughts?
71 ~harring

Replies