I've been trying to compile the latest Linux Kernel, v4.8.9 but I keep encountering this error after I run 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: *** [kernel/bounds.s] Error 1 Makefile:1015: recipe for target 'prepare0' failed make: *** [prepare0] Error 2
I have Ubuntu 16.10 running in VirtualBox on a MacBook Pro. I'm using GCC version 6.2.0. I've made sure to run "make mrproper" right after I untarred the file and I've gone through both "make defconfig" and "make menuconfig" before running the actual "make" command by itself.
From the research that I've done on the error, I've gotten a myriad of unrelated fixes for it. One involved directly cloning from source through git but that didn't work for me either. I understand that PIC means Position Independent Code but if I'm correct, I believe GCC 6 is supposed to support that function.
Compiling with "-no-pie" seems to help but I always get these "missing target" errors.
I'm curious if this a problem other people had and what a possible solution for it might be.