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

gozstd fails during linking if the standard lib "plugin" module is imported #32

Open
gordallott opened this issue Jan 28, 2021 · 2 comments

Comments

@gordallott
Copy link

you can reproduce this simply by importing both gozstd and plugin at the same time, for example

package main

import (
    _ "github.com/valyala/gozstd"
    _ "plugin"
)

as an example I forked the gozstd repo to add a test to fail this, thus

go get github.com/gordallott/gozstd
go test -v github.com/gordallott/gozstd

should result in something like

# github.com/gordallott/gozstd.test
/home/mhr3/.axiom-dev/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /home/mhr3/.axiom-dev/gopath/src/github.com/gordallott/gozstd/libzstd_linux_amd64.a(zdict.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a PDE object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

tested on multiple machines with go version go version go1.15.2 linux/amd64

does not appear to be a CGO problem as using other CGO based modules work fine with the plugin module

@jamesqddd
Copy link

I have the same problem,and how to solve this problem please,thanks.

@SimFG
Copy link

SimFG commented Sep 21, 2022

maybe this pull request can help you, detail: pingcap/tiflow#834

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

3 participants