All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] package/go: disable cgo support with static libs
@ 2022-11-21 22:49 Anisse Astier
  2022-11-22  6:36 ` Christian Stewart via buildroot
  2022-11-22 17:21 ` Yann E. MORIN
  0 siblings, 2 replies; 3+ messages in thread
From: Anisse Astier @ 2022-11-21 22:49 UTC (permalink / raw)
  To: buildroot; +Cc: Anisse Astier, Yann E . MORIN

The go stdlib "plugin" package relies on dlfcn.h which isn't available
when we have BR2_STATIC_LIBS=y.

This should fix this build error from autobuilders:

/buildroot/build/host-go-1.19.3/src/plugin/plugin_dlopen.go:11:10: fatal error: dlfcn.h: No such file or directory
   11 | #include <dlfcn.h>

Signed-off-by: Anisse Astier <anisse@astier.eu>
---
 package/go/Config.in.host | 1 +
 package/go/go.mk          | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/go/Config.in.host b/package/go/Config.in.host
index ded02d3b3a..9e79a7dfd5 100644
--- a/package/go/Config.in.host
+++ b/package/go/Config.in.host
@@ -23,6 +23,7 @@ config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
 	# Go doesn't support CGO linking on MIPS64x platforms
 	# See: https://github.com/karalabe/xgo/issues/46
 	depends on !BR2_mips64 && !BR2_mips64el
+	depends on !BR2_STATIC_LIBS
 
 # Host go packages should depend on BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
 config BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS
diff --git a/package/go/go.mk b/package/go/go.mk
index fd4caa2e5a..d54be8cd78 100644
--- a/package/go/go.mk
+++ b/package/go/go.mk
@@ -87,7 +87,7 @@ HOST_GO_TARGET_ENV = \
 # set, build in cgo support for any go programs that may need it.  Note that
 # any target package needing cgo support must include
 # 'depends on BR2_TOOLCHAIN_HAS_THREADS' in its config file.
-ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y)
+ifeq ($(BR2_TOOLCHAIN_HAS_THREADS):$(BR2_STATIC_LIBS),y:)
 HOST_GO_CGO_ENABLED = 1
 else
 HOST_GO_CGO_ENABLED = 0
-- 
2.38.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-22 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-21 22:49 [Buildroot] [PATCH v2] package/go: disable cgo support with static libs Anisse Astier
2022-11-22  6:36 ` Christian Stewart via buildroot
2022-11-22 17:21 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.