Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 183015 - sys-devel/gcc-4.1.2 cannot compile with -ffast-math, vanilla okay.
Summary: sys-devel/gcc-4.1.2 cannot compile with -ffast-math, vanilla okay.
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2007-06-24 04:46 UTC by Possum
Modified: 2007-10-07 02:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Possum 2007-06-24 04:46:20 UTC
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)
Comment 1 Ryan Hill (RETIRED) gentoo-dev 2007-06-24 05:00:35 UTC
caused by the patch to bug #182374
Comment 2 SpanKY gentoo-dev 2007-06-25 15:33:54 UTC
i dont see how it could be caused by 182374 when that patch isnt included in gcc-4.1.2 (yet)
Comment 3 Possum 2007-06-26 06:08:30 UTC
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.
Comment 4 SpanKY gentoo-dev 2007-10-07 02:19:00 UTC
unable to reproduce on my x86 system

try building gcc w/out -ffast-math