Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 829961 - sys-devel/gcc: ICE when compiling sys-boot/grub-2.06-r1 (cc1: internal compiler error: Segmentation fault)
Summary: sys-devel/gcc: ICE when compiling sys-boot/grub-2.06-r1 (cc1: internal compil...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-25 12:56 UTC by bigzeke215
Modified: 2022-04-21 21:39 UTC (History)
4 users (show)

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


Attachments
Build Log (build.log,737.16 KB, text/plain)
2021-12-25 12:56 UTC, bigzeke215
Details
Emerge Info (emerge_info.log,5.89 KB, text/plain)
2021-12-25 13:01 UTC, bigzeke215
Details
Emerge Build (emerge_build.log,365 bytes, text/plain)
2021-12-25 13:02 UTC, bigzeke215
Details
Environment Log (environment.log,99.97 KB, text/plain)
2021-12-25 13:02 UTC, bigzeke215
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bigzeke215 2021-12-25 12:56:08 UTC
Created attachment 760193 [details]
Build Log

I am receiving the error below when I attempt to build grub during the installation process. 


cc1: internal compiler error: Segmentation fault
0x15bdcc8 internal_error(char const*, ...)
        ???:0
0x612c3f private_lookup_attribute(char const*, unsigned long, tree_node*)
        ???:0
0x77cc1d symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
make[2]: *** [Makefile:8488: grub-core/lib/zstd/libgrubmods_a-zstd_decompress.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/var/tmp/portage/sys-boot/grub-2.06-r1/work/grub-2.06-efi-64'
make[1]: *** [Makefile:11931: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/sys-boot/grub-2.06-r1/work/grub-2.06-efi-64'
make: *** [Makefile:3783: all] Error 2
 * ERROR: sys-boot/grub-2.06-r1::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-boot/grub-2.06-r1::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-boot/grub-2.06-r1::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-boot/grub-2.06-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-boot/grub-2.06-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-boot/grub-2.06-r1/work/grub-2.06-efi-64'
 * S: '/var/tmp/portage/sys-boot/grub-2.06-r1/work/grub-2.06'
Comment 1 bigzeke215 2021-12-25 13:01:50 UTC
Created attachment 760194 [details]
Emerge Info
Comment 2 bigzeke215 2021-12-25 13:02:26 UTC
Created attachment 760195 [details]
Emerge Build
Comment 3 bigzeke215 2021-12-25 13:02:53 UTC
Created attachment 760196 [details]
Environment Log
Comment 4 Mike Gilbert gentoo-dev 2021-12-25 22:31:50 UTC
Seems like something is wrong with your compiler or the system it is running on.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-25 23:43:31 UTC
Is this reproducible for you?

If so,
1. Please try the GCC 11.2.1.x version in ~arch.
2. Follow https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide (we can help with this).
Comment 6 Georgy Yakovlev archtester gentoo-dev 2021-12-26 09:07:30 UTC
please add some swap to the system
with -j2 you need 4G of ram generally.

or try adding -j1 to MAKEOPTS but still add some swap, even 512M should help.
Comment 7 johnnyliao 2022-04-18 05:19:05 UTC
I also suffered similar failure while compiling grub-2.06 version with gcc version 11.2.0.
Trying to google the failure and did not see many articles mentioned such failure. I figured out the error on "make[2]: *** [grub-core/lib/zstd/libgrubmods_a-zstd_decompress.o] Error 1". Is there missing library needed for this grub-2.06 compiler in order to work with gcc?

sed-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion   -MT util/grub_mkstandalone-mkimage.o -MD -MP -MF util/.deps-util/grub_mkstandalone-mkimage.Tpo -c -o util/grub_mkstandalone-mkimage.o `test -f 'util/mkimage.c' || echo './'`util/mkimage.c
make[2]: *** [grub-core/lib/zstd/libgrubmods_a-zstd_decompress.o] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f util/.deps-util/grub_mkrescue-config.Tpo util/.deps-util/grub_mkrescue-config.Po
mv -f grub-core/kern/emu/.deps-util/grub_mkrescue-argp_common.Tpo grub-core/kern/emu/.deps-util/grub_mkrescue-argp_common.Po
mv -f grub-core/disk/.deps-util/grub_mkrescue-host.Tpo grub-core/disk/.deps-util/grub_mkrescue-host.Po
mv -f util/.deps-util/grub_mkrescue-grub-mkimage32.Tpo util/.deps-util/grub_mkrescue-grub-mkimage32.Po
mv -f grub-core/osdep/.deps-util/grub_mkrescue-config.Tpo grub-core/osdep/.deps-util/grub_mkrescue-config.Po
mv -f grub-core/osdep/.deps-util/grub_mkrescue-init.Tpo grub-core/osdep/.deps-util/grub_mkrescue-init.Po
mv -f util/.deps-util/grub_mkrescue-resolve.Tpo util/.deps-util/grub_mkrescue-resolve.Po
mv -f util/.deps-util/grub_mkrescue-grub-mkimage64.Tpo util/.deps-util/grub_mkrescue-grub-mkimage64.Po
mv -f grub-core/kern/emu/.deps-util/grub_mkrescue-hostfs.Tpo grub-core/kern/emu/.deps-util/grub_mkrescue-hostfs.Po
mv -f util/.deps-util/grub_mkstandalone-grub-mkstandalone.Tpo util/.deps-util/grub_mkstandalone-grub-mkstandalone.Po
mv -f util/.deps-util/grub_mkstandalone-render-label.Tpo util/.deps-util/grub_mkstandalone-render-label.Po
mv -f util/.deps-util/grub_mkstandalone-glue-efi.Tpo util/.deps-util/grub_mkstandalone-glue-efi.Po
mv -f util/.deps-util/grub_mkstandalone-mkimage.Tpo util/.deps-util/grub_mkstandalone-mkimage.Po
make[2]: Leaving directory `/root/grub2/grub-2.06'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/grub2/grub-2.06'
make: *** [all] Error 2

[root@cserver grub-2.06]# gcc --version
gcc (GCC) 11.2.0
Copyright (C) 2021 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.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-21 21:39:12 UTC
(In reply to johnnyliao from comment #7)
> I also suffered similar failure while compiling grub-2.06 version with gcc
> version 11.2.0.
> Trying to google the failure and did not see many articles mentioned such
> failure. I figured out the error on "make[2]: ***
> [grub-core/lib/zstd/libgrubmods_a-zstd_decompress.o] Error 1". Is there
> missing library needed for this grub-2.06 compiler in order to work with gcc?
> 
> sed-function -Wunused-label -Wunused-parameter -Wunused-value 
> -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes
> -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self
> -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull
> -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros
> -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs
> -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror -Wno-undef
> -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls
> -Wno-unreachable-code -Wno-conversion   -MT util/grub_mkstandalone-mkimage.o
> -MD -MP -MF util/.deps-util/grub_mkstandalone-mkimage.Tpo -c -o
> util/grub_mkstandalone-mkimage.o `test -f 'util/mkimage.c' || echo
> './'`util/mkimage.c
> make[2]: *** [grub-core/lib/zstd/libgrubmods_a-zstd_decompress.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> mv -f util/.deps-util/grub_mkrescue-config.Tpo
> util/.deps-util/grub_mkrescue-config.Po
> mv -f grub-core/kern/emu/.deps-util/grub_mkrescue-argp_common.Tpo
> grub-core/kern/emu/.deps-util/grub_mkrescue-argp_common.Po
> mv -f grub-core/disk/.deps-util/grub_mkrescue-host.Tpo
> grub-core/disk/.deps-util/grub_mkrescue-host.Po
> mv -f util/.deps-util/grub_mkrescue-grub-mkimage32.Tpo
> util/.deps-util/grub_mkrescue-grub-mkimage32.Po
> mv -f grub-core/osdep/.deps-util/grub_mkrescue-config.Tpo
> grub-core/osdep/.deps-util/grub_mkrescue-config.Po
> mv -f grub-core/osdep/.deps-util/grub_mkrescue-init.Tpo
> grub-core/osdep/.deps-util/grub_mkrescue-init.Po
> mv -f util/.deps-util/grub_mkrescue-resolve.Tpo
> util/.deps-util/grub_mkrescue-resolve.Po
> mv -f util/.deps-util/grub_mkrescue-grub-mkimage64.Tpo
> util/.deps-util/grub_mkrescue-grub-mkimage64.Po
> mv -f grub-core/kern/emu/.deps-util/grub_mkrescue-hostfs.Tpo
> grub-core/kern/emu/.deps-util/grub_mkrescue-hostfs.Po
> mv -f util/.deps-util/grub_mkstandalone-grub-mkstandalone.Tpo
> util/.deps-util/grub_mkstandalone-grub-mkstandalone.Po
> mv -f util/.deps-util/grub_mkstandalone-render-label.Tpo
> util/.deps-util/grub_mkstandalone-render-label.Po
> mv -f util/.deps-util/grub_mkstandalone-glue-efi.Tpo
> util/.deps-util/grub_mkstandalone-glue-efi.Po
> mv -f util/.deps-util/grub_mkstandalone-mkimage.Tpo
> util/.deps-util/grub_mkstandalone-mkimage.Po
> make[2]: Leaving directory `/root/grub2/grub-2.06'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/root/grub2/grub-2.06'
> make: *** [all] Error 2

Your log is missing the real error (please include the log in full) but you're also not building via the ebuild. This is Gentoo's bug tracker, not grub's.

> 
> [root@cserver grub-2.06]# gcc --version
> gcc (GCC) 11.2.0
> Copyright (C) 2021 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.

Is this on Gentoo...?