This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fno-builtin-function doesn't work?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]