This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

libgcc.a not built with -msoft-float when --with-float=soft specified for ARM-ELF target (__divsi3 problem etc.)


Hi,

I have successfully built binutils and gcc, both for the arm-elf
target. Programs not requiring integer division (only multiply or plus
or minus) arithmetic operation compile right.
However I have one program doing integer division and in the resulting
object file, there are references to functions like __divsi3 etc.,
which I believe are to make the integer division possible.

The problem is, I compile with "-march=armv5 -msoft-float", and during
linking, the linker complains:

arm-elf-gcc -march=armv5 -mno-thumb -O1 -c -o ./prec.o ./prec.c
arm-elf-ld --entry=main -L/usr/local/lib/gcc/arm-elf/4.2.2 --strip-all
-o ./prec ./prec.o -lgcc
arm-elf-ld: ERROR:
/usr/local/lib/gcc/arm-elf/4.2.2/libgcc.a(_divsi3.o) uses FPA
instructions, whereas ./prec does not
arm-elf-ld: failed to merge target specific data of file
/usr/local/lib/gcc/arm-elf/4.2.2/libgcc.a(_divsi3.o)
arm-elf-ld: ERROR:
/usr/local/lib/gcc/arm-elf/4.2.2/libgcc.a(_modsi3.o) uses FPA
instructions, whereas ./prec does not
arm-elf-ld: failed to merge target specific data of file
/usr/local/lib/gcc/arm-elf/4.2.2/libgcc.a(_modsi3.o)
arm-elf-ld: ERROR:
/usr/local/lib/gcc/arm-elf/4.2.2/libgcc.a(_dvmd_tls.o) uses FPA
instructions, whereas ./prec does not
arm-elf-ld: failed to merge target specific data of file
/usr/local/lib/gcc/arm-elf/4.2.2/libgcc.a(_dvmd_tls.o)
./prec.o: In function `poradi_na_permutace':
prec.c:(.text+0x110): undefined reference to `realloc'

I read in the gcc manual that when I use -msoft-float, then I must
make sure that libgcc.a is built with -msoft-float as well. I have
specified the "--with-float=soft" to gcc ./configure, but it probably
does not take effect for the libgcc.a build.

And I just thought about it and because _divsi3 and _modsi3 are, as it
seems, written in assembly, they are probably already hardcoded to use
the HW floating unit (FPA).

Could you please explain to me if there is a solution to the problem?
I am using gcc branch 4.2 from SVN (and binutila 2.18). My target is
arm-elf.

Thanks,
Boris DuÅek

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]