EmbDev.net

Forum: ARM programming with GCC/GNU tools FPA linking error


von Massimiliano C. (mastupristi)


Rate this post
useful
not useful
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

von Clifford S. (clifford)


Rate this post
useful
not useful
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).

von Massimiliano C. (mastupristi)


Rate this post
useful
not useful
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

von Clifford S. (clifford)


Rate this post
useful
not useful
Massimiliano Cialdi wrote:
> I will try with -nostdlib, but I don't think that this can solve the
> problem
It worked for this guy: in a similar situation.
http://en.mikrocontroller.net/topic/126973

The point is that if you do not specify -nostdlib, the linker will
select a library depending upon architecture settings, and it seems to
be getting it wrong.

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.