Open Lee266 opened 4 hours ago
static library will be tried prior to dynamic library, since this Nginx module uses some advanced APIs where static linking is recommended.
libzstd.a
. For this reason, the static library (libzstd.a) is prioritized over the dynamic library (libzstd.so) during the build process.libzstd.a
from the Zstandard source with -fPIC enabled.
ca0905793476a1896f59e60c627c2a28f4bec475
summary
Environment
Error messages
Show error messages
``` => ERROR [nginx builder 6/6] RUN cd nginx-1.27.2 && ./configure --with-compat --add-dynamic-module=../ngx_brotli --add-dynamic-module=../zstd-nginx-module 2.6s ------ ... 2.239 make -f objs/Makefile modules ... 2.439 -shared 2.446 cc -c -fPIC -DZSTD_STATIC_LINKING_ONLY -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Wno-deprecated-declarations -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I ../ngx_brotli/deps/brotli/c/include -I -DZSTD_STATIC_LINKING_ONLY -I -DZSTD_STATIC_LINKING_ONLY -I objs -I src/http -I src/http/modules \ 2.446 -o objs/addon/filter/ngx_http_zstd_filter_module.o \ 2.446 ../zstd-nginx-module/filter/ngx_http_zstd_filter_module.c 2.527 cc -c -fPIC -DZSTD_STATIC_LINKING_ONLY -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -Wno-deprecated-declarations -I src/core -I src/event -I src/event/modules -I src/event/quic -I src/os/unix -I ../ngx_brotli/deps/brotli/c/include -I -DZSTD_STATIC_LINKING_ONLY -I -DZSTD_STATIC_LINKING_ONLY -I objs -I src/http -I src/http/modules \ 2.527 -o objs/ngx_http_zstd_filter_module_modules.o \ 2.527 objs/ngx_http_zstd_filter_module_modules.c 2.557 cc -o objs/ngx_http_zstd_filter_module.so \ 2.557 objs/addon/filter/ngx_http_zstd_filter_module.o \ 2.557 objs/ngx_http_zstd_filter_module_modules.o \ 2.557 -l:libzstd.a -l:libzstd.a -l:libzstd.a \ 2.557 -shared 2.564 /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/libzstd.a(zstd_compress.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ZSTD_copySequencesToSeqStoreNoBlockDelim' which may bind externally can not be used when making a shared object; recompile with -fPIC 2.564 /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/libzstd.a(zstd_compress.o): in function `ZSTD_compressSequences': 2.564 (.text+0xc554): dangerous relocation: unsupported relocation 2.564 /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/libzstd.a(zstd_compress.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ZSTD_copySequencesToSeqStoreNoBlockDelim' which may bind externally can not be used when making a shared object; recompile with -fPIC 2.564 (.text+0xc7ec): dangerous relocation: unsupported relocation 2.564 /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/libzstd.a(zstd_compress.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ZSTD_copySequencesToSeqStoreExplicitBlockDelim' which may bind externally can not be used when making a shared object; recompile with -fPIC 2.564 (.text+0xc800): dangerous relocation: unsupported relocation 2.564 /usr/bin/ld: /usr/lib/gcc/aarch64-linux-gnu/13/../../../aarch64-linux-gnu/libzstd.a(zstd_compress.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol `ZSTD_copySequencesToSeqStoreExplicitBlockDelim' which may bind externally can not be used when making a shared object; recompile with -fPIC 2.564 (.text+0xc948): dangerous relocation: unsupported relocation 2.565 collect2: error: ld returned 1 exit status 2.566 make[1]: *** [objs/Makefile:1275: objs/ngx_http_zstd_filter_module.so] Error 1 2.566 make[1]: Leaving directory '/app/nginx-1.27.2' 2.566 make: *** [Makefile:16: modules] Error 2 ------ ```