You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux: static archives link in scan order, so interdependent package libraries fail (libcurl → libssl.a needs libcrypto.a) #1193
/usr/bin/ld: …/openssl/3.6.4/lib/libssl.a(libssl-lib-ssl_lib.o): in function `SSL_get0_peer_scts':
ssl_lib.c: undefined reference to `OCSP_SINGLERESP_get1_ext_d2i'
… undefined reference to `CT_POLICY_EVAL_CTX_new_ex' (and 6 more)
Exact lines.conan_scan_libraries (src/compiler/ConanClient.w) collects a package's libraries with conan_sorted_insert_unique, i.e. alphabetically: crypto before ssl. Both ELF link paths in src/compiler/Link.w — the compiler-driver path (link_stage_make_link_command, the link_libs loop) and the direct plan (link_stage_make_linux_llvm_link_command) — emit -l<lib> in that order with no grouping. GNU ld and lld resolve static archives left to right, once, so libssl.a's references into libcrypto.a are never satisfied. ld64 is order-insensitive, which is why the same package links on darwin.
Fix. Wrap the user libraries in --start-group … --end-group on ELF targets (both paths), so any set of interdependent archives links regardless of the order a scan produced. Ordering by the package graph would fix openssl but not a package whose own archives are mutually dependent.
Activity
Link the user's libraries as one group on ELF targets