【P1010】 How to compile kernel module

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

【P1010】 How to compile kernel module

ソリューションへジャンプ
2,237件の閲覧回数
luyufan498
Contributor I

make -C /home/yflu/linux-3.10.48 M=/home/yflu/hello modules ARCH=powerpc CROSS_COMPILE=powerpc-fsl-linux-gnuspe-

make[1]: Entering directory `/home/yflu/linux-3.10.48'

  Building modules, stage 2.

  MODPOST 1 modules

  LD [M]  /home/yflu/hello/mo.ko

powerpc-fsl-linux-gnuspe-ld: unrecognized option '-Wl,-O1'

powerpc-fsl-linux-gnuspe-ld: use the --help option for usage information

make[2]: *** [/home/yflu/hello/mo.ko] Error 1

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

make[1]: Leaving directory `/home/yflu/linux-3.10.48'

make: *** [all] Error 2

0 件の賞賛
返信
1 解決策
1,975件の閲覧回数
bpe
NXP Employee
NXP Employee

Your linker for some reason receives options that should rather be interpreted by GCC. This may happen

due to wrong makefiles or environment variables. Suggestions:

1. Check the Makefile or Kbuild in your module source directory. One of them must be present. See Section 3 of this:

https://www.kernel.org/doc/Documentation/kbuild/modules.txt

2. Use the kernel and the toolchain from QorIQ SDK.

3. Make sure you successfully built the kernel for the selected target before attempting to build an external module.

4. Refer to the following links for general information:

https://www.kernel.org/doc/Documentation/kbuild/modules.txt

Compiling Kernel Modules


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,976件の閲覧回数
bpe
NXP Employee
NXP Employee

Your linker for some reason receives options that should rather be interpreted by GCC. This may happen

due to wrong makefiles or environment variables. Suggestions:

1. Check the Makefile or Kbuild in your module source directory. One of them must be present. See Section 3 of this:

https://www.kernel.org/doc/Documentation/kbuild/modules.txt

2. Use the kernel and the toolchain from QorIQ SDK.

3. Make sure you successfully built the kernel for the selected target before attempting to build an external module.

4. Refer to the following links for general information:

https://www.kernel.org/doc/Documentation/kbuild/modules.txt

Compiling Kernel Modules


Have a great day,
Platon

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信