[lxc-devel] [lxd/master] lxd-p2c: Fix static build
stgraber on Github
lxc-bot at linuxcontainers.org
Thu Oct 4 17:05:14 UTC 2018
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181004/dd3d117d/attachment.bin>
-------------- next part --------------
From 9f5cf240f530e65b27e652d0476cd35c1ee69bcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 4 Oct 2018 12:58:05 -0400
Subject: [PATCH] lxd-p2c: Fix static build
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Closes #5102
Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
Makefile | 5 +++++
shared/i18n/i18n.go | 2 +-
shared/i18n/i18n_linux.go | 1 +
shared/util_linux_notcgo.go | 5 +++++
4 files changed, 12 insertions(+), 1 deletion(-)
create mode 100644 shared/util_linux_notcgo.go
diff --git a/Makefile b/Makefile
index cec6a61421..636dd34a2d 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,11 @@ client:
go install -v -tags "$(TAG_SQLITE3)" $(DEBUG) ./lxc
@echo "LXD client built successfully"
+.PHONY: lxd-p2c
+lxd-p2c:
+ CGO_ENABLED=0 go install -v -tags netgo ./lxd-p2c
+ @echo "LXD-P2C built successfully"
+
.PHONY: deps
deps:
# sqlite
diff --git a/shared/i18n/i18n.go b/shared/i18n/i18n.go
index 9a43f14b74..0fdb9aebdb 100644
--- a/shared/i18n/i18n.go
+++ b/shared/i18n/i18n.go
@@ -1,4 +1,4 @@
-// +build !linux
+// +build !linux !cgo
package i18n
diff --git a/shared/i18n/i18n_linux.go b/shared/i18n/i18n_linux.go
index 11399daee5..1b3ab14fd8 100644
--- a/shared/i18n/i18n_linux.go
+++ b/shared/i18n/i18n_linux.go
@@ -1,4 +1,5 @@
// +build linux
+// +build cgo
package i18n
diff --git a/shared/util_linux_notcgo.go b/shared/util_linux_notcgo.go
new file mode 100644
index 0000000000..9f82988c8d
--- /dev/null
+++ b/shared/util_linux_notcgo.go
@@ -0,0 +1,5 @@
+// +build linux,!cgo
+
+package shared
+
+const ABSTRACT_UNIX_SOCK_LEN int = 107
More information about the lxc-devel
mailing list