Bug#841533: gcc-6: versions 6.2.0-[7-9] break construction of linux kernel with -fstack-protector-xxxx
Hi, this is caused by -fPIC by default in latest debian packages. Kernel build fails because -fPIC is incompatible with -mcmodel=kernel . Example command line used for -fstack-protector test follows: gcc -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -O2 -fstack-protector -fomit-frame-pointer -DCC_HAVE_ASM_GOTO -fstack-protector -c -x c /dev/null -o .18640.tmp -- Jindřich Makovička
Bug#841533: gcc-6: versions 6.2.0-[7-9] break construction of linux kernel with -fstack-protector-xxxx
On 10/21/16 15:52, Paul Menzel wrote: On 10/21/16 13:43, Jean-Luc Coulon (f5ibh) wrote: Since 6.2.0-7, building the linux kernel (4.8.3 in my case) with --fstack-protector-strong or -fstack-protector fails. I've tested wit h 6.2.0-7 and 6.2.0-9. The I've reverted to 6.2.0-6 and it works fine. Since gcc-6 6.2.0-7, I am also unable to build coreboot or SeaBIOS. ``` $ git clone git://git.seabios.org/seabios.git $ cd seabios $ make menuconfig # choose coreboot $ make -j […] src/stacks.c: Assembler messages: src/stacks.c:567: Error: found '(', expected: ')' src/stacks.c:567: Error: junk `(%ebp))' after expression src/stacks.c:568: Warning: indirect call without `*' Makefile:133: recipe for target 'out/src/stacks.o' failed make: *** [out/src/stacks.o] Error 1 ``` I build the snapshot GCC 6-20161020 [1] from scratch, and SeaBIOS builds fine with that, so it looks like a Debian problem. Kind regards, Paul [1] ftp://gcc.gnu.org/pub/gcc/snapshots/6-20161020/
Bug#841533: gcc-6: versions 6.2.0-[7-9] break construction of linux kernel with -fstack-protector-xxxx
Control: found -1 6.2.0-7 Dear Debian folks, On 10/21/16 13:43, Jean-Luc Coulon (f5ibh) wrote: Since 6.2.0-7, building the linux kernel (4.8.3 in my case) with --fstack-protector-strong or -fstack-protector fails. I've tested wit h 6.2.0-7 and 6.2.0-9. The I've reverted to 6.2.0-6 and it works fine. Since gcc-6 6.2.0-7, I am also unable to build coreboot or SeaBIOS. ``` $ git clone git://git.seabios.org/seabios.git $ cd seabios $ make menuconfig # choose coreboot $ make -j […] src/stacks.c: Assembler messages: src/stacks.c:567: Error: found '(', expected: ')' src/stacks.c:567: Error: junk `(%ebp))' after expression src/stacks.c:568: Warning: indirect call without `*' Makefile:133: recipe for target 'out/src/stacks.o' failed make: *** [out/src/stacks.o] Error 1 ``` Kind regards, Paul
Bug#841533: gcc-6: versions 6.2.0-[7-9] break construction of linux kernel with -fstack-protector-xxxx
Package: gcc-6 Version: 6.2.0-9 Severity: important Hi, Since 6.2.0-7, building the linux kernel (4.8.3 in my case) with --fstack-protector-strong or -fstack-protector fails. I've tested wit h 6.2.0-7 and 6.2.0-9. The I've reverted to 6.2.0-6 and it works fine. -- System Information: Debian Release: stretch/sid APT prefers buildd-unstable APT policy: (500, 'buildd-unstable'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernelving directory '/usr/src/linux-4.8.3' make EXTRAVERSION=-i7-1 ARCH=x86_64 prepare make[2]: Entering directory '/usr/src/linux-4.8.3' 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 Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler Makefile:1048: recipe for target 'prepare-compiler-check' failed make[2]: *** [prepare-compiler-check] Error 1 make[2]: Leaving directory '/usr/src/linux-4.8.3' debian/ruleset/targets/common.mk:194: recipe for target 'debian/stamp/conf/kernel-conf' failed --- Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler Makefile:1048: recipe for target 'prepare-compiler-check' failed make[2]: *** [prepare-compiler-check] Error 1 make[2]: Leaving directory '/usr/src/linux-4.8.3' debian/ruleset/targets/common.mk:194: recipe for target 'debian/stamp/conf/kernel-conf' failed ---: Linux 4.8.3-i7-0.1 (SMP w/8 CPU cores; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages gcc-6 depends on: ii binutils 2.27-9 ii cpp-6 6.2.0-9 ii gcc-6-base6.2.0-9 ii libc6 2.24-5 ii libcc1-0 6.2.0-9 ii libgcc-6-dev 6.2.0-9 ii libgcc1 1:6.2.0-9 ii libgmp10 2:6.1.1+dfsg-1 ii libisl15 0.17.1-1 ii libmpc3 1.0.3-1 ii libmpfr4 3.1.5-1 ii libstdc++66.2.0-9 ii zlib1g1:1.2.8.dfsg-2+b1 Versions of packages gcc-6 recommends: ii libc6-dev 2.24-5 Versions of packages gcc-6 suggests: pn gcc-6-doc pn gcc-6-locales ii gcc-6-multilib6.2.0-9 pn libasan3-dbg pn libatomic1-dbg pn libcilkrts5-dbg pn libgcc1-dbg pn libgomp1-dbg pn libitm1-dbg pn liblsan0-dbg pn libmpx2-dbg pn libquadmath0-dbg pn libtsan0-dbg pn libubsan0-dbg -- no debconf information