You are not logged in.
Hi everyone,
I'm having trouble building a project (specifically, a Rust crate that depends on libgit2) on Arch Linux. CMake is complaining that it can't find OpenSSL, even though OpenSSL is definitely installed on my system.
Here's the error message I'm getting from CMake:
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES)
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "3.4.0")
CMake Error at cmake/SelectHTTPSBackend.cmake:29 (message):
Unable to autodetect a usable HTTPS backend.Please pass the backend name
explicitly (-DUSE_HTTPS=backend)
Call Stack (most recent call first):
src/CMakeLists.txt:40 (include)
I've already tried the following:
Reinstalling OpenSSL: I've reinstalled the openssl package using
sudo pacman -S openssl
Verifying Installation: I can confirm that the OpenSSL libraries (libssl.so and libcrypto.so) exist in /usr/lib and /usr/lib64.
pkg-config:
pkg-config --cflags --libs openssl
outputs
-lssl -lcrypto
so pkg-config seems to be configured correctly.
cmake command:
cmake lib/libgit2-1.7.0 -Blib/build -DBUILD_SHARED_LIBS=OFF -DLINK_WITH_STATIC_LIBRARIES=ON
also tried:
cmake lib/libgit2-1.7.0 -Blib/build -DBUILD_SHARED_LIBS=OFF -DLINK_WITH_STATIC_LIBRARIES=ON -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/ -DOPENSSL_ROOT_DIR=/usr/local
Could anyone offer some guidance on how to resolve this? Any help would be greatly appreciated!
Thanks in advance.
Last edited by 39george (2025-02-15 05:45:00)
Offline
Usually for compiling you need the devel or dev packages. I'm new to Arch so not yet 100% on the naming schemes. Look for openssl-devel or similar.
I Am Canadian!
Offline
Cmake told you that it found version 3.4.0.
Which one does the package need?
Last edited by mithrial (2025-02-11 15:18:57)
Offline
It looks like not-finding openssl is NOT the issue.
CMake Error at cmake/SelectHTTPSBackend.cmake:29 (message):
Unable to autodetect a usable HTTPS backend.Please pass the backend name
explicitly (-DUSE_HTTPS=backend)
Call Stack (most recent call first):
src/CMakeLists.txt:40 (include)
Please post the exact build command used and the full commandline output it gives.
A link to to the project files, especially to src/CMakeLists.txt would also help .
Moderator Note
This is not an installation topic, but until more is known about the project I can't determine which subboard it should be in.
For now it can stay in installation .
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Thanks you all very much for replies! I updated libgit2 to the latest version, and the behavior has changed only slightly. When I ran the command:
cmake lib/libgit2 -Blib/build -DBUILD_SHARED_LIBS=OFF -DLINK_WITH_STATIC_LIBRARIES=ON
I received the following output:
CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
Compatibility with CMake < 3.10 will be removed from a future version of
CMake.
Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.
-- The C compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "2.3.0")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM - Success
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC - Failed
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC - Failed
-- Looking for futimens
-- Looking for futimens - found
-- Performing Test IS_WALL_SUPPORTED
-- Performing Test IS_WALL_SUPPORTED - Success
-- Performing Test IS_WEXTRA_SUPPORTED
-- Performing Test IS_WEXTRA_SUPPORTED - Success
-- Performing Test IS_WDOCUMENTATION_SUPPORTED
-- Performing Test IS_WDOCUMENTATION_SUPPORTED - Failed
-- Performing Test IS_WNO_DOCUMENTATION_DEPRECATED_SYNC_SUPPORTED
-- Performing Test IS_WNO_DOCUMENTATION_DEPRECATED_SYNC_SUPPORTED - Success
-- Performing Test IS_WNO_MISSING_FIELD_INITIALIZERS_SUPPORTED
-- Performing Test IS_WNO_MISSING_FIELD_INITIALIZERS_SUPPORTED - Success
-- Performing Test IS_WMISSING_DECLARATIONS_SUPPORTED
-- Performing Test IS_WMISSING_DECLARATIONS_SUPPORTED - Success
-- Performing Test IS_WSTRICT_ALIASING_SUPPORTED
-- Performing Test IS_WSTRICT_ALIASING_SUPPORTED - Success
-- Performing Test IS_WSTRICT_PROTOTYPES_SUPPORTED
-- Performing Test IS_WSTRICT_PROTOTYPES_SUPPORTED - Success
-- Performing Test IS_WDECLARATION_AFTER_STATEMENT_SUPPORTED
-- Performing Test IS_WDECLARATION_AFTER_STATEMENT_SUPPORTED - Success
-- Performing Test IS_WSHIFT_COUNT_OVERFLOW_SUPPORTED
-- Performing Test IS_WSHIFT_COUNT_OVERFLOW_SUPPORTED - Success
-- Performing Test IS_WUNUSED_CONST_VARIABLE_SUPPORTED
-- Performing Test IS_WUNUSED_CONST_VARIABLE_SUPPORTED - Success
-- Performing Test IS_WUNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WUNUSED_FUNCTION_SUPPORTED - Success
-- Performing Test IS_WINT_CONVERSION_SUPPORTED
-- Performing Test IS_WINT_CONVERSION_SUPPORTED - Success
-- Performing Test IS_WC11_EXTENSIONS_SUPPORTED
-- Performing Test IS_WC11_EXTENSIONS_SUPPORTED - Failed
-- Performing Test IS_WC99_C11_COMPAT_SUPPORTED
-- Performing Test IS_WC99_C11_COMPAT_SUPPORTED - Success
-- Performing Test IS_WFORMAT_SUPPORTED
-- Performing Test IS_WFORMAT_SUPPORTED - Success
-- Performing Test IS_WFORMAT_SECURITY_SUPPORTED
-- Performing Test IS_WFORMAT_SECURITY_SUPPORTED - Success
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found version "3.4.1")
-- Found mbedTLS:
-- TLS: /usr/lib/libmbedtls.a
-- X509: /usr/lib/libmbedx509.a
-- Crypto: /usr/lib/libmbedcrypto.a
-- Auto-detecting default certificates location
-- Could NOT find PCRE (missing: PCRE_LIBRARY)
-- Looking for regcomp_l
-- Looking for regcomp_l - not found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for memmove
-- Looking for memmove - found
-- Looking for strerror
-- Looking for strerror - found
-- Looking for strtoll
-- Looking for strtoll - found
-- Looking for strtoq
-- Looking for strtoq - found
-- Looking for _strtoi64
-- Looking for _strtoi64 - not found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of unsigned long long
-- Check size of unsigned long long - done
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED
-- Performing Test IS_WNO_UNUSED_FUNCTION_SUPPORTED - Success
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED
-- Performing Test IS_WNO_IMPLICIT_FALLTHROUGH_SUPPORTED - Success
-- Performing Test IS_WNO_UNUSED_BUT_SET_VARIABLE_SUPPORTED
-- Performing Test IS_WNO_UNUSED_BUT_SET_VARIABLE_SUPPORTED - Success
-- Found ZLIB: /usr/lib/libz.a (found version "1.3.1")
-- Looking for iconv_open
-- Looking for iconv_open - found
-- Found Iconv: provided by libc
-- Could NOT find GSSAPI (missing: GSSAPI_LIBRARIES)
-- Performing Test IS_WNO_UNUSED_PARAMETER_SUPPORTED
-- Performing Test IS_WNO_UNUSED_PARAMETER_SUPPORTED - Success
-- Checking prototype qsort_r for GIT_QSORT_BSD
-- Checking prototype qsort_r for GIT_QSORT_BSD - False
-- Checking prototype qsort_r for GIT_QSORT_GNU
-- Checking prototype qsort_r for GIT_QSORT_GNU - True
-- Checking prototype qsort_s for GIT_QSORT_C11
-- Checking prototype qsort_s for GIT_QSORT_C11 - False
-- Checking prototype qsort_s for GIT_QSORT_MSC
-- Checking prototype qsort_s for GIT_QSORT_MSC - False
-- Looking for getentropy
-- Looking for getentropy - found
-- Looking for getloadavg
-- Looking for getloadavg - found
-- Looking for poll
-- Looking for poll - found
-- Looking for select
-- Looking for select - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Found PythonInterp: /usr/bin/python3 (found version "3.13.1")
-- Enabled features:
* Threads, using pthreads
* Nanosecond support, using mtim
* HTTPS, using mbedTLS (certificate location: /etc/ssl/cert.pem)
* SHA1, using bundled collision detection implementation
* SHA256, using mbedTLS
* HTTP Parser, using bundled parser
* Regular expressions, using bundled implementation
* Xdiff, using bundled provider
* Compression, using system zlib
* NTLM authentication, using bundled ntlmclient
-- Disabled features:
* SHA256 API, experimental SHA256 APIs
* Debug pool, debug-mode struct pool allocators
* Debug alloc, debug-mode strict allocators
* Debug open, strict path validation in open
* SSH, SSH transport support
* Internationalization, internationalization support is disabled
* Negotiate authentication, SPNEGO support is disabled
-- Configuring done (5.5s)
-- Generating done (0.1s)
-- Build files have been written to: /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/build
It still can't find openssl, but it found `mbedtls`, by the way it can't build anyway with cmake --build lib/build command:
[ 4%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xdiffi.c.o
[ 4%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xemit.c.o
[ 4%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xhistogram.c.o
[ 4%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xmerge.c.o
[ 4%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xpatience.c.o
[ 4%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xprepare.c.o
[ 5%] Building C object deps/xdiff/CMakeFiles/xdiff.dir/xutils.c.o
[ 5%] Built target xdiff
[ 6%] Building C object deps/ntlmclient/CMakeFiles/ntlmclient.dir/ntlm.c.o
In file included from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/crypt_mbedtls.h:12,
from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/crypt.h:18,
from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/ntlm.h:14,
from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/ntlm.c:19:
/usr/include/mbedtls/md.h:246:14: error: expected ‘;’ before ‘unsigned’
246 | static inline unsigned char mbedtls_md_get_size_from_type(mbedtls_md_type_t md_type)
| ^~~~~~~~~
| ;
cc1: note: unrecognized command-line option ‘-Wno-documentation-deprecated-sync’ may have been intended to silence earlier diagnostics
make[2]: *** [deps/ntlmclient/CMakeFiles/ntlmclient.dir/build.make:79: deps/ntlmclient/CMakeFiles/ntlmclient.dir/ntlm.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:450: deps/ntlmclient/CMakeFiles/ntlmclient.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
I also tried to run this command:
cmake lib/libgit2 -Blib/build -DBUILD_SHARED_LIBS=OFF -DLINK_WITH_STATIC_LIBRARIES=ON -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/libcrypto.so -DOPENSSL_SSL_LIBRARY=/usr/lib/libssl.so
Cmake successfully found openssl:
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "3.4.1")
And successfully built library. But then I try to link to that library from rust and get these errors:
= note: mold: error: undefined symbol: SSL_CTX_load_verify_locations
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_openssl__set_cert_location)
mold: error: undefined symbol: SSL_connect
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_connect)
mold: error: undefined symbol: ASN1_STRING_type
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: OPENSSL_sk_value
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: SSL_get_error
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(ssl_set_error)
mold: error: undefined symbol: BIO_meth_new
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: ERR_error_string
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: HMAC_Init_ex
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: TLS_method
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: inflateInit_
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_init)
mold: error: undefined symbol: SSL_new
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_stream_wrap)
mold: error: undefined symbol: BIO_new
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_connect)
mold: error: undefined symbol: X509_NAME_get_index_by_NID
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: SSL_get1_peer_certificate
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_certificate)
mold: error: undefined symbol: BIO_meth_set_ctrl
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: BIO_set_data
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(bio_create)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(bio_destroy)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_connect)
mold: error: undefined symbol: SSL_CTX_set_default_verify_paths
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: SHA256_Update
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_hash_sha256_update)
mold: error: undefined symbol: deflateReset
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_reset)
mold: error: undefined symbol: HMAC_CTX_new
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: BIO_meth_free
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(shutdown_ssl)
mold: error: undefined symbol: X509_STORE_add_cert
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_openssl__add_x509_cert)
mold: error: undefined symbol: SSL_write
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_write)
mold: error: undefined symbol: ASN1_STRING_to_UTF8
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: ASN1_STRING_length
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: SSL_shutdown
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(ssl_teardown)
mold: error: undefined symbol: BIO_meth_set_read
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: HMAC_Final
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_CTX_set_options
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: inflateEnd
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_free)
mold: error: undefined symbol: deflateInit_
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_init)
>>> referenced by filebuf.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(filebuf.c.o):(git_filebuf_open_withsize)
mold: error: undefined symbol: DES_ecb_encrypt
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_ctrl
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_connect)
mold: error: undefined symbol: X509_NAME_ENTRY_get_data
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: OPENSSL_sk_num
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: BIO_meth_set_destroy
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: BIO_get_new_index
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: HMAC_CTX_reset
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: OPENSSL_init_ssl
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: ERR_get_error
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(ssl_set_error)
>>> referenced 2 more times
mold: error: undefined symbol: deflateEnd
>>> referenced by filebuf.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(filebuf.c.o):(git_filebuf_cleanup)
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_free)
mold: error: undefined symbol: crc32
>>> referenced by indexer.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(indexer.c.o):(crc_object)
>>> referenced by indexer.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(indexer.c.o):(crc_object)
>>> referenced by indexer.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(indexer.c.o):(hash_and_save)
>>> referenced 3 more times
mold: error: undefined symbol: SSL_free
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_free)
mold: error: undefined symbol: CRYPTO_free
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: X509_get_subject_name
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: BIO_meth_set_gets
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: BIO_set_init
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(bio_create)
mold: error: undefined symbol: RAND_bytes
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_CTX_set_verify
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: inflateReset
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_reset)
mold: error: undefined symbol: SHA256_Init
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_hash_sha256_init)
mold: error: undefined symbol: EVP_md5
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_CTX_get_cert_store
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_openssl__add_x509_cert)
mold: error: undefined symbol: i2d_X509
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_certificate)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_certificate)
mold: error: undefined symbol: CRYPTO_malloc
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: ASN1_STRING_get0_data
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: ERR_error_string_n
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(ssl_set_error)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(ssl_set_error)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_openssl__set_cert_location)
mold: error: undefined symbol: BIO_meth_set_write
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: HMAC_Update
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_CTX_new
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: deflate
>>> referenced by filebuf.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(filebuf.c.o):(write_deflate)
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_get_output_chunk)
mold: error: undefined symbol: DES_set_key
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_set_bio
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_connect)
mold: error: undefined symbol: X509_NAME_get_entry
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: X509_get_ext_d2i
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: BIO_meth_set_create
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: BIO_get_data
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(bio_read)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(bio_write)
mold: error: undefined symbol: SSL_CTX_set_cipher_list
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: SHA256_Final
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(git_hash_sha256_final)
mold: error: undefined symbol: HMAC_CTX_free
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: SSL_CTX_free
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(shutdown_ssl)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: SSL_read
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_read)
mold: error: undefined symbol: X509_free
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_certificate)
mold: error: undefined symbol: GENERAL_NAMES_free
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: SSL_get_verify_result
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(verify_server_cert)
mold: error: undefined symbol: BIO_meth_set_puts
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(init_bio_method)
mold: error: undefined symbol: MD4
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
mold: error: undefined symbol: inflate
>>> referenced by zstream.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(zstream.c.o):(git_zstream_get_output_chunk)
mold: error: undefined symbol: SSL_CTX_ctrl
>>> referenced by openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(openssl.c.o):(openssl_init)
mold: error: undefined symbol: ERR_lib_error_string
>>> referenced by crypt_openssl.c
>>> /home/george/dev/rust/projects/git-toy/target/debug/deps/libgit_toy_sys-90ba2160fcf37de6.rlib(crypt_openssl.c.o):(ntlm_crypt_init_functions)
collect2: error: ld returned 1 exit status
warning: `git-toy` (bin "git-toy") generated 5 warnings
error: could not compile `git-toy` (bin "git-toy") due to 1 previous error; 5 warnings emitted
Maybe that is because I setted up
-DOPENSSL_CRYPTO_LIBRARY=/usr/lib/libcrypto.so -DOPENSSL_SSL_LIBRARY=/usr/lib/libssl.so
manually? Now rust can't find openssl too.
That strange, because pkg-config shows that these libs are available:
$ pkg-config --libs libssl libcrypto
-lssl -lcrypto
Last edited by 39george (2025-02-15 05:43:27)
Offline
Please use [code][/code] tags. Edit your post in this regard.
And what objects is that mold command (trying to) link in?
Why is mbedtls installed and why are you not building https://aur.archlinux.org/packages/libgit2-git ?
Offline
The mold linker is trying to combine the compiled libgit2 library with my rust project. The linking process fails because the compiled libgit2 library has calls to functions inside of the openssl libraries, and the linker can't find those openssl functions.
mbedTLS is installed on my system as a dependency of obs-studio package. I'm not explicitly installing it for libgit2; it's likely a system-wide dependency.
I'm attempting to build libgit2 from source within my Rust project's crates/git-toy-sys/lib/libgit2 directory because it is a dependency of my rust crate. I was not aware of the aur package, but I am attempting to build the library from source because it is a dependency of my crate. I'm trying to keep the build process contained within my Rust project's workspace
Offline
The mold linker is trying to…
Please don't paraphrase, https://bbs.archlinux.org/viewtopic.php?id=57855
Because
the linker can't find those openssl functions.
Yes, but what objects are actually being linked in here?
I'm not explicitly installing it for libgit2
So why
In file included from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/crypt_mbedtls.h:12,
from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/crypt.h:18,
from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/ntlm.h:14,
from /home/george/dev/rust/projects/git-toy/crates/git-toy-sys/lib/libgit2/deps/ntlmclient/ntlm.c:19:
does libgit2 inclde it?
Afaikt it's not a dependency of the AUR package.
Build that first, see how it goes, have a look at its PKGBUILD and what's different from your current setup.
Offline
Moving to Programming subboard as that seems most appropriate
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Didn't see the part where you made sure you have the dev versions of these libraries installed.
Note that dev versions of libraries usually come with/from different packages.
(Interesting, this is one part where Arch Linux differs from other distros. There's no dev packages on Arch Linux :] )
Last edited by ReDress (2025-02-15 17:37:14)
Offline