[arch-commits] Commit in go/trunk (PKGBUILD fix-ldflags.patch)

Morten Linderud foxboron at archlinux.org
Sat Nov 14 11:58:24 UTC 2020


    Date: Saturday, November 14, 2020 @ 11:58:24
  Author: foxboron
Revision: 754064

upgpkg: go 2:1.15.5-2

Added:
  go/trunk/fix-ldflags.patch
Modified:
  go/trunk/PKGBUILD

-------------------+
 PKGBUILD          |    9 ++++++---
 fix-ldflags.patch |   26 ++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-11-14 11:53:39 UTC (rev 754063)
+++ PKGBUILD	2020-11-14 11:58:24 UTC (rev 754064)
@@ -14,7 +14,7 @@
 pkgname=go
 epoch=2
 pkgver=1.15.5
-pkgrel=1
+pkgrel=2
 pkgdesc='Core compiler tools for the Go programming language'
 arch=(x86_64)
 url='https://golang.org/'
@@ -24,15 +24,18 @@
 provides=(go-pie)
 options=(!strip staticlibs)
 source=(https://storage.googleapis.com/golang/go$pkgver.src.tar.gz{,.asc}
-        "fix-color.patch::https://github.com/golang/go/commit/29634436fd741a7c685bf8f242b6fd62f093d1ad.patch")
+        "fix-color.patch::https://github.com/golang/go/commit/29634436fd741a7c685bf8f242b6fd62f093d1ad.patch"
+        "fix-ldflags.patch")
 validpgpkeys=('EB4C1BFD4F042F6DDDCCEC917721F63BD38B4796')
 sha256sums=('c1076b90cf94b73ebed62a81d802cd84d43d02dea8c07abdc922c57a071c84f1'
             'SKIP'
-            'f6bf4c18e4395bdd4925b1f15a713fa3daca0a28123d6c20d51234d7ce2d3357')
+            'f6bf4c18e4395bdd4925b1f15a713fa3daca0a28123d6c20d51234d7ce2d3357'
+            '57793df3095606f930b95c8b40deca6a0c9dbc3b3fcc491ad77a91c01f67c12e')
 
 prepare() {
     cd "${pkgname}"
     patch -Np1 < "$srcdir/fix-color.patch"
+    patch -Np1 < "$srcdir/fix-ldflags.patch"
 }
 
 build() {

Added: fix-ldflags.patch
===================================================================
--- fix-ldflags.patch	                        (rev 0)
+++ fix-ldflags.patch	2020-11-14 11:58:24 UTC (rev 754064)
@@ -0,0 +1,26 @@
+diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go
+index 2c40a4b..157ac4c 100644
+--- a/src/cmd/go/internal/work/exec.go
++++ b/src/cmd/go/internal/work/exec.go
+@@ -2883,6 +2883,21 @@
+ 				idx = bytes.Index(src, []byte(cgoLdflag))
+ 			}
+ 		}
++
++		// We expect to find the contents of cgoLDFLAGS in flags.
++		if len(cgoLDFLAGS) > 0 {
++		outer:
++			for i := range flags {
++				for j, f := range cgoLDFLAGS {
++					if f != flags[i+j] {
++						continue outer
++					}
++				}
++				flags = append(flags[:i], flags[i+len(cgoLDFLAGS):]...)
++				break
++			}
++		}
++
+ 		if err := checkLinkerFlags("LDFLAGS", "go:cgo_ldflag", flags); err != nil {
+ 			return nil, nil, err
+ 		}



More information about the arch-commits mailing list