Cross compilation for x86 hand

I am trying to insert a .ko kernel .ko in linux running on an arm processor. I created a .ko file on a desktop PC, which is x86. How to cross it to pick up the specifications. I am new to this area.

Thank you in advance

+4
source share
2 answers

To do this, you must first download the ARM compilers. I suggest you download the compiler from http://www.linaro.org/downloads/ , and then set the CROSS_COMPILE environment variable to arm-linux-gcc.

set the bin directory path in the PATH variable. You can do this by exporting PATH = $ PATH: / path / to / arm / binaries /

Finally, compile the code, then run in ARM.

use file <filename> regardless of whether it is ARM executable or not.

+5
source

To do this, you need to follow these steps.

  • Check if you have a cross compiler toolchain or not. If you do not have a cross-compiler toolchain, you can download it from one of the free ARM cross-compiler from the network. You can create your own tool chain using the Buildroot tool. Below you can get a link to the Buildroot user guide. http://buildroot.uclibc.org/downloads/manual/manual.html#_using_buildroot

  • Install cross-chaining tools on your PC.

  • Export the cross-tool chain path to the host using the export command.

  • Modify the kernel module make file to set the compiler as CROSS_COMPILE.

  • Do it.

  • Move the .ko file to the target and paste it.

+5
source

All Articles