EmbDev.net

Forum: ARM programming with GCC/GNU tools Trouble obtaining a toolchain for VFP and Windows/cygwin


von Juke J. (jjohnson)


Rate this post
useful
not useful
I'm fairly new to this stuff and am having an issues getting my
application built for my AT91SAM9261 target.

My problem seems to boil down to my desire to compile my application
with VFP (armv5te instructions) and that the arm-elf-gcc toolchain that
I'm using is built with FPA and therefore will not link with my app.
I'm using arm-elf-gcc 4.1.1 that I get in binary form from gnuarm.com.
It seems I need to rebuild this toolchain with VFP but all the
instructions to do this appear to be for linux and won't work on a
windows/cygwin platform.

Anyone know of any instructions available for building my toolchain in
windows/cygwin or of any existing VFP builds that will link with my
application?

In case they are of additional value here are the link errors I get:

Building target: eCos_Test.exe
Invoking: Cygwin C Linker
arm-elf-gcc -nostartfiles -nodefaultlibs -nostdlib -static
-L"C:\cygwin\opt\ecos\ecos-cvs\cb5\cb5_install\lib" -Ttarget.ld -g
-march=armv5te -Wl,-Map,mapfile.txt -mcpu=xscale  -o"eCos_Test.exe"
./hello.o
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_udivsi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_udivsi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_divsi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_divsi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_umodsi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_umodsi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_modsi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_modsi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_dvmd_tls.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_dvmd_tls.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_addsubdf3.o) uses
FPA instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_addsubdf3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_muldivdf3.o) uses
FPA instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_muldivdf3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_cmpdf2.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_cmpdf2.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_unorddf2.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_unorddf2.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_fixdfsi.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_fixdfsi.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_truncdfsf2.o) uses
FPA instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_truncdfsf2.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_divdi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_divdi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_udivdi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_udivdi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_umoddi3.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_umoddi3.o)
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
ERROR: /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_clz.o) uses FPA
instructions, whereas eCos_Test.exe does not
/ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/../../../../arm-elf/bin/ld:
failed to merge target specific data of file /ecos-c/Program
Files/GNUARM/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_clz.o)
collect2: ld returned 1 exit status
make: *** [eCos_Test.exe] Error 1

von Clifford S. (clifford)


Rate this post
useful
not useful
You are wasting your time for two reasons.

1) The AT91SAM9261 does not have floating point hardware, neither an FPA
nor VFP. Currently the only off-the-shelf ARM9 with VFP hardware is the
NXP LPC3180.

2) The GNU tool-chain will happily generate VFP instructions you don't
need to rebuild it. You do need to rebuild the Newlib library for VFP if
you use the C math library. I also recommend re-writing the sqrt() and
fsqrt() functions to use the VFP SQRT instructions rather than an
algorithm. If you use VFP instructions on a target without VFP, the
invalid instruction exception handler invokes the emulator to perform
the operation in software.

I discussed VFP code generation (mostly with myself) at length in this
thread: http://en.mikrocontroller.net/topic/61360

Looking at your log, your problem is not that you need VFP instructions
but rather that you need to stop using libraries with FPA instructions
(your code uses neither VFP nor FPA instructions). Your build looks a
bit messed up - the AT91SAM9261 is not and Xscale device, so why the
-mcpu=xscale option?

Clifford

von Clifford S. (clifford)


Rate this post
useful
not useful
This thread: http://en.mikrocontroller.net/topic/126973 discusses a
similar problem with a solution (-nostdlibs).

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.