2016-05-25 Magnus Granberg #584014 sys-kernel/gentoo-sources-4.6.0: building w/gcc-6[pie]: kernel/bounds.c:1:0: error: code model kernel does not support PIC mode * Makefile: Add -fno-PIE --- a/Makefile 2016-05-24 00:42:31.208000000 +0200 +++ b/Makefile 2016-05-24 00:24:23.023000000 +0200 @@ -674,6 +674,11 @@ endif endif KBUILD_CFLAGS += $(stackp-flag) +# On gcc 6.1 with --enable-default-pie set we need to pass +# -fno-pie -no-pie +KBUILD_AFLAGS += $(call as-option, -fno-PIE) +KBUILD_CFLAGS += $(call cc-option, -fno-PIE) + ifdef CONFIG_KCOV ifeq ($(call cc-option, $(CFLAGS_KCOV)),) $(warning Cannot use CONFIG_KCOV: \