Closed kn007 closed 11 months ago
temp fix:
change CMAKE_AR
& CMAKE_RANLIB
value from ngx_brotli/deps/brotli/out/CMakeFiles/3.27.7/CMakeCCompiler.cmake
ar
to gcc-ar
, ranlib
to gcc-ranlib
ar & ranlib version 2.30-108.el8_5.1 gcc-ar & gcc-ranlib version 2.35-8.el8_5.6
> cmake --build . --config Release --target brotlienc ed738e8 [ed738e8] untracked
-- Build type is 'Release'
-- Compiler is not EMSCRIPTEN
-- Configuring done (0.0s)
-- Generating done (0.1s)
-- Build files have been written to: /data/src/ngx_brotli/deps/brotli/out
[ 3%] Building C object CMakeFiles/brotlicommon.dir/c/common/constants.c.o
[ 6%] Building C object CMakeFiles/brotlicommon.dir/c/common/context.c.o
[ 10%] Building C object CMakeFiles/brotlicommon.dir/c/common/dictionary.c.o
[ 13%] Building C object CMakeFiles/brotlicommon.dir/c/common/platform.c.o
[ 17%] Building C object CMakeFiles/brotlicommon.dir/c/common/shared_dictionary.c.o
[ 20%] Building C object CMakeFiles/brotlicommon.dir/c/common/transform.c.o
[ 24%] Linking C static library libbrotlicommon.a
[ 24%] Built target brotlicommon
[ 27%] Building C object CMakeFiles/brotlienc.dir/c/enc/backward_references.c.o
[ 31%] Building C object CMakeFiles/brotlienc.dir/c/enc/backward_references_hq.c.o
[ 34%] Building C object CMakeFiles/brotlienc.dir/c/enc/bit_cost.c.o
[ 37%] Building C object CMakeFiles/brotlienc.dir/c/enc/block_splitter.c.o
[ 41%] Building C object CMakeFiles/brotlienc.dir/c/enc/brotli_bit_stream.c.o
[ 44%] Building C object CMakeFiles/brotlienc.dir/c/enc/cluster.c.o
[ 48%] Building C object CMakeFiles/brotlienc.dir/c/enc/command.c.o
[ 51%] Building C object CMakeFiles/brotlienc.dir/c/enc/compound_dictionary.c.o
[ 55%] Building C object CMakeFiles/brotlienc.dir/c/enc/compress_fragment.c.o
[ 58%] Building C object CMakeFiles/brotlienc.dir/c/enc/compress_fragment_two_pass.c.o
[ 62%] Building C object CMakeFiles/brotlienc.dir/c/enc/dictionary_hash.c.o
[ 65%] Building C object CMakeFiles/brotlienc.dir/c/enc/encode.c.o
[ 68%] Building C object CMakeFiles/brotlienc.dir/c/enc/encoder_dict.c.o
[ 72%] Building C object CMakeFiles/brotlienc.dir/c/enc/entropy_encode.c.o
[ 75%] Building C object CMakeFiles/brotlienc.dir/c/enc/fast_log.c.o
[ 79%] Building C object CMakeFiles/brotlienc.dir/c/enc/histogram.c.o
[ 82%] Building C object CMakeFiles/brotlienc.dir/c/enc/literal_cost.c.o
[ 86%] Building C object CMakeFiles/brotlienc.dir/c/enc/memory.c.o
[ 89%] Building C object CMakeFiles/brotlienc.dir/c/enc/metablock.c.o
[ 93%] Building C object CMakeFiles/brotlienc.dir/c/enc/static_dict.c.o
[ 96%] Building C object CMakeFiles/brotlienc.dir/c/enc/utf8_util.c.o
[100%] Linking C static library libbrotlienc.a
[100%] Built target brotlienc
compile nginx with ngx_brotli pass.
I know this is an upstream question, but these projects belong to Google. So I won't close this issue
There's an upstream issue at: https://github.com/google/brotli/issues/1094
@FireMasterK
Yes, as I wrote in the readme. Better to link the actual source than to copy & paste it in a random issue or forum post. "Why?" you ask? So the canonical source can be referenced and updated when things inevitable change in the future.
This is a compiler issue. Don't use ancient compilers. If you're on Redhat (or a clone) use the devtoolset
/ gcc-toolset
to use the latest compilers (while still targeting the system glibc).
In short, google it.
It seems that it will not be fixed.
It seems that it will not be fixed.
Maybe it doesn't need fixing because it's really a compiler issue.
alpine:3.14
with gcc 10.3.1
, compile pass without any errors, musl
of course.
But Redhat 8 (or Rocky8 or AlmaLinux8) with gcc 8.5.0
or gcc 10.3.1
is compile failed, and I don't know why because I know nothing about C. 😅
Using gcc 11.2.1
will compile successfully.
dnf -y install gcc-toolset-11-gcc gcc-toolset-11-gcc-c++
source /opt/rh/gcc-toolset-11/enable
temp fix: change
CMAKE_AR
&CMAKE_RANLIB
value from ngx_brotli/deps/brotli/out/CMakeFiles/3.27.7/CMakeCCompiler.cmakear
togcc-ar
,ranlib
togcc-ranlib
@saytesnake
cmake version 3.27.7 nginx 1.25.3 gcc (GCC) 10.3.1 20210422 (Red Hat 10.3.1-1)
==================================================
Maybe it's because plugin needed to handle lto object ?