problem with math library ?
Naga Kalla
praveen@nec-lab.com
Fri Jun 21 09:16:00 GMT 2002
Hi all,
I am using a sparc simulator. In order to run a normal C program on this
simulator, a set of libraries, gcc compiler, etc have been provided.
This was done quite some time back. But when i am using it right now, i
have a problem :
if i compile a program foo.c like :
gcc foo.c -lm
it compiles fine on my system. But when i use the compiler given with
the simulator, after the compilation step, i get the following problem
with the linker :
lib/libsim/libmath.a(sincos.o)(.text+0xc): undefined reference to
`__finite'
lib/libsim/libmath.a(__drem.o)(.text+0x8): undefined reference to
`errno'
How do i approach this problem ?Any suggestions would be greatly
appreciated.
Full error message is attached below:
/u/praveen/cache/benches> mke all.new4.c
srcfiles= all.new4.c
asmfiles= all.new4.s
objfiles= all.new4.o
SPARCSim C-compilation starts ..........
/u/praveen/cache/sparcsim/gnu/bin/gcc -g -O3 -S -funsigned-char
-DSWITCH_SIMUL -v -DISS -I/p/sdt/polis/polis_lib/os all.new4.c
-I/u/praveen/cache/sparcsim/include
Reading specs from
/u/praveen/cache/sparcsim/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.5.7/specs
gcc version 2.5.7
/u/praveen/cache/sparcsim/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.5.7/cpp
-lang-c -v -I/p/sdt/polis/polis_lib/os
-I/u/praveen/cache/sparcsim/include -iprefix
/u/praveen/cache/sparcsim/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.5.7/sparc-sun-sunos4.1/2.5.7/
-undef -D__GNUC__=2 -D__GNUC_MINOR__=5 -Dsparc -Dsun -Dunix
-D__GCC_NEW_VARARGS__ -D__sparc__ -D__sun__ -D__unix__
-D__GCC_NEW_VARARGS__ -D__sparc -D__sun -D__unix -D__GCC_NEW_VARARGS__
-Asystem(unix) -Asystem(bsd) -Acpu(sparc) -Amachine(sparc)
-D__CHAR_UNSIGNED__ -D__OPTIMIZE__ -g -DSWITCH_SIMUL -DISS all.new4.c
/usr/tmp/cca03501.i
GNU CPP version 2.5.7 (sparc)
#include "..." search starts here:
#include <...> search starts here:
/p/sdt/polis/polis_lib/os
/u/praveen/cache/sparcsim/include
/u/praveen/cache/sparcsim/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.5.7/sparc-sun-sunos4.1/2.5.7/include
/usr/local/include
/vergil/home/gcc-2.5.7/sparc-sun-sunos4.1/include
/vergil/home/gcc-2.5.7/lib/gcc-lib/sparc-sun-sunos4.1/2.5.7/include
/usr/include
End of search list.
/u/praveen/cache/sparcsim/gnu/lib/gcc-lib/sparc-sun-sunos4.1/2.5.7/cc1
/usr/tmp/cca03501.i -quiet -dumpbase all.new4.c -g -O3 -version
-funsigned-char -o all.new4.s
GNU C version 2.5.7 (sparc) compiled by GNU C version 2.5.7.
/u/praveen/cache/sparcsim/gnu/bin/as -o all.new4.o all.new4.s
/u/praveen/cache/sparcsim/gnu/bin/ld -m sparcaout
-L/u/praveen/cache/sparcsim/lib/libsim -N -Ttext 4000
/u/praveen/cache/sparcsim/lib/libsim/crt0sim.o -o os_sparc all.new4.o
-lsswitch -lmain -lc -lmath
/u/praveen/cache/sparcsim/lib/libsim/libmath.a(sincos.o)(.text+0xc):
undefined reference to `__finite'
/u/praveen/cache/sparcsim/lib/libsim/libmath.a(sincos.o)(.text+0x27c):
undefined reference to `__finite'
/u/praveen/cache/sparcsim/lib/libsim/libmath.a(__drem.o)(.text+0x8):
undefined reference to `errno'
/u/praveen/cache/sparcsim/lib/libsim/libmath.a(__drem.o)(.text+0xc):
undefined reference to `errno'
Error 1
More information about the Gcc-help
mailing list