Control: tags -1 - patch 2016-10-20 18:48 GMT+02:00 Sven Joachim <svenj...@gmx.de>: > On 2016-10-20 17:54 +0200, Bálint Réczey wrote: > >> Control: reassign -1 linux 4.7.8-1 >> Control: severity -1 serious >> Control: tags -1 patch >> >> Hi David, >> >> 2016-10-20 14:02 GMT+02:00 David Weinehall <t...@debian.org>: >>> Package: gcc-6 >>> Severity: important >>> Version: 6.2.0-7 >>> >>> --enable-default-pie (first enabled in gcc-6 6.2.0-7) causes kernel >>> builds to fail. If the kernel is configured with the stack protector >>> enabled it'll fail with a rather unhelpful error message claiming >>> that the compiler doesn't support -fstack-protector, >>> but the problem is in fact caused by: >>> >>> kernel/bounds.c:1:0: error: code model kernel does not support PIC mode >>> >>> (The kernel is built with -mcmodel=kernel) >>> >>> I think it's fair to say that the kernel is kind of an important piece >>> of software and that it's imperative that we don't break kernel builds... >> >> The kernel is very important indeed and it did break in our build test. >> I'm sorry, somehow I missed filing bug for the linux package, just for >> user-mode-linux. >> The following patch fixes the FTBFS: >> >> --- linux-4.7.8/debian/rules.d/Makefile.inc >> +++ linux-4.7.8/debian/rules.d/Makefile.inc >> @@ -5,7 +5,8 @@ >> >> SHELL = /bin/sh -e >> >> -CC = $(CROSS_COMPILE)gcc >> +CC = $(CROSS_COMPILE)gcc -no-pie >> +LD = $(CROSS_COMPILE)ld -no-pie >> CXX = $(CROSS_COMPILE)g++ >> CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall >> CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) \ >> >> Maybe the ld part is obsolete, I have not checked that. > > That patch might work for the Debian package, but has anybody contacted > the upstream kernel developers about that? At least the 4.8.3 vanilla > kernel fails in the same way, I haven't tested 4.9-rc1 yet.
Fixing it upstream would certainly be better. I also haven't booted the built image, thus please use this patch only as inspiration. :-) Cheers, Balint > > FWIW, this issue has been discussed in Ubuntu for six months(!), see > https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/1574982. > > Cheers, > Sven