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

undefined reference to __fprint_chk #274

Closed
georgewilk01 opened this issue Jun 9, 2020 · 1 comment · Fixed by #287
Closed

undefined reference to __fprint_chk #274

georgewilk01 opened this issue Jun 9, 2020 · 1 comment · Fixed by #287
Labels
area/build help wanted anyone who are interested in could help on it triage/week-24

Comments

@georgewilk01
Copy link

georgewilk01 commented Jun 9, 2020

Expected behavior

go test command runs successfully when building with github.com/apache/pulsar-client-go@master on alpine

Actual behavior

go test fails with the following output:

# github.com/valyala/gozstd /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(zdict.o): in function ZDICT_analyzeEntropy':
zdict.c:(.text+0x7ce): undefined reference to __fprintf_chk' /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(zdict.o): in function ZDICT_analyzePos':
zdict.c:(.text+0x1832): undefined reference to __fprintf_chk' /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: zdict.c:(.text+0x18c2): undefined reference to __fprintf_chk'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(zdict.o): in function ZDICT_finalizeDictionary': zdict.c:(.text+0x1b24): undefined reference to __fprintf_chk'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(zdict.o): in function ZDICT_trainFromBuffer_unsafe_legacy': zdict.c:(.text+0x1d54): undefined reference to __fprintf_chk'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(zdict.o):zdict.c:(.text+0x1dd4): more undefined references to __fprintf_chk' follow /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(entropy_common.o): in function FSE_readNCount':
entropy_common.c:(.text+0x345): undefined reference to __memcpy_chk' /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(fastcover.o): in function FASTCOVER_buildDictionary.isra.6':
fastcover.c:(.text+0x3a9): undefined reference to __fprintf_chk' /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: fastcover.c:(.text+0x44f): undefined reference to __fprintf_chk'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: fastcover.c:(.text+0x488): undefined reference to __fprintf_chk' /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(fastcover.o): in function FASTCOVER_ctx_init':
fastcover.c:(.text+0x8a0): undefined reference to __fprintf_chk' /usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: fastcover.c:(.text+0x8e6): undefined reference to __fprintf_chk'
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: vendor/github.com/valyala/gozstd/libzstd_linux_amd64.a(fastcover.o):fastcover.c:(.text+0xbc7): more undefined references to __fprintf_chk' follow collect2: error: ld returned 1 exit status The command '/bin/sh -c go test -mod=vendor ./...' returned a non-zero code: 2

Steps to reproduce

Create project with pulsar-client-go dependency
go get github.com/apache/pulsar-client-go/pulsar@master
go mod tidy
go mod vendor
run go test -mod=vendor ./... on alpine docker image (golang:alpine)

System configuration

Pulsar version: apachepulsar/pulsar v2.5.2

@merlimat
Copy link
Contributor

@georgewilk01 This is due to the library github.com/valyala/gozstd that provides pre-compiled binaries for linux but these won't work on Alpine. I already have a fix for that, will post it soon. Workaround, if you can, is to use CGO_ENABLED=0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build help wanted anyone who are interested in could help on it triage/week-24
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants