Perl weirdness

Greg Schafer gschafer at zip.com.au
Sun Jan 4 22:15:14 PST 2004


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!



More information about the lfs-dev mailing list