Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 788613 - bootstrap-prefix.sh: stage 3 sys-devel/gcc-11.1.0 build fail: error: 'mallinfo2' was not declared in this scope
Summary: bootstrap-prefix.sh: stage 3 sys-devel/gcc-11.1.0 build fail: error: 'mallinf...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-06 16:55 UTC by Alfred Wingate
Modified: 2021-06-08 19:28 UTC (History)
3 users (show)

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


Attachments
build.log for sys-deve/gcc-11.1.0 (gcc-build.log,573.61 KB, text/x-log)
2021-05-06 16:56 UTC, Alfred Wingate
Details
emerge --info in the prefix (emerge.log,4.50 KB, text/x-log)
2021-05-06 17:00 UTC, Alfred Wingate
Details
emerge --info gcc:11 (gcc11.log,6.08 KB, text/x-log)
2021-05-06 18:47 UTC, Alfred Wingate
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred Wingate 2021-05-06 16:55:40 UTC
boostrap-prefix.sh fails on stage 3 while building sys-devel/gcc-11.1.0. This is due to code changed in made in GCC-11 branch in commit 432c551b17d655823a4825855b4b966441c8cfb3, and therefore this problem can be avoided by going back to GCC-10. I've worked around this by unmasking the unstable keyword for GCC-11 and therefore was able to complete building the prefix (this includes fix in https://bugs.gentoo.org/788334 to get around issue in stage 1).

Reproducible: Always

Steps to Reproduce:
1.Follow instruction for creating prefix in https://wiki.gentoo.org/wiki/Project:Prefix/Bootstrap
Actual Results:  
Fails on stage 3 due to sys-devel/gcc-11.1.0 build error.

Expected Results:  
Script should work without failures.

Link to the change in question on gcc upstream gitweb:
https://gcc.gnu.org/git/?p=gcc.git;a=blobdiff;f=gcc/ggc-common.c;h=6f8da300970ebec268fd50abe186091ba5d50273;hp=94da02f11857589d3b731c44c06af766b3d17e95;hb=432c551b17d655823a4825855b4b966441c8cfb3;hpb=11da31998af6d7b7d4d6fcd3f705c17d69baf58b
Comment 1 Alfred Wingate 2021-05-06 16:56:21 UTC
Created attachment 706380 [details]
build.log for sys-deve/gcc-11.1.0
Comment 2 Alfred Wingate 2021-05-06 16:57:03 UTC
And prefix was being built inside x86-64 ubuntu-20.10
Comment 3 Alfred Wingate 2021-05-06 17:00:38 UTC
Created attachment 706383 [details]
emerge --info in the prefix
Comment 4 Alfred Wingate 2021-05-06 18:47:30 UTC
sys-devel/gcc-11.1.0 doesn't fail to build when built in the finished prefix with the workarounds.
Comment 5 Alfred Wingate 2021-05-06 18:47:46 UTC
Created attachment 706401 [details]
emerge --info gcc:11
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-04 23:35:54 UTC
Yeah, just hit this on Ubuntu 20.04 and 20.10 too.

Thanks for filing this bug with the details.
Comment 7 Alfred Wingate 2021-06-07 03:27:25 UTC
I've also hit this on my Gentoo machine as well which is fully built with GCC-11, was trying to build a prefix for my regular user. And as previously stated forcing the stage3 bootstrap to use GCC-10 instead works around the issue, enabling a full GCC-11 rebuild of the prefix afterwards.
Comment 8 Fabian Groffen gentoo-dev 2021-06-08 08:06:10 UTC
hmmm, using gcc-10.3.0 doesn't improve things for me
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-06-08 08:06:53 UTC
(In reply to Fabian Groffen from comment #8)
> hmmm, using gcc-10.3.0 doesn't improve things for me

That's interesting... 10.2.0?
Comment 10 Fabian Groffen gentoo-dev 2021-06-08 08:24:34 UTC
ok, gcc-10.2 same problem, something is hosed (gcc-7 not recent enough?) no idea at this point

I have this in stage2 though, so this may be another problem.
Comment 11 Larry the Git Cow gentoo-dev 2021-06-08 09:14:48 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=29f4de200d9916a117ec1658c87fad73f3a513e2

commit 29f4de200d9916a117ec1658c87fad73f3a513e2
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-06-08 09:12:19 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-06-08 09:12:19 +0000

    scripts/bootstrap-prefix: fix g++ wrapper
    
    In 2dfc27192fbe00e4661ca06a0b18f09a4137dd50 the executable name was
    fixed, so it wasn't dependant on PATH, however, it broke g++ for that
    would still call gcc.  Fix that now.
    
    Mask GCC-11 during stage2 and stage3 for bug #788613.
    
    Bug: https://bugs.gentoo.org/788613
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 scripts/bootstrap-prefix.sh | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
Comment 12 Alfred Wingate 2021-06-08 11:19:03 UTC
I've was able to build the prefix on Ubuntu 21.04 which has glibc-2.33 (My Gentoo system is glibc.2.32 and Ubuntu-20.10 is 2.32 aswell).

According glibc-2.33 release notes mallinfo2 was introduced in this release.

The prefix itself uses sys-libs/glibc-2.33 and it correctly shows up in the configuration stage of the build. This should've meant that mallinfo2 is available for gcc-11 during the src_compile  stage, but as it isnt id think that maybe the system libc is somehow being used which then doesnt include mallinfo2. The problem with the enviroment then seems to be fixed once the prefix bootstrap script is finished.

I started building the prefix before sys-devel/gcc-11 got masked in stage2 and stage3.

https://sourceware.org/pipermail/libc-alpha/2021-February/122207.html
Comment 13 Fabian Groffen gentoo-dev 2021-06-08 11:32:01 UTC
Hey thanks for that info, I think it means we'll have to mask gcc-11 on profiles targetting an older libc or something.  Yet, it seems like this should be easy enough to fix, so a later version could work again.

Anyway, I'm continuing my bootstrap attempts on ubuntu 18 here
Comment 14 Fabian Groffen gentoo-dev 2021-06-08 19:28:38 UTC
I'm in the final stage emerging gcc, so I'm pretty sure this is now worked around sufficiently