Won't compile (ARM): main.c Error 141 y.tab.h

400 views
Skip to first unread message

AJ ONeal

unread,
Apr 13, 2011, 5:11:25 PM4/13/11
to golan...@googlegroups.com
When I try to compile go it gets stuck at main.c with what appears to be a bison error.

I've tried the bison that comes with my distro (OpenEmbedded) and the one straight from GNU.

Am I doing something wrong or should I file a bug?


gcc (GCC) 4.3.3
m4 (GNU M4) 1.4.14
bison (GNU Bison) 2.4.3 (downloaded and compiled directly from gnu.org)



%%%% making godefs %%%%

make -C godefs install
make[1]: Entering directory `/home/root/go/src/cmd/cc'
LANG=C LANGUAGE="en_US.UTF8" bison -v -y -d cc.y 
make[1]: Entering directory `/home/root/go/src/cmd/5l'
quietgcc -I"/home/root/go/include" -ggdb -O2 -c "/home/root/go/src/cmd/5l/asm.c"
make[1]: Entering directory `/home/root/go/src/cmd/godefs'
quietgcc -I"/home/root/go/include" -ggdb -O2 -c "/home/root/go/src/cmd/godefs/main.c"
make[1]: Entering directory `/home/root/go/src/cmd/cov'
quietgcc -I"/home/root/go/include" -ggdb -O2 -c "/home/root/go/src/cmd/cov/main.c"
conflicts: 3 shift/reduce
make[1]: *** [y.tab.h] Error 141
make[1]: Leaving directory `/home/root/go/src/cmd/cc'
make: *** [cc.install] Error 2
make: *** Waiting for unfinished jobs....

Russ Cox

unread,
Apr 13, 2011, 5:26:49 PM4/13/11
to golan...@googlegroups.com

You might have bison++ installed instead of bison.

AJ ONeal

unread,
Apr 13, 2011, 6:21:26 PM4/13/11
to golan...@googlegroups.com
I have http://ftp.gnu.org/gnu/bison/bison-2.4.tar.gz

Where would you suggest that I get bison?

AJ ONeal

peterGo

unread,
Apr 13, 2011, 7:00:24 PM4/13/11
to golang-nuts
AJ,

On linux 386/amd64 and on windows 386 I have:

$ bison -V
bison (GNU Bison) 2.4.1

I haven't got as far as installing Go on my linux arm system.

Peter

Skip Tavakkolian

unread,
Apr 13, 2011, 8:23:27 PM4/13/11
to peterGo, golang-nuts
i build the linux/arm port regularly. bison is 2.3

-Skip

Russ Cox

unread,
Apr 13, 2011, 10:09:59 PM4/13/11
to AJ ONeal, golan...@googlegroups.com
I don't know what's wrong with your bison, but it should not
be exiting with an error just because there are shift-reduce
conflicts:

$ cd $GOROOT/src/cmd/cc
$ bison -v -y -d cc.y
conflicts: 3 shift/reduce
$ echo $?
0
$

AJ ONeal

unread,
Apr 14, 2011, 2:00:34 PM4/14/11
to Skip Tavakkolian, golang-nuts
Skip, Russ,

The error appears to be with the go scripts. They aren't respecting my environment's search paths.

# which bison
/usr/local/bin/bison

# cd $GOROOT/src/cmd/cc
# bison -v -y -d cc.y
conflicts: 3 shift/reduce
# echo $?
0


# cd $GOROOT/src/cmd/cc
# /usr/bin/bison -v -y -d cc.y
conflicts: 3 shift/reduce
# echo $?
141

I'm going to try again by replacing /usr/bin/bison with /usr/local/bin/bison

AJ ONeal

AJ ONeal

unread,
Apr 14, 2011, 3:00:52 PM4/14/11
to Russ Cox, Skip Tavakkolian, golang-nuts
I was able to compile my first GO program (the hello world on the front page)!

Thanks for your help.

AJ ONeal
Reply all
Reply to author
Forward
0 new messages