FPA linking error

OP #1173617
I use GNUARM gcc 4.1.1, and I compile for arm966e-s (str912)

I have a linker error:
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_divs 
i3.o)
uses FPA instructions, whereas demo_arm966s.elf does not
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../ar 
m-elf/bin/ld:
failed to merge target specific data of file
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_divs 
i3.o)
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../ar 
m-elf/bin/ld:
ERROR:
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_dvmd 
_tls.o)
uses FPA instructions, whereas demo_arm966s.elf does not
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/../../../../ar 
m-elf/bin/ld:
failed to merge target specific data of file
/cygdrive/c/programmi/gnuarm/bin/../lib/gcc/arm-elf/4.1.1/libgcc.a(_dvmd 
_tls.o)


the compiler command lines are the sam for all files:
arm-elf-gcc -c  -mcpu=arm966e-s  -I. -gstabs -DROM_RUN  -Wall
-Wcast-align -Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch
-Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=main.lst
-I./libstr91x/include -O3 -MD -MP -MF .dep/main.o.d -Wstrict-prototypes
-Wmissing-declarations -Wmissing-prototypes  -std=gnu99 main.c -o main.o

and the linker command line is:
arm-elf-gcc  -mcpu=arm966e-s  -I. -gstabs -DROM_RUN  -Wall -Wcast-align
-Wcast-qual -Wimplicit  -Wpointer-arith -Wswitch -Wredundant-decls
-Wreturn-type -Wshadow -Wunused -Wa,-adhlns=startup.lst
-I./libstr91x/include -O3 -MD -MP -MF .dep/demo_arm966s.elf.d startup.o
vector.o     main.o vectors.o     --output demo_arm966s.elf
-nostartfiles -Wl,-Map=demo_arm966s.map,--cref   -lgcc -Llibstr91x
-lstr91x -Trom912.ld

Any idea?
How can I avoid this problem?

thanks
#1173618
There are multiple libraries built for different architectures. Since
your device almost certainly has no FPA hardware you don't want an FPA
supporting library. I am not sure why your build is picking up an FPA
library, but in the past when this has occurred, it has been solved by
specifying -nostdlib and then linking the required libraries explicitly
(you;ll normally need at least libgcc.a and probably libc.a, and
possibly libm.a linked in the order -lm -lc -lgcc after any additional
libraries you might link).
OP #1173619
There is something strange:
If I compile changing from -mcpu=arm966e-s to -mcpu=arm7tdmi all works,
and the linker uses the same libraries.
I don't think that arm7tdmi has FPA instructions and arm9 don't. I
cannot understand.

I tried also 2 different versione of yagarto (gcc 4.1.1 and 4.2.2) with
the same
results.

I will try with -nostdlib, but I don't think that this can solve the
problem

thanks

Reply

A question of your own? This thread is over 18 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

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.