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

libzstd.a(zstd_compress.o): relocation R_X86_64_PC32 against symbol ZSTD_copySequencesToSeqStoreExplicitBlockDelim can not be used when making a shared object; recompile with -fPIC #37

Open
n0099 opened this issue Sep 27, 2024 · 3 comments

Comments

@n0099
Copy link

n0099 commented Sep 27, 2024

sudo apt install libzstd-dev
git clone https://github.com/tokers/zstd-nginx-module
wget https://nginx.org/download/nginx-1.27.1.tar.gz
tar xvf nginx-1.27.1.tar.gz
cd nginx-1.27.1
./configure --with-compat --add-dynamic-module=../zstd-nginx-module
make modules
make -f objs/Makefile modules
make[1]: Entering directory 'nginx-1.27.1'
cc -o objs/ngx_http_zstd_filter_module.so \
objs/addon/filter/ngx_http_zstd_filter_module.o \
objs/ngx_http_zstd_filter_module_modules.o \
-l:libzstd.a -l:libzstd.a -l:libzstd.a \
-shared
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libzstd.a(zstd_compress.o): warning: relocation against `ZSTD_copySequencesToSeqStoreNoBlockDelim' in read-only section `.text'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libzstd.a(zstd_compress.o): relocation R_X86_64_PC32 against symbol `ZSTD_copySequencesToSeqStoreExplicitBlockDelim' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make[1]: *** [objs/Makefile:1527: objs/ngx_http_zstd_filter_module.so] Error 1
make[1]: Leaving directory 'nginx-1.27.1'
make: *** [Makefile:16: modules] Error 2
@AnYiEE
Copy link

AnYiEE commented Oct 1, 2024

I also encountered this problem on a new installed Ubuntu 24.04, but it can be successfully compiled on Ubuntu 22.04, so I copied the compiled files over from there and it looks like no problem.

@n0099
Copy link
Author

n0099 commented Oct 2, 2024

I'm using Ubuntu 24.04 too.

@Soberia
Copy link

Soberia commented Oct 8, 2024

Also does not compile on Debian Bookworm 12.

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