Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 108871

Summary: glibc-2.3.5-r2 crosscompile setup_flags called before CFLAGS are set
Product: Gentoo Linux Reporter: Jan Kobler <eng1>
Component: [OLD] Core systemAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jan Kobler 2005-10-11 07:33:26 UTC
This is the function setup_env from the file glibc-2.3.5-r2.ebuild.
When crosscompiling I think there are two bugs:

setup_env ()
{
    if is_crosscompile || tc-is-cross-compiler; then
        multilib_env ${CTARGET};
    fi;
    export ABI=${ABI:-${DEFAULT_ABI:-default}};

    #setup_flags;   ## ERROR: I think this is to early, move it to the end
                    ## CFLAGS has the value of the CFLAGS of the build machine here

    if is_crosscompile || tc-is-cross-compiler; then
        MULTILIB_ABIS=${MULTILIB_ABIS:-DEFAULT_ABI};
        local VAR1=CFLAGS_${CTARGET//[-.]/_} VAR2=CFLAGS_${ABI};
        export CFLAGS="${CFLAGS} ${!VAR1-${!VAR2--O2 -pipe}}";
	
	### ERROR: To the current value of CFLAGS the value of VAR1 or VAR2 or -O2 -pipe 
	###        is appended
	### It guess it should be something like 
	### export CFLAGS="${CFLAGS}:-${!VAR1-${!VAR2--O2 -pipe}}";
    fi
    
    setup_flags;  # proposed BUGFIX: I think setup_flags should go here, because it
                  # checks and changes CFLAGS
}


The environment before crossdev is called:
ABI=ppc
CFLAGS_ppc='-O2 -mtune=G3 -fno-strict-aliasing -pipe'
CFLAGS='-O2 -march=pentium4 -fomit-frame-pointer'

The values when glibc is build:

CFLAGS='-freorder-blocks -O2 -O2 -mtune=G3 -fno-strict-aliasing -pipe'
CFLAGS_BASE='-O2 -march=pentium4 -fomit-frame-pointer'    <--- this is from the
build machine CBUILD


Reproducible: Always
Steps to Reproduce:
Comment 1 SpanKY gentoo-dev 2005-10-11 08:32:52 UTC
no, current behavior is correct