undefined reference in libm.a (__gtsf2,__ltsfw,__lesf2,__eqsf2,__nesf2...)

J. Johnston jjohnstn@cygnus.com
Mon Apr 2 11:41:00 GMT 2001

> Cliff Tsai wrote:
> Hi:
>     I'm testing libm on my m68k platform,but have following errors.
>     I can't find any document about this symbol,what do they mean?
>     And how to solve these?Thanks!
> C:/cygwin/tools/m68k-coff/m68k-coff/lib/m68000/libm.a(wf_acos.o): In function `acosf':
> /src/newlib/newlib-1.9.0/newlib/libm/math/wf_acos.c:37: undefined reference to `__gtsf2'
> C:/cygwin/tools/m68k-coff/m68k-coff/lib/m68000/libm.a(wf_acosh.o): In function `acoshf':
> /src/newlib/newlib-1.9.0/newlib/libm/math/wf_acosh.c:38: undefined reference to `__ltsf2'
> C:/cygwin/tools/m68k-coff/m68k-coff/lib/m68000/libm.a(wf_atan2.o): In function `atan2f':
> /src/newlib/newlib-1.9.0/newlib/libm/math/wf_atan2.c:38: undefined reference to `__eqsf2'
> C:/cygwin/tools/m68k-coff/m68k-coff/lib/m68000/libm.a(wf_log10.o): In function `log10f':
> /src/newlib/newlib-1.9.0/newlib/libm/math/wf_log10.c:37: undefined reference to `__lesf2'
> /src/newlib/newlib-1.9.0/newlib/libm/math/wf_log10.c:51: undefined reference to `__eqsf2'
> C:/cygwin/tools/m68k-coff/m68k-coff/lib/m68000/libm.a(erf_lgamma.o): In function `sin_pif':
> /src/newlib/newlib-1.9.0/newlib/libm/math/erf_lgamma.c:118: undefined reference to `__nesf2'


  These are calls to float math comparison operators that are generated by the compiler.  They will
be found in the libgcc.a for the compiler.  You can resolve them by adding -lgcc at the end of your
link.  The libgcc routines may subsequently make references to the C library in which case add -lc
to the end.  Continue adding -lgcc and/or -lc until the undefined references are all resolved.

-- Jeff J.

More information about the Newlib mailing list