HARD Booted. <Cpu0> 0000107e00e00000 0000000000000000 CC_BOOT_LAUNCH_IPL_PRI <Cpu0> 0100142900e00000 fffffff0f0e0ac00 CC_CPU_INTRIGUE_LDB <Cpu0> 3400082100e00000 0000000000000001 CC_BOOT_BOOT_COMPLETE <Cpu0> e800009800e00000 00000000000640a8 CC_ERR_CHECK_HPMC <Cpu0> 37000f7300e00000 8040004000000000 CC_ERR_CPU_CHECK_SUMMARY <Cpu0> f600105e00e00000 fffffff0f0c00000 CC_MC_HPMC_MONARCH_SELECTED <Cpu0> 140003b200e00000 000000000000000b CC_ERR_HPMC_STATE_ENTRY <Cpu0> 400010bd00e00000 0000000000000000 CC_MC_OS_HPMC_CODE_ZERO <Cpu0> 5600106400e00000 fffffff0f0435110 CC_MC_BR_TO_OS_HPMC_FAILED I didn't record the HPMC (yet).
Merely switching back to sys-devel/gcc-9.3.0 works around the issue.
Normally this would show up as: HARD Booted. <Cpu0> 0000109800e00000 0000000000000000 CC_BOOT_LAUNCH_IPL_OTHR <Cpu0> 0100142900e00000 fffffff0f0e0ac00 CC_CPU_INTRIGUE_LDB <Cpu0> 3400082100e00000 0000000000000001 CC_BOOT_BOOT_COMPLETE palo ipl 2.12 http://www.parisc-linux.org - Tue Oct 1 05:26:38 EDT 2019 Boot image contains: 0/vmlinux64 16301344(0) bytes @ 0xe000 0/ramdisk 5685144 bytes @ 0xf9a000 Information: No console specified on kernel command line. This is normal. PALO will choose the console currently used by firmware (serial). Current command line: 0/vmlinux initrd=0/ramdisk root=/dev/ram0 console=ttyS0 TERM=vt102 0: 0/vmlinux 1: initrd=0/ramdisk 2: root=/dev/ram0 3: console=ttyS0 4: TERM=vt102
Created attachment 640492 [details] sys-boot:palo-2.12:20200518-151820.log.xz
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de9ddf0d8414328da4af833bbf46c9810084852f commit de9ddf0d8414328da4af833bbf46c9810084852f Author: Jeroen Roovers <jer@gentoo.org> AuthorDate: 2020-05-20 09:55:43 +0000 Commit: Jeroen Roovers <jer@gentoo.org> CommitDate: 2020-05-20 09:56:22 +0000 sys-boot/palo: Fix compiling ipl with GCC 10 Package-Manager: Portage-2.3.99, Repoman-2.3.22 Bug: https://bugs.gentoo.org/724264 Signed-off-by: Jeroen Roovers <jer@gentoo.org> sys-boot/palo/files/palo-2.12-gcc10.patch | 11 ++++++++ sys-boot/palo/palo-2.12-r1.ebuild | 44 +++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c8a1f566b00d6eaa447eec8b17a86a4be66d0fb commit 5c8a1f566b00d6eaa447eec8b17a86a4be66d0fb Author: Jeroen Roovers <jer@gentoo.org> AuthorDate: 2020-05-20 20:02:01 +0000 Commit: Jeroen Roovers <jer@gentoo.org> CommitDate: 2020-05-20 20:02:45 +0000 sys-boot/palo: Old Package-Manager: Portage-2.3.99, Repoman-2.3.22 Closes: https://bugs.gentoo.org/show_bug.cgi?id=724264 Signed-off-by: Jeroen Roovers <jer@gentoo.org> sys-boot/palo/palo-2.12.ebuild | 43 ------------------------------------------ 1 file changed, 43 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=753be99e27af82ca91ebab7cd7802d0a632dd7bf commit 753be99e27af82ca91ebab7cd7802d0a632dd7bf Author: Jeroen Roovers <jer@gentoo.org> AuthorDate: 2020-05-20 20:01:06 +0000 Commit: Jeroen Roovers <jer@gentoo.org> CommitDate: 2020-05-20 20:02:44 +0000 sys-boot/palo: Stable Package-Manager: Portage-2.3.99, Repoman-2.3.22 Bug: https://bugs.gentoo.org/show_bug.cgi?id=724264 Signed-off-by: Jeroen Roovers <jer@gentoo.org> sys-boot/palo/palo-2.12-r1.ebuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
To elaborate a bit more on breakage mechanics why -fno-builtin helps here: mis-compliation happens in ipl/lib.c file where a bunch of C-library substitutes like malloc() and strcpy() are provided to make self-contained static iplelf binary to later convert to iplboot. Worst-affected function seems to be a memset() definition. Here is a shrinked example: // cat lib_minimized.c typedef unsigned long size_t; void * memset(void * s, int c, size_t count) { char *xs = (char *) s; while (count--) *xs++ = c; return s; } $ hppa2.0-unknown-linux-gnu-gcc -O2 -mdisable-fpregs -Wall -fno-delete-null-pointer-checks -S -fverbose-asm -o lib_minimized.S lib_minimized.c -fdump-tree-all -fdump-rtl-all $ cat lib_minimized.c.234t.optimized ;; Function memset (memset, funcdef_no=0, decl_uid=796, cgraph_uid=1, symbol_order=0) Removing basic block 5 __attribute__((nothrow, leaf)) memset (void * s, int c, size_t count) { char _4; int _18; <bb 2> [local count: 118111600]: if (count_6(D) != 0) goto <bb 4>; [89.00%] else goto <bb 3>; [11.00%] <bb 3> [local count: 118111600]: return s_5(D); <bb 4> [local count: 105119324]: _4 = (char) c_10(D); _18 = (int) _4; __builtin_memset (s_5(D), _18, count_6(D)); goto <bb 3>; [100.00%] } Note how tree transform made memset() into __builtin_memset(). $ cat lib_minimized.S ; GNU C17 (Gentoo 10.1.0 p1) version 10.1.0 (hppa2.0-unknown-linux-gnu) ... .text .align 4 .globl memset .type memset, @function memset: .PROC .CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=4 .ENTRY stw %r2,-20(%r30) ;, stwm %r4,64(%r30) ;,, stw %r3,-60(%r30) ;, copy %r26,%r3 ; s, tmp106 ; lib_minimized.c:7: while (count--) comib,= 0,%r24,.L4 ;,, tmp108, stw %r19,-32(%r30) ;, ; lib_minimized.c:8: *xs++ = c; bl memset,%r2 ;, extrs %r25,31,8,%r25 ; c, .L4: ; lib_minimized.c:11: } copy %r3,%r28 ; s, ldw -84(%r30),%r2 ;, ldw -60(%r30),%r3 ;, bv %r0(%r2) ldwm -64(%r30),%r4 ;,, .EXIT .PROCEND .size memset, .-memset .ident "GCC: (Gentoo 10.1.0 p1) 10.1.0" Here RTL turned __builtin_memset() into memset() call building endless recursion.
Possible cause is that in GCC <10 -ftree-loop-distribute-patterns is enabled with -O3 and higher, while in GCC >=10 -ftree-loop-distribute-patterns is enabled with -O2 and higher: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5879ab5fafedc8f6f9bfe95a4cf8501b0df90edd https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1d672917b4b324a6aac3743f21b8c58940a0ceb8 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=afb4cc68530e7f07ae580639910ea9197daf7b88 E.g. glibc uses -fno-tree-loop-distribute-patterns: https://sourceware.org/git/?p=glibc.git;a=blob;f=include/libc-symbols.h;h=b2f36bc44b35805a13daba4b69e8c10a64371e71;hb=HEAD#l1088 https://sourceware.org/git/?p=glibc.git;a=blob;f=string/memmove.c;h=b281d770462158f0fe2e8a82b927084e47c360fa;hb=HEAD#l43 https://sourceware.org/git/?p=glibc.git;a=blob;f=string/memset.c;h=9c213e82dc90f3eb426bc0b6c97ec5312b9d5c46;hb=HEAD#l26