|
@@ -78,23 +78,24 @@ HOST_GO_TARGET_ENV = \
|
|
|
CGO_LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
|
GOTOOLDIR="$(HOST_GO_TOOLDIR)"
|
|
|
|
|
|
-# The go compiler's cgo support uses threads. If BR2_TOOLCHAIN_HAS_THREADS is
|
|
|
-# 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)
|
|
|
+# Allow packages to use cgo support if it is available for the target. They
|
|
|
+# will need the toolchain for cgo support; for convenence, include that
|
|
|
+# dependency here.
|
|
|
+#
|
|
|
+# Note that any target package needing cgo support must include 'depends on
|
|
|
+# BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS' in its config file.
|
|
|
+ifeq ($(BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS),y)
|
|
|
HOST_GO_DEPENDENCIES_CGO += toolchain
|
|
|
HOST_GO_CGO_ENABLED = 1
|
|
|
else
|
|
|
HOST_GO_CGO_ENABLED = 0
|
|
|
endif
|
|
|
-
|
|
|
else # !BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
|
|
|
-# host-go can still be used to build packages for the host. No need to set all
|
|
|
-# the arch stuff since we will not be cross-compiling.
|
|
|
+# If the target arch does not support go, host-go can still be used to build
|
|
|
+# packages for the host, and enable cgo. No need to set all the arch stuff
|
|
|
+#since we will not be cross-compiling.
|
|
|
HOST_GO_CGO_ENABLED = 1
|
|
|
endif # BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
|
|
|
-
|
|
|
# Ensure the toolchain is available, whatever the provider
|
|
|
HOST_GO_DEPENDENCIES += $(HOST_GO_DEPENDENCIES_CGO)
|
|
|
|