Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos Undefined symbols for architecture x86_64 after bump to 46.9.1 #33

Open
delta1 opened this issue Jan 19, 2022 · 7 comments
Open

Comments

@delta1
Copy link

delta1 commented Jan 19, 2022

Hi @afilini - experiencing this compilation issue on macos after libtor-sys was bumped - any ideas?

note: Undefined symbols for architecture x86_64:
            "_EVP_PKEY_get_base_id", referenced from:
                _tor_tls_cert_is_valid in libtor_sys-4d079d3be7ca8339.rlib(libtor_tls_a-x509_openssl.o)
            "_EVP_PKEY_get_bits", referenced from:
                _tor_tls_cert_is_valid in libtor_sys-4d079d3be7ca8339.rlib(libtor_tls_a-x509_openssl.o)
            "_EVP_PKEY_CTX_set1_hkdf_key", referenced from:
                _crypto_expand_key_material_rfc5869_sha256_openssl in libtor_sys-4d079d3be7ca8339.rlib(libtor_crypt_ops_a-crypto_hkdf.o)
            "_EVP_PKEY_CTX_set1_hkdf_salt", referenced from:
                _crypto_expand_key_material_rfc5869_sha256_openssl in libtor_sys-4d079d3be7ca8339.rlib(libtor_crypt_ops_a-crypto_hkdf.o)
            "_EVP_PKEY_CTX_add1_hkdf_info", referenced from:
                _crypto_expand_key_material_rfc5869_sha256_openssl in libtor_sys-4d079d3be7ca8339.rlib(libtor_crypt_ops_a-crypto_hkdf.o)
            "_EVP_PKEY_CTX_set_hkdf_md", referenced from:
                _crypto_expand_key_material_rfc5869_sha256_openssl in libtor_sys-4d079d3be7ca8339.rlib(libtor_crypt_ops_a-crypto_hkdf.o)
            "_SSL_get1_peer_certificate", referenced from:
                _tor_tls_get_peer_cert in libtor_sys-4d079d3be7ca8339.rlib(libtor_tls_a-tortls_openssl.o)
                _tor_tls_peer_has_cert in libtor_sys-4d079d3be7ca8339.rlib(libtor_tls_a-tortls_openssl.o)
                _try_to_extract_certs_from_tls in libtor_sys-4d079d3be7ca8339.rlib(libtor_tls_a-tortls_openssl.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
@delta1
Copy link
Author

delta1 commented Jan 19, 2022

actually seems to happen on 46.9.0 now too 🤷

stringhandler pushed a commit to tari-project/tari that referenced this issue Jan 19, 2022
Description
---

Make libtor fully optional behind `libtor` feature flag since we are hitting a compilation issue on macos. 

MagicalBitcoin/libtor-sys#33
@afilini
Copy link
Member

afilini commented Jan 20, 2022

Try enabling the vendored-openssl feature which will compile and link to a static version of openssl

@delta1
Copy link
Author

delta1 commented Jan 20, 2022

Thanks I will try that, but don't want to have to include openssl if it's not strictly necessary.

@afilini
Copy link
Member

afilini commented Jan 20, 2022

I've always had issues linking with openssl on macos because there are many different "packages" (one from Apple and then my others from Homebrew, Mac Ports, etc) providing it and if you ship a dinamically linked binary your users might have different versions.

If you can provide more tails on your environment I'll try to reproduce the issue, but for the time being I would recomment to just use the vendored one

@delta1
Copy link
Author

delta1 commented Jan 20, 2022

I appreciate that and hear where you’re coming from! What environment info do you need? I tried with both [email protected] and openssl@3 from brew - a colleague also had the same issue.

@afilini
Copy link
Member

afilini commented Jan 21, 2022

Openssl version and where it's coming from are a good start. What version of macos are you using?

Thanks

@delta1
Copy link
Author

delta1 commented Jan 24, 2022

Sure, thanks @afilini. I think it only started on 46.9.1 I will have to try again with 46.9.0 and will let you know

Tried with both of these OpenSSL versions installed with brew:

[email protected]

❯ brew info openssl
openssl@3: stable 3.0.1 (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/openssl@3/3.0.1 (6,420 files, 28.1MB)
  Poured from bottle on 2022-01-19 at 09:59:40
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]

and

[email protected]

❯ brew info [email protected]
[email protected]: stable 1.1.1m (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/[email protected]/1.1.1m (8,081 files, 18.5MB)
  Poured from bottle on 2022-01-15 at 13:35:11
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/[email protected]

macOS Monterey 12.1

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants