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

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

Thread Previous | Thread Next
From:
H.Merijn Brand
Date:
December 24, 2008 07:01
Subject:
Re: [PATCH] -g isn't always -g
Message ID:
20081224160127.479ed7a7@pc09.procura.nl
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:

+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

-- 
H.Merijn Brand  http://tux.nl      Perl Monger  http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.3, and 11.0, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/           http://www.test-smoke.org/
http://qa.perl.org      http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous | Thread Next


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