- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
All,
Today, when I build my application without any debugging information, everything is OK. But when I am going to link the .gdb file for debugging, the problem shows up. I got an "undefined error" when linking the .bin file into .gdb file. After checking the problem, I found in the Rules.mak file, it still uses the lib provided by newlib not uclibc, while we are using the libc.a from uclibc. After changing the LIBM to libm.a provided from uclibc, the problem is solved. Is it a bug? <div class='quotetop'>QUOTE </div> --- Quote Start --- ######################################################## # I use the libm.a provided by uclibc instead of# newlib.# # ###################################################### LIBM := $(LIBCDIR)/lib/libm.a# LIBM := $(shell $(CC) -print-file-name=libm.a)[/b] --- Quote End ---Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We used the newlib's libm because we found it to be more efficient. What was the specific error message that you got?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Randy,
The following is the error information I got. Thanks. <div class='quotetop'>QUOTE </div> --- Quote Start --- nios2-elf-ld -T C:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.application_0.1.0/scripts/elf2flt.ld -o kvm_g.gdb kvm_g.bin kvm_g.bin(.text+0x3b298): In function `fmod': /build/nios2/bin/nios2-gnutools/src/newlib/newlib/libm/math/w_fmod.c:97: undefined reference to `__errno' kvm_g.bin(.text+0x3b2c8):/build/nios2/bin/nios2-gnutools/src/newlib/newlib/libm/math/w_fmod.c:100: undefined reference to `__errno' make[1]: *** [kvm_g.gdb] Error 1[/b] --- Quote End ---- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi neo,
Yes. It is a problem. You are right to use the libm from uClibc. The libm from newlib is compiled with newlib header files, and should not be used together with uClibc. Thanks for your finding, wentao
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page