Question on Bug #1749261 - Won't fix

Asked by Jose Rivera on 2019-11-04

Hello, we are running into this issue with an Ubuntu 18.04.3 LTS container running via docker on a host running 'CentOS Linux release 7.5.1804'. We are attempting to compile a kernel module using the host installed kernel-devel source in /usr/src/kernels/3.10.0-862.3.2.el7.x86_64. However the 18.04.3 installed gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 is not allowing the compilation because of the error below.

This bug references "Enable x86 retpoline options by default". Has this option truly been disabled by default, Is there a way to proceed past this issue in this environment? Can we update to compiler which would solve this? Any information you can provide would be appreciated. Thank you ... Jose

make[1]: Entering directory '/usr/src/kernels/3.10.0-862.3.2.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-862.3.2.el7.x86_64'
Makefile:51: recipe for target 'all' failed
make: *** [all] Error 2

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu gcc-7 Edit question
Assignee:
No assignee Edit question
Last query:
2019-11-05
Last reply:
2019-11-05
Manfred Hampl (m-hampl) said : #1

Have you tried installing the package gcc-4.8 before compiling?

Jose Rivera (jriverapwx) said : #2

Thank you Manfred for your reply. I just tried installing gcc-4.8. Didn't know if it would supply something that would help gcc-7.4. So I tried both 7.4 and 4.8.

Compiling with gcc-7.4 with installed gcc-4.8 I get the same:

make[1]: Entering directory '/usr/src/kernels/3.10.0-862.3.2.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-862.3.2.el7.x86_64'
Makefile:56: recipe for target 'all' failed
make: *** [all] Error 2

Compiling with just gcc-4.8 is below. It seems that gcc-4.8 has an unsupported option which is by default add when compiling a module for this kernel. Can you suggest anything else that we can try to get around this? Will any gcc supplied by bionic support 'stack-protector' and 'CONFIG_RETPOLINE'?. Thanks again for your help ... Jose

Makefile:648: Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
  .....
gcc: error: unrecognized command line option '-fstack-protector-strong'
scripts/Makefile.build:341: recipe for target '....o' failed
make[2]: *** [...o] Error 1
Makefile:1312: recipe for target '_module_...' failed
make[1]: *** [_module_...] Error 2
make[1]: Leaving directory '/usr/src/kernels/3.10.0-862.3.2.el7.x86_64'
Makefile:56: recipe for target 'all' failed
make: *** [all] Error 2

Jose Rivera (jriverapwx) said : #3

gcc packages I currently have installed:

# dpkg -l | egrep gcc
ii gcc 4:7.4.0-1ubuntu2.3 amd64 GNU C compiler
ii gcc-4.8 4.8.5-4ubuntu8 amd64 GNU C compiler
ii gcc-4.8-base:amd64 4.8.5-4ubuntu8 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-7 7.4.0-1ubuntu1~18.04.1 amd64 GNU C compiler
ii gcc-7-base:amd64 7.4.0-1ubuntu1~18.04.1 amd64 GCC, the GNU Compiler Collection (base package)
ii gcc-8 8.3.0-6ubuntu1~18.04.1 amd64 GNU C compiler
ii gcc-8-base:amd64 8.3.0-6ubuntu1~18.04.1 amd64 GCC, the GNU Compiler Collection (base package)
ii gccgo 4:8.3.0-1ubuntu2.3 amd64 Go compiler, based on the GCC backend
ii gccgo-8 8.3.0-6ubuntu1~18.04.1 amd64 GNU Go compiler
ii libgcc-4.8-dev:amd64 4.8.5-4ubuntu8 amd64 GCC support library (development files)
ii libgcc-7-dev:amd64 7.4.0-1ubuntu1~18.04.1 amd64 GCC support library (development files)
ii libgcc-8-dev:amd64 8.3.0-6ubuntu1~18.04.1 amd64 GCC support library (development files)
ii libgcc1:amd64 1:8.3.0-6ubuntu1~18.04.1 amd64 GCC support library

Jose Rivera (jriverapwx) said : #4

Also tried installing gcc-5 and ran into the same error which we got when we use gcc-7.4...

Manfred Hampl (m-hampl) said : #5

What is the output of
gcc --version

Maybe you have to specify a different compiler by invoking the build command with
make CC=gcc-8
or something similar.

Jose Rivera (jriverapwx) said : #6

I have been updating the /usr/bin/gcc link to move the version. The last update I did was for gcc-5 so the version was :
# gcc --version
gcc (Ubuntu 5.5.0-12ubuntu1) 5.5.0 20171010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I just tried this:

# cd /usr/bin && rm gcc && ln -s gcc-8 gcc && cd -
# gcc --version
gcc (Ubuntu 8.3.0-6ubuntu1~18.04.1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# KERNELPATH=/usr/src/kernels/$(uname -r) make
make -C /usr/src/kernels/3.10.0-862.3.2.el7.x86_64 M=... modules
make[1]: Entering directory '/usr/src/kernels/3.10.0-862.3.2.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-862.3.2.el7.x86_64'
Makefile:56: recipe for target 'all' failed
make: *** [all] Error 2

So I am using the gcc-8 compiler in this case. This used to work under Xenial gcc-5. Was there a change to gcc for Bionic? Any help around this is appreciated. Thank you again ... Jose

Manfred Hampl (m-hampl) said : #7

What is the output of the command

uname -a

The 3.10 version of the kernel was never supported on Ubuntu 16.04 (only on 13.10, saucy, already end of life for years)

Jose Rivera (jriverapwx) said : #8

We are using an Ubuntu 18.04.3 LTS docker container running on a host with OS distro 'CentOS Linux release 7.5.1804'. We are attempting to compile a kernel module using the host installed kernel-devel source in /usr/src/kernels/3.10.0-862.3.2.el7.x86_64 via the "Ubuntu 18.04.3 LTS docker container". We were doing this previously using Xenial 16.04 and it worked ok. We wanted to upgrade to Bionic to better support for tracing tools that we use.

The uname -a of the host is "Linux centos-75-test 3.10.0-862.3.2.el7.x86_64 #1 SMP Mon May 21 23:36:36 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux".

Can you help with this problem?

Provide an answer of your own, or ask Jose Rivera for more information if necessary.

To post a message you must log in.