randombit / botan

Cryptography Toolkit
https://botan.randombit.net
BSD 2-Clause "Simplified" License
2.55k stars 561 forks source link

C++ related linker errors with static library under macOS #2763

Closed KizzyCode closed 1 year ago

KizzyCode commented 3 years ago

If I build a static library under macOS, I cannot link it to any C or Swift or Rust etc. application due to a lot of (C++ related?) linker errors.

Botan build steps:

cd "Botan-2.18.1"
./configure.py --prefix="./" --cc="clang" --build-targets="static"
make -j12 check install

Configure output:

``` INFO: ./configure.py invoked with options "--prefix=./ --cc=clang --build-targets=static" INFO: Configuring to build Botan 2.18.1 (revision git:d4bd416702a65eddcc14ee06b9c1b674631e6ae3) INFO: Running under 2.7.16 (default, May 8 2021, 11:48:02) [GCC Apple LLVM 12.0.5 (clang-1205.0.19.59.6) [+internal-os, ptrauth-isa=deploy INFO: Autodetected platform information: OS="Darwin" machine="x86_64" proc="i386" INFO: Guessing target OS is darwin (use --os to set) INFO: Guessing target processor is a x86_64 (use --cpu to set) INFO: Using /etc/ssl/cert.pem as system certificate store INFO: Auto-detected compiler version 4.0 INFO: Auto-detected compiler arch x86_64 INFO: Target is clang:4.0-macos-x86_64 INFO: Assuming target x86_64 is little endian INFO: Skipping (dependency failure): asio certstor_sqlite3 sessions_sqlite3 INFO: Skipping (incompatible CPU): aes_armv8 aes_power8 sha1_armv8 sha2_32_armv8 sm4_armv8 INFO: Skipping (incompatible OS): certstor_system_windows proc_walk win32_stats INFO: Skipping (no enabled compression schemes): compression INFO: Skipping (requires external dependency): boost bzip2 commoncrypto lzma openssl sqlite3 tpm zlib INFO: Loading modules: adler32 aead aes aes_ni aes_vperm aont argon2 aria asn1 auto_rng base base32 base58 base64 bcrypt bcrypt_pbkdf bigint blake2 block blowfish camellia cascade cast128 cast256 cbc cbc_mac ccm cecpq1 certstor_flatfile certstor_sql certstor_system certstor_system_macos cfb chacha chacha20poly1305 chacha_avx2 chacha_rng chacha_simd32 checksum cmac comb4p cpuid crc24 crc32 cryptobox ctr curve25519 des dev_random dh dl_algo dl_group dlies dsa dyn_load eax ec_group ecc_key ecdh ecdsa ecgdsa ecies eckcdsa ed25519 elgamal eme_oaep eme_pkcs1 eme_raw emsa1 emsa_pkcs1 emsa_pssr emsa_raw emsa_x931 entropy fd_unix ffi filters fpe_fe1 gcm getentropy ghash ghash_cpu ghash_vperm gmac gost_28147 gost_3410 gost_3411 hash hash_id hex hkdf hmac hmac_drbg hotp http_util idea idea_sse2 iso9796 kasumi kdf kdf1 kdf1_iso18033 kdf2 keccak keypair lion locking_allocator mac mce mceies md4 md5 mdx_hash mem_pool mgf1 misty1 mode_pad modes mp newhope nist_keywrap noekeon noekeon_simd numbertheory ocb ofb par_hash passhash9 pbes2 pbkdf pbkdf1 pbkdf2 pem pgp_s2k pk_pad pkcs11 poly1305 poly_dbl prf_tls prf_x942 processor_rng psk_db pubkey rc4 rdrand_rng rdseed rfc3394 rfc6979 rmd160 rng roughtime rsa salsa20 scrypt seed serpent serpent_avx2 serpent_simd sessions_sql sha1 sha1_sse2 sha1_x86 sha2_32 sha2_32_bmi2 sha2_32_x86 sha2_64 sha2_64_bmi2 sha3 sha3_bmi2 shacal2 shacal2_avx2 shacal2_simd shacal2_x86 shake shake_cipher simd simd_avx2 siphash siv skein sm2 sm3 sm4 socket sodium sp800_108 sp800_56a sp800_56c srp6 stateful_rng stream streebog system_rng thread_utils threefish_512 threefish_512_avx2 tiger tls tls_10 tls_cbc tss twofish utils uuid whirlpool x509 x919_mac xmss xtea xts INFO: Using symlink to link files into build dir (use --link-method to change) INFO: Botan 2.18.1 (revision git:d4bd416702a65eddcc14ee06b9c1b674631e6ae3) (release dated 20210509) build setup is complete ```

For the full build output, please see Full Build Output.txt.

Test application test_botan.c:

#include <stdio.h>
#include <stdint.h>

extern uint32_t botan_ffi_api_version();

int main() {
    printf("Version: %d\n", botan_ffi_api_version());
    return 0;
}

Build steps:

clang -L"./Botan-2.18.1/lib/" -l"botan-2" -o "test_botan" "test_botan.c"

Full build output with linker errors:

``` Undefined symbols for architecture x86_64: "std::__1::basic_string, std::__1::allocator >::find(char, unsigned long) const", referenced from: Botan::parse_algorithm_name(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) "std::__1::basic_string, std::__1::allocator >::compare(unsigned long, unsigned long, char const*, unsigned long) const", referenced from: Botan_FFI::ffi_error_exception_thrown(char const*, char const*, int) in libbotan-2.a(ffi.o) Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::CPUID::bit_from_string(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_cpuid.o) "std::__1::__vector_base_common::__throw_length_error() const", referenced from: Botan::hex_decode_locked(char const*, unsigned long, bool) in libbotan-2.a(codec_hex.o) Botan::hex_decode(char const*, unsigned long, bool) in libbotan-2.a(codec_hex.o) std::__1::vector >::__append(unsigned long) in libbotan-2.a(codec_hex.o) std::__1::vector >::__append(unsigned long) in libbotan-2.a(codec_base64.o) Botan::OS::allocate_locked_pages(unsigned long) in libbotan-2.a(utils_os_utils.o) std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > >::push_back(std::__1::basic_string, std::__1::allocator >&&) in libbotan-2.a(utils_cpuid.o) std::__1::vector >::__append(unsigned long) in libbotan-2.a(utils_mem_pool.o) ... "std::__1::__basic_string_common::__throw_length_error() const", referenced from: std::__1::__function::__func, int ()>::operator()() in libbotan-2.a(ffi.o) Botan::hex_encode(unsigned char const*, unsigned long, bool) in libbotan-2.a(codec_hex.o) std::__1::basic_stringbuf, std::__1::allocator >::str() const in libbotan-2.a(utils_version.o) Botan::base64_encode(unsigned char const*, unsigned long) in libbotan-2.a(codec_base64.o) std::__1::basic_stringbuf, std::__1::allocator >::str() const in libbotan-2.a(utils_assert.o) Botan::Exception::Exception(std::__1::basic_string, std::__1::allocator > const&, std::exception const&) in libbotan-2.a(utils_exceptn.o) std::__1::basic_string, std::__1::allocator > std::__1::operator+, std::__1::allocator >(std::__1::basic_string, std::__1::allocator > const&, char const*) in libbotan-2.a(utils_exceptn.o) ... "std::__1::locale::has_facet(std::__1::locale::id&) const", referenced from: std::__1::basic_filebuf >::basic_filebuf() in libbotan-2.a(utils_data_src.o) "std::__1::locale::use_facet(std::__1::locale::id&) const", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) std::__1::basic_filebuf >::basic_filebuf() in libbotan-2.a(utils_data_src.o) std::__1::basic_filebuf >::imbue(std::__1::locale const&) in libbotan-2.a(utils_data_src.o) ... "std::__1::ios_base::getloc() const", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) "std::exception::what() const", referenced from: vtable for std::__1::bad_function_call in libbotan-2.a(ffi.o) vtable for std::__1::bad_function_call in libbotan-2.a(utils_os_utils.o) vtable for std::__1::bad_function_call in libbotan-2.a(utils_parsing.o) vtable for std::__1::bad_function_call in libbotan-2.a(asn1_der_enc.o) "std::logic_error::logic_error(char const*)", referenced from: std::length_error::length_error(char const*) in libbotan-2.a(utils_os_utils.o) std::length_error::length_error(char const*) in libbotan-2.a(utils_cpuid.o) std::length_error::length_error(char const*) in libbotan-2.a(utils_mem_pool.o) std::length_error::length_error(char const*) in libbotan-2.a(utils_parsing.o) std::length_error::length_error(char const*) in libbotan-2.a(asn1_oid.o) std::length_error::length_error(char const*) in libbotan-2.a(asn1_der_enc.o) std::length_error::length_error(char const*) in libbotan-2.a(asn1_oids.o) ... "std::length_error::~length_error()", referenced from: std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_os_utils.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_cpuid.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_mem_pool.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_parsing.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(asn1_oid.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(asn1_der_enc.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(asn1_oids.o) ... "std::__1::__next_prime(unsigned long)", referenced from: std::__1::__hash_table, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > >, std::__1::__unordered_map_hasher, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > >, std::__1::hash, std::__1::allocator > >, true>, std::__1::__unordered_map_equal, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > >, std::__1::equal_to, std::__1::allocator > >, true>, std::__1::allocator, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > > > >::rehash(unsigned long) in libbotan-2.a(asn1_oids.o) std::__1::__hash_table, std::__1::allocator >, Botan::OID>, std::__1::__unordered_map_hasher, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, Botan::OID>, std::__1::hash, std::__1::allocator > >, true>, std::__1::__unordered_map_equal, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, Botan::OID>, std::__1::equal_to, std::__1::allocator > >, true>, std::__1::allocator, std::__1::allocator >, Botan::OID> > >::rehash(unsigned long) in libbotan-2.a(asn1_oids.o) std::__1::__hash_table, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > >, std::__1::__unordered_map_hasher, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > >, std::__1::hash, std::__1::allocator > >, true>, std::__1::__unordered_map_equal, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > >, std::__1::equal_to, std::__1::allocator > >, true>, std::__1::allocator, std::__1::allocator >, std::__1::basic_string, std::__1::allocator > > > >::rehash(unsigned long) in libbotan-2.a(asn1_oid_maps.o) std::__1::__hash_table, std::__1::allocator >, Botan::OID>, std::__1::__unordered_map_hasher, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, Botan::OID>, std::__1::hash, std::__1::allocator > >, true>, std::__1::__unordered_map_equal, std::__1::allocator >, std::__1::__hash_value_type, std::__1::allocator >, Botan::OID>, std::__1::equal_to, std::__1::allocator > >, true>, std::__1::allocator, std::__1::allocator >, Botan::OID> > >::rehash(unsigned long) in libbotan-2.a(asn1_oid_maps.o) "std::__1::basic_string, std::__1::allocator >::append(char const*)", referenced from: Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::base64_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::base64_decode(char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::Exception::Exception(char const*, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Lookup_Error::Lookup_Error(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Invalid_IV_Length::Invalid_IV_Length(std::__1::basic_string, std::__1::allocator > const&, unsigned long) in libbotan-2.a(utils_exceptn.o) ... "std::__1::basic_string, std::__1::allocator >::append(char const*, unsigned long)", referenced from: Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::Exception::Exception(std::__1::basic_string, std::__1::allocator > const&, std::exception const&) in libbotan-2.a(utils_exceptn.o) std::__1::basic_string, std::__1::allocator > std::__1::operator+, std::__1::allocator >(std::__1::basic_string, std::__1::allocator > const&, char const*) in libbotan-2.a(utils_exceptn.o) Botan::Exception::Exception(char const*, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Invalid_Argument::Invalid_Argument(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Lookup_Error::Lookup_Error(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) ... "std::__1::basic_string, std::__1::allocator >::assign(char const*)", referenced from: Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::OS::read_env_variable(std::__1::basic_string, std::__1::allocator >&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_os_utils.o) "std::__1::basic_string, std::__1::allocator >::insert(unsigned long, char const*)", referenced from: Botan::Invalid_IV_Length::Invalid_IV_Length(std::__1::basic_string, std::__1::allocator > const&, unsigned long) in libbotan-2.a(utils_exceptn.o) Botan::Charset::transcode(std::__1::basic_string, std::__1::allocator > const&, Botan::Character_Set, Botan::Character_Set) in libbotan-2.a(utils_charset.o) Botan::asn1_tag_to_string(Botan::ASN1_Tag) in libbotan-2.a(asn1_obj.o) Botan::asn1_class_to_string(Botan::ASN1_Tag) in libbotan-2.a(asn1_obj.o) Botan::DER_Encoder::add_object(Botan::ASN1_Tag, Botan::ASN1_Tag, unsigned char const*, unsigned long) in libbotan-2.a(asn1_der_enc.o) Botan::OIDS::oid2str_or_throw(Botan::OID const&) in libbotan-2.a(asn1_oids.o) "std::__1::basic_string, std::__1::allocator >::resize(unsigned long, char)", referenced from: std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_version.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_assert.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(asn1_oid.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(asn1_obj.o) "std::__1::basic_string, std::__1::allocator >::push_back(char)", referenced from: std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_version.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_assert.o) Botan::timespec_to_u32bit(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) Botan::parse_algorithm_name(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) Botan::split_on_pred(std::__1::basic_string, std::__1::allocator > const&, std::__1::function) in libbotan-2.a(utils_parsing.o) Botan::string_join(std::__1::vector, std::__1::allocator >, std::__1::allocator, std::__1::allocator > > > const&, char) in libbotan-2.a(utils_parsing.o) Botan::erase_chars(std::__1::basic_string, std::__1::allocator > const&, std::__1::set, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) ... "std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&)", referenced from: Botan::Exception::Exception(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Exception::Exception(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Invalid_Argument::Invalid_Argument(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Invalid_Argument::Invalid_Argument(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Invalid_Argument::Invalid_Argument(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Lookup_Error::Lookup_Error(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Internal_Error::Internal_Error(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) ... "std::__1::basic_string, std::__1::allocator >::basic_string(std::__1::basic_string, std::__1::allocator > const&, unsigned long, unsigned long, std::__1::allocator const&)", referenced from: Botan::timespec_to_u32bit(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) Botan::parse_algorithm_name(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) "std::__1::basic_istream >::read(char*, long)", referenced from: Botan::DataSource_Stream::read(unsigned char*, unsigned long) in libbotan-2.a(utils_data_src.o) Botan::DataSource_Stream::peek(unsigned char*, unsigned long, unsigned long) const in libbotan-2.a(utils_data_src.o) "std::__1::basic_istream >::seekg(std::__1::fpos<__mbstate_t>)", referenced from: Botan::DataSource_Stream::check_available(unsigned long) in libbotan-2.a(utils_data_src.o) "std::__1::basic_istream >::seekg(long long, std::__1::ios_base::seekdir)", referenced from: Botan::DataSource_Stream::check_available(unsigned long) in libbotan-2.a(utils_data_src.o) Botan::DataSource_Stream::peek(unsigned char*, unsigned long, unsigned long) const in libbotan-2.a(utils_data_src.o) "std::__1::basic_istream >::tellg()", referenced from: Botan::DataSource_Stream::check_available(unsigned long) in libbotan-2.a(utils_data_src.o) "std::__1::basic_istream >::~basic_istream()", referenced from: construction vtable for std::__1::basic_istream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) construction vtable for std::__1::basic_istream >-in-std::__1::basic_ifstream > in libbotan-2.a(utils_data_src.o) "std::__1::basic_istream >::~basic_istream()", referenced from: construction vtable for std::__1::basic_istream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) construction vtable for std::__1::basic_istream >-in-std::__1::basic_ifstream > in libbotan-2.a(utils_data_src.o) "std::__1::basic_istream >::~basic_istream()", referenced from: Botan::DataSource_Stream::DataSource_Stream(std::__1::basic_string, std::__1::allocator > const&, bool) in libbotan-2.a(utils_data_src.o) std::__1::basic_ifstream >::~basic_ifstream() in libbotan-2.a(utils_data_src.o) std::__1::basic_ifstream >::~basic_ifstream() in libbotan-2.a(utils_data_src.o) virtual thunk to std::__1::basic_ifstream >::~basic_ifstream() in libbotan-2.a(utils_data_src.o) virtual thunk to std::__1::basic_ifstream >::~basic_ifstream() in libbotan-2.a(utils_data_src.o) "std::__1::basic_ostream >::sentry::sentry(std::__1::basic_ostream >&)", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) "std::__1::basic_ostream >::sentry::~sentry()", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) "std::__1::basic_ostream >::~basic_ostream()", referenced from: construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_version.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_assert.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(asn1_oid.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_ostream >::~basic_ostream()", referenced from: construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_version.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_assert.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(asn1_oid.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_ostream >::~basic_ostream()", referenced from: Botan::runtime_version_check(unsigned int, unsigned int, unsigned int) in libbotan-2.a(utils_version.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) virtual thunk to std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) virtual thunk to std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) Botan::throw_invalid_argument(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_assert.o) ... "std::__1::basic_ostream >::operator<<(int)", referenced from: Botan::assertion_failure(char const*, char const*, char const*, char const*, int) in libbotan-2.a(utils_assert.o) "std::__1::basic_ostream >::operator<<(unsigned int)", referenced from: Botan::runtime_version_check(unsigned int, unsigned int, unsigned int) in libbotan-2.a(utils_version.o) Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) "std::__1::basic_iostream >::~basic_iostream()", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_iostream >::~basic_iostream()", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_iostream >::~basic_iostream()", referenced from: Botan::BER_Object::assert_is_a(Botan::ASN1_Tag, Botan::ASN1_Tag, std::__1::basic_string, std::__1::allocator > const&) const in libbotan-2.a(asn1_obj.o) std::__1::basic_stringstream, std::__1::allocator >::~basic_stringstream() in libbotan-2.a(asn1_obj.o) non-virtual thunk to std::__1::basic_stringstream, std::__1::allocator >::~basic_stringstream() in libbotan-2.a(asn1_obj.o) virtual thunk to std::__1::basic_stringstream, std::__1::allocator >::~basic_stringstream() in libbotan-2.a(asn1_obj.o) std::__1::basic_stringstream, std::__1::allocator >::~basic_stringstream() in libbotan-2.a(asn1_obj.o) non-virtual thunk to std::__1::basic_stringstream, std::__1::allocator >::~basic_stringstream() in libbotan-2.a(asn1_obj.o) virtual thunk to std::__1::basic_stringstream, std::__1::allocator >::~basic_stringstream() in libbotan-2.a(asn1_obj.o) ... "std::__1::basic_streambuf >::sync()", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_streambuf >::imbue(std::__1::locale const&)", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_streambuf >::uflow()", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) vtable for std::__1::basic_filebuf > in libbotan-2.a(utils_data_src.o) "std::__1::basic_streambuf >::setbuf(char*, long)", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "std::__1::basic_streambuf >::xsgetn(char*, long)", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) vtable for std::__1::basic_filebuf > in libbotan-2.a(utils_data_src.o) "std::__1::basic_streambuf >::xsputn(char const*, long)", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) vtable for std::__1::basic_filebuf > in libbotan-2.a(utils_data_src.o) "std::__1::basic_streambuf >::showmanyc()", referenced from: vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) vtable for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) vtable for std::__1::basic_filebuf > in libbotan-2.a(utils_data_src.o) "std::__1::basic_streambuf >::basic_streambuf()", referenced from: Botan::runtime_version_check(unsigned int, unsigned int, unsigned int) in libbotan-2.a(utils_version.o) Botan::throw_invalid_argument(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) Botan::throw_invalid_state(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) Botan::assertion_failure(char const*, char const*, char const*, char const*, int) in libbotan-2.a(utils_assert.o) Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) Botan::BER_Object::assert_is_a(Botan::ASN1_Tag, Botan::ASN1_Tag, std::__1::basic_string, std::__1::allocator > const&) const in libbotan-2.a(asn1_obj.o) std::__1::basic_filebuf >::basic_filebuf() in libbotan-2.a(utils_data_src.o) ... "std::__1::basic_streambuf >::~basic_streambuf()", referenced from: Botan::runtime_version_check(unsigned int, unsigned int, unsigned int) in libbotan-2.a(utils_version.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) virtual thunk to std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) virtual thunk to std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) std::__1::basic_stringbuf, std::__1::allocator >::~basic_stringbuf() in libbotan-2.a(utils_version.o) std::__1::basic_stringbuf, std::__1::allocator >::~basic_stringbuf() in libbotan-2.a(utils_version.o) ... "std::__1::ctype::id", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) "std::__1::mutex::lock()", referenced from: Botan::Memory_Pool::allocate(unsigned long) in libbotan-2.a(utils_mem_pool.o) Botan::Memory_Pool::deallocate(void*, unsigned long) in libbotan-2.a(utils_mem_pool.o) Botan::(anonymous namespace)::OID_Map::add_oid2str(Botan::OID const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) Botan::(anonymous namespace)::OID_Map::add_str2oid(Botan::OID const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) Botan::OIDS::oid2str_or_empty(Botan::OID const&) in libbotan-2.a(asn1_oids.o) Botan::OIDS::str2oid_or_empty(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) Botan::OIDS::have_oid(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) ... "std::__1::mutex::unlock()", referenced from: Botan::Memory_Pool::allocate(unsigned long) in libbotan-2.a(utils_mem_pool.o) Botan::Memory_Pool::deallocate(void*, unsigned long) in libbotan-2.a(utils_mem_pool.o) Botan::(anonymous namespace)::OID_Map::add_oid2str(Botan::OID const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) Botan::(anonymous namespace)::OID_Map::add_str2oid(Botan::OID const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) Botan::OIDS::oid2str_or_empty(Botan::OID const&) in libbotan-2.a(asn1_oids.o) Botan::OIDS::str2oid_or_empty(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) Botan::OIDS::have_oid(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(asn1_oids.o) ... "std::__1::mutex::~mutex()", referenced from: Botan::Memory_Pool::Memory_Pool(std::__1::vector > const&, unsigned long) in libbotan-2.a(utils_mem_pool.o) Botan::Memory_Pool::~Memory_Pool() in libbotan-2.a(utils_mem_pool.o) Botan::Memory_Pool::~Memory_Pool() in libbotan-2.a(utils_mem_pool.o) Botan::(anonymous namespace)::OID_Map::global_registry() in libbotan-2.a(asn1_oids.o) Botan::(anonymous namespace)::OID_Map::~OID_Map() in libbotan-2.a(asn1_oids.o) "std::__1::stoul(std::__1::basic_string, std::__1::allocator > const&, unsigned long*, int)", referenced from: Botan::OS::read_env_variable_sz(std::__1::basic_string, std::__1::allocator > const&, unsigned long) in libbotan-2.a(utils_os_utils.o) Botan::to_u32bit(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_parsing.o) "std::__1::chrono::steady_clock::now()", referenced from: Botan::OS::get_high_resolution_clock() in libbotan-2.a(utils_os_utils.o) "std::__1::chrono::system_clock::now()", referenced from: Botan::OS::get_system_timestamp_ns() in libbotan-2.a(utils_os_utils.o) "std::__1::locale::locale(char const*)", referenced from: Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) "std::__1::locale::locale(std::__1::locale const&)", referenced from: Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) std::__1::basic_filebuf >::basic_filebuf() in libbotan-2.a(utils_data_src.o) "std::__1::locale::~locale()", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) std::__1::basic_filebuf >::basic_filebuf() in libbotan-2.a(utils_data_src.o) ... "std::__1::locale::operator=(std::__1::locale const&)", referenced from: Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) "std::__1::thread::hardware_concurrency()", referenced from: Botan::OS::get_cpu_total() in libbotan-2.a(utils_os_utils.o) Botan::OS::get_cpu_available() in libbotan-2.a(utils_os_utils.o) "std::__1::codecvt::id", referenced from: std::__1::basic_filebuf >::basic_filebuf() in libbotan-2.a(utils_data_src.o) std::__1::basic_filebuf >::imbue(std::__1::locale const&) in libbotan-2.a(utils_data_src.o) "std::__1::ios_base::__set_badbit_and_consider_rethrow()", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) "std::__1::ios_base::init(void*)", referenced from: Botan::runtime_version_check(unsigned int, unsigned int, unsigned int) in libbotan-2.a(utils_version.o) Botan::throw_invalid_argument(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) Botan::throw_invalid_state(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) Botan::assertion_failure(char const*, char const*, char const*, char const*, int) in libbotan-2.a(utils_assert.o) Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) Botan::BER_Object::assert_is_a(Botan::ASN1_Tag, Botan::ASN1_Tag, std::__1::basic_string, std::__1::allocator > const&) const in libbotan-2.a(asn1_obj.o) Botan::DataSource_Stream::DataSource_Stream(std::__1::basic_string, std::__1::allocator > const&, bool) in libbotan-2.a(utils_data_src.o) ... "std::__1::ios_base::clear(unsigned int)", referenced from: std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_cpuid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_oid.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(asn1_obj.o) Botan::DataSource_Stream::peek(unsigned char*, unsigned long, unsigned long) const in libbotan-2.a(utils_data_src.o) Botan::DataSource_Stream::DataSource_Stream(std::__1::basic_string, std::__1::allocator > const&, bool) in libbotan-2.a(utils_data_src.o) ... "std::__1::ios_base::imbue(std::__1::locale const&)", referenced from: Botan::OID::to_string() const in libbotan-2.a(asn1_oid.o) "std::__1::basic_ios >::~basic_ios()", referenced from: Botan::runtime_version_check(unsigned int, unsigned int, unsigned int) in libbotan-2.a(utils_version.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) virtual thunk to std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) virtual thunk to std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_version.o) Botan::throw_invalid_argument(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) std::__1::basic_ostringstream, std::__1::allocator >::~basic_ostringstream() in libbotan-2.a(utils_assert.o) ... "std::__1::to_string(int)", referenced from: Botan::System_Error::System_Error(std::__1::basic_string, std::__1::allocator > const&, int) in libbotan-2.a(utils_exceptn.o) Botan::ipv4_to_string(unsigned int) in libbotan-2.a(utils_parsing.o) Botan::Charset::transcode(std::__1::basic_string, std::__1::allocator > const&, Botan::Character_Set, Botan::Character_Set) in libbotan-2.a(utils_charset.o) Botan::Integer_Overflow_Detected::Integer_Overflow_Detected(std::__1::basic_string, std::__1::allocator > const&, int) in libbotan-2.a(asn1_ber_dec.o) "std::__1::to_string(unsigned int)", referenced from: Botan::BER_Object::assert_is_a(Botan::ASN1_Tag, Botan::ASN1_Tag, std::__1::basic_string, std::__1::allocator > const&) const in libbotan-2.a(asn1_obj.o) Botan::BER_Bad_Tag::BER_Bad_Tag(std::__1::basic_string, std::__1::allocator > const&, Botan::ASN1_Tag) in libbotan-2.a(asn1_obj.o) Botan::BER_Bad_Tag::BER_Bad_Tag(std::__1::basic_string, std::__1::allocator > const&, Botan::ASN1_Tag, Botan::ASN1_Tag) in libbotan-2.a(asn1_obj.o) Botan::DER_Encoder::add_object(Botan::ASN1_Tag, Botan::ASN1_Tag, unsigned char const*, unsigned long) in libbotan-2.a(asn1_der_enc.o) "std::__1::to_string(unsigned long)", referenced from: Botan::Invalid_Key_Length::Invalid_Key_Length(std::__1::basic_string, std::__1::allocator > const&, unsigned long) in libbotan-2.a(utils_exceptn.o) Botan::Invalid_IV_Length::Invalid_IV_Length(std::__1::basic_string, std::__1::allocator > const&, unsigned long) in libbotan-2.a(utils_exceptn.o) Botan::asn1_tag_to_string(Botan::ASN1_Tag) in libbotan-2.a(asn1_obj.o) Botan::asn1_class_to_string(Botan::ASN1_Tag) in libbotan-2.a(asn1_obj.o) "std::__1::basic_string, std::__1::allocator > std::__1::operator+, std::__1::allocator >(char const*, std::__1::basic_string, std::__1::allocator > const&)", referenced from: Botan::Lookup_Error::Lookup_Error(std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&, std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Internal_Error::Internal_Error(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Internal_Error::Internal_Error(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Key_Not_Set::Key_Not_Set(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Key_Not_Set::Key_Not_Set(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Policy_Violation::Policy_Violation(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) Botan::Policy_Violation::Policy_Violation(std::__1::basic_string, std::__1::allocator > const&) in libbotan-2.a(utils_exceptn.o) ... "std::bad_cast::bad_cast()", referenced from: std::__1::__throw_bad_cast() in libbotan-2.a(utils_data_src.o) "std::bad_cast::~bad_cast()", referenced from: std::__1::__throw_bad_cast() in libbotan-2.a(utils_data_src.o) "std::bad_alloc::bad_alloc()", referenced from: Botan::allocate_memory(unsigned long, unsigned long) in libbotan-2.a(utils_mem_ops.o) "std::bad_alloc::~bad_alloc()", referenced from: Botan::allocate_memory(unsigned long, unsigned long) in libbotan-2.a(utils_mem_ops.o) "std::exception::~exception()", referenced from: std::__1::bad_function_call::~bad_function_call() in libbotan-2.a(ffi.o) std::__1::bad_function_call::~bad_function_call() in libbotan-2.a(ffi.o) Botan::Invalid_Argument::~Invalid_Argument() in libbotan-2.a(codec_hex.o) Botan::Exception::~Exception() in libbotan-2.a(codec_hex.o) Botan::Exception::~Exception() in libbotan-2.a(codec_hex.o) Botan::Invalid_Argument::~Invalid_Argument() in libbotan-2.a(codec_base64.o) Botan::Exception::~Exception() in libbotan-2.a(codec_base64.o) ... "std::terminate()", referenced from: ___clang_call_terminate in libbotan-2.a(ffi.o) ___clang_call_terminate in libbotan-2.a(codec_hex.o) ___clang_call_terminate in libbotan-2.a(utils_version.o) ___clang_call_terminate in libbotan-2.a(codec_base64.o) ___clang_call_terminate in libbotan-2.a(utils_assert.o) ___clang_call_terminate in libbotan-2.a(utils_os_utils.o) ___clang_call_terminate in libbotan-2.a(utils_locking_allocator.o) ... "typeinfo for std::__1::basic_istream >", referenced from: construction vtable for std::__1::basic_istream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) construction vtable for std::__1::basic_istream >-in-std::__1::basic_ifstream > in libbotan-2.a(utils_data_src.o) typeinfo for std::__1::basic_ifstream > in libbotan-2.a(utils_data_src.o) "typeinfo for std::__1::basic_ostream >", referenced from: construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_version.o) typeinfo for std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_version.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_assert.o) typeinfo for std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_assert.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(asn1_oid.o) typeinfo for std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(asn1_oid.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) ... "typeinfo for std::__1::basic_iostream >", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) typeinfo for std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "typeinfo for std::__1::basic_streambuf >", referenced from: typeinfo for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_version.o) typeinfo for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(utils_assert.o) typeinfo for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_oid.o) typeinfo for std::__1::basic_stringbuf, std::__1::allocator > in libbotan-2.a(asn1_obj.o) typeinfo for std::__1::basic_filebuf > in libbotan-2.a(utils_data_src.o) "typeinfo for std::length_error", referenced from: std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_os_utils.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_cpuid.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_mem_pool.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(utils_parsing.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(asn1_oid.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(asn1_der_enc.o) std::__1::__throw_length_error(char const*) in libbotan-2.a(asn1_oids.o) ... "typeinfo for std::bad_cast", referenced from: std::__1::__throw_bad_cast() in libbotan-2.a(utils_data_src.o) "typeinfo for std::bad_alloc", referenced from: GCC_except_table1 in libbotan-2.a(ffi.o) Botan::allocate_memory(unsigned long, unsigned long) in libbotan-2.a(utils_mem_ops.o) "typeinfo for std::exception", referenced from: GCC_except_table1 in libbotan-2.a(ffi.o) typeinfo for Botan::Exception in libbotan-2.a(ffi.o) typeinfo for std::__1::bad_function_call in libbotan-2.a(ffi.o) typeinfo for Botan::Exception in libbotan-2.a(codec_hex.o) typeinfo for Botan::Exception in libbotan-2.a(codec_base64.o) typeinfo for Botan::Exception in libbotan-2.a(utils_assert.o) GCC_except_table11 in libbotan-2.a(utils_os_utils.o) ... "vtable for __cxxabiv1::__class_type_info", referenced from: typeinfo for std::__1::__function::__base in libbotan-2.a(ffi.o) typeinfo for botan_hex_encode::$_0 in libbotan-2.a(ffi.o) typeinfo for botan_hex_decode::$_1 in libbotan-2.a(ffi.o) typeinfo for botan_base64_encode::$_2 in libbotan-2.a(ffi.o) typeinfo for botan_base64_decode::$_3 in libbotan-2.a(ffi.o) typeinfo for Botan::OS::Echo_Suppression in libbotan-2.a(utils_os_utils.o) typeinfo for std::__1::__function::__base in libbotan-2.a(utils_parsing.o) ... NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for __cxxabiv1::__si_class_type_info", referenced from: typeinfo for Botan::Exception in libbotan-2.a(ffi.o) typeinfo for Botan_FFI::FFI_Error in libbotan-2.a(ffi.o) typeinfo for std::__1::bad_function_call in libbotan-2.a(ffi.o) typeinfo for std::__1::__function::__func, int ()> in libbotan-2.a(ffi.o) typeinfo for std::__1::__function::__func, int ()> in libbotan-2.a(ffi.o) typeinfo for std::__1::__function::__func, int ()> in libbotan-2.a(ffi.o) typeinfo for std::__1::__function::__func, int ()> in libbotan-2.a(ffi.o) ... NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "vtable for std::length_error", referenced from: std::length_error::length_error(char const*) in libbotan-2.a(utils_os_utils.o) std::length_error::length_error(char const*) in libbotan-2.a(utils_cpuid.o) std::length_error::length_error(char const*) in libbotan-2.a(utils_mem_pool.o) std::length_error::length_error(char const*) in libbotan-2.a(utils_parsing.o) std::length_error::length_error(char const*) in libbotan-2.a(asn1_oid.o) std::length_error::length_error(char const*) in libbotan-2.a(asn1_der_enc.o) std::length_error::length_error(char const*) in libbotan-2.a(asn1_oids.o) ... NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. "non-virtual thunk to std::__1::basic_iostream >::~basic_iostream()", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "non-virtual thunk to std::__1::basic_iostream >::~basic_iostream()", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "virtual thunk to std::__1::basic_istream >::~basic_istream()", referenced from: construction vtable for std::__1::basic_istream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) construction vtable for std::__1::basic_istream >-in-std::__1::basic_ifstream > in libbotan-2.a(utils_data_src.o) "virtual thunk to std::__1::basic_istream >::~basic_istream()", referenced from: construction vtable for std::__1::basic_istream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) construction vtable for std::__1::basic_istream >-in-std::__1::basic_ifstream > in libbotan-2.a(utils_data_src.o) "virtual thunk to std::__1::basic_ostream >::~basic_ostream()", referenced from: construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_version.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_assert.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(asn1_oid.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "virtual thunk to std::__1::basic_ostream >::~basic_ostream()", referenced from: construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_version.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(utils_assert.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_ostringstream, std::__1::allocator > in libbotan-2.a(asn1_oid.o) construction vtable for std::__1::basic_ostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "virtual thunk to std::__1::basic_iostream >::~basic_iostream()", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "virtual thunk to std::__1::basic_iostream >::~basic_iostream()", referenced from: construction vtable for std::__1::basic_iostream >-in-std::__1::basic_stringstream, std::__1::allocator > in libbotan-2.a(asn1_obj.o) "operator delete[](void*)", referenced from: std::__1::basic_filebuf >::imbue(std::__1::locale const&) in libbotan-2.a(utils_data_src.o) std::__1::basic_filebuf >::setbuf(char*, long) in libbotan-2.a(utils_data_src.o) std::__1::basic_filebuf >::~basic_filebuf() in libbotan-2.a(utils_data_src.o) "operator delete(void*)", referenced from: Botan_FFI::ffi_error_exception_thrown(char const*, char const*, int) in libbotan-2.a(ffi.o) std::__1::bad_function_call::~bad_function_call() in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::~__func() in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::destroy_deallocate() in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::~__func() in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::destroy_deallocate() in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::operator()() in libbotan-2.a(ffi.o) ... "operator new[](unsigned long)", referenced from: std::__1::basic_filebuf >::imbue(std::__1::locale const&) in libbotan-2.a(utils_data_src.o) std::__1::basic_filebuf >::setbuf(char*, long) in libbotan-2.a(utils_data_src.o) "operator new(unsigned long)", referenced from: Botan_FFI::ffi_error_exception_thrown(char const*, char const*, int) in libbotan-2.a(ffi.o) _botan_hex_encode in libbotan-2.a(ffi.o) _botan_hex_decode in libbotan-2.a(ffi.o) _botan_base64_encode in libbotan-2.a(ffi.o) _botan_base64_decode in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::__clone() const in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::__clone() const in libbotan-2.a(ffi.o) ... "___cxa_allocate_exception", referenced from: std::__1::__throw_bad_function_call() in libbotan-2.a(ffi.o) Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::hex_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_hex.o) Botan::base64_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::base64_decode(char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::allocate_memory(unsigned long, unsigned long) in libbotan-2.a(utils_mem_ops.o) ... "___cxa_begin_catch", referenced from: Botan_FFI::ffi_guard_thunk(char const*, std::__1::function) in libbotan-2.a(ffi.o) ___clang_call_terminate in libbotan-2.a(ffi.o) ___clang_call_terminate in libbotan-2.a(codec_hex.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_version.o) ___clang_call_terminate in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) ___clang_call_terminate in libbotan-2.a(codec_base64.o) ... "___cxa_end_catch", referenced from: Botan_FFI::ffi_guard_thunk(char const*, std::__1::function) in libbotan-2.a(ffi.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_version.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_version.o) std::__1::basic_stringbuf, std::__1::allocator >::overflow(int) in libbotan-2.a(utils_assert.o) std::__1::basic_ostream >& std::__1::__put_character_sequence >(std::__1::basic_ostream >&, char const*, unsigned long) in libbotan-2.a(utils_assert.o) Botan::OS::read_env_variable_sz(std::__1::basic_string, std::__1::allocator > const&, unsigned long) in libbotan-2.a(utils_os_utils.o) Botan::OS::suppress_echo_on_terminal()::POSIX_Echo_Suppression::~POSIX_Echo_Suppression() in libbotan-2.a(utils_os_utils.o) ... "___cxa_free_exception", referenced from: Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::hex_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_hex.o) Botan::base64_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::base64_decode(char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::throw_invalid_argument(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) Botan::throw_invalid_state(char const*, char const*, char const*) in libbotan-2.a(utils_assert.o) ... "___cxa_guard_abort", referenced from: Botan::OS::get_cpu_cycle_counter() in libbotan-2.a(utils_os_utils.o) Botan::OS::get_high_resolution_clock() in libbotan-2.a(utils_os_utils.o) Botan::OS::allocate_locked_pages(unsigned long) in libbotan-2.a(utils_os_utils.o) Botan::mlock_allocator::instance() in libbotan-2.a(utils_locking_allocator.o) Botan::CPUID::has_simd_32() in libbotan-2.a(utils_cpuid.o) Botan::CPUID::to_string() in libbotan-2.a(utils_cpuid.o) Botan::CPUID::initialize() in libbotan-2.a(utils_cpuid.o) ... "___cxa_guard_acquire", referenced from: Botan::OS::get_cpu_cycle_counter() in libbotan-2.a(utils_os_utils.o) Botan::OS::get_high_resolution_clock() in libbotan-2.a(utils_os_utils.o) Botan::OS::allocate_locked_pages(unsigned long) in libbotan-2.a(utils_os_utils.o) Botan::mlock_allocator::instance() in libbotan-2.a(utils_locking_allocator.o) Botan::CPUID::has_simd_32() in libbotan-2.a(utils_cpuid.o) Botan::CPUID::to_string() in libbotan-2.a(utils_cpuid.o) Botan::CPUID::initialize() in libbotan-2.a(utils_cpuid.o) ... "___cxa_guard_release", referenced from: Botan::OS::get_cpu_cycle_counter() in libbotan-2.a(utils_os_utils.o) Botan::OS::get_high_resolution_clock() in libbotan-2.a(utils_os_utils.o) Botan::OS::allocate_locked_pages(unsigned long) in libbotan-2.a(utils_os_utils.o) Botan::mlock_allocator::instance() in libbotan-2.a(utils_locking_allocator.o) Botan::CPUID::has_simd_32() in libbotan-2.a(utils_cpuid.o) Botan::CPUID::to_string() in libbotan-2.a(utils_cpuid.o) Botan::CPUID::initialize() in libbotan-2.a(utils_cpuid.o) ... "___cxa_throw", referenced from: std::__1::__throw_bad_function_call() in libbotan-2.a(ffi.o) Botan::hex_decode(unsigned char*, char const*, unsigned long, unsigned long&, bool) in libbotan-2.a(codec_hex.o) Botan::hex_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_hex.o) Botan::base64_decode(unsigned char*, char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::base64_decode(char const*, unsigned long, bool) in libbotan-2.a(codec_base64.o) Botan::(anonymous namespace)::Base64::check_bad_char(unsigned char, char, bool) in libbotan-2.a(codec_base64.o) Botan::allocate_memory(unsigned long, unsigned long) in libbotan-2.a(utils_mem_ops.o) ... "___gxx_personality_v0", referenced from: Botan_FFI::ffi_error_exception_thrown(char const*, char const*, int) in libbotan-2.a(ffi.o) Botan_FFI::ffi_guard_thunk(char const*, std::__1::function) in libbotan-2.a(ffi.o) _botan_hex_encode in libbotan-2.a(ffi.o) _botan_hex_decode in libbotan-2.a(ffi.o) _botan_base64_encode in libbotan-2.a(ffi.o) _botan_base64_decode in libbotan-2.a(ffi.o) std::__1::__function::__func, int ()>::operator()() in libbotan-2.a(ffi.o) ... ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ```

System:

mouse07410 commented 3 years ago

If (for reasons I don't claim to understand) you insist on linking with a static Botan library, you need to add libc++.dylib (which, like libSystem.B.dylib, does not exist in static form) to resolve references to it.

Taking your source, and trying:

$ sw_vers
ProductName:    macOS
ProductVersion: 11.4
BuildVersion:   20F71
$ clang --version
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ 
$ clang $CFLAGS -static -o botan-tst1 -I/opt/local/include/botan-2 botan-tst1.c -L/opt/local/lib -lbotan-2
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang $CFLAGS -o botan-tst1 -I/opt/local/include/botan-2 botan-tst1.c -L/opt/local/lib -lbotan-2
$ ./botan-tst1
Version: 20210220
$ otool -L botan-tst1
botan-tst1:
    /opt/local/lib/libbotan-2.18.dylib (compatibility version 2018.18.0, current version 2018.18.1)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
$ 
$ clang $CFLAGS -static -o botan-tst1 -I/opt/local/include/botan-2 botan-tst1.c /opt/local/lib/libbotan-2.a -lc++
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ clang $CFLAGS -o botan-tst1 -I/opt/local/include/botan-2 botan-tst1.c /opt/local/lib/libbotan-2.a -lc++
$ ./botan-tst1
Version: 20210220
$ otool -L botan-tst1
botan-tst1:
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 905.6.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.100.5)
$ 
$ 

AFAIK, there's no "truly" static linking on MacOS anymore, and for quite some time:

$ clang -static -o t1 t1.c
ld: library not found for -lcrt0.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
$ 

you can recognize "Hello World" (cat t1.c):

#include <stdio.h>

int main(int argc, char **argv) {
    printf("Hello, World!\n");
    return 0;
}
randombit commented 3 years ago

I think you need to either link using clang++ or else link in libc++ explicitly.

BTW if you are using Rust you may be interested in https://crates.io/crates/botan

randombit commented 1 year ago

Closing as stale