[uClibc]Math library problem

Erik Andersen andersen at codepoet.org
Thu Aug 1 21:09:54 UTC 2002


On Thu Aug 01, 2002 at 09:05:45PM +0800, Bob Cheng wrote:
> Hi:
> 
>  I am using gcc-3.1-uclibc-20020711.src.tar.gz on a Redhat 7.2 host.
> I do need C++ compiler so I remarked some lines in Makefile:
> 
> ARCH:=arm
> HAS_MMU:=false
> USE_UCLIBC_SNAPSHOT:=false
> TARGETS:=gcc_final
> TARGET_LANGUAGES:=c,c++
> #ifneq ($(HAS_MMU),true)
> ###TARGETS:=elf2flt
> #TARGET_LANGUAGES:=c
> #endif
> 
> I can build toolchain successfully. However, if I compile a C++ program
> with variables declared as 'double', I got linker error like this:
> 
> ld: cannot find -lm
> collect2: ld returned 1 exit status
> 
> I checked my toolchain/lib directory and I do have no libm.a file there.
> 
> Please advise me how to solve this problem. Thanks!

You need to change
	--float=$(HAS_MMU) \
to be
	--float=true \

And make sure that you have CONFIG_NWFPE=y in your kernel .config
or the fpu instructions will cause things to choke.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--



More information about the uClibc mailing list