Closed stgraber closed 9 years ago
ok, so the main failure can be fixed with the following changes:
I'm now getting:
ubuntu@lantea:~/lxd-0.0$ gccgo-go install -v github.com/lxc/lxd/lxc
github.com/lxc/lxd/lxc
# github.com/lxc/lxd/lxc
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:37: error: undefined reference to 'list_active_containers'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:43: error: undefined reference to 'list_all_containers'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:49: error: undefined reference to 'list_defined_containers'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:55: error: undefined reference to 'lxc_container_get'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:61: error: undefined reference to 'lxc_container_new'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:67: error: undefined reference to 'lxc_container_put'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:73: error: undefined reference to 'lxc_get_global_config_item'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.go:79: error: undefined reference to 'lxc_get_version'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.c:232: error: undefined reference to 'lxc_attach_run_shell'
/home/ubuntu/lxd-0.0/dist/src/gopkg.in/lxc/go-lxc.v2/lxc-binding.c:236: error: undefined reference to 'lxc_wait_for_pid_status'
collect2: error: ld returned 1 exit status
Which to me looks like -llxc wasn't passed through to ld somehow.
Apparently that's because gccgo ignores or fails to parse the pkg-config line, manually setting LDFLAGS fixes it... I'll send a branch with both changes.
I'm looking into gccgo as a way to build LXD for ppc64el and arm64 where gc doesn't work.
So far it looks like most of our code is fine, but go-lxc itself fails when building using gccgo5.
Here's as simple an example as I could come up with: