我一直在尝试在Ubuntu 16.10上编译最新的Linux v4.8.9内核,在我设置默认.config,使用menuconfig对其进行修改并自行运行make之后,该错误不断弹出。解压缩文件后,我也立即运行make mrproper。这是我运行make之后的输出:
scripts/kconfig/conf --silentoldconfig Kconfig
SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_32_ia32.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_64_x32.h
SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_64.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_64.h
SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
CHK include/config/kernel.release
UPD include/config/kernel.release
WRAP arch/x86/include/generated/asm/clkdev.h
WRAP arch/x86/include/generated/asm/cputime.h
WRAP arch/x86/include/generated/asm/dma-contiguous.h
WRAP arch/x86/include/generated/asm/early_ioremap.h
WRAP arch/x86/include/generated/asm/mcs_spinlock.h
WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
CC kernel/bounds.s
kernel/bounds.c:1:0: error: code model kernel does not support PIC mode
/*
Kbuild:45: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:1015: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
我还尝试在make命令后使用-no-pie选项进行编译,但它会呈现出一组新错误,并不断说“缺少目标”。我有gcc版本6.2.0。我还安装了gcc-5,因为我在一开始就认为这可能是因为gcc太新了,但gcc-5仍然存在相同的问题。邮件列表或另一个论坛中的某个人提到,通过直接从git克隆解决了问题,但这对我的情况也没有帮助。
我很好奇是否有人遇到了这个问题,如果可以,可能的解决方法是什么?
注意:如果这可能是问题的根源,我正在Mac上的Virtualbox中运行Ubuntu。