This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to debug go build errors


On 02/08/2018 05:39 PM, Ian Lance Taylor wrote:
On Thu, Feb 8, 2018 at 3:24 PM, Martin Sebor <msebor@gmail.com> wrote:

While testing what should be an innocuous patch to add LTO
to a bunch of middle-end warning options

  https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00381.html

I get Go errors during ordinary bootstrap about undefined names
for errno constants:

/opt/notnfs/msebor/src/gcc/84212/libgo/go/syscall/env_unix.go:96:10: error:
reference to undefined name ‘EINVAL’

Bootstrapping all other front ends (including Ada and Brig),
succeeds and there are no regressions in the test suite.

I have no experience with Go.  Does anything about the patch
jump out at you that could be causing this?  If not, can you
suggest how to debug it?

No, I don't see why your patch would cause this problem.

EINVAL should be defined in the generated file
TARGET/libgo/sysinfo.go.  You should see, among many others, the lines
    const _EINVAL = 22
and
    const EINVAL = Errno(_EINVAL)

That file is built by the shell script libgo/mksysinfo.sh, which looks
at the generated file TARGET/libgo/gen-sysinfo.go.  The gen-sysinfo.go
file is built by running the C compiler with the -fdump-go-spec option
on the file libgo/sysinfo.c (essentially GCC_FOR_TARGET
-fdump-go-spec=gen-sysinfo.go -std=gnu99 -S sysinfo.c).  I guess
something along that chain has broken, but I don't know what.

I've figured out what was causing it -- a silly typo.  (Our
emails must have crossed by barely a couple of minutes).
Thanks for the quick reply though!

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]