develooper Front page | perl.perl5.porters | Postings from December 2008

Re: [PATCH] -g isn't always -g

Thread Previous
From:
Jarkko Hietaniemi
Date:
December 24, 2008 07:36
Subject:
Re: [PATCH] -g isn't always -g
Message ID:
495256D1.5010606@iki.fi
H.Merijn Brand wrote:
> On Wed, 24 Dec 2008 09:43:42 -0500, Jarkko Hietaniemi <jhi@iki.fi>
> wrote:
> 
>> In Tru64 if one cranks up the optimization to -O4, one also needs to
>> crank up the debugging to -g3, since -g is equivalent to -g2, which
>> is not enough for -O4.  The problem is that the -g might be added
>> by Configure when doing -DDEBUGGING/-DEBUGGING, so looking at optimize
>> and/or ccflags in the hints file is not enough.
>>
>> I could have just tweaked this in hints/dec_osf.sh, but I would have
>> just ended up duplicating much of the the Configure DEBUGGING logic.
>> Therefore I introduced a new Configure variable 'debugging', which
>> defaults to '-g', but can be whatever. I don't know that it's necessary
>> to store it in config.sh, this patch doesn't, but I'll leave it to
>> Configuremeister to decide.
> 
> I don't know if I like this bit:

Uhh, I don't either.  Sorry about that, didn't think this through.  We
definitely don't want the patch as-is, we don't want debugging as default.

> +case "$debugging" in
> +    '') debugging='-g' ;;
> +esac
> +
>  case "$DEBUGGING" in
>  -g|both|$define)
>      case "$optimize" in
> -	*-g*) ;;
> -	*)    optimize="$optimize -g" ;;
> +	*$debugging*) ;;
> +	*)    optimize="$optimize $debugging" ;;
>      esac ;;
> 
> That will default debugging to -g, where it was '', which will cause
> serious conflicts with -O* on HP-UX, where you can't have -O3 or up (2
> being default for -O) when -g is also present. If I still want -g
> disabled, I would need to explicitly pass 'none'
> 
> 1020 $ cc -Ae +O3 -g -o tztest tztest.c
> cc: warning 414: Optimization reduced to +O2 for compatibility with Debug.
> 
> 1100 $ cc -Ae +O3 -g -o tztest tztest.c
> cc: warning 414: Optimization reduced to +O2 for compatibility with Debug.
> 
> 1111 $ cc -Ae +O3 -g -o tztest tztest.c
> cc: warning 414: Optimization reduced to +O2 for compatibility with Debug.
> 
> 1123 $ cc -Ae -O4 -g -o tztest tztest.c
> cc: warning 974: Option +noobjdebug was added due to use of option(s) -g -ipo or +O4.
> 
> 1131 $ cc -Ae -O4 -g -o tztest tztest.c
> cc: warning 974: Option +noobjdebug was added due to use of option(s) -g -ipo or +O4.
> 
> I have no problem with introducing new variables, nor with making them
> global (and documenting them), but your patch changes a default
> 


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About