RJVB / macstrop

RJVB's repository of alternative macports, with ports missing from or overriding those in the standard collection, including a set of KF5 ports.
21 stars 9 forks source link

curl does not pass a ldflag to brotli on Linux: `clang-14: error: linker command failed with exit code 1` #115

Open barracuda156 opened 2 months ago

barracuda156 commented 2 months ago
/bin/sh ../libtool  --tag=CC   --mode=link /usr/bin/clang  -pipe -Os -Qunused-arguments -Werror-implicit-function-declaration    -L/opt/local/lib -Wl,--enable-new-dtags -Wl,-rpath,/opt/local/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/libexec/openssl3/lib -L/opt/local/lib -L/opt/local/lib -L/opt/local/lib -o curl slist_wc.o terminal.o tool_binmode.o tool_bname.o tool_cb_dbg.o tool_cb_hdr.o tool_cb_prg.o tool_cb_rea.o tool_cb_see.o tool_cb_soc.o tool_cb_wrt.o tool_cfgable.o tool_dirhie.o tool_doswin.o tool_easysrc.o tool_filetime.o tool_findfile.o tool_formparse.o tool_getparam.o tool_getpass.o tool_help.o tool_helpers.o tool_hugehelp.o tool_ipfs.o tool_libinfo.o tool_listhelp.o tool_main.o tool_msgs.o tool_operate.o tool_operhlp.o tool_paramhlp.o tool_parsecfg.o tool_progress.o tool_setopt.o tool_sleep.o tool_stderr.o tool_strdup.o tool_urlglob.o tool_util.o tool_vms.o tool_writeout.o tool_writeout_json.o tool_xattr.o var.o ../lib/base64.o ../lib/curl_multibyte.o ../lib/dynbuf.o ../lib/nonblock.o ../lib/strtoofft.o ../lib/timediff.o ../lib/version_win32.o ../lib/warnless.o   ../lib/libcurl.la -lssl -lcrypto -lz  
libtool: link: /usr/bin/clang -pipe -Os -Qunused-arguments -Werror-implicit-function-declaration -Wl,--enable-new-dtags -Wl,-rpath -Wl,/opt/local/lib -o .libs/curl slist_wc.o terminal.o tool_binmode.o tool_bname.o tool_cb_dbg.o tool_cb_hdr.o tool_cb_prg.o tool_cb_rea.o tool_cb_see.o tool_cb_soc.o tool_cb_wrt.o tool_cfgable.o tool_dirhie.o tool_doswin.o tool_easysrc.o tool_filetime.o tool_findfile.o tool_formparse.o tool_getparam.o tool_getpass.o tool_help.o tool_helpers.o tool_hugehelp.o tool_ipfs.o tool_libinfo.o tool_listhelp.o tool_main.o tool_msgs.o tool_operate.o tool_operhlp.o tool_paramhlp.o tool_parsecfg.o tool_progress.o tool_setopt.o tool_sleep.o tool_stderr.o tool_strdup.o tool_urlglob.o tool_util.o tool_vms.o tool_writeout.o tool_writeout_json.o tool_xattr.o var.o ../lib/base64.o ../lib/curl_multibyte.o ../lib/dynbuf.o ../lib/nonblock.o ../lib/strtoofft.o ../lib/timediff.o ../lib/version_win32.o ../lib/warnless.o  -L/opt/local/lib -L/opt/local/libexec/openssl3/lib ../lib/.libs/libcurl.so -lssl -lcrypto -lz -Wl,-rpath -Wl,/opt/local/lib
/usr/bin/riscv64-pine64-linux-ld: ../lib/.libs/libcurl.so: undefined reference to `BrotliDecoderCreateInstance'
/usr/bin/riscv64-pine64-linux-ld: ../lib/.libs/libcurl.so: undefined reference to `BrotliDecoderVersion'
/usr/bin/riscv64-pine64-linux-ld: ../lib/.libs/libcurl.so: undefined reference to `BrotliDecoderDestroyInstance'
/usr/bin/riscv64-pine64-linux-ld: ../lib/.libs/libcurl.so: undefined reference to `BrotliDecoderDecompressStream'
/usr/bin/riscv64-pine64-linux-ld: ../lib/.libs/libcurl.so: undefined reference to `BrotliDecoderGetErrorCode'
clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [Makefile:1016: curl] Error 1
make[1]: Leaving directory '/opt/local/var/macports/build/_home_svacchanda_macstrop_net_curl/curl/work/curl-8.9.1/src'
make: *** [Makefile:1229: all-recursive] Error 1
make: Leaving directory '/opt/local/var/macports/build/_home_svacchanda_macstrop_net_curl/curl/work/curl-8.9.1'
Command failed:  cd "/opt/local/var/macports/build/_home_svacchanda_macstrop_net_curl/curl/work/curl-8.9.1" && /usr/bin/make -j4 -w all 
Exit code: 2
Error: Failed to build curl: command execution failed
barracuda156 commented 2 months ago

Without +brotli among default variants it builds:

sh-5.1# port -v installed curl
The following ports are currently installed:
  curl @8.9.1_1+http2+idn+psl+ssl (active) requested_variants='+http2+idn+psl+ssl' platform='linux 3' archs='riscv64' date='2024-09-04T19:13:11+0000'
RJVB commented 2 months ago

patchelf --print-needed /opt/local/lib/libcurl.so libnghttp2.so.14 libidn2.so.0 libpsl.so.5 libnettle.so.8 libgnutls.so.30 libgss.so.3 libzstd.so.1 libbrotlidec.so.1 libz.so.1 libpthread.so.0 libc.so.6

What variant are you using and does the build system detect brotli correctly?

barracuda156 commented 2 months ago

Initially I just tried to install whatever default curl had, without specifying variants. Defaults include brotli via standard. Since I could not install it with brotli enabled, output from the command above does not include it. How should I check if brotli is correctly detected?

barracuda156 commented 2 months ago
sh-5.1# patchelf --print-needed /opt/local/lib/libcurl.so
libnghttp2.so.14
libidn2.so.0
libpsl.so.5
libssl.so.3
libcrypto.so.3
libz.so.1
libc.so.6

sh-5.1# port -v installed curl
The following ports are currently installed:
  curl @8.9.1_1+http2+idn+psl+ssl (active) requested_variants='+http2+idn+psl+ssl' platform='linux 3' archs='riscv64' date='2024-09-04T19:13:11+0000'
RJVB commented 2 months ago

Since I could not install it with brotli enabled, output from the command above does not include it. How should I check if brotli is correctly detected?

Evidently you'll have to start a new build with +brotli and then do something like

> fgrep -l lbrotli -R `port work curl`

You should see -lbrotlidec in a bunch of Makefile files, as well as in the generated curl-config script . If not ans as always, the config.log file in $worksrcpath should give some clues as to why.