Closed gitpubber closed 2 years ago
I've had something similar, I believe a flag for statically linking fixed it.
@anacrolix How did you fix it on non-musl distro ? I don't get this warning only when I compile it on musl based distro like alpine
Here's a snippet from the build script I had to cross compile from MacOS for linux:
# You might need some cross-compiler stuff installed from Homebrew.
set -eux
CXX=x86_64-linux-musl-g++ CC=x86_64-linux-musl-gcc CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
go build \
-mod=readonly `# Ignore vendor directory produced by docker make targets` \
-v -ldflags="-extldflags=-static"
Ok, I installed musl toolchain and problem got solved. Thanks @anacrolix
@anacrolix How to cross compile from linux to macos ? I don't have x86_64-apple-musl-gcc available
I am getting these warning. Is there a way to disable them ?