我有一个由硬件供应商根据版本2.6.18修改的自定义Linux内核。我需要使用最新版本的 uClibc 为MIPS架构生成一个新的工具链。
我选择了crosstool-ng工具来简化这个过程,但它在生成过程中失败了。这是错误部分的日志:
[INFO ] =================================================================
[INFO ] Installing kernel headers
[DEBUG] Using kernel's headers_install
[EXTRA] Installing kernel headers
[DEBUG] ==> Executing: 'make' '-C' '/home/myuser/sources/custom-linux/toolchain/.build/src/linux-custom' 'O=/home/myuser/sources/custom-linux/toolchain/.build/mipsel-unknown-linux-uclibc/build/build-kernel-headers' 'ARCH=mips' 'INSTALL_HDR_PATH=/home/myuser/x-tools/mipsel-unknown-linux-uclibc/mipsel-unknown-linux-uclibc/sysroot/usr' 'V=0' 'headers_install'
[ALL ] make[1]: Entering directory `/home/myuser/sources/custom-linux/stblinux-2.6.18'
[ALL ] CHK include/linux/version.h
[ALL ] UPD include/linux/version.h
[ALL ] *** Error: Headers not exportable for this architecture (mips)
[ERROR] make[2]: *** [headers_install] Error 1
[ERROR] make[1]: *** [headers_install] Error 2
[ALL ] make[1]: Leaving directory `/home/myuser/sources/custom-linux/stblinux-2.6.18'
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Installing kernel headers'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@257]
[ERROR] >> called from: do_kernel_install[scripts/build/kernel/linux.sh@112]
[ERROR] >> called from: do_kernel_headers[scripts/build/kernel/linux.sh@91]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@632]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> '/home/myuser/.local/share/doc/crosstool-ng/ct-ng.hg+default-20f2459b97bf/B - Known issues.txt'
[ERROR]
[ERROR] (elapsed: 41:41.63)
该问题似乎与 *headers_install* 规则有关。我认为它是在特定版本的内核中引入的。有趣的事实是,如果我跑
make ARCH=mips INSTALL_HDR_PATH=... headers_install
标头将安装得很好。该问题似乎与使用O=参数有关。有谁知道它是干什么用的?这个问题有解决方法吗?