Browse Source

Merge pull request #10874 from jefferyto/golang-ldflags-fix

golang: Fix ldflags when GO_PKG_LDFLAGS is set
lilik-openwrt-22.03
Rosen Penev 5 years ago
committed by GitHub
parent
commit
4b7e8d8593
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lang/golang/golang-package.mk

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

@ -275,7 +275,7 @@ define GoPackage/Build/Compile
mips|mipsle) installsuffix="$(GO_MIPS)" ;; \ mips|mipsle) installsuffix="$(GO_MIPS)" ;; \
mips64|mips64le) installsuffix="$(GO_MIPS64)" ;; \ mips64|mips64le) installsuffix="$(GO_MIPS64)" ;; \
esac ; \ esac ; \
ldflags="all=-linkmode external -extldflags '$(TARGET_LDFLAGS)'" ; \
ldflags="-linkmode external -extldflags '$(TARGET_LDFLAGS)'" ; \
pkg_gcflags="$(GO_PKG_GCFLAGS)" ; \ pkg_gcflags="$(GO_PKG_GCFLAGS)" ; \
pkg_ldflags="$(GO_PKG_LDFLAGS)" ; \ pkg_ldflags="$(GO_PKG_LDFLAGS)" ; \
for def in $(GO_PKG_LDFLAGS_X); do \ for def in $(GO_PKG_LDFLAGS_X); do \
@ -284,10 +284,10 @@ define GoPackage/Build/Compile
go install \ go install \
$$$${installsuffix:+-installsuffix $$$$installsuffix} \ $$$${installsuffix:+-installsuffix $$$$installsuffix} \
-trimpath \ -trimpath \
-ldflags "$$$$ldflags" \
-ldflags "all=$$$$ldflags" \
-v \ -v \
$$$${pkg_gcflags:+-gcflags "$$$$pkg_gcflags"} \ $$$${pkg_gcflags:+-gcflags "$$$$pkg_gcflags"} \
$$$${pkg_ldflags:+-ldflags "$$$$pkg_ldflags"} \
$$$${pkg_ldflags:+-ldflags "$$$$pkg_ldflags $$$$ldflags"} \
$(1) \ $(1) \
$$$$targets ; \ $$$$targets ; \
retval=$$$$? ; \ retval=$$$$? ; \


Loading…
Cancel
Save