Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906942 - dev-util/ccache-4.8.1 (currently still masked) compile fails with internal g++ error
Summary: dev-util/ccache-4.8.1 (currently still masked) compile fails with internal g+...
Status: RESOLVED DUPLICATE of bug 906310
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-22 12:41 UTC by Joe Breuer
Modified: 2023-08-08 02:10 UTC (History)
0 users

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


Attachments
Output of ebuild .../ccache-4.8.1.ebuild package (ebuild-ccache.log,37.97 KB, text/x-log)
2023-05-22 12:41 UTC, Joe Breuer
Details
Preprocessed source to be attached to bug report as per g++ diagnostic, ccCbwiil.out (ccCbwiil.out.bz2,333.69 KB, application/octet-stream)
2023-05-22 12:45 UTC, Joe Breuer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Breuer 2023-05-22 12:41:09 UTC
Created attachment 862182 [details]
Output of ebuild .../ccache-4.8.1.ebuild package

I came across this because an embedded build environment, specifically LibreElec.tv, tries to build ccache 4.8.1 as part of its toolchain. Luckily, I can easily reproduce this error using the current (hard-masked) ccache-4.8.1.ebuild.

Simply compiling ccache-4.8.1 with
  $ ebuild /path/to/portage/dev-util/ccache/ccache-4.8.1.ebuild package
brings up an g++/gcc internal error/stack trace for me, which instructs to use -freport-bug.

To get well readable logs, I then did this:

$ MAKEOPTS="-j1" CFLAGS='-freport-bug' CXXFLAGS='-freport-bug' \
  ebuild /path/to/portage/dev-util/ccache/ccache-4.8.1.ebuild package

I'll attach both its output and the preprocessed source mentioned there.
Comment 1 Joe Breuer 2023-05-22 12:45:21 UTC
Created attachment 862183 [details]
Preprocessed source to be attached to bug report as per g++ diagnostic, ccCbwiil.out
Comment 2 Joe Breuer 2023-05-22 13:37:14 UTC
Just reconfirmed, current stable ccache-4.7.4 correctly builds with the very same compiler.

I've also created an issue at upstream, the breaking usage of LOG() in LocalStorage.cpp is new for 4.8.1. My C++ is too rusty to say either way, maybe what's asked of the compiler there is a bit edgy. Or not. It looks innocuous enough.

https://github.com/ccache/ccache/issues/1289
Comment 3 Mike Gilbert gentoo-dev 2023-05-22 15:49:35 UTC

*** This bug has been marked as a duplicate of bug 906310 ***
Comment 4 Joe Breuer 2023-05-22 16:02:43 UTC
Dug after this a bit as part of https://github.com/ccache/ccache/issues/1289

The issue seems to originate with ccache's use of the fmt library, more specifically its FMT_STRING_IMPL which allows syntax checking of formatting strings to compile time.

In case anyone finds this and is bitten by a similar issue, here's what a workaround (forgoing the compile time syntax check) can look like:

https://github.com/ccache/ccache/commit/0d425bc96fb08f0e5c61527796894909bd24da47
Comment 5 Larry the Git Cow gentoo-dev 2023-08-08 02:10:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1683082f6735325895ab84e5d16801dc7fad2f5

commit c1683082f6735325895ab84e5d16801dc7fad2f5
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-08-08 02:09:48 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-08-08 02:09:48 +0000

    dev-util/ccache: backport ICE workaround
    
    Already fixed in stable GCC but let's backport as it makes life easier for
    people.
    
    Bug: https://bugs.gentoo.org/906310
    Bug: https://bugs.gentoo.org/906942
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-util/ccache/ccache-4.8.2.ebuild                |  1 +
 .../files/ccache-4.8.2-gcc-ice-workaround.patch    | 25 ++++++++++++++++++++++
 2 files changed, 26 insertions(+)