-fno-builtin-function doesn't work?

Jim Wilson wilson@codesourcery.com
Mon Apr 19 17:41:00 GMT 2010


On 04/19/2010 12:19 AM, Pan ruochen wrote:
> $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'

This isn't a linker issue, it is a gcc issue.

GCC has a macro TARGET_HAS_SINCOS which is defined in config/linux.h as
/* Whether we have sincos that follows the GNU extension.  */
#define TARGET_HAS_SINCOS (OPTION_GLIBC)
The tree-ssa-math.c file performs this optimization if this is true.

So if you configure for a linux (glibc) target, then gcc will assume it 
can emit calls to sincos.  You can configure for a uclibc target instead 
of configuring for a linux target, if one exists.  Or you can submit a 
gcc bug report pointing out that -muclibc doesn't work right with 
respect to the sincos support.  Or you could submit a uclibc bug report 
asking that they add sincos support.

You can also point out that -fno-builtins doesn't disable this 
optimization, as it should.

Jim



More information about the Binutils mailing list