Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1907945 - GCC 11 will not build the Fedora kernel.
Summary: GCC 11 will not build the Fedora kernel.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 34
Hardware: aarch64
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ARMTracker
TreeView+ depends on / blocked
 
Reported: 2020-12-15 15:03 UTC by Justin M. Forbes
Modified: 2021-04-05 14:55 UTC (History)
15 users (show)

Fixed In Version: binutils-2.35.1-17.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-04-05 14:55:05 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Justin M. Forbes 2020-12-15 15:03:58 UTC
I had not realized that gcc 11 was popped into rawhide last week and have spent a good bit of time trying to figure out what changed in the kernel, and why no one else was seeing it.  Looks like gcc11 is the culprit, and kernels will not build in rawhide/eln on aarch64 with:

WARNING: modpost: vmlinux.o (__patchable_function_entries): unexpected non-allocatable section.
Did you forget to use "ax"/"aw" in a .S file?
Note that for example <linux/init.h> contains
section definitions for use in .S files.
ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.init.data' in ./drivers/firmware/efi/libstub/vsprintf.stub.o] sections
ld: final link failed: bad value
make: *** [Makefile:1175: vmlinux] Error 1

This code has not changed upstream, and builds fine on f33.

To be clear, this means that no kernels have been built for Rawhide or ELN in a week now.

Comment 1 Jakub Jelinek 2020-12-15 17:10:35 UTC
As I've asked privately, please attach main.i and vsprintf.i, ideally from both f33 and f34 build of the same kernel, and say the exact gcc command line used to compile those.
I've tried to reproduce, but the kernel fails to build far before that on aarch64 (fedora-rawhide-aarch64 mock):
Processing /builddir/build/BUILD/kernel-5.10-rc6/linux-5.10.0-0.rc6.90.fc34.aarch64/configs/kernel-5.10.0-x86_64-debug.config ... Found unset config items, please set them to an appropriate value
CONFIG_KCSAN=n
error: Bad exit status from /var/tmp/rpm-tmp.RLqtOw (%prep)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.RLqtOw (%prep)

Comment 2 Justin M. Forbes 2020-12-15 18:37:55 UTC
Yes, the KCSAN bit doesn't get exposed until gcc 11 is used, that was updated, rc6 is over 2 weeks old. https://kojipkgs.fedoraproject.org//work/tasks/4249/57444249/kernel-5.10.0-98.fc34.src.rpm is much more recent, and has the KCSAN config set correctly.  I am trying to get your builds, I was given access to a machine today, though I am also trying to get 5.10 into another repository and built so that people can use it and test it since rawhide fails, as well as work through the merge window, all while "on PTO". I did get your response, but the bug was opened because a number of people have been asking about the issue, and this was something I could point them to.

Comment 3 Jakub Jelinek 2020-12-15 20:53:03 UTC
There is one possible issue related to the -fpatchable-function-entry=2 stuff when gcc is configured against latest binutils, see
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/561974.html
Whether that is all or not, no idea.

Comment 4 Jeremy Linton 2020-12-15 21:56:41 UTC
There is a duplicate section with differing flags in main.o that isn't there on the gcc10 machine.

  [19] __patchable_function_entries PROGBITS        0000000000000000 0015f8 000008 00 WAL  1   0  8
  [20] .rela__patchable_function_entries RELA            0000000000000000 04dcb0 000018 18   I 76  19  8
  [21] __patchable_function_entries PROGBITS        0000000000000000 001600 000150 00      0   0  8

Comment 5 Jeff Law 2020-12-16 05:31:27 UTC
Yes Jeremy.  I think that's unexpected fallout from some of HJ's GCC changes.  Jakub's patch is supposed to address that, but we want to consult with HJ on whether or not gas is supposed to handle this case more gracefully.

Comment 6 Justin M. Forbes 2020-12-18 19:03:53 UTC
I am guessing this patch was not included in gcc-11.0.0-0.10.fc34 ?

Comment 7 Jakub Jelinek 2020-12-18 19:25:06 UTC
It is included there.

Comment 8 Justin M. Forbes 2020-12-18 20:02:20 UTC
Hmm, okay, this is not the complete fix then:

koji build used gcc                     aarch64 11.0.0-0.10.fc34    

Error now shows as

ld: .init.data has both ordered [`__patchable_function_entries' in init/main.o] and unordered [`.init.data' in ./drivers/firmware/efi/libstub/vsprintf.stub.o] sections
ld: final link failed: bad value

So we do not get the "WARNING: modpost: vmlinux.o (__patchable_function_entries): unexpected non-allocatable section.", but the build still fails.

Comment 9 Jeff Law 2020-12-18 20:06:35 UTC
Note, I'm aware of linker issues affecting both s390 and ppc builds.  Nick has been notified but he's already on PTO and then we've got the shutdown.  So I don't really expect those issues to be fixed before the new year.

The point is I don't really expect kernel builds to be successful on multiple architectures until the start of the year.  Yes, this sucks.

Comment 11 Jakub Jelinek 2020-12-19 16:57:46 UTC
I don't know if this is a kernel bug or binutils bug, filed https://sourceware.org/bugzilla/show_bug.cgi?id=27098 so that H.J. can comment on it.

Comment 12 Herton R. Krzesinski 2020-12-21 20:33:30 UTC
I tested the patch from https://sourceware.org/bugzilla/show_bug.cgi?id=26256 (https://sourceware.org/bugzilla/attachment.cgi?id=13070), after building and updating binutils I don't see anymore the error on aarch64 kernel build. I'm changing the component, hope this is ok now.

Comment 13 Nick Clifton 2021-01-04 15:18:58 UTC
OK - I have imported the patch into rawhide.

The upstream version still has a problem with creating new linker testsuite failures, but I do not believe that this is because of a problem with the patch itself, just the new tests.  So for this update I have just imported the fix, but not the new tests.  A rebase is due in a month which will bring in the fixed tests as well.

Comment 14 Ben Cotton 2021-02-09 16:10:03 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.


Note You need to log in before you can comment on or make changes to this bug.