Closed hallyn closed 5 years ago
Hm, @CajuM says he does get libselinx on his build line. I must have something whacky in my environment, but I have no idea what. Using golang 1.11.5 on ubuntu disco.
With the following patch applied on master ld ends up complaining about missing p11-kit symbols, but there is no static version of libp11-kit in disco
diff --git a/linking_dynamic.go b/linking_dynamic.go
deleted file mode 100644
index 1197b81..0000000
--- a/linking_dynamic.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright <C2><A9> 2013, 2014, The Go-LXC Authors. All rights reserved.
-// Use of this source code is governed by a LGPLv2.1
-// license that can be found in the LICENSE file.
-
-// +build linux,cgo,!static_build
-
-package lxc
-
-// #cgo LDFLAGS: -llxc -lutil
-import "C"
diff --git a/linking_static.go b/linking_static.go
index 89f06b4..5b08adb 100644
--- a/linking_static.go
+++ b/linking_static.go
@@ -6,5 +6,5 @@
package lxc
-// #cgo LDFLAGS: -static -llxc -lseccomp -lutil -lcap
+// #cgo LDFLAGS: -static -llxc -lutil -lcap -lselinux -lseccomp -lgnutls -lgmp -lidn2 -lunistring -lhogweed -lgmp -lnettle -ltasn1 -lz
import "C"
Ok, thanks, guys. I think I'll spend some more time in a few weeks on the general static linking issue, but for now I can't.
Hi @caglar10ur
I'm trying to get github.com/lxc/crio-lxc with PR 15 to build. It's doing a static build and importing go-lxc. When I add -x to the go build line, I see
but i've added libselinux to the pkg-config line here, as well as in crio-lxc's internal.go. On the system where I'm building,
So why am I not seeing -lselinux in the gcc command being done by 'go build' above?