GP2X Gp2x Assembly Programming


MiniMoose

Member
Joined
Oct 18, 2005
Messages
125
I've been playing around with writing some assembly language code for the GP2X and I've run into a peculiar problem. I'm using the arm-linux-as assembler to assemble my source into .o files but when I try to link them with .o files created by compiling C source with arm-linux-gcc, I get the following error:

ERROR: fxdmath.o uses hardware FP, whereas test uses software FP

After googling around I figured out that this is a "feature" of GCC to prevent the linking of objects compiled with conflicting floating point settings (soft-float/hard-float).

My assembly code doesn't use any of the floating point instructions:

Code:
    .align  2                   /* word alignment               */
    .global fxdAdd              /* make fxAdd a global symbol   */
    .type   fxdAdd, %function   /* declare fxdAdd as a function */
fxdAdd:
    add r0, r0, r1              /* r0 = r0 + r1                 */
    bx  lr                      /* return                       */
    .size   fxdAdd, .-fxdAdd    /* calculate size of fxdAdd     */

Does anybody know how to get the GNU assembler to add the magic bits into the object files it creates so that the GNU linker doesn't complain?
 
Would it not be an option passed to the assembler ? Something like -mno_fpu ? Sorry not familiar with anything newer than the 68k, and have forgotten that. (zzzzzzzzzz dozes off in his bath chair).

The arthritic old fingers were too slow - listen to Squidge, he understands these new fangled chips.
 
Squidge posted on Dec 21 2005 at 06:56 PM said:
Try adding "-msoft-float" to your assembler command line.
Error: unrecognized option -msoft-float

I tried that already...that's why I posted a message on the boards.
 
Last edited by a moderator:
Mr.Jabberwocky posted on Dec 21 2005 at 07:01 PM said:
Would it not be an option passed to the assembler ? Something like -mno_fpu ? Sorry not familiar with anything newer than the 68k, and have forgotten that. (zzzzzzzzzz dozes off in his bath chair).

The arthritic old fingers were too slow - listen to Squidge, he understands these new fangled chips.
Give the man a cigar! -mno_fpu seems to work. Thanks.
 
Last edited by a moderator:
Back
Top