Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 927830 - sys-devel/gcc-13.2.1_p20240210[go]: miscompiled with -fstack-clash-protection on ppc64 (internal compiler error (libgo/go/runtime/mheap.go:808:29: internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2cfi.cc:1844))
Summary: sys-devel/gcc-13.2.1_p20240210[go]: miscompiled with -fstack-clash-protection...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 915000
  Show dependency tree
 
Reported: 2024-03-25 18:50 UTC by Alan Mock
Modified: 2024-07-23 17:55 UTC (History)
3 users (show)

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


Attachments
Build log (gcc-build-logs.tar.xz,313.41 KB, application/x-xz)
2024-03-25 18:50 UTC, Alan Mock
Details
emerge --info '=sys-devel/gcc-13.2.1_p20240210::gentoo' (emerge.info,7.42 KB, text/plain)
2024-03-25 18:50 UTC, Alan Mock
Details
emerge -pqv '=sys-devel/gcc-13.2.1_p20240210::gentoo' (emerge.pqv,378 bytes, text/plain)
2024-03-25 18:51 UTC, Alan Mock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Mock 2024-03-25 18:50:11 UTC
Created attachment 888573 [details]
Build log

I am trying to update from default/linux/ppc64/17.0 to default/linux/ppc64/23.0/split-usr and the results of running emerge --ask --oneshot sys-devel/gcc is that the build fails with:

during RTL pass: dwarf2
/var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libgo/go/runtime/mheap.go: In function ‘runtime.mheap.reclaimChunk..stub2’:
/var/tmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/libgo/go/runtime/mheap.go:808:29: internal compiler error: in dwarf2out_frame_debug_expr, at dwarf2cfi.cc:1844
  808 | func (h *mheap) reclaimChunk(arenas []arenaIdx, pageIdx, n uintptr) uintptr {
      |                             ^
Comment 1 Alan Mock 2024-03-25 18:50:41 UTC
Created attachment 888574 [details]
emerge --info '=sys-devel/gcc-13.2.1_p20240210::gentoo'
Comment 2 Alan Mock 2024-03-25 18:51:00 UTC
Created attachment 888575 [details]
emerge -pqv '=sys-devel/gcc-13.2.1_p20240210::gentoo'
Comment 3 Alan Mock 2024-03-25 20:03:04 UTC
The build is successful if I add -go to the use flags.
Comment 4 Marcus Comstedt 2024-05-12 09:30:17 UTC
I confirm the same behaviour.  With the 17.0 profile it built ok.
Maybe related to default-stack-clash-protection ?
Comment 5 Marcus Comstedt 2024-05-12 12:04:56 UTC
By the way, the issue does not occur when building sys-devel/gcc[go] on a
system that has previously been migrated to default/linux/ppc64le/23.0/split-usr

So might be that ELFABIv1 is needed to trigger the problem.  Or possibly gcc can be rebuilt with USE=go when profile migration is complete; I'll need to try that
later (still some 1700 packages to rebuild first... :)
Comment 6 Marcus Comstedt 2024-05-15 06:58:11 UTC
Migration complete, and sys-devel/gcc-13.2.1_p20240210 still fails to build with USE=go.  Also, sys-devel/gcc-14.1.0 fails in the same way.
Comment 7 Marcus Comstedt 2024-05-15 15:49:29 UTC
gcc-13.2.1_p20240210 builds fine with USE="vanilla go", so there is definitely some connection to the Gentoo patches (as expected from the profile change being the triggering factor).
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-21 17:26:32 UTC
Could you try to narrow down which patch it seems to be?
Comment 9 Marcus Comstedt 2024-07-21 22:09:27 UTC
Yes.  It is "24_all_DEF_GENTOO_SCP-fstack-clash-protection.patch".  If I zap this file only from work/patch between unpack and prepare, then the build succeeds.
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-22 09:35:11 UTC
Gah, thanks.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-07-22 09:36:52 UTC
Actually, I suppose it might not be miscompiled.
Comment 12 Marcus Comstedt 2024-07-22 09:38:52 UTC
Yeah, it could just be triggering a dormant bug by creating the appropriate preconditions.