problem building gccgo on Fedora 10

13 views
Skip to first unread message

Chris Card

unread,
Nov 12, 2009, 11:25:15 AM11/12/09
to golang-nuts
I'm trying to build gccgo on Fedora 10.
First I hit the issue with <linux/user.h> which I replaced by <sys/
user.h> in mksysinfo.sh, but now I'm getting these errors:

make[3]: Entering directory `/home/ccard/gccgo/objdir/i686-pc-linux-
gnu/libgo'
rm -f `echo debug/libproc.a | sed -e 's|/lib|/|' -e 's/\.a/.gox/'`;
test -d debug || mkdir -p debug; rm -f debug/libproc.a;
files=`echo ../../../gccgo/libgo/go/debug/proc/proc.go ../../../gccgo/
libgo/go/debug/proc/proc_linux.go ../../../gccgo/libgo/go/debug/proc/
regs_linux_386.go container/vector.gox fmt.gox io.gox os.gox
runtime.gox strconv.gox strings.gox sync.gox syscall.gox | sed -e 's/
[^ ]*\.gox//g'`; if /bin/sh ./libtool --tag GO --mode=compile /home/
ccard/gccgo/objdir/./gcc/gccgo -B/home/ccard/gccgo/objdir/./gcc/ -O2
-g -c -o debug/libproc.a.o $files; then ar rc debug/libproc.a debug/
libproc.a.o; else exit 1; fi
libtool: compile: /home/ccard/gccgo/objdir/./gcc/gccgo -B/home/ccard/
gccgo/objdir/./gcc/ -O2 -g -c ../../../gccgo/libgo/go/debug/proc/
proc.go ../../../gccgo/libgo/go/debug/proc/proc_linux.go ../../../
gccgo/libgo/go/debug/proc/regs_linux_386.go -fPIC -o debug/.libs/
libproc.a.o
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:83:16: error:
reference to undefined field or method ‘Cs’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:85:16: error:
reference to undefined field or method ‘Ss’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:87:16: error:
reference to undefined field or method ‘Ds’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:89:16: error:
reference to undefined field or method ‘Es’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:91:16: error:
reference to undefined field or method ‘Fs’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:93:16: error:
reference to undefined field or method ‘Gs’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:121:4: error:
reference to undefined field or method ‘Cs’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:123:4: error:
reference to undefined field or method ‘Ss’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:125:4: error:
reference to undefined field or method ‘Ds’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:127:4: error:
reference to undefined field or method ‘Es’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:129:4: error:
reference to undefined field or method ‘Fs’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:131:4: error:
reference to undefined field or method ‘Gs’
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:121:8: error:
invalid left hand side of assignment
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:123:8: error:
invalid left hand side of assignment
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:125:8: error:
invalid left hand side of assignment
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:127:8: error:
invalid left hand side of assignment
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:129:8: error:
invalid left hand side of assignment
../../../gccgo/libgo/go/debug/proc/regs_linux_386.go:131:8: error:
invalid left hand side of assignment

Any ideas?

Chris

Ian Lance Taylor

unread,
Nov 12, 2009, 6:25:28 PM11/12/09
to Chris Card, golang-nuts
Chris Card <ctc...@hotmail.com> writes:

> I'm trying to build gccgo on Fedora 10.
> First I hit the issue with <linux/user.h> which I replaced by <sys/
> user.h> in mksysinfo.sh, but now I'm getting these errors:

I hope to fix this soon, but in the meantime see this patch from
Martin Capitanio may help.

Ian

svn diff
Index: libgo/go/debug/proc/regs_linux_386.go
===================================================================
--- libgo/go/debug/proc/regs_linux_386.go (revision 154104)
+++ libgo/go/debug/proc/regs_linux_386.go (working copy)
@@ -26,12 +26,12 @@
"esp",
"eip",
"eflags",
- "cs",
- "ss",
- "ds",
- "es",
- "fs",
- "gs",
+ "xcs",
+ "xss",
+ "xds",
+ "xes",
+ "xfs",
+ "xgs",
}

func (r *_386Regs) PC() Word { return Word(r.Eip) }
@@ -80,17 +80,17 @@
case 9:
return Word(uint32(r.Eflags))
case 10:
- return Word(r.Cs)
+ return Word(r.Xcs)
case 11:
- return Word(r.Ss)
+ return Word(r.Xss)
case 12:
- return Word(r.Ds)
+ return Word(r.Xds)
case 13:
- return Word(r.Es)
+ return Word(r.Xes)
case 14:
- return Word(r.Fs)
+ return Word(r.Xfs)
case 15:
- return Word(r.Gs)
+ return Word(r.Xgs)
}
panic("invalid register index ", strconv.Itoa(i));
}
@@ -118,17 +118,17 @@
case 9:
r.Eflags = int32(val)
case 10:
- r.Cs = uint16(val)
+ r.Xcs = int32(val)
case 11:
- r.Ss = uint16(val)
+ r.Xss = int32(val)
case 12:
- r.Ds = uint16(val)
+ r.Xds = int32(val)
case 13:
- r.Es = uint16(val)
+ r.Xes = int32(val)
case 14:
- r.Fs = uint16(val)
+ r.Xfs = int32(val)
case 15:
- r.Gs = uint16(val)
+ r.Xgs = int32(val)
default:
panic("invalid register index ", strconv.Itoa(i))
}
Index: libgo/mksysinfo.sh
===================================================================
--- libgo/mksysinfo.sh (revision 154104)
+++ libgo/mksysinfo.sh (working copy)
@@ -45,11 +45,13 @@
EOF

# FIXME: GNU/Linux specific.
+#include <sys/user.h>
+#include <linux/user.h>
cat >>sysinfo.c <<EOF
-#include <linux/user.h>
+#include <sys/user.h>
EOF

-${CC} -D_GNU_SOURCE -ggo -S -o sysinfo.s sysinfo.c
+${CC} ${CFLAGS} -D_GNU_SOURCE -ggo -S -o sysinfo.s sysinfo.c

echo 'package syscall' > ${OUT}


Chris Card

unread,
Nov 13, 2009, 3:44:31 AM11/13/09
to golang-nuts


On Nov 12, 11:25 pm, Ian Lance Taylor <i...@google.com> wrote:
> Chris Card <ctc...@hotmail.com> writes:
> > I'm trying to build gccgo on Fedora 10.
> > First I hit the issue with <linux/user.h> which I replaced by <sys/
> >user.h> in mksysinfo.sh, but now I'm getting these errors:
>
> I hope to fix this soon, but in the meantime see this patch from
> Martin Capitanio may help.
>
> Ian

Thanks Ian,
I'll give that a try

Chris

Chris Card

unread,
Nov 13, 2009, 3:57:08 AM11/13/09
to golang-nuts
... and it worked. Thanks again

Chris

andreluizv...@gmail.com

unread,
Nov 17, 2009, 8:29:00 PM11/17/09
to golang-nuts
Please forgive my ignorance, but what exactly, should I do do apply
this patch? I'm trying to build gccgo on my Ubuntu 9.10 machine.

Thanks a lot

On 13 nov, 06:44, Chris Card <ctc...@hotmail.com> wrote:
> On Nov 12, 11:25 pm, Ian Lance Taylor <i...@google.com> wrote:
>
> > Chris Card <ctc...@hotmail.com> writes:
> > > I'm trying to buildgccgoon Fedora 10.

Adam Langley

unread,
Nov 17, 2009, 8:31:56 PM11/17/09
to andreluizv...@gmail.com, golang-nuts
On Tue, Nov 17, 2009 at 5:29 PM, andreluizv...@gmail.com
<andreluizv...@gmail.com> wrote:
> Please forgive my ignorance, but what exactly, should I do do apply
> this patch? I'm trying to build gccgo on my Ubuntu 9.10 machine.

The 'patch' command will apply patches. See `man patch`.


AGL

Ian Lance Taylor

unread,
Nov 18, 2009, 12:35:14 AM11/18/09
to andreluizv...@gmail.com, golang-nuts
"andreluizv...@gmail.com" <andreluizv...@gmail.com>
writes:

> Please forgive my ignorance, but what exactly, should I do do apply
> this patch? I'm trying to build gccgo on my Ubuntu 9.10 machine.

You no longer need to apply that patch, I have committed a different
fix to the gccgo branch.

Ian
Reply all
Reply to author
Forward
0 new messages