One or more of the patches applied by the gcc ebuild breaks the compiler's ability to create binaries with the -ffast-math CFLAG. After USE="vanilla", gcc works as expected. Example: (dummy.c contains "main() {}") # i686-pc-linux-gnu-gcc -ffast-math dummy.c /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/crtfastmath.o: In function `set_fast_math': /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/config/i386/crtfastmath.c:88: undefined reference to `__builtin_ia32_stmxcsr' /var/tmp/portage/sys-devel/gcc-4.1.2/work/gcc-4.1.2/gcc/config/i386/crtfastmath.c:104: undefined reference to `__builtin_ia32_ldmxcsr' collect2: ld returned 1 exit status (Similar errors occur when combined with other normal CFLAGS such as -Os, -O2, -march=pentium4) With a vanilla gcc, programs compile and run without error, which leads me to believe the bug is in crtfastmath.c. Reproducible: Always Steps to Reproduce: 1. USE="-vanilla" emerge gcc 2. gcc -ffast-math dummy.c OR CFLAGS="-ffast-math" emerge anything 3. (errors) 4. USE="vanilla" emerge gcc 5. (normal)
caused by the patch to bug #182374
i dont see how it could be caused by 182374 when that patch isnt included in gcc-4.1.2 (yet)
I recompiled by commenting one line from the ebuild, and that seems to work as expected. Here's the diff: # diff /usr/portage/sys-devel/gcc/gcc-4.1.2.ebuild /usr/local/portage/sys-devel/gcc/gcc-4.1.2.ebuild 65c65 < epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch --- > # epatch "${FILESDIR}"/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch I suppose that patch is what breaks it? The text of the patch links to bug 147020 I hope this information is useful, thanks.
unable to reproduce on my x86 system try building gcc w/out -ffast-math