LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Linking (ld) syntax and Floating Point crosscompile question (http://www.linuxquestions.org/questions/linux-software-2/linking-ld-syntax-and-floating-point-crosscompile-question-731419/)

Caesurus 06-08-2009 08:36 AM

Linking (ld) syntax and Floating Point crosscompile question
 
Hi,

I'm working on compiling some code from a vendor. They provide a library to link to which I presume was compiled with a gcc 2.9 cross compiler.

I'm having trouble understanding something. Any help or hints would be greatly appreciated. Here is the problem...

The library is supposedly compiled with hard-floating point:

Code:

$ arm-linux-gnu-objdump -p mylib.lib
mylib.lib:    file format elf32-littlearm
private flags = 0: [APCS-32] [FPA float format]

my driver .o files are compiled with soft-float

Code:

$ arm-linux-gnu-objdump -p sm_drv.o
sm_drv.o:    file format elf32-littlearm
private flags = 200: [APCS-32] [FPA float format] [software FP]

Now... when I try to link the two files I get the following, very understandable, error:

Code:

$ arm-linux-gnu-ld -r -o test.o sm_drv.o mylib.lib
arm-linux-gnu-ld: ERROR: mylib.lib uses hardware FP, whereas test.o uses software FP
arm-linux-gnu-ld: failed to merge target specific data of file mylib.lib

BUT... and here is what I don't understand, if I link as follows:
Code:

$ arm-linux-gnu-ld mylib.lib -r -o test.o sm_drv.o
I am able to link the two and the resulting test.o file is:

Code:

$ arm-linux-gnu-objdump -p test.o
test.o:    file format elf32-littlearm
private flags = 200: [APCS-32] [FPA float format] [software FP]

Why is this???

I appreciate the fact that I can ask the vendor to recompile the library for me with my toolchain and my compile flags, but that's not the question here.

Any clues would be greatly appreciated.

Thanks,


All times are GMT -5. The time now is 04:47 AM.