[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: --enable-default-pie breaks kernel build on amd64

On Thu, 20 Oct 2016 19:05:51 +0200 Gianfranco Costamagna <locutusofborg@debian.org> wrote:
> control: severity -1 normal
> control: reassign -1 src:linux
> control: affects -1 gcc-6
> Hi Linux Kernel maintainers,
> as you already know, the default PIE flag breaks the kernel build, can I suggest you to apply a similar patch
> to the one that Ubuntu appplied some time ago?
> https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1574982/comments/39

Many Debian users do not use our packaged kernel, so working around
this in src:linux does not solve the problem.  The default compiler in
Debian *must* be able to compile the upstream Linux kernel.  I will not
accept any patches for this that have not been accepted upstream.

A better approach might be to make -mcmodel=kernel automatically
override the default of -fPIE.


> --- a/Makefile
> +++ b/Makefile
> @@ -612,6 +612,12 @@ endif # $(dot-config)
>  # Defaults to vmlinux, but the arch makefile usually adds further targets
>  all: vmlinux
> +# force no-pie for distro compilers that enable pie by default
> +KBUILD_CFLAGS += $(call cc-option, -fno-pie)
> +KBUILD_CFLAGS += $(call cc-option, -no-pie)
> +KBUILD_AFLAGS += $(call cc-option, -fno-pie)
> +KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)
> +
>  # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default
>  # values of the respective KBUILD_* variables
> thanks
> Gianfranco

Ben Hutchings
Never put off till tomorrow what you can avoid all togethe

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: