@@ -84,8 +84,10 @@ therefore only use a few of them, or none.
infrastructure will automatically generate a minimal +go.mod+ file
in the package source tree if it doesn't exist.
-* +FOO_LDFLAGS+ and +FOO_TAGS+ can be used to pass respectively the
- +LDFLAGS+ or the +TAGS+ to the +go+ build command.
+* +FOO_LDFLAGS+, +FOO_EXTLDFLAGS+, and +FOO_TAGS+ can be used to pass
+ respectively the go +LDFLAGS+ (via the `-ldflags` command line flag),
+ the external linker flags +EXTLDFLAGS+ (via the `-extldflags`
+ command line flag), or the +TAGS+ to the +go+ build command.
* +FOO_BUILD_TARGETS+ can be used to pass the list of targets that
should be built. If +FOO_BUILD_TARGETS+ is not specified, it
@@ -114,10 +114,14 @@ ifndef $(2)_BUILD_CMDS
ifeq ($(4),target)
ifeq ($(BR2_STATIC_LIBS),y)
-$(2)_LDFLAGS += -extldflags '-static'
+$(2)_EXTLDFLAGS += -static
$(2)_TAGS += osusergo netgo
endif
+ifneq ($$($(2)_EXTLDFLAGS),)
+$(2)_LDFLAGS += -extldflags '$$($(2)_EXTLDFLAGS)'
+endif
+
# Build package for target
define $(2)_BUILD_CMDS
$$(foreach d,$$($(2)_BUILD_TARGETS),\