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.

Fail to crosscompile a LKM module for sitara

I successfully compiled this module on another installation two months ago, and now I can no longer do it. What could I be doing wrong?

So, starting with a new installation, I do (on a Ubuntu 3.11.0-14-generic)

$ CROSS_COMPILE=/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/arm-linux-gnueabihf/bin/

$ KERNELDIR=../board-support/linux-3.2.0-psp04.06.00.11
$ PATH=${PATH}:/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/

$ make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi- -C $KERNELDIR prepare

   (i needed to run this to avoid a kernel invalid error)

~/ti-sdk-am335x-evm-06.00.00.00/AWB$ make ARCH=arm -C $KERNELDIR M=$PWD modules
make: Entering directory `/home/melody/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11'

  WARNING: Symbol version dump /home/melody/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /home/melody/ti-sdk-am335x-evm-06.00.00.00/AWB/AWB.o
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
make[1]: *** [/home/melody/ti-sdk-am335x-evm-06.00.00.00/AWB/AWB.o] Error 1
make: *** [_module_/home/melody/ti-sdk-am335x-evm-06.00.00.00/AWB] Error 2
make: Leaving directory `/home/melody/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11'

  • Hi,

    The cross compile toolchain prefix is arm-linux-gnueabihf- but I can see that you are using arm-arago-linux-gnueabi-.

    I also can't understand why do you first set the $CROSS_COMPILE variable to be pointing at /home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/arm-linux-gnueabihf/bin/. The toolchain is actually located in <sdk_dir>/linux-devkit/sysroots/i686-arago-linux/usr/bin/ but this should be appended to the $PATH variable, as you have done on one of the next lines. The CROSS_COMPILE should be set to arm-linux-gnueabihf-.

    Best regards,
    Miroslav

  • Thanks. I still get the same errors about those flags I do not set anywhere:

    AWB $ make ARCH=arm -C $KERNELDIR M=$PWD modules
    make: Entering directory `/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11'
      CC [M]  /home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/AWB/AWB.o
    gcc: error: unrecognized command line option ‘-mlittle-endian’
    gcc: error: unrecognized command line option ‘-mapcs’
    gcc: error: unrecognized command line option ‘-mno-sched-prolog’
    gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
    gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
    gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
    make[1]: *** [/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/AWB/AWB.o] Error 1
    make: *** [_module_/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/AWB] Error 2
    make: Leaving directory `/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/board-support/linux-3.2.0-psp04.06.00.11'
    AWB $ CROSS_COMPILE=arm-linux-gnueabihf-
    AWB $ echo $CROSS_COMPILE
    arm-linux-gnueabihf-
    AWB $ echo $PATH
    /opt/jdk1.7.0_11/bin/:/home/msilaghi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/sbin/:/home/msilaghi/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/
    AWB $ echo $KERNELDIR
    ../board-support/linux-3.2.0-psp04.06.00.11

  • Hi,

    It seems like the "make" command is invoking the native gcc compiler instead of the arm-linux-gnueabihf-gcc compiler, so these command line options make no sense to the native gcc compiler. Please pass the CROSS_COMPILE variable to the make command when you run it.

    Best regards,
    Miroslav