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:
no, current behavior is correct