Bug 105315 - go build fail on ppc: has no member named 'gregs'; did you mean 'regs'?
Summary: go build fail on ppc: has no member named 'gregs'; did you mean 'regs'?
Alias: None
Product: gcc
Classification: Unclassified
Component: go (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
Depends on:
Reported: 2022-04-20 01:42 UTC by Jiu Fu Guo
Modified: 2022-04-21 09:16 UTC (History)
1 user (show)

See Also:
Target: powerpc64-linux
Known to work:
Known to fail:
Last reconfirmed:


Note You need to log in before you can comment on or make changes to this bug.
Description Jiu Fu Guo 2022-04-20 01:42:22 UTC
On P8 BE machine, I encounter a build failure.

libgo/runtime/go-signal.c:236:59: error: 'union uc_regs_ptr' has no member named 'gregs'; did you mean 'regs'?
  236 |         ret.sigpc = ((ucontext_t*)(context))->uc_mcontext.gregs[32];

The machine is:
Architecture:          ppc64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Big Endian
Model name:            POWER8 (architected), altivec supported

reproduce command:
$GCC_SRC/configure --enable-languages=c,c++,go --with-cpu=native --with-long-double-128 --prefix=~/install/gcc-mainline-base
make -j 30

It may be the commit "r12-8168 af27d545dc6132dcd67d1ee854372ea9cfd2a225" which cause this issue.
Comment 1 Jiu Fu Guo 2022-04-20 01:44:46 UTC
The failure compiling command is about -m32:

/home/guojiufu/gcc/build/gcc-mainline-base/./gcc/xgcc -B/home/guojiufu/gcc/build/gcc-mainline-base/./gcc/ -B/home/guojiufu/gcc/install/gcc-mainline-base/powerpc64-unknown-linux-gnu/bin/ -B/home/guojiufu/gcc/install/gcc-mainline-base/powerpc64-unknown-linux-gnu/lib/ -isystem /home/guojiufu/gcc/install/gcc-mainline-base/powerpc64-unknown-linux-gnu/include -isystem /home/guojiufu/gcc/install/gcc-mainline-base/powerpc64-unknown-linux-gnu/sys-include -m32 -DHAVE_CONFIG_H -I. -I/home/guojiufu/gcc/gcc-mainline-base/libgo -I /home/guojiufu/gcc/gcc-mainline-base/libgo/runtime -I/home/guojiufu/gcc/gcc-mainline-base/libgo/../libffi/include -I../libffi/include -pthread -L../libatomic/.libs -fexceptions -fnon-call-exceptions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /home/guojiufu/gcc/gcc-mainline-base/libgo/../libgcc -I /home/guojiufu/gcc/gcc-mainline-base/libgo/../libbacktrace -I ../../../gcc/include -g -O2 -m32 -MT runtime/go-signal.lo -MD -MP -MF runtime/.deps/go-signal.Tpo -c /home/guojiufu/gcc/gcc-mainline-base/libgo/runtime/go-signal.c  -fPIC -DPIC -o runtime/.libs/go-signal.o
Comment 2 CVS Commits 2022-04-21 00:49:57 UTC
The master branch has been updated by Ian Lance Taylor <ian@gcc.gnu.org>:


commit r12-8210-g6a4e9934545c112eef5eb7248636baa96cbfd2c0
Author: Ian Lance Taylor <iant@golang.org>
Date:   Wed Apr 20 14:22:41 2022 -0700

    runtime: use correct field name for PPC32 GLIBC registers
    One of these days we will get this right.
    Fixes PR go/105315
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/401374
Comment 3 Ian Lance Taylor 2022-04-21 00:50:37 UTC
Thanks, should be fixed now, I hope.
Comment 4 Jiu Fu Guo 2022-04-21 09:16:53 UTC
(In reply to Ian Lance Taylor from comment #3)
> Thanks, should be fixed now, I hope.

As tested, 'go' build pass on that machine now. Thanks!