Win Unix Mac

Articles,How Tos,Tips n more

  • Increase font size
  • Default font size
  • Decrease font size

Go compilation error and solutions

E-mail Print PDF

Error message: sysinfo.c:18:24: fatal error: linux/user.h: No such file or directory, compiling Gccgo on Fedora 11 i386.

I came across this error message after following the instructions on the Gccgo website,

1) install any dependancies ( kernel-devel, kernel-headers, the usual compilations tools including gcc )

2) Configure the source ../gccgo/configure --enable-languages=c,c++,go

3) Make and then the error :

sysinfo.c:18:24: fatal error: linux/user.h: No such file or directory

The only other link in Google for this error is on the Golang-Nuts Group list / website.

Having read this page I am testing by installing more possibly silent or otherwise missing dependancies and recompiling before I start changing the code at all. I will update the page with more information shortly ...

So after some tinkering i decided to find out where it expected to include these files, and found them using locate.  ( on my Fedora 11 box, it was searching /usr/local/src )

[root@f11 include]# cp /usr/src/kernels/2.6.30.8-64.fc11.i586/arch/x86/include/asm/user_64.h asm/


I repeated the solution, only to come accross a new error:

libgo/syscalls/sysfile.go sysinfo.go  -fPIC -o .libs/libsyscall.a.o

../../../gccgo/libgo/syscalls/syscall_linux_386.go:10:24: error: reference to undefined field or method ‘Eip’

../../../gccgo/libgo/syscalls/syscall_linux_386.go:14:3: error: reference to undefined field or method ‘Eip’

sysinfo.go:2124:358: error: use of undefined type ‘__fpstate’

sysinfo.go:2127:24: error: struct field type is incomplete

../../../gccgo/libgo/syscalls/syscall_linux_386.go:14:8: error: invalid left hand side of assignment

sysinfo.go:2124:358: error: use of undefined type ‘__fpstate’

make[3]: *** [libsyscall.a] Error 1

make[3]: Leaving directory `/home/go/objdir/i686-pc-linux-gnu/libgo'

make[2]: *** [all] Error 2

make[2]: Leaving directory `/home/go/objdir/i686-pc-linux-gnu/libgo'

make[1]: *** [all-target-libgo] Error 2

make[1]: Leaving directory `/home/go/objdir'

make: *** [all] Error 2

So back to the drawing board, I suspect I should do an SVN update, make sure I have the latest src, rm -fr the source tree, and start again. I might have to work on the config script, look in more detail at what its doing. I am pretty sure my environment is not setup well for gccgo and its not that it does not compile. I am not afraid to change the code, but it complicates troubleshooting if you do mess with it :) Other people do report sucess compiling, I must do more research and try again.

Last Updated on Friday, 13 November 2009 16:47  

Add your comment

Your name:
Subject:
Comment:

yvcomment, category: "Unix Error Messages"