Browse Source

golang: Fix conditionals not stripped

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 86fd1ebbe4)
lilik-openwrt-22.03
Jeffery To 3 years ago
committed by Rosen Penev
parent
commit
56108a08ba
2 changed files with 10 additions and 10 deletions
  1. +4
    -4
      lang/golang/golang-host-build.mk
  2. +6
    -6
      lang/golang/golang-package.mk

+ 4
- 4
lang/golang/golang-host-build.mk View File

@ -107,10 +107,10 @@ GO_HOST_CUSTOM_LDFLAGS= \
GO_HOST_INSTALL_ARGS= \ GO_HOST_INSTALL_ARGS= \
-v \ -v \
-ldflags "all=$(GO_HOST_DEFAULT_LDFLAGS)" \ -ldflags "all=$(GO_HOST_DEFAULT_LDFLAGS)" \
$(if $(filter $(GO_HOST_ENABLE_PIE),1),-buildmode pie) \
$(if $(GO_HOST_GCFLAGS),-gcflags "$(GO_HOST_GCFLAGS)") \
$(if $(GO_HOST_CUSTOM_LDFLAGS),-ldflags "$(GO_HOST_CUSTOM_LDFLAGS) $(GO_HOST_DEFAULT_LDFLAGS)") \
$(if $(GO_HOST_TAGS),-tags "$(GO_HOST_TAGS)")
$(if $(GO_HOST_ENABLE_PIE),-buildmode pie) \
$(if $(strip $(GO_HOST_GCFLAGS)),-gcflags "$(GO_HOST_GCFLAGS)") \
$(if $(strip $(GO_HOST_CUSTOM_LDFLAGS)),-ldflags "$(GO_HOST_CUSTOM_LDFLAGS) $(GO_HOST_DEFAULT_LDFLAGS)") \
$(if $(strip $(GO_HOST_TAGS)),-tags "$(GO_HOST_TAGS)")
define GoHost/Host/Configure define GoHost/Host/Configure
$(GO_GENERAL_BUILD_CONFIG_VARS) \ $(GO_GENERAL_BUILD_CONFIG_VARS) \


+ 6
- 6
lang/golang/golang-package.mk View File

@ -241,15 +241,15 @@ GO_PKG_INSTALL_ARGS= \
-buildvcs=false \ -buildvcs=false \
-trimpath \ -trimpath \
-ldflags "all=$(GO_PKG_DEFAULT_LDFLAGS)" \ -ldflags "all=$(GO_PKG_DEFAULT_LDFLAGS)" \
$(if $(GO_PKG_DEFAULT_GCFLAGS),-gcflags "all=$(GO_PKG_DEFAULT_GCFLAGS)") \
$(if $(GO_PKG_DEFAULT_ASMFLAGS),-asmflags "all=$(GO_PKG_DEFAULT_ASMFLAGS)") \
$(if $(filter $(GO_PKG_ENABLE_PIE),1),-buildmode pie) \
$(if $(strip $(GO_PKG_DEFAULT_GCFLAGS)),-gcflags "all=$(GO_PKG_DEFAULT_GCFLAGS)") \
$(if $(strip $(GO_PKG_DEFAULT_ASMFLAGS)),-asmflags "all=$(GO_PKG_DEFAULT_ASMFLAGS)") \
$(if $(GO_PKG_ENABLE_PIE),-buildmode pie) \
$(if $(filter $(GO_ARCH),arm),-installsuffix "v$(GO_ARM)") \ $(if $(filter $(GO_ARCH),arm),-installsuffix "v$(GO_ARM)") \
$(if $(filter $(GO_ARCH),mips mipsle),-installsuffix "$(GO_MIPS)") \ $(if $(filter $(GO_ARCH),mips mipsle),-installsuffix "$(GO_MIPS)") \
$(if $(filter $(GO_ARCH),mips64 mips64le),-installsuffix "$(GO_MIPS64)") \ $(if $(filter $(GO_ARCH),mips64 mips64le),-installsuffix "$(GO_MIPS64)") \
$(if $(GO_PKG_GCFLAGS),-gcflags "$(GO_PKG_GCFLAGS) $(GO_PKG_DEFAULT_GCFLAGS)") \
$(if $(GO_PKG_CUSTOM_LDFLAGS),-ldflags "$(GO_PKG_CUSTOM_LDFLAGS) $(GO_PKG_DEFAULT_LDFLAGS)") \
$(if $(GO_PKG_TAGS),-tags "$(GO_PKG_TAGS)")
$(if $(strip $(GO_PKG_GCFLAGS)),-gcflags "$(GO_PKG_GCFLAGS) $(GO_PKG_DEFAULT_GCFLAGS)") \
$(if $(strip $(GO_PKG_CUSTOM_LDFLAGS)),-ldflags "$(GO_PKG_CUSTOM_LDFLAGS) $(GO_PKG_DEFAULT_LDFLAGS)") \
$(if $(strip $(GO_PKG_TAGS)),-tags "$(GO_PKG_TAGS)")
define GoPackage/Build/Configure define GoPackage/Build/Configure
$(GO_GENERAL_BUILD_CONFIG_VARS) \ $(GO_GENERAL_BUILD_CONFIG_VARS) \


Loading…
Cancel
Save