-fno-builtin-function doesn't work?

Pan ruochen panruochen@gmail.com
Mon Apr 19 07:19:00 GMT 2010


Hi All,

I was developing with uclibc libarary and came across some linking problems.

$cat 1.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(int argc, char *argv[])
{
    double a, b, x;
    x = rand();
    a = sin(x) * cos(x);
    printf("%lf %lf\n", a, b);
    return 0;
}
$mips-linux-gnu-gcc -mips32r2 -EL -O2 -muclibc -msoft-float 1.c
/tmp/ccufhMGF.o: In function `main':
1.c:(.text+0x28): undefined reference to `sincos'
1.c:(.text+0x38): undefined reference to `sincos'
collect2: ld returned 1 exit status

Since the uclibc libraries don't contain the `sincos' functions, I
tried to prevent gcc from producing `sincos'
$mips-linux-gnu-gcc -mips32r2 -EL -O2 -muclibc -msoft-float
-fno-builtin-sincos -fno-builtin-sincosf -fno-builtin-sincosl 1.c
/tmp/ccufhMGF.o: In function `main':
1.c:(.text+0x28): undefined reference to `sincos'
1.c:(.text+0x38): undefined reference to `sincos'
collect2: ld returned 1 exit status
It seemed that -fno-builtin-function doesn't really disable one single
built-in function.


Best Regards,
PRC
Apr 19,2010



More information about the Binutils mailing list