Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 288982 - sys-devel/gcc-4.3.4 -ffast-math option leads to undefined symbol
Summary: sys-devel/gcc-4.3.4 -ffast-math option leads to undefined symbol
Status: RESOLVED DUPLICATE of bug 288977
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-14 01:07 UTC by Hugo Mildenberger
Modified: 2009-10-14 01:27 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 Hugo Mildenberger 2009-10-14 01:07:05 UTC
Compiling mesa on hardened ~x86, configure bailed out stating that gcc could not produce executables. It turned out that any attempt to compile a program using the -ffast-math option leads to an undefined symbol error:

gcc -ffast-math test.c -o test
/usr/lib/gcc/i686-pc-linux-gnu/4.3.4/crtfastmath.o:(.ctors+0x0): undefined reference to `no symbol'
collect2: ld gab 1 als Ende-Status zurück


$ gcc -ffast-math test.c -o test.o -c
$ readelf -s test.o

Symbol table '.symtab' contains 14 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 00000000     0 FILE    LOCAL  DEFAULT  ABS test.c
     2: 00000000     0 SECTION LOCAL  DEFAULT    2
     3: 00000000     0 SECTION LOCAL  DEFAULT    4
     4: 00000000     0 SECTION LOCAL  DEFAULT    5
     5: 00000000     0 SECTION LOCAL  DEFAULT    6
     6: 00000000     0 SECTION LOCAL  DEFAULT    8
     7: 00000000     0 SECTION LOCAL  DEFAULT    9
     8: 00000000     0 SECTION LOCAL  DEFAULT    7
     9: 00000000     0 SECTION LOCAL  DEFAULT    1
    10: 00000000    58 FUNC    GLOBAL DEFAULT    2 main
    11: 00000000     0 FUNC    GLOBAL HIDDEN    8 __i686.get_pc_thunk.bx
    12: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND _GLOBAL_OFFSET_TABLE_
    13: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND puts

There shouldn't be any FP-operation in test.c:

include <stdio.h>
int main()
{
        printf("hello world\n");
        return 0;
}

Linking -lm explictly doesn't help. The generated assembly and object files are identical, with and without-ffast-math, while only the link without -ffast-math succeeds. I use sys-devel/binutils-2.19-r1.
Comment 1 Hugo Mildenberger 2009-10-14 01:27:24 UTC

*** This bug has been marked as a duplicate of bug 288977 ***