Skip to content

Change settings to unpack and dynamically link libraries #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 43 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,55 @@ before:
- go mod tidy
- go generate ./...
builds:
- goos:
- id: bootstrap-amd64
goos:
- linux
goarch:
- amd64
ldflags:
- "-s -w -extldflags '-Wl,-rpath,$ORIGIN'"
env:
- CGO_ENABLED=1
- CC=gcc
- CXX=g++
- id: bootstrap-arm64
goos:
- linux
goarch:
- arm64
flags:
- -trimpath
- -mod=readonly
ldflags:
- -s -w
- "-s -w -extldflags '-Wl,-rpath,$ORIGIN'"
env:
- CGO_ENABLED=1
- CC=aarch64-linux-gnu-gcc
- CXX=aarch64-linux-gnu-g++
- CGO_LDFLAGS="-L/usr/aarch64-linux-gnu/lib -Wl,--sysroot=/usr/aarch64-linux-gnu"
- CGO_CFLAGS="--sysroot=/usr/aarch64-linux-gnu"
- id: bootstrap-musl-amd64
goos:
- linux
goarch:
- amd64
ldflags:
- "-s -w -extldflags '-Wl,-rpath,$ORIGIN'"
env:
- CGO_ENABLED=0
upx:
- enabled: true
brute: true
- CGO_ENABLED=1
- CC=x86_64-linux-musl-gcc
- CXX=x86_64-linux-musl-g++
- CGO_LDFLAGS=-static-libgcc
# I'm having a hard time finding a cross-compiler that works for arm-based musl builds. In theory this would work if building in an arm environment
# - id: bootstrap-musl-arm64
# goos:
# - linux
# goarch:
# - arm64
# ldflags:
# - "-s -w -extldflags '-Wl,-rpath,$ORIGIN'"
# env:
# - CGO_ENABLED=1
# - CC=aarch64-linux-musl-gcc
# - CXX=aarch64-linux-musl-g++
# - CGO_LDFLAGS=-static-libgcc
archives:
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
format: binary
Expand Down
Loading