zhaojh329 / libuhttpd

A very flexible, lightweight and high performance HTTP server library based on libev and http-parser for Embedded Linux.
MIT License
386 stars 67 forks source link

nossl not compiling #18

Open neheb opened 3 years ago

neheb commented 3 years ago

Something strange happened locally such that a bunch of packages now get linking errors. This one included:

[13/21] Linking C executable example/multi_process_server
FAILED: example/multi_process_server
: && /home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/bin/powerpc-openwrt-linux-musl-gcc -Os -pipe -mcpu=464fp -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/home/mangix/devstuff/openwrt/build_dir/target-powerpc_464fp_musl/libuhttpd-nossl/libuhttpd-3.12.1=libuhttpd-3.12.1 -Wformat -Werror=format-security -DPIC -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wl,-z,now -Wl,-z,relro -DNDEBUG -L/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/usr/lib -L/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib -DPIC -fPIC -specs=/home/mangix/devstuff/openwrt/include/hardened-ld-pie.specs -znow -zrelro   -rdynamic example/CMakeFiles/multi_process_server.dir/multi_process_server.c.o example/CMakeFiles/multi_process_server.dir/handler.c.o -o example/multi_process_server  -lev  src/libuhttpd.so.3.12.1 && :
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_session_free'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_connect'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_read'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_strerror'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_err_code'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_write'
/home/mangix/devstuff/openwrt/staging_dir/toolchain-powerpc_464fp_gcc-11.2.0_musl/lib/gcc/powerpc-openwrt-linux-musl/11.2.0/../../../../powerpc-openwrt-linux-musl/bin/ld: src/libuhttpd.so.3.12.1: undefined reference to `ssl_session_new'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
make[2]: *** [Makefile:61: /home/mangix/devstuff/openwrt/build_dir/target-powerpc_464fp_musl/libuhttpd-nossl/libuhttpd-3.12.1/.built] Error 1
make[2]: Leaving directory '/home/mangix/devstuff/openwrt/feeds/packages/libs/libuhttpd'
time: package/feeds/packages/libuhttpd/nossl/compile#0.21#0.11#0.31
    ERROR: package/feeds/packages/libuhttpd failed to build (build variant: nossl).
make[1]: *** [package/Makefile:125: package/feeds/packages/libuhttpd/compile] Error 1
make[1]: Leaving directory '/home/mangix/devstuff/openwrt'
make: *** [/home/mangix/devstuff/openwrt/include/toplevel.mk:230: package/libuhttpd/compile] Error 2

Looking at the code, these functions are not implemented when there is no ssl library.

zhaojh329 commented 3 years ago

However, I did not find the problem.

neheb commented 3 years ago

I got it to compile by disabling examples.

The issue is also on my end (ccache update broke linking of some packages).