From f36a491cf93f6a2b7141a617de90ba06066c8d45 Mon Sep 17 00:00:00 2001 From: Jeremy Drake Date: Wed, 23 Mar 2022 17:03:29 -0700 Subject: [PATCH 1/3] go: add upstream fixes for usage in CLANGARM64. These issues only cropped up when linking Go binaries with clang/lld on ARM64 (which is required in order to make a DLL). --- mingw-w64-go/PKGBUILD | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mingw-w64-go/PKGBUILD b/mingw-w64-go/PKGBUILD index 3665feea5d..2782a0b748 100644 --- a/mingw-w64-go/PKGBUILD +++ b/mingw-w64-go/PKGBUILD @@ -5,17 +5,23 @@ _realname=go pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=1.18 -pkgrel=1 +pkgrel=2 pkgdesc="Go Lang (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') license=('BSD') url="https://www.golang.org/" depends=() -makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-${_realname}") +makedepends=("git" + "${MINGW_PACKAGE_PREFIX}-cc" + "${MINGW_PACKAGE_PREFIX}-${_realname}") options=('!strip') -source=("https://storage.googleapis.com/golang/go${pkgver}.src.tar.gz") -sha256sums=('38f423db4cc834883f2b52344282fa7a39fbb93650dc62a11fdf0be6409bdad6') +source=("https://storage.googleapis.com/golang/go${pkgver}.src.tar.gz" + "0001-no-dwarf-label-symbols.patch"::"https://github.com/golang/go/commit/cccfb8ffdb97224aed5cc718d4bac3f3df9e55ed.patch" + "0002-sort-relocations.patch"::"https://github.com/golang/go/commit/1a9972ec87de1eba7f9f71c8ed4afa88b0c122d4.patch") +sha256sums=('38f423db4cc834883f2b52344282fa7a39fbb93650dc62a11fdf0be6409bdad6' + '469a86967472989e24e986bb2f21122180ad59da06d10c6d41f9873e068bd289' + '3da855f4ada0bdef7b0ba8531a918086fc819401730da6684937e2a2c1d70b87') noextract=(go${pkgver}.src.tar.gz) # Helper macros to help make tasks easier # @@ -34,6 +40,9 @@ prepare() { mv "${srcdir}"/${_realname} "${srcdir}"/${_realname}-${pkgver} cd "${srcdir}/${_realname}-${pkgver}" + apply_patch_with_msg \ + 0001-no-dwarf-label-symbols.patch \ + 0002-sort-relocations.patch } build() { From ca2b8531b73b6fbdfd9ce2e2c35baf459d7a1fd5 Mon Sep 17 00:00:00 2001 From: Jeremy Drake Date: Mon, 28 Mar 2022 17:54:37 -0700 Subject: [PATCH 2/3] Revert "hugo: work around link error on arm64" This reverts commit 3534efbcab89ec1e681343c9cc61c1d34ccc1de9. Workaroud is no longer required after go-1.18-2 --- mingw-w64-hugo/PKGBUILD | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/mingw-w64-hugo/PKGBUILD b/mingw-w64-hugo/PKGBUILD index c5118e9e33..e5cb6cf50c 100644 --- a/mingw-w64-hugo/PKGBUILD +++ b/mingw-w64-hugo/PKGBUILD @@ -4,7 +4,7 @@ _realname=hugo pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=0.93.2 -pkgrel=2 +pkgrel=3 pkgdesc='A Fast and Flexible Static Site Generator built with love by bep, spf13 and friends in Go. (mingw-w64)' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') @@ -25,12 +25,8 @@ build() { export CGO_CXXFLAGS="${CXXFLAGS}" export CGO_LDFLAGS="${LDFLAGS}" export GO_LDFLAGS="-s -w" - export GOFLAGS="-trimpath -mod=readonly -modcacherw" - # work around a link error in aarch64 - # .debug_frame+1MB: addpesym: could not map .debug_frame+1MB symbol with non .text or .rdata or .data section - if [[ "${CARCH}" != "aarch64" ]]; then - GOFLAGS+=" -ldflags=-linkmode=external" - fi + export GOFLAGS="-trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external" + go build } From e76c667a23bc26760da632c57aece701230e1ad3 Mon Sep 17 00:00:00 2001 From: Jeremy Drake Date: Mon, 28 Mar 2022 17:56:42 -0700 Subject: [PATCH 3/3] rclone: enable for clangarm64. This succeeds and generates a working librclone.dll after go-1.18-2 --- mingw-w64-rclone/PKGBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-rclone/PKGBUILD b/mingw-w64-rclone/PKGBUILD index 52d36712c4..6b8afa8d39 100644 --- a/mingw-w64-rclone/PKGBUILD +++ b/mingw-w64-rclone/PKGBUILD @@ -9,7 +9,7 @@ pkgver=1.58.0 pkgrel=2 pkgdesc='Cloud-aware file synchonization utility (mingw-w64)' arch=('any') -mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32') +mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') url='https://rclone.org/' license=('MIT') makedepends=("git"