0

So, I have been trying to build flannel (https://github.com/coreos/flannel) with gccgo. Here is the error I am getting while building:

$ ./build 
Building flanneld...
# github.com/coreos/flannel/pkg/ip
gopath/src/github.com/coreos/flannel/pkg/ip/tun.go:57:37: error: reference to undefined identifier ‘syscall.TUNSETIFF’
  err = ioctl(int(tun.Fd()), syscall.TUNSETIFF, uintptr(unsafe.Pointer(&ifr)))
                                     ^

I am using gccgo-5 and gcc-5. Can anyone please help me figure out what exactly is the issue here? TIA

Pensu
  • 3,263
  • 10
  • 46
  • 71
  • What OS are you using? – Ainar-G Jul 02 '15 at 10:37
  • I am using Ubuntu Vivid (15.04) – Pensu Jul 02 '15 at 10:38
  • It could be an issue with the versinn of gccgo that supports it. Have you tried compiling it with the default go compiler? – Not_a_Golfer Jul 02 '15 at 12:21
  • Yeah, I tried. And it builds with default go compiler. But the arch I am working on, only has gccgo. Could it be the possibility that gccgo doesn't support all the stuff that default go compiler does? – Pensu Jul 02 '15 at 12:27
  • @Pensu: the syscall package is arch specific. You'll have to check how the syscall source for your arch is generated, and if that value is valid for your system. You can always lookup the value and define your own const. – JimB Jul 02 '15 at 15:48

1 Answers1

0

So, I found the answer. The problem was that gccgo didn't define TUNSETIFF for my arch. I defined the value accordingly and I was able to make it work. Thanks @JimB

Pensu
  • 3,263
  • 10
  • 46
  • 71