我尝试在 Ubuntu 16.04 LTS 上编译 Linux 内核 3.10.31。 我曾经在 Ubuntu 12.04 LTS 上编译完全相同的内核,一切运行良好。
在 Ubuntu 16.04 上,gcc 版本为 gcc-5
;
在 Ubuntu 12.04 上,gcc 版本是 gcc-4.6
。
Linux kernel 3.18之前的kernel好像不能用gcc-5
编译。 kernel 3.10.31用make
fatal error: linux/compiler-gcc5.h: No such file or directory
我尝试将 gcc-4.7 安装到 Ubuntu 16.04 上,并将 /usr/bin/gcc
更改为指向 gcc-4.7。这可以解决上述错误。但是,在我运行 make
$linux/arch/x86/Makefile:98: stack protector enabled but no compiler support
make[1]: Nothing to be done for 'all'.
make[1]: Nothing to be done for 'relocs'.
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
CC kernel/bounds.s
gcc-4.7.real: error: unrecognized command line option ‘-no-pie’
linux/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:835: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
我的问题是:
有没有一种巧妙的方法可以使用旧的编译链在 Ubuntu 16.04 上编译旧的内核 3.10.31?
非常感谢您的帮助!非常感谢任何建议。
最佳答案
关于linux - 在 Ubuntu 16.04 LTS 上编译旧的 Linux 内核,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37802473/