dokar3 / quickjs-kt

A QuickJS binding for idiomatic Kotlin, with Async/DSL/ES Modules support.
Apache License 2.0
31 stars 3 forks source link

Undefined Symbol for arm64 on linking #56

Open ValentinDenis opened 4 months ago

ValentinDenis commented 4 months ago

Hi,

I have a Kotlin Multiplatform project that fails at the linking step when building for iOS (device or simulator).

Here is the stack in XCode when trying to build :

Stack Trace :

Undefined symbols for architecture arm64:
  "_JS_AtomToValue", referenced from:
      _quickjs_JS_AtomToValue_wrapper62 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_Call", referenced from:
      _quickjs_JS_Call_wrapper145 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_CallConstructor", referenced from:
      _quickjs_JS_CallConstructor_wrapper147 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_DefinePropertyGetSet", referenced from:
      _quickjs_JS_DefinePropertyGetSet_wrapper158 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_DefinePropertyValue", referenced from:
      _quickjs_JS_DefinePropertyValue_wrapper155 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_DefinePropertyValueStr", referenced from:
      _quickjs_JS_DefinePropertyValueStr_wrapper157 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_Eval", referenced from:
      _quickjs_JS_Eval_wrapper150 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_EvalFunction", referenced from:
      _quickjs_JS_EvalFunction_wrapper188 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ExecutePendingJob", referenced from:
      _quickjs_JS_ExecutePendingJob_wrapper184 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_FreeAtom", referenced from:
      _quickjs_JS_FreeAtom_wrapper60 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_FreeCString", referenced from:
      _quickjs_JS_FreeCString_wrapper118 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetArrayBuffer", referenced from:
      _quickjs_JS_GetArrayBuffer_wrapper168 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetException", referenced from:
      _quickjs_JS_GetException_wrapper91 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetGlobalObject", referenced from:
      _quickjs_JS_GetGlobalObject_wrapper152 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetOwnPropertyNames", referenced from:
      _quickjs_JS_GetOwnPropertyNames_wrapper143 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetPropertyInternal", referenced from:
      _quickjs_JS_GetProperty_wrapper129 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetPropertyStr", referenced from:
      _quickjs_JS_GetPropertyStr_wrapper130 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetPropertyUint32", referenced from:
      _quickjs_JS_GetPropertyUint32_wrapper131 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_GetRuntime", referenced from:
      _quickjs_JS_GetRuntime_wrapper20 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_IsArray", referenced from:
      _quickjs_JS_IsArray_wrapper127 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_IsError", referenced from:
      _quickjs_JS_IsError_wrapper92 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_IsFunction", referenced from:
      _quickjs_JS_IsFunction_wrapper123 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_IsInstanceOf", referenced from:
      _quickjs_JS_IsInstanceOf_wrapper153 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_JSONStringify", referenced from:
      _quickjs_JS_JSONStringify_wrapper164 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewArray", referenced from:
      _quickjs_JS_NewArray_wrapper126 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewArrayBuffer", referenced from:
      _quickjs_JS_NewArrayBuffer_wrapper165 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewAtom", referenced from:
      _quickjs_JS_NewAtom_wrapper57 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewCFunctionData", referenced from:
      _quickjs_JS_NewCFunctionData_wrapper193 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewContext", referenced from:
      _quickjs_JS_NewContext_wrapper15 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewError", referenced from:
      _quickjs_JS_NewError_wrapper94 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewObject", referenced from:
      _quickjs_JS_NewObject_wrapper122 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewPromiseCapability", referenced from:
      _quickjs_JS_NewPromiseCapability_wrapper171 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewRuntime", referenced from:
      _quickjs_JS_NewRuntime_wrapper2 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_NewString", referenced from:
      _quickjs_JS_NewString_wrapper111 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_PromiseResult", referenced from:
      _quickjs_JS_PromiseResult_wrapper173 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_PromiseState", referenced from:
      _quickjs_JS_PromiseState_wrapper172 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ReadObject", referenced from:
      _quickjs_JS_ReadObject_wrapper187 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_SetHostPromiseRejectionTracker", referenced from:
      _quickjs_JS_SetHostPromiseRejectionTracker_wrapper174 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_SetPropertyStr", referenced from:
      _quickjs_JS_SetPropertyStr_wrapper136 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_SetPropertyUint32", referenced from:
      _quickjs_JS_SetPropertyUint32_wrapper134 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_Throw", referenced from:
      _quickjs_JS_Throw_wrapper90 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ToBool", referenced from:
      _quickjs_JS_ToBool_wrapper102 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ToCStringLen2", referenced from:
      _quickjs_JS_ToCString_wrapper117 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ToFloat64", referenced from:
      _quickjs_JS_ToFloat64_wrapper107 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ToInt32", referenced from:
      _quickjs_JS_ToInt32_wrapper103 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_ToInt64", referenced from:
      _quickjs_JS_ToInt64_wrapper105 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_UpdateStackTop", referenced from:
      _quickjs_JS_UpdateStackTop_wrapper7 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_JS_WriteObject", referenced from:
      _quickjs_JS_WriteObject_wrapper185 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "___JS_FreeValue", referenced from:
      _quickjs_JS_FreeValue_wrapper97 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
  "_js_free", referenced from:
      _quickjs_js_free_wrapper47 in Shared[arm64][9](libquickjs-kt:quickjs-cinterop-quickjs-cache.a.o)
ld: symbol(s) not found for architecture arm64

Steps to reproduce :

Any idea of where it comes from ?

Thanks for your help !

dokar3 commented 4 months ago

Thanks for reporting, it looks like iOS libraries are broken due to the cross-compiling or something. iOS targets are not tested (Sorry for this) since I'm Windows only and not yet ready to step into the iOS world. Will try to test it in a VM when I'm available, so fixing this might take a while.