Bug 196689
Summary: | 4.12.5 compile fails -- Error: instruction `andn' isn't supported in 16-bit mode. | ||
---|---|---|---|
Product: | Other | Reporter: | Alex (fhlfibh) |
Component: | Other | Assignee: | other_configuration (other_configuration) |
Status: | CLOSED INVALID | ||
Severity: | normal | CC: | rdunlap |
Priority: | P1 | ||
Hardware: | x86-64 | ||
OS: | Linux | ||
URL: | https://bugs.gentoo.org/show_bug.cgi?id=627890 | ||
Kernel Version: | 4.12.5 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
kernel config
/proc/cpuinfo cpucheck.S cpucheck.SV (verbose) |
Description
Alex
2017-08-17 10:43:55 UTC
Created attachment 257991 [details]
/proc/cpuinfo
Tried to debug this issue following this https://sourceware.org/bugzilla/show_bug.cgi?id=17421 With "make V=1 -j1" The last command before fail is: ------------------------------------------------------------------ gcc -Wp,-MD,arch/x86/boot/.cpucheck.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include -I./arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -O2 -march=native -fno-stack-protector -fomit-frame-pointer -m16 -g -Os -D__KERNEL__ -DDISABLE_BRANCH_PROFILING -Wall -Wstrict-prototypes -march=i386 -mregparm=3 -fno-strict-aliasing -fomit-frame-pointer -fno-pic -mno-mmx -mno-sse -ffreestanding -fno-stack-protector -D_SETUP -DKBUILD_BASENAME='"cpucheck"' -DKBUILD_MODNAME='"cpucheck"' -c -o arch/x86/boot/cpucheck.o arch/x86/boot/cpucheck.c --------------------------------------------------------------- Adjusted it to get asm source: ------------------------------------------------------------------ gcc -Wp,-MD,arch/x86/boot/.cpucheck.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include -I./arch/x86/include -I./arch/x86/include/generated/uapi -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -O2 -march=native -fno-stack-protector -fomit-frame-pointer -m16 -g -Os -D__KERNEL__ -DDISABLE_BRANCH_PROFILING -Wall -Wstrict-prototypes -march=i386 -mregparm=3 -fno-strict-aliasing -fomit-frame-pointer -fno-pic -mno-mmx -mno-sse -ffreestanding -fno-stack-protector -D_SETUP -DKBUILD_BASENAME='"cpucheck"' -DKBUILD_MODNAME='"cpucheck"' -c -S -o arch/x86/boot/cpucheck.S arch/x86/boot/cpucheck.c ----------------------------------------------------------------- Compiling the resulted cpucheck.S gives (almost) the same errors: ------------------------------------------------------------------- # as arch/x86/boot/cpucheck.S -c -o temp.o arch/x86/boot/cpucheck.S: Assembler messages: arch/x86/boot/cpucheck.S:32: Error: instruction `andn' isn't supported in 16-bit mode. arch/x86/boot/cpucheck.S:40: Error: instruction `shlx' isn't supported in 16-bit mode. arch/x86/boot/cpucheck.S:84: Error: register save offset not a multiple of 8 arch/x86/boot/cpucheck.S:91: Error: register save offset not a multiple of 8 ---------------------------------------------------------------- Adjusted the command again to get more verbose asm source. Compiling cpucheck.SV also shows the same errors: ------------------------------------------------------------------------ # as arch/x86/boot/cpucheck.SV -c -o temp.o arch/x86/boot/cpucheck.SV: Assembler messages: arch/x86/boot/cpucheck.SV:105: Error: instruction `andn' isn't supported in 16-bit mode. arch/x86/boot/cpucheck.SV:113: Error: instruction `shlx' isn't supported in 16-bit mode. arch/x86/boot/cpucheck.SV:157: Error: register save offset not a multiple of 8 arch/x86/boot/cpucheck.SV:164: Error: register save offset not a multiple of 8 ------------------------------------------------------------------------------- Both cpucheck.S and cpucheck.SV are attached and they do have the specified instructions in specified lines. However, I still have no idea how to fix it. Created attachment 258003 [details]
cpucheck.S
Created attachment 258005 [details]
cpucheck.SV (verbose)
It seems to me something is wrong with AND NOT and left shift in this function of cpucheck.c: ----------------------------------------------------------------------- /* Returns a bitmask of which words we have error bits in */ static int check_cpuflags(void) { u32 err; int i; err = 0; for (i = 0; i < NCAPINTS; i++) { err_flags[i] = req_flags[i] & ~cpu.flags[i]; if (err_flags[i]) err |= 1 << i; } return err; } ------------------------------------------------------------------------ The bug finally landed here https://sourceware.org/bugzilla/show_bug.cgi?id=21965 4.12.5 builds with gcc-5.4.0 and '--march=broadwell' Sorry, kernel guys. Regards, Alex Needs newer gcc or don't use -march=native. |