Skip Menu |
Report information
Id: 112536
Status: open
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: ruslan.zakirov [at] gmail.com
Cc:
AdminCc:

Operating System: darwin
PatchStatus: (no value)
Severity: low
Type: install
Perl Version: 5.15.9
Fixed In: (no value)



Subject: Setting -g3 is not trivial
Date: Thu, 19 Apr 2012 14:56:17 +0400
To: perlbug [...] perl.org
From: Ruslan Zakirov <ruslan.zakirov [...] gmail.com>
Download (untitled) / with headers
text/plain 4.2k
This is a bug report for perl from ruz@new-mac.local, generated with the help of perlbug 1.39 running under perl 5.15.9. ----------------------------------------------------------------- [Please describe your issue here] Wanted to compile perl with -g3 flag to enable macros expanding in GDB. According to INSTALL document: =item -DEBUGGING=-g =item -Doptimize=-g Adds -g to optimize, but does not set -DDEBUGGING. (Note: Your system may actually require something like cc -g2. Check your man pages for cc(1) and also any hint file for your system.) This note made me believe that I can set -DEBUGGING=-g3 and it will work, but it failed. I've tried a combinations using -Accflags and -DDEBUGGING. It was a mess. Ended up looking into Configure script to figure it out. Final variant that worked for me: -Doptimize='-O3 -g3' -DEBUGGING So it has two disadvantages: 1) you have to know or struggle 2) have to repeat default value (-O3). [Please do not change anything below this line] ----------------------------------------------------------------- --- Flags: category=install severity=low --- Site configuration information for perl 5.15.9: Configured by ruz at Thu Apr 19 13:44:09 GET 2012. Summary of my perl5 (revision 5 version 15 subversion 9) configuration: Local Commit: 72fe21782afa1cae1beef02d6a0216ed4c9c5e6a Ancestor: 1a15d16d8ab308fc4f99063c180391a513f81fdb Platform: osname=darwin, osvers=10.8.0, archname=darwin-thread-multi-2level uname='darwin new-mac.local 10.8.0 darwin kernel version 10.8.0: tue jun 7 16:33:36 pdt 2011; root:xnu-1504.15.3~1release_i386 i386 i386 macbook7,1 darwin ' config_args='-des -Dprefix=/Users/ruz/perl/blead -Dusedevel -Doptimize=-O3 -g3 -DEBUGGING -Dusemymalloc -Dusethreads -Dinc_version_list=none' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=y, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-common -DPERL_DARWIN -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include', optimize='-O3 -g3', cppflags='-fno-common -DPERL_DARWIN -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include' ccversion='', gccversion='4.2.1 (Gentoo 4.2.1_p5666, Apple Inc. build 5666) (dot 3)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib' libpth=/usr/local/lib /opt/local/lib /usr/lib libs=-lgdbm -ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=, so=dylib, useshrplib=false, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector' Locally applied patches: --- @INC for perl 5.15.9: /Users/ruz/perl/blead/lib/site_perl/5.15.9/darwin-thread-multi-2level /Users/ruz/perl/blead/lib/site_perl/5.15.9 /Users/ruz/perl/blead/lib/5.15.9/darwin-thread-multi-2level /Users/ruz/perl/blead/lib/5.15.9 . --- Environment for perl 5.15.9: DYLD_LIBRARY_PATH=/opt/oracle/instantclient_10_2_64bit/: HOME=/Users/ruz LANG=ru_RU.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/Users/ruz/bin:/opt/local/bin:/opt/local/sbin:/opt/portage/usr/sbin:/opt/portage/usr/bin:/opt/portage/sbin:/opt/portage/bin:/opt/portage/usr/local/bin/:/opt/portage/opt/bin:/opt/portage/usr/sbin:/opt/portage/sbin:/opt/portage/usr/x86_64-apple-darwin10/gcc-bin/4.2.1:/opt/local/usr/sbin:/opt/local/usr/bin:/opt/local/sbin:/opt/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin:/usr/X11/bin:/Users/ruz/.perl6/bin:/Users/ruz/projs/perl6/rakudo/install/bin PERL_BADLANG (unset) SHELL=/opt/portage/bin/bash -- Best regards, Ruslan.
Subject: Re: [perl #112536] Setting -g3 is not trivial
Date: Sun, 22 Apr 2012 12:05:03 +0200
To: perl5-porters [...] perl.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
Download (untitled) / with headers
text/plain 1.5k
On Thu, 19 Apr 2012 03:56:35 -0700, Ruslan Zakirov (via RT) <perlbug-followup@perl.org> wrote: Show quoted text
> Wanted to compile perl with -g3 flag to enable macros expanding > in GDB. According to INSTALL document: > > =item -DEBUGGING=-g > > =item -Doptimize=-g > > Adds -g to optimize, but does not set -DDEBUGGING. > > (Note: Your system may actually require something like cc -g2. > Check your man pages for cc(1) and also any hint file for your system.) > > This note made me believe that I can set -DEBUGGING=-g3 and it will work, > but it failed. I've tried a combinations using -Accflags and -DDEBUGGING. > It was a mess. Ended up looking into Configure script to figure it out.
I never thought of additional digits when allowing that. I could extend the current behavior to do so if p5p thinks that is sane. : Check what DEBUGGING is required from the command line : -DEBUGGING or -DDEBUGGING or : -DEBUGGING=both = -g + -DDEBUGGING : -DEBUGGING=-g or -Doptimize=-g = -g : -DEBUGGING=none or -UDEBUGGING = : -DEBUGGING=old or -DEBUGGING=default = ? $optimize Show quoted text
> Final variant that worked for me: > > -Doptimize='-O3 -g3' -DEBUGGING > > So it has two disadvantages: 1) you have to know or struggle 2) have to > repeat default value (-O3).
-- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.14 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
CC: perl5-porters [...] perl.org
Subject: Re: [perl #112536] Setting -g3 is not trivial
Date: Mon, 23 Apr 2012 13:39:49 +0200
To: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
From: Leon Timmermans <fawaka [...] gmail.com>
Download (untitled) / with headers
text/plain 286b
On Sun, Apr 22, 2012 at 12:05 PM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote: Show quoted text
> I never thought of additional digits when allowing that. I could extend > the current behavior to do so if p5p thinks that is sane.
If you do that, don't forget to allow -ggdb3 and similar too too. Leon
CC: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>, perl5-porters [...] perl.org
Subject: Re: [perl #112536] Setting -g3 is not trivial
Date: Tue, 24 Apr 2012 10:22:08 +0100
To: Leon Timmermans <fawaka [...] gmail.com>
From: Nicholas Clark <nick [...] ccl4.org>
Download (untitled) / with headers
text/plain 683b
On Mon, Apr 23, 2012 at 01:39:49PM +0200, Leon Timmermans wrote: Show quoted text
> On Sun, Apr 22, 2012 at 12:05 PM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
> > I never thought of additional digits when allowing that. I could extend > > the current behavior to do so if p5p thinks that is sane.
> > If you do that, don't forget to allow -ggdb3 and similar too too.
Seems sane to me. At least, I can't think of anything it might be confused with. Is there a "list" of "similar too"? Or do we assume that anything /^-g[a-z0-9][-+a-z0-9]*$/ is valid? (ie is there a counter-example of a compiler flag starting -g that isn't about debugging, and would be confusing to add here) Nicholas Clark
CC: Leon Timmermans <fawaka [...] gmail.com>, "H.Merijn Brand" <h.m.brand [...] xs4all.nl>, perl5-porters [...] perl.org
Subject: Re: [perl #112536] Setting -g3 is not trivial
Date: Tue, 24 Apr 2012 20:12:41 +0600
To: Nicholas Clark <nick [...] ccl4.org>
From: Ruslan Zakirov <ruz [...] bestpractical.com>
Download (untitled) / with headers
text/plain 1.5k
On Tue, Apr 24, 2012 at 15:22, Nicholas Clark <nick@ccl4.org> wrote: Show quoted text
> On Mon, Apr 23, 2012 at 01:39:49PM +0200, Leon Timmermans wrote:
>> On Sun, Apr 22, 2012 at 12:05 PM, H.Merijn Brand <h.m.brand@xs4all.nl> wrote:
>> > I never thought of additional digits when allowing that. I could extend >> > the current behavior to do so if p5p thinks that is sane.
>> >> If you do that, don't forget to allow -ggdb3 and similar too too.
> > Seems sane to me. At least, I can't think of anything it might be confused > with. > > Is there a "list" of "similar too"? Or do we assume that anything > /^-g[a-z0-9][-+a-z0-9]*$/ is valid?
I don't think so, but as I recall it's possible that you need -gdwarf-2 -g3. Also, primary problem with instructions in INSTALL is that those doesn't cover all possible cases. I wanted to compile variant with -DDEBUGGING set and -gLevel adjusted to get macros expansion in GDB. Even if you extended -DDEBUGGING option with -gXXX support then it's still open question on how to set -DDEBUGGING for perl itself. May be the following is better: -Aoptimize=-g3 -DEBUGGING It probably works and you don't have to repeate -O3 flag in optimize. If optimize option is properly described then there is no need in -DEBUGGING=-g and =both variants. For backwards compatibility -DDEBUGGING may add -g to optimize unless there -g* and -UDEBUGGING or =none variant can delete all -g* flags from optimize. Show quoted text
> (ie is there a counter-example of a compiler flag starting -g that isn't > about debugging, and would be confusing to add here) > > Nicholas Clark
-- Best regards, Ruslan.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org