* [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
* Re: [Buildroot] [PATCH v2] package/go: disable cgo support with static libs
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
1 sibling, 0 replies; 3+ messages in thread
From: Christian Stewart via buildroot @ 2022-11-22 6:36 UTC (permalink / raw)
To: Anisse Astier; +Cc: Christian Stewart, Yann E . MORIN, Buildroot Mailing List
[-- Attachment #1.1: Type: text/plain, Size: 1840 bytes --]
Reviewed-by: Christian Stewart <christian@paral.in>
Thanks!
On Mon, Nov 21, 2022, 2:50 PM Anisse Astier <anisse@astier.eu> wrote:
> 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
>
>
[-- Attachment #1.2: Type: text/html, Size: 2886 bytes --]
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH v2] package/go: disable cgo support with static libs
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
1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2022-11-22 17:21 UTC (permalink / raw)
To: Anisse Astier; +Cc: buildroot
Anisse, All,
On 2022-11-21 23:49 +0100, Anisse Astier spake thusly:
> 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
Why don't we move the dependency on threads to this symbol, and...
> # 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:)
... then this condition would be just:
ifeq ($(BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS),y)
I am not fond of the current situation, where parts of the conditions
are in Config.in, and the rest in go.mk.
Regards,
Yann E. MORIN.
> HOST_GO_CGO_ENABLED = 1
> else
> HOST_GO_CGO_ENABLED = 0
> --
> 2.38.1
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [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.