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

iOS linker error with 0.4.0 on macbook #52

Open
ardune opened this issue Oct 22, 2024 · 3 comments
Open

iOS linker error with 0.4.0 on macbook #52

ardune opened this issue Oct 22, 2024 · 3 comments
Milestone

Comments

@ardune
Copy link

ardune commented Oct 22, 2024

I am getting an error (slightly different depending on xcode version) when attempting to run locally on iOS simulator:

Undefined symbols for architecture arm64:
  "_compress", referenced from:
      _zlib_oneshot_compress_block in shared[210](libcrypto-lib-c_zlib.o)
  "_deflate", referenced from:
      _zlib_stateful_compress_block in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_write in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_ctrl in shared[210](libcrypto-lib-c_zlib.o)
  "_deflateEnd", referenced from:
      _zlib_stateful_finish in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_free in shared[210](libcrypto-lib-c_zlib.o)
  "_deflateInit_", referenced from:
      _zlib_stateful_init in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_write in shared[210](libcrypto-lib-c_zlib.o)
  "_inflate", referenced from:
      _zlib_stateful_expand_block in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_read in shared[210](libcrypto-lib-c_zlib.o)
  "_inflateEnd", referenced from:
      _zlib_stateful_finish in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_free in shared[210](libcrypto-lib-c_zlib.o)
  "_inflateInit_", referenced from:
      _zlib_stateful_init in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_read in shared[210](libcrypto-lib-c_zlib.o)
  "_uncompress", referenced from:
      _zlib_oneshot_expand_block in shared[210](libcrypto-lib-c_zlib.o)
  "_zError", referenced from:
      _bio_zlib_write in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_read in shared[210](libcrypto-lib-c_zlib.o)
      _bio_zlib_ctrl in shared[210](libcrypto-lib-c_zlib.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Attached is a minimal repo solution which is a file -> new project for KMP and then adding "dev.whyoleg.cryptography *" for testing
CryptoTest.zip

Macbook (M3 / apple silicon) when attempting to use "openssl3-prebuilt"

I've attempted to use xcode 15.1, 15.3, 15.4, and 16.0

All of the above work when using
"dev.whyoleg.cryptography:cryptography-provider-apple:0.4.0"
but fail when using
"dev.whyoleg.cryptography:cryptography-provider-openssl3-prebuilt:0.4.0"

I am very new to KMP platform so please let me know if there extra information that would be helpful.

@whyoleg
Copy link
Owner

whyoleg commented Oct 29, 2024

Hey!
Thanks for raising the issue and providing the reproducer! This looks very similar to #8. I will take a look in coming days on what is really happening.

@whyoleg whyoleg added this to the 0.4.1 milestone Oct 29, 2024
@ardune
Copy link
Author

ardune commented Dec 4, 2024

A bit late but I decided to look into this a bit more and it turns out that kotlin 2.0.0 doesn't work, but kotlin 2.0.21+ does - I was able to test 2.1.0 and 2.0.21 successfully using the sample above.

@whyoleg
Copy link
Owner

whyoleg commented Dec 5, 2024

Glad that the issue was resolved!
Probably this is because 0.4.0 is using kotlin 2.0.20.

I'm still planning to create some integration test for this case, to be sure that everything will work in future.

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