Bug 205103

Summary: Kernel 5.3.x fails to compile with binutils 2.20 and below
Product: Platform Specific/Hardware Reporter: James Brown (jbrown)
Component: x86-64Assignee: platform_x86_64 (platform_x86_64)
Status: NEW ---    
Severity: normal CC: bp
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.3.4 Tree: Mainline
Regression: No

Description James Brown 2019-10-06 19:55:39 UTC
"entry_64.S" fails to compile with binutils 2.20.x (found in RHEL6 and all derivatives) with the following error:

> arch/x86/entry/entry_64.S:1025: Error: using shift_ist requires paranoid=1


I verified that backporting GAS 2.31 fixes this compilation failure (specifically, 2.20.51.0.2-5.48.el6_10.1 from CentOS 6 fails, and 2.31 works). GAS 2.20 and below require doubling ampersands in macros, but this check (introduced in 4234653e882740cbf6625eeee294e388b3176583) does not double ampersands. I am not aware of a way to perform a logical AND in a macro that works both with GAS 2.20- and GAS 2.21+.
Comment 1 Borislav Petkov 2019-10-06 20:17:58 UTC
The minimum binutils version needed to build the current kernel is 2.21:

https://www.kernel.org/doc/html/latest/process/changes.html
Comment 2 James Brown 2019-10-06 23:46:52 UTC
I agree that that doc says 2.21, but mainline kernels for rhel/centos 6 have been compiled successfully with 2.20 up to 5.3, and I see there's still lots of compatibility code in the kernel for binutils down to 2.11. With the `&&` patched into `&&&&`, everything continues to compile and run just fine. I don't suppose there's any chance of maintaining upstream EL6-era-toolchain compatibility for a bit longer?
Comment 3 Borislav Petkov 2019-10-07 06:37:23 UTC
I just installed centos6 in a vm:

In file included from ././include/linux/compiler_types.h:68,
                 from <command-line>:0:
./include/linux/compiler-gcc.h:14:3: error: #error Sorry, your compiler is too old - please upgrade it.


So what you're reporting is not the only problem.

$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
Copyright (C) 2010 Free Software Foundation, Inc.