From 78a35219961d4684fb2597a5c1720d68e2f35cf8 Mon Sep 17 00:00:00 2001 From: Minoru Mizutani Date: Tue, 3 Oct 2023 05:31:26 +0900 Subject: [PATCH] Utilize the gcc-aarch64-linux-gnu toolchain to cross-arch compile on amd64 Linux machines --- .github/workflows/release-test.yml | 2 +- .goreleaser/linux.yml | 27 +++++++-------------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index 4cfcfd5b..a5a7b2a2 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -39,7 +39,7 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install sqlite3 + sudo apt-get install sqlite3 gcc-aarch64-linux-gnu - name: Install aws-cli uses: isbang/setup-awscli@v0.1.0 diff --git a/.goreleaser/linux.yml b/.goreleaser/linux.yml index c714d4d3..4e51dcfd 100644 --- a/.goreleaser/linux.yml +++ b/.goreleaser/linux.yml @@ -4,7 +4,7 @@ before: - go mod tidy builds: - - id: tbls-linux-amd64 + id: tbls-linux flags: - -a - -tags @@ -21,26 +21,13 @@ builds: - linux goarch: - amd64 -- - id: tbls-linux-arm64 - flags: - - -a - - -tags - - netgo - - -installsuffix - - netgo - ldflags: - - -s -w -X github.com/k1LoW/tbls.version={{.Version}} -X github.com/k1LoW/tbls.commit={{.FullCommit}} -X github.com/k1LoW/tbls.date={{.Date}} -X github.com/k1LoW/tbls/version.Version={{.Version}} - - -linkmode external - - -extldflags '-static' - env: - - CGO_ENABLED=1 - - CC=aarch64-linux-gnu-gcc - - CXX=aarch64-linux-gnu-g++ - goos: - - linux - goarch: - arm64 + overrides: + - goos: linux + goarch: arm64 + env: + - CC=aarch64-linux-gnu-gcc + - CXX=aarch64-linux-gnu-g++ archives: - id: tbls-archive