ROOT=/blah/ PORTAGE_CONFIGROOT=/blah/ sudo emerge mdadm / is amd64 /blah/ is i686 gcc is invoked by mdadm's Makefile which - in this case - produces an error (error: CPU you selected does not support x86-64 instruction set) as gcc is invoked with -march=athlon-xp for the hosted environment. Solution : to have Makefile invoke more specific gcc (i686-pc-linux-gnu-gcc in this case) Makefile seems to have support for setting $CROSS_COMPILE to specify prefix to gcc.
Adding the following line below emake in the ebuild seems to give correct results on amd64 and x86. CROSS_COMPILE="${CHOST}-" \
added your fix to the 2.5.5 ebuild, thanks !