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

build failure on Mac Pro with Apple M2 Chip. #199

Closed
tpa10 opened this issue Jun 28, 2023 · 6 comments
Closed

build failure on Mac Pro with Apple M2 Chip. #199

tpa10 opened this issue Jun 28, 2023 · 6 comments

Comments

@tpa10
Copy link

tpa10 commented Jun 28, 2023

Describe the bug
ld emits warning:
ld: warning: ignoring file /Users/tpa/oqs-provider-git-repo/oqs-provider/.local/lib/libcrypto.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64
and subsequent link step fails due to not finding entry points...

Undefined symbols for architecture x86_64:
"_ASN1_item_d2i_ex", referenced from:
_oqsx_d2i_X509_PUBKEY_INTERNAL in oqs_decode_der2key.c.o
"_ERR_new", referenced from:
_OSSL_provider_init in oqsprov.c.o
_oqsx_key_op in oqsprov_keys.c.o
_oqsx_key_new in oqsprov_keys.c.o
_oqsx_key_fromdata in oqsprov_keys.c.o
_oqsx_key_recreate_classickey in oqsprov_keys.c.o
_oqsx_key_new_from_nid in oqsprov_keys.c.o
_oqsx_import in oqs_kmgmt.c.o
...
etc, etc.

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/open-quantum-safe/oqs-provider.git
  2. cd ors-provider
  3. scripts/fullbuild.sh -F

Expected behavior
Expected build to complete without error.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: MacOS Ventura 13.3.1
  • OpenSSL version: OpenSSL 3.2.0-dev (Library: OpenSSL 3.2.0-dev )
  • Version [e.g. 0.4.0]

Additional context
it appears that openssl is being built for arm64 and oqs-provider is trying to build for X86_64, but I have no idea how to fix this.
note that I get the same result, whether I use the "fullbuild.sh" script, or if I manually build & install openssl and liboqs.
Those components build and run, but when I attempt to use them to build oqs-provider, I get the arch mismatch problem.
I expect this is NOT an issue on an older Mac that is using an intel chip.

@baentsch
Copy link
Member

Thanks for this report. It's puzzling indeed and I have no M2 to test this on. Build on M1 following the 3 steps outlined above works without problems. Also there is no reference to "x64" anywhere in the code of oqsprovider.

So the best thing I can offer is to review the output of your cmake run: Please share everything output by fullbuild.sh: Maybe there's a wrong compiler setting visible somewhere... In addition, can I ask you to run make run_tests in the liboqs/_build subdirectory created as part of the oqsprovider build? This just to test that cmake works OK for liboqs.

@dstebila
Copy link
Member

dstebila commented Jul 6, 2023

I just compiled on my M2 with macOS 13.4.1 and did not get any errors. I wonder if it has something to do with the OpenSSL version. How did you install OpenSSL 3.2.0-dev? For me, cmake finds OpenSSL 1.1.1u via brew. I do have OpenSSL 3.1.1 installed via brew but the build scripts apparently find the 1.1.1 installation.

@tpa10
Copy link
Author

tpa10 commented Jul 6, 2023 via email

@baentsch
Copy link
Member

baentsch commented Jul 14, 2023

but the build scripts apparently find the 1.1.1 installation.

This should be fixed by now courtesy #212.

@tpa10 , please retry with latest code.

@tpa10
Copy link
Author

tpa10 commented Jul 15, 2023 via email

@baentsch
Copy link
Member

Closing assuming this is fixed. Please re-open if not, providing new logs.

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

3 participants