Skip to content
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

linker error when building on alpine linux 3.19 #1735

Open
plarsson opened this issue Dec 13, 2023 · 1 comment
Open

linker error when building on alpine linux 3.19 #1735

plarsson opened this issue Dec 13, 2023 · 1 comment

Comments

@plarsson
Copy link

Build fails on docker alpine 3.19 (golang:1.21.5-alpine). Works fine on 3.18 (golang:1.21.5-alpine3.18)

using build-base apk update && apk upgrade && apk add --no-cache ca-certificates git openssh build-base

RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build \
   -ldflags='-w -s -extldflags "-static"' \
   -o /out/main ./cmd/api-service/

It looks like its a newer musl version that is the problem musl-dev (1.2.4_git20230717-r4)

#20 64.87 /usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
#20 64.87 /usr/lib/gcc/x86_64-alpine-linux-musl/13.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /go/pkg/mod/github.com/osohq/[email protected]/internal/ffi/native/linux/amd64/libpolar.a(std-df986adbef8b2eb0.std.3c2b20ec-cgu.0.rcgu.o): in function std::sys::unix::fs::File::file_attr': #20 64.87 /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/library/std/src/sys/unix/fs.rs:1023:(.text._ZN3std2fs4read5inner17he426ae8d55037015E+0x132): undefined reference to fstat64'
...

@plarsson
Copy link
Author

rust-lang/libc#2935

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant