[lxc-devel] [go-lxc/v2] go-lxc: update cgo build flags

brauner on Github lxc-bot at linuxcontainers.org
Mon Oct 21 19:28:52 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 477 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191021/d7352983/attachment.bin>
-------------- next part --------------
From 498d25b1407b2c60c44dcd70d8798a6673861afe Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 21 Oct 2019 21:27:02 +0200
Subject: [PATCH] go-lxc: update cgo build flags

Use the same flags we require in LXD. Especially, hide all C functions
to avoid symbol resolution clashes.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 linking_dynamic.go | 1 +
 linking_static.go  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/linking_dynamic.go b/linking_dynamic.go
index fdd8bbc..4d67019 100644
--- a/linking_dynamic.go
+++ b/linking_dynamic.go
@@ -6,5 +6,6 @@
 
 package lxc
 
+// #cgo CFLAGS: -std=gnu11 -Wvla -Werror -fvisibility=hidden
 // #cgo pkg-config: lxc
 import "C"
diff --git a/linking_static.go b/linking_static.go
index 8e9c626..3bacea2 100644
--- a/linking_static.go
+++ b/linking_static.go
@@ -6,6 +6,7 @@
 
 package lxc
 
+// #cgo CFLAGS: -std=gnu11 -Wvla -Werror -fvisibility=hidden
 // #cgo pkg-config: --static lxc
 // #cgo LDFLAGS: -static
 import "C"


More information about the lxc-devel mailing list