This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EABI version error on compiling RT2070 USB WiFi driver

Hello,

I'm trying to build the RT2070 USB WiFi module's driver for MVL4.0.1 (kernel 2.6.10) for DM355. All the necessary files get compiled until the last part where the linker tries to generate the rt2070sta.ko kernel module.

I tried this with the toolchain that comes with MVL4.0.1 (gcc version 3.4.3, ld version 2.15.94 20041215), and the error I got was:

 


  CC [M]  /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/../../common/rtmp_mcu.o

  LD [M]  /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.o

  Building modules, stage 2.

  MODPOST

  LD [M]  /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.ko

arm_v5t_le-ld: Segmentation fault

make[2]: *** [/home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.ko] Error 139

make[1]: *** [modules] Error 2

make[1]: Leaving directory `/home/kapil/Work/netFox_kernel2.6.10'

make: *** [LINUX] Error 2


This looked like a problem with the linker not handling some problem with the driver code properly. So in order to get more detailed information about the problem, I decided to use the MVL5.0 toolchain (gcc version 4.2.0, ld version 2.17.50 20070611). With this toolchain, I first re-compiled the MVL4.0.1 kernel 2.6.10:
$ make distclean
$ make ARCH=arm CROSS_COMPILE=arm_v5t_le- uImage
$ make ARCH=arm CROSS_COMPILE=arm_v5t_le- modules
$ make ARCH=arm CROSS_COMPILE=arm_v5t_le- INSTALL_MOD_PATH=/home/kapil/Work/dm355fsnew modules_install
Then I re-built the RT2070 driver code. The error I got this time was:

  LD [M]  /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.o
  Building modules, stage 2.
  MODPOST
  LD [M]  /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.ko
arm_v5t_le-ld: ERROR: Source object /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.mod.o has EABI version 4, but target /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.ko has EABI version 0
arm_v5t_le-ld: failed to merge target specific data of file /home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.mod.o
make[2]: *** [/home/kapil/Work/RT3070_LinuxSTA_V2.3.0.1_20100208/os/linux/rt2070sta.ko] Error 1
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/kapil/Work/netFox_kernel2.6.10'
make: *** [LINUX] Error 2

I read somewhere that the order of files given on the command line to the linker can make a difference. So I tried the following 2 manually (instead of running make):
kapil@kapil-desktop:~/Work/RT3070_LinuxSTA_V2.3.0.1_20100208$ arm_v5t_le-ld -EL -r -o os/linux/rt2070sta.ko os/linux/rt2070sta.mod.o os/linux/rt2070sta.o arm_v5t_le-ld: ERROR: Source object os/linux/rt2070sta.o has EABI version 0, but target os/linux/rt2070sta.ko has EABI version 4
arm_v5t_le-ld: failed to merge target specific data of file os/linux/rt2070sta.o
kapil@kapil-desktop:~/Work/RT3070_LinuxSTA_V2.3.0.1_20100208$ arm_v5t_le-ld -EL -r -o os/linux/rt2070sta.ko os/linux/rt2070sta.o os/linux/rt2070sta.mod.o 
arm_v5t_le-ld: ERROR: Source object os/linux/rt2070sta.mod.o has EABI version 4, but target os/linux/rt2070sta.ko has EABI version 0
arm_v5t_le-ld: failed to merge target specific data of file os/linux/rt2070sta.mod.o
This indicates that the EABI version selected for the output file rt2070.ko seems to be the EABI version of the first input file on the command line. To confirm this, I ran the "arm_v5t_le-readelf" tool with the -h option on both the input files (rt2070.o and rt2070.mod.o).
Indeed, the rt2070sta.o has EABI version 0 (Flags: 0x604, GNU EABI, interworking enabled, software FP, VFP), and the rt2070.mod.o has EABI version 4 (Flags: 0x4000000, Version4 EABI).

Now my question is, if the same toolchain is generating both the rt2070.o and rt2070.mod.o, why are the EABI versions different? I even tried to set the -fabi-version command line parameter in the CFLAGS in Makefile to try and force the EABI of both files to same value, but that did not seem to make any difference.
I have downloaded the driver from RaLink's website (http://www.ralinktech.com/support.php?s=2)
Can someone kindly help me find solution to this problem? I think I might be missing something very silly here. Maybe some tweak in the Makefile?
Kindly help me out. Many thanks!
Best regards,
Kapil