Bug 1791341

Summary: impossible to compile kernel 3.10.0-957.el7.x86_64 with clearcase 9.0.1.9
Product: Red Hat Enterprise Linux 7 Reporter: jerome.galliere
Component: gccAssignee: Marek Polacek <mpolacek>
Status: CLOSED NOTABUG QA Contact: Alexandra Petlanová Hájková <ahajkova>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.6CC: fweimer, jakub, law, ohudlick, sipoyare
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-24 09:23:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jerome.galliere 2020-01-15 15:30:23 UTC
Description of problem:

[root@ssc3pas3ccvol2 mvfs_src]# pwd 
/var/adm/rational/clearcase/mvfs/mvfs_src 
[root@ssc3pas3ccvol2 mvfs_src]# make 
make -C /lib/modules/3.10.0-957.el7.x86_64/build SUBDIRS=`pwd` 
make[1]: Entering directory `/usr/src/kernels/3.10.0-957.el7.x86_64' 
arch/x86/Makefile:96: stack-protector enabled but compiler support broken 
arch/x86/Makefile:166: *** CONFIG_RETPOLINE=y, but not supported by the compiler. Compiler update recommended.. Stop. 
make[1]: Leaving directory `/usr/src/kernels/3.10.0-957.el7.x86_64' 
make: *** [all] Error 2 
[root@ssc3pas3ccvol2 mvfs_src]# type make 
make is hashed (/usr/bin/make) 


[root@ssc3pas3ccvol2 mvfs_src]# rpm -qa | grep gcc 
libgcc-4.8.5-36.el7.x86_64 
gcc-4.8.5-36.el7.x86_64 
libgcc-4.8.5-36.el7.i686 


Version-Release number of selected component (if applicable):


How reproducible:



Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Marek Polacek 2020-01-15 19:42:15 UTC
arch/x86/Makefile has:

# Avoid indirect branches in kernel to deal with Spectre
ifdef CONFIG_RETPOLINE
    RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
    ifneq ($(RETPOLINE_CFLAGS),)
        KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE
    else
        $(error CONFIG_RETPOLINE=y, but not supported by the compiler. Compiler update recommended.)
    endif
endif

so it test if gcc groks -mindirect-branch=thunk-extern -mindirect-branch-register.  But gcc-4.8.5-36.el7.x86_64 has that support.

Is that test really using the system gcc?  What does compiling a trivial program with -mindirect-branch=thunk-extern -mindirect-branch-register show?

Comment 3 Jeff Law 2020-01-21 16:52:47 UTC
Both of the error messages are indications that you're not using the right compiler.  THe output of "gcc -v" would be helpful here.  I suspect it's going to report some version of gcc without spectre/meltdown mitigations and presumably a version with problems with stack-protector-strong.

Comment 4 jerome.galliere 2020-01-24 07:26:42 UTC
Jeff here is the gcc version

[root@ssc3pas3ccvol2 ~]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
[root@ssc3pas3ccvol2 ~]#

Comment 5 Florian Weimer 2020-01-24 09:23:19 UTC
I have successfully built a minimal kernel module using the kernel makefiles and these package versions:

kernel-3.10.0-957.el7.x86_64
kernel-headers-3.10.0-957.el7.x86_64
kernel-devel-3.10.0-957.el7.x86_64
gcc-4.8.5-36.el7.x86_64

The module was built with -mindirect-branch=thunk-extern -mindirect-branch-register -DRETPOLINE, as expected.

I'm sorry, but this must be something specific to your environment. If you need further assistance, please open a support case at: <https://access.redhat.com/support/cases/new>

Thank you for your understanding.