[Buildroot] [PATCH 2/3] package/runc: fix shared only build when libseccomp is enabled.

Romain Naour romain.naour at gmail.com
Thu Jul 7 18:39:36 UTC 2016


When BR2_PACKAGE_LIBSECCOMP is set, the go build system will try to
find static library libseccomp.a since "static_build" and
"extldflags '-static'" are used.

Link runc statically only for static only build and prefer dynamic
linking otherwise.

Signed-off-by: Romain Naour <romain.naour at gmail.com>
Cc: Christian Stewart <christian at paral.in>
---
 package/runc/runc.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/package/runc/runc.mk b/package/runc/runc.mk
index 1396e0c..66f234f 100644
--- a/package/runc/runc.mk
+++ b/package/runc/runc.mk
@@ -19,10 +19,14 @@ RUNC_MAKE_ENV = $(HOST_GO_TARGET_ENV) \
 	PATH=$(BR_PATH)
 
 RUNC_GLDFLAGS = \
-	-X main.gitCommit=$(RUNC_VERSION) \
-	-extldflags '-static'
+	-X main.gitCommit=$(RUNC_VERSION)
 
-RUNC_GOTAGS = cgo static_build
+RUNC_GOTAGS = cgo
+
+ifeq ($(BR2_STATIC_LIBS),y)
+RUNC_GOTAGS += static_build
+RUNC_GLDFLAGS += -extldflags '-static'
+endif
 
 ifeq ($(BR2_PACKAGE_LIBSECCOMP),y)
 RUNC_GOTAGS += seccomp
-- 
2.5.5



More information about the buildroot mailing list