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

Issue building in docker #57

Open
Devil-sir opened this issue Jul 24, 2023 · 1 comment
Open

Issue building in docker #57

Devil-sir opened this issue Jul 24, 2023 · 1 comment

Comments

@Devil-sir
Copy link

Devil-sir commented Jul 24, 2023

Having trouble using this library in a new docker image:

Jenkinsfile:
sh 'go get -d github.com/valyala/gozstd'
sh 'cd ${GOPATH}/src/github.com/valyala/gozstd && MOREFLAGS=-fPIC make clean libzstd.a && go install'
sh 'cd ${GOPATH} && docker run -v ${GOPATH}:/go build:0.0.1 go install -buildmode=c-shared -ldflags "-s -w -extldflags=-fPIC" ${SRC}

Error output:
# github.com/valyala/gozstd /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_common.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_compress.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_compress_sequences.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_compress_superblock.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_lazy.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_ldm.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_opt.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_decompress.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_decompress_block.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zdict.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(error_private.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(fse_decompress.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_v05.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_v06.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(zstd_v07.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(fse_compress.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(huf_compress.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(huf_decompress.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(divsufsort.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(fastcover.o): relocation R_X86_64_32 against undefined symbol __iob' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(pool.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: /go/src/github.com/valyala/gozstd/libzstd_illumos_amd64.a(cover.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status script returned exit code 2

@valyala Please help on the issue

@f41gh7
Copy link
Contributor

f41gh7 commented Aug 14, 2023

Hello, currently new builder - ziglang compiler doesn't support freebsd and illumos as targets.

It should be possible to compile it manually at native OS without docker:

	cd zstd/lib && ZSTD_LEGACY_SUPPORT=0 MOREFLAGS=$(MOREFLAGS) make clean libzstd.a
        # replace  LIBZSTD_NAME with target name
	mv zstd/lib/libzstd.a $(LIBZSTD_NAME)

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

2 participants