Perl weirdness

Bruce Dubbs bdubbs at swbell.net
Mon Jan 5 07:17:58 PST 2004


Greg Schafer wrote:

>On Mon, Jan 05, 2004 at 03:48:56PM +1100, Greg Schafer wrote:
>  
>
>>Can someone else confirm this with current LFS cvs?
>>
>>In Ch 5 I'm getting:
>>What optimizer/debugger flag should be used? [-O3]
>>
>>In Ch 6:
>>What optimizer/debugger flag should be used? [-O2] 
>>
>>In subsequent Ch 6 reinstalls:
>>What optimizer/debugger flag should be used? [-O3]
>>
>>WTF? Can anyone explain?
>>    
>>
>
>Ok, it's due to a missing "arch" command. The perl hints/linux.sh file
>foolishly uses arch to figure out what opt' level to use:
>
>case "$optimize" in
>'') # If we have modern enough gcc and well-supported enough CPU,
>    # crank up the optimization level. 
>    case "`${cc:-gcc} -v 2>&1`" in
>    *"gcc version 2.95"*|*"gcc version 3."*)
>        case "`arch 2>&1`" in
>        i?86|ppc) optimize='-O3' ;;
>        esac
>        ;;
>    esac
>    case "$optimize" in
>    '') optimize='-O2' ;;
>    esac
>    ;;
>esac
>
>
>Clearly, they want to use O3 by default. Rather than hack -Doptimize=
>into the perl build commands for Ch 6, it may well be easier for us to just
>install "arch" in the Ch 5 util-linux section.
>
>I've never noticed this before coz I've always used the -Doptimize switch in
>my own perl builds. Shame on me.
>
>See? Performing test builds directly from the book XML source does find
>bugs!
>  
>
It may be a bug, but its insignificant.  Do you really think there will 
be a discernable difference between -O2 and -O3?  If -O3 is correct, and 
it appers to be, will -O2 ever be noticed?  I don't think so.

  -- Bruce




More information about the lfs-dev mailing list