hermida has asked for the wisdom of the Perl Monks concerning the following question:
I posted some questions on the chat wondering why most Linux distros include -g in the -Doptimize option when building their included system Perl distribution. For example:
sh Configure -des -Doptimize='-O2 -g ...'
Some people on this site said there are advantages to having -g in ccflags which adds system debugger support and -g has very little if any performance overhead unlike -DDEBUGGING which will build full internal support for debugging Perl and this has a significant performance hit.
The Install docs say, by adding -g to -Doptimize this will only enable support for the system debugger and will not add Perl internal debugging support by making sure -DDEBUGGING in not in the ccflags. Though if you try to build Perl with -g in -Doptimize as instructed it doesn't do what you think and also adds Perl internal debugging support by adding -DDEBUGGING in ccflags and this will make your Perl binary much slower.
If you use the second synonym option from the docs and must remove the -g from -Doptimize and added a separate -DEBUGGING=-g configure option then it does the right thing, it only adds -g to the ccflags and doesn't add -DDEBUGGING. It could be that the install docs are not syntactically incorrect, maybe you must put -Doptimize='-g ...' first or something but that is confusing and possibly misleading.
I took a look at Perl 5.8.8 on RHEL and with 5.8.8 the Install docs behaviour seems to hold, they built it with -Doptimize='-O2 -g ...' and it doesn't build Perl with -DDEBUGGING. Then I tested Perl 5.10.1 and 5.12.3 where the Install docs behaviour is wrong just like I described, something changed between 5.8.8 and the newer versions and if you follow the docs it doesn't do what you want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Install docs "Building a Debugging Perl" section could have a mistake that builds wrong debugging Perl
by hermida (Scribe) on Mar 22, 2011 at 16:19 UTC | |
by hermida (Scribe) on Mar 22, 2011 at 17:47 UTC | |
by j.wimmer (Initiate) on Jul 02, 2023 at 11:59 UTC |