Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 720776 - sys-kernel/gentoo-sources cannot be compiled with gcc-10
Summary: sys-kernel/gentoo-sources cannot be compiled with gcc-10
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-03 11:27 UTC by Helmut Jarausch
Modified: 2020-07-09 19:46 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2020-05-03 11:27:42 UTC
At least, version 5.6.8 and 5.6.9 cannot be compiled with gcc-10.
Either this is a bug (sloppy programming) in the kernel or the
default compiler options (all warnings being treated as errors)
are too strict for these kernels

  LD [M]  drivers/gpu/drm/drm_kms_helper.o
In file included from net/bluetooth/mgmt.c:36:
In function 'eir_append_data',
    inlined from 'read_local_oob_ext_data' at net/bluetooth/mgmt.c:6355:13:
net/bluetooth/hci_request.h:124:17: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  124 |  eir[eir_len++] = sizeof(type) + data_len;
      |  ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from net/bluetooth/mgmt.c:34:
net/bluetooth/mgmt.c: In function 'read_local_oob_ext_data':
./include/net/bluetooth/mgmt.h:518:7: note: at offset 0 to object 'eir' with size 0 declared here
  518 |  __u8 eir[0];
      |       ^~~
In file included from net/bluetooth/mgmt.c:36:
In function 'eir_append_data',
    inlined from 'read_local_oob_ext_data' at net/bluetooth/mgmt.c:6355:13:
net/bluetooth/hci_request.h:125:17: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  125 |  eir[eir_len++] = type;
      |  ~~~~~~~~~~~~~~~^~~~~~
In file included from net/bluetooth/mgmt.c:34:
net/bluetooth/mgmt.c: In function 'read_local_oob_ext_data':
./include/net/bluetooth/mgmt.h:518:7: note: at offset 0 to object 'eir' with size 0 declared here
  518 |  __u8 eir[0];
      |       ^~~
cc1: all warnings being treated as errors
make[2]: *** [scripts/Makefile.build:267: arch/x86/kvm/../../../virt/kvm/kvm_main.o] Error 1
Comment 1 Thomas Deutschmann gentoo-dev Security 2020-05-03 22:51:18 UTC
> cc1: all warnings being treated as errors

This is caused by -Werror.
Comment 2 Pavel Volkov 2020-05-10 08:09:41 UTC
I use gentoo-sources 5.6.11.
It compiles fine but does not boot.
I see nothing on display and nothing in logs, not sure how to proceed.

I'll try re-building with GCC 9 to make sure.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-10 08:19:13 UTC
(In reply to Pavel Volkov from comment #2)
> I use gentoo-sources 5.6.11.
> It compiles fine but does not boot.
> I see nothing on display and nothing in logs, not sure how to proceed.
> 
> I'll try re-building with GCC 9 to make sure.

That is a https://bugs.gentoo.org/721734
Comment 4 Mike Pagano gentoo-dev 2020-05-12 12:25:29 UTC
No problem here with 5.6.12.  Can you retest with the latest version of 5.6.X which is 5.6.12 as of this writing?
Comment 5 Michael Cook 2020-05-12 21:07:16 UTC
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?h=v5.7-rc5&qt=grep&q=gcc-10

More warnings tweaks are needed, personally I've hit "Stop the ad-hoc games with -Wno-maybe-initialized" so far with GCC 10.
Comment 6 Aleksandr K. 2020-05-15 11:37:16 UTC
For me the same error with kvm enabled on kernel 5.6.11-13 and gcc10.1.0.
Changing gcc to 9.3.0 compiles w/o errors.
Comment 7 Dennis Schridde 2020-05-15 20:45:00 UTC
On my system CONFIG_PLUGIN_HOSTCC is empty and no GCC plugins are being enabled.


I tracked it down via:
❯ cat /usr/src/linux-5.6.13-gentoo/scripts/gcc-plugins/Kconfig                             
# SPDX-License-Identifier: GPL-2.0-only                               
preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC))
                                                                                           
config PLUGIN_HOSTCC                                                     
        string                                                            
        default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")" if CC_IS_GCC
        help                                                             
          Host compiler used to build GCC plugins.  This can be $(HOSTCXX),
          $(HOSTCC), or a null string if GCC plugin is unsupported.
[...]


to (I added `set -x` to the head of the script):
❯ /usr/src/linux-5.6.13-gentoo/scripts/gcc-plugin.sh g++ g++ gcc
++ dirname /usr/src/linux-5.6.13-gentoo/scripts/gcc-plugin.sh
+ srctree=/usr/src/linux-5.6.13-gentoo/scripts
+ SHOW_ERROR=
+ '[' g++ = --show-error ']'
++ gcc -print-file-name=plugin
+ gccplugins_dir=/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/plugin
++ g++ -E -x c++ - -o /dev/null -I/usr/src/linux-5.6.13-gentoo/scripts/gcc-plugins -I/usr/lib/gcc/x86_64-pc-linux-gnu/10.1.0/plugin/include
+ plugincc='In file included from <stdin>:1:
/usr/src/linux-5.6.13-gentoo/scripts/gcc-plugins/gcc-common.h:38:10: fatal error: params.h: No such file or directory
   38 | #include "params.h"
      |          ^~~~~~~~~~
compilation terminated.'
+ '[' 1 -ne 0 ']'
+ '[' -n '' ']'
+ exit 1


Should I open a separate bug for that, or does it have the same cause that's being tracked here?
Comment 8 Mike Pagano gentoo-dev 2020-06-05 14:07:38 UTC
Can you please test with the latest gentoo-sources-5.6.X which is 5.6.16 as of this writing. I do see gcc fixes in the stable tree.
Comment 9 Jack 2020-06-05 17:28:18 UTC
gentoo-source-5.6.16 compiles fine for me with gcc-10.1.0.
5.6.13 requires the patch, and I have not tried .14 or .15.
Comment 10 Mike Pagano gentoo-dev 2020-07-09 19:46:30 UTC
All of the latest gentoo-sources are now compiling with gcc 10.
If you find a new supported version not compiling, please let me know.