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

makefile broken #1094

Open
albgen opened this issue Oct 25, 2023 · 7 comments
Open

makefile broken #1094

albgen opened this issue Oct 25, 2023 · 7 comments

Comments

@albgen
Copy link

albgen commented Oct 25, 2023

hi,

just tried to compile the new nginx 1.25.3 with brotli but cannot

make -f objs/Makefile modules make[1]: Entering directory /usr/src/nginx-1.25.3'
cc -c -fPIC -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 objs -I src/http -I src/http/modules
-o objs/addon/filter/ngx_http_brotli_filter_module.o
../ngx_brotli/filter/ngx_http_brotli_filter_module.c
cc -c -fPIC -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 objs -I src/http -I src/http/modules
-o objs/ngx_http_brotli_filter_module_modules.o
objs/ngx_http_brotli_filter_module_modules.c
cc -o objs/ngx_http_brotli_filter_module.so
objs/addon/filter/ngx_http_brotli_filter_module.o
objs/ngx_http_brotli_filter_module_modules.o
-L../ngx_brotli/deps/brotli/c/../out -lbrotlienc -lbrotlicommon -lm
-shared
/usr/bin/ld: cannot find -lbrotlienc
/usr/bin/ld: cannot find -lbrotlicommon

collect2: error: ld returned 1 exit status
make[1]: *** [objs/ngx_http_brotli_filter_module.so] Error 1
make[1]: Leaving directory /usr/src/nginx-1.25.3'

@kkumar326
Copy link

I'm also getting the same error. Did you find any workaround @albgen ?

@albgen
Copy link
Author

albgen commented Oct 28, 2023

It was faster sokution for me to use gzip so currently i have removed brotli from the nginx config

@vjick7
Copy link

vjick7 commented Oct 31, 2023

The same problem. Does anyone find the solution?

@kkumar326
Copy link

@vjick7 not yet. one way is to build by undoing new commits. it seems like it broke recently only so this might work.

@vjick7
Copy link

vjick7 commented Oct 31, 2023

I found out how to fix this issue.
Just run by instruction of https://github.com/google/ngx_brotli.

git clone --recurse-submodules -j8 https://github.com/google/ngx_brotli
cd ngx_brotli/deps/brotli
mkdir out && cd out
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="-Ofast -m64 -march=native -mtune=native -flto -funroll-loops -ffunction-sections -fdata-sections -Wl,--gc-sections" -DCMAKE_INSTALL_PREFIX=./installed ..
cmake --build . --config Release --target brotlienc

After that you can use dpkg-buildpackage -b -uc -us.

@wyattoday
Copy link

wyattoday commented Dec 14, 2023

@vjick7

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.

@pexcn
Copy link

pexcn commented Mar 18, 2024

Temporary solution:

ln -s "$(find /usr/lib -type f -name "libbrotlienc*")" /usr/lib/libbrotlienc.so
ln -s "$(find /usr/lib -type f -name "libbrotlicommon*")" /usr/lib/libbrotlicommon.so

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

5 participants