CNIOBorringSSL Undefined symbols for architecture arm64

I am having an issue compiling an iOS application that depends on an XCFramework distributed in a Swift Package. The purpose of this approach is closed source software. When I Depend on the same source code only has a swift package I have no problem, but when I pull the package into a static library and then create an XCFramework I get the error bellow when building the iOS project after I pull the package into it, the error says that CNIOBoringSSL does not have a needed architect - arm64. I am also hiding modules with @_implemenationOnly and hiding all symbols that are not publicly exposed via access control.

Does CNIOBorringSSL really not have an arm64 architecture? If that is true how can I work around this issue?

This line is a bit suspicious

  • NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in libMySDK.a(CNIOBoringSSL.o)
  "vtable for __cxxabiv1::__si_class_type_info", referenced from:
      typeinfo for bssl::CNIOBoringSSL::(anonymous namespace)::ECKeyShare in libMySDK.a(CNIOBoringSSL.o)
      typeinfo for bssl::CNIOBoringSSL::(anonymous namespace)::X25519KeyShare in libMySDK.a(CNIOBoringSSL.o)
      typeinfo for bssl::CNIOBoringSSL::(anonymous namespace)::CECPQ2KeyShare in libMySDK.a(CNIOBoringSSL.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for __cxxabiv1::__class_type_info", referenced from:
      typeinfo for bssl::CNIOBoringSSL::SSLKeyShare in libMySDK.a(CNIOBoringSSL.o)
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "std::terminate()", referenced from:
      ___clang_call_terminate in libMySDK.a(CNIOBoringSSL.o)
  "___gxx_personality_v0", referenced from:
      bssl::CNIOBoringSSL::hm_fragment::~hm_fragment() in libMySDK.a(CNIOBoringSSL.o)
      bssl::CNIOBoringSSL::dtls1_open_handshake(CNIOBoringSSL_ssl_st*, unsigned long*, unsigned char*, bssl::CNIOBoringSSL::Span<unsigned char>) in libMySDK.a(CNIOBoringSSL.o)
      std::__1::unique_ptr<bssl::CNIOBoringSSL::hm_fragment, bssl::CNIOBoringSSL::internal::Deleter<bssl::CNIOBoringSSL::hm_fragment> >::reset(bssl::CNIOBoringSSL::hm_fragment*) in libMySDK.a(CNIOBoringSSL.o)
      bssl::CNIOBoringSSL::dtls1_add_message(CNIOBoringSSL_ssl_st*, bssl::CNIOBoringSSL::Array<unsigned char>) in libMySDK.a(CNIOBoringSSL.o)
      bssl::CNIOBoringSSL::dtls1_add_change_cipher_spec(CNIOBoringSSL_ssl_st*) in libMySDK.a(CNIOBoringSSL.o)
      bssl::CNIOBoringSSL::send_flight(CNIOBoringSSL_ssl_st*) in libMySDK.a(CNIOBoringSSL.o)
      bssl::CNIOBoringSSL::Array<unsigned char>::~Array() in libMySDK.a(CNIOBoringSSL.o))``````

CNIOBoringSSL absolutely does build for arm64. This is likely to be an artefact of the way you’re building your project. As CNIOBoringSSL is distributed as source, you’d need to be building the arm64 slice yourself.

Thanks @lukasa. When setting the xcodebuild setting to specify certain architectures it seems to produce this error, at least for me it does. Removing the setting seems to make everything happy.

Thanks for the reply