Find the answer to your Linux question:
Results 1 to 5 of 5
can anyone tell me what command I have to enter for building a module?? 1)I've installed the tool chain 2)I've set the path 3) Then I had written a simple ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2010
    Posts
    4

    Command for cross compilation to build the module for simple hello program


    can anyone tell me what command I have to enter for building a module??

    1)I've installed the tool chain

    2)I've set the path

    3) Then I had written a simple hello module program & Makefile

    4)CROSS_COMPILE=arm-linux- ARCH=arm make used this one for cross compilation...

    5) I'm getting the error that I've posted below

    make -C /lib/modules/2.6.31.5/build M=/root/Char modules
    make[1]: arm-linux-gcc: Command not found
    make[1]: Entering directory `/usr/src/linux-2.6.31.5'
    CC [M] /root/Char/char.o
    /bin/sh: arm-linux-gcc: command not found
    make[2]: *** [/root/Char/char.o] Error 127
    make[1]: *** [_module_/root/Char] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.31.5'
    make: *** [all] Error 2


    so could you please again help me where I was going wrong & how to compile the module(

  2. #2
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85
    I think you have missed the complete path for the argument CROSS_COMPILE, it requires the complete path of you gcc.

  3. #3
    Just Joined!
    Join Date
    Sep 2010
    Posts
    4

    Hi maheshgupta024

    I'm newbie on this field. whatever the technique of compilation I saw on net, that I tried it but my program is still not compiled successfully.Could you please tell me the cross compilation procedure step by step on ARM9 board(it's urgent for me)

    Regards
    Shreyas

  4. #4
    Just Joined!
    Join Date
    Oct 2009
    Posts
    85
    Quote Originally Posted by karmahe View Post
    can anyone tell me what command I have to enter for building a module??

    1)I've installed the tool chain

    2)I've set the path

    3) Then I had written a simple hello module program & Makefile

    4)CROSS_COMPILE=arm-linux- ARCH=arm make used this one for cross compilation...

    5) I'm getting the error that I've posted below

    make -C /lib/modules/2.6.31.5/build M=/root/Char modules
    make[1]: arm-linux-gcc: Command not found
    make[1]: Entering directory `/usr/src/linux-2.6.31.5'
    CC [M] /root/Char/char.o
    /bin/sh: arm-linux-gcc: command not found
    make[2]: *** [/root/Char/char.o] Error 127
    make[1]: *** [_module_/root/Char] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.31.5'
    make: *** [all] Error 2


    so could you please again help me where I was going wrong & how to compile the module(

    See the problem here is
    make[1]: arm-linux-gcc: Command not found
    for CROSS_COMPILE variable, you have to give the complete path.
    for example if the toolchain is installed in the /usr/timsys/
    then the gcc should be in /usr/timesys/XX/xXX/bin folder (I think you have to find that path for the arm-linux-gcc, use the find command). then the path should be include to CROSS_COMPILE variable. Its not a big thing.
    Point is to search for the arm-linux-gcc compiler. and add to the CROSS_COMPILE thats it.

  5. #5
    Just Joined!
    Join Date
    Sep 2010
    Posts
    2
    Try this:

    On your terminal type

    echo $PATH

    On my system I get:

    /usr/local/xtools/arm-unknown-linux-uclibcgnueabi/bin:~/scripts:/usr/local/sbin:/usr/local/bin:/usr /sbin:/usr/bin:/sbin:/bin:/usr/games

    Now can you see the '/usr/local/xtools/arm-unknown-linux-uclibcgnueabi/bin' ?
    That is where you can find the 'arm' toolchain on my system.

    Initially try adjusting the PATH variable manually and see if the problem is fixed.

    If so make the change permanent in the appropriate shell startup file. I added the following line
    in my .profile file:

    # including the path for the toolchain generated by crosstools-ng
    export PATH=/usr/local/xtools/arm-unknown-linux-uclibcgnueabi/bin:~/scripts:$PATH

    I hope I was able to help

    humbly yours


    dar_beh_dar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •