Linking problem with WinARM/yagarto

OP #1174511
Rate this post
• ▲ useful
▼ not useful
Hi all,

I'm writing a simple inertial navigation system that should run on a
ARM9 Microcontrollerboard assembled by Olimex. The Controller is an
ATMEL AT91SAM9160. Since I get the basics working, I need to use sinus,
cosine and tangent for further calculations.

But when I implement these parts, the linker throws an error about
undefined references to sinus, cosine and tangent.

I've tested this with WinARM2006, WinARM2008 and yagarto.
When I switch to WinARM2008 and the arm-eabi compiler, the linker throws
also errors like undefined reference to “__eabi_d2f”.

For linking and compiling I used the examples from ATMEL Software
Package for the AT91SAM9160 from this site:
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4343
I also had a look in the examples from the WinARM compilation and added
the linking directives from the WinARM examples in the makefile witch I
use.
So the linker and compiler use the libm.a and the math.h from WinARM or
yagarto. I've tested these by renaming them in the directories.

So, what do I have to do, to get these functions work proper?

Kind regards,
Christian
Moderator #1174514
Rate this post
• ▲ useful
▼ not useful
Christian Pietsch wrote:
> Here is a minimum example with one sinus function. All files for link
> and make included. Hope it will help.

Try to modfiy the "linker-call"-line in the makefile so $(LDFLAGS) is
the last element and not the one of the firsts.

...
$(CC) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@.lds" -o
$(OUTPUT)-$$@.elf $$^  $(LDFLAGS)
...

If have just tested with CS G++ lite for arm-eabi Version q1-2008 but
this should not matter since I could reproduce the issue with this
package too.
OP #1174515
Rate this post
• ▲ useful
▼ not useful
Martin Thomas wrote:
> Try to modfiy the "linker-call"-line in the makefile so $(LDFLAGS) is
> the last element and not the one of the firsts.
>
> ...
> $(CC) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@.lds" -o
> $(OUTPUT)-$$@.elf $$^  $(LDFLAGS)
> ...
>
> If have just tested with CS G++ lite for arm-eabi Version q1-2008 but
> this should not matter since I could reproduce the issue with this
> package too.

Yes! It works. Thanks a lot.
Such a little thing, an now it works.

Thousand thanks,
Christian

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.