EmbDev.net

Forum: ARM programming with GCC/GNU tools Linking problem with WinARM/yagarto


von Christian P. (beelzebub23)


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

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Please create a minimal example project to reproduce this (makefile,
linker-script, startup-code, C-sources), pack it intro a zip- or
tgz-archive and attach it to a message here.

von Christian P. (beelzebub23)


Attached files:

Rate this post
useful
not useful
Here is a minimum example with one sinus function. All files for link
and make included. Hope it will help.

von Martin T. (mthomas) (Moderator)


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.

von Christian P. (beelzebub23)


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

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.