JaneaSystems / nodejs-mobile

Full-fledged Node.js on Android and iOS
https://code.janeasystems.com/nodejs-mobile
Other
2.55k stars 183 forks source link

compiling iOS framework - Undefined symbols for architecture arm64 #102

Open zoecarver opened 5 years ago

zoecarver commented 5 years ago

I get the following error when I try to compile to an iOS framework:

Undefined symbols for architecture arm64:

Full Error

Open Error

```bash Undefined symbols for architecture arm64: "_JsAddRef", referenced from: node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(node::AliasedBuffer const&) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(node::AliasedBuffer const&) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(node::AliasedBuffer const&) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o ... "_JsBoolToBoolean", referenced from: jsrt::SetProperty(void*, void*, bool) in libchakrashim.a(jsrtutils.o) jsrt::HasOwnProperty(void*, void*, void**) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::ExecuteChakraInspectorShimJS(void**) in libchakrashim.a(jsrtcontextshim.o) "_JsBooleanToBool", referenced from: v8::Value::BooleanValue(v8::Local) const in libchakrashim.a(v8value.o) jsrt::GetProperty(void*, void*, bool*) in libchakrashim.a(jsrtutils.o) jsrt::HasPrivate(void*, void*) in libchakrashim.a(jsrtutils.o) jsrt::DeletePrivate(void*, void*) in libchakrashim.a(jsrtutils.o) jsrt::GetPrivate(void*, void*, void**) in libchakrashim.a(jsrtutils.o) "_JsCallFunction", referenced from: v8::HandleScope::AddLocal(void*) in libchakrashim.a(v8handlescope.o) v8::Object::GetPropertyAttributes(v8::Local, v8::Local) in libchakrashim.a(v8object.o) v8::Object::GetOwnPropertyNames(v8::Local) in libchakrashim.a(v8object.o) v8::Object::ObjectProtoToString(v8::Local) in libchakrashim.a(v8object.o) v8::String::Concat(v8::Local, v8::Local) in libchakrashim.a(v8string.o) v8::Function::Call(v8::Local, v8::Local, int, v8::Local*) in libchakrashim.a(v8function.o) v8::StackTrace::CurrentStackTrace(v8::Isolate*, int, v8::StackTrace::StackTraceOptions) in libchakrashim.a(v8stacktrace.o) ... "_JsCollectGarbage", referenced from: v8::Isolate::RequestGarbageCollectionForTesting(v8::Isolate::GarbageCollectionType) in libchakrashim.a(v8isolate.o) jsrt::CollectGarbage(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtutils.o) "_JsConstructObject", referenced from: v8::Utils::NewTypedArray(jsrt::ContextShim::GlobalType, v8::Local, unsigned long, unsigned long, void**) in libchakrashim.a(v8typedarray.o) v8::Object::Clone() in libchakrashim.a(v8object.o) v8::Function::NewInstance(v8::Local, int, v8::Local*) const in libchakrashim.a(v8function.o) jsrt::CreateProxy(void*, void* (* const*)(void*, bool, void**, unsigned short, void*), void**) in libchakrashim.a(jsrtproxyutils.o) "_JsConvertValueToBoolean", referenced from: v8::Value::ToBoolean(v8::Local) const in libchakrashim.a(v8value.o) v8::Value::BooleanValue(v8::Local) const in libchakrashim.a(v8value.o) jsrt::GetProperty(void*, void*, bool*) in libchakrashim.a(jsrtutils.o) "_JsConvertValueToNumber", referenced from: v8::Utils::GetOwnPropertyDescriptorCallback(void*, bool, void**, unsigned short, void*) in libchakrashim.a(v8objecttemplate.o) v8::Object::GetPropertyAttributes(v8::Local, v8::Local) in libchakrashim.a(v8object.o) v8::Value::ToNumber(v8::Local) const in libchakrashim.a(v8value.o) v8::Value::NumberValue(v8::Local) const in libchakrashim.a(v8value.o) v8::Value::Int32Value(v8::Local) const in libchakrashim.a(v8value.o) jsrt::GetProperty(void*, void*, int*) in libchakrashim.a(jsrtutils.o) jsrt::CallGetter(void*, jsrt::CachedPropertyIdRef, int*) in libchakrashim.a(jsrtutils.o) ... "_JsConvertValueToObject", referenced from: v8::Value::ToObject(v8::Local) const in libchakrashim.a(v8value.o) jsrt::JsGetFunctionPosition(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) "_JsConvertValueToString", referenced from: v8::Value::ToString(v8::Local) const in libchakrashim.a(v8value.o) jsrt::GetPropertyIdFromValue(void*, void**) in libchakrashim.a(jsrtutils.o) jsrt::ToString(void*, void**, jsrt::StringUtf8*) in libchakrashim.a(jsrtutils.o) jsrt::Fatal(char const*, ...) in libchakrashim.a(jsrtutils.o) "_JsCopyString", referenced from: v8::String::WriteUtf8(char*, int, int*, int) const in libchakrashim.a(v8string.o) jsrt::StringUtf8::From(void*) in libchakrashim.a(jsrtutils.o) jsrt::StringUtf8::LengthFrom(void*) in libchakrashim.a(jsrtutils.o) "_JsCopyStringOneByte", referenced from: v8::String::WriteOneByte(unsigned char*, int, int, int) const in libchakrashim.a(v8string.o) "_JsCopyStringUtf16", referenced from: v8::String::Write(unsigned short*, int, int, int) const in libchakrashim.a(v8string.o) "_JsCreateArray", referenced from: v8::HandleScope::AddLocal(void*) in libchakrashim.a(v8handlescope.o) v8::Array::New(v8::Isolate*, int) in libchakrashim.a(v8array.o) "_JsCreateArrayBuffer", referenced from: v8::ArrayBuffer::New(v8::Isolate*, unsigned long) in libchakrashim.a(v8arraybuffer.o) "_JsCreateContext", referenced from: jsrt::ContextShim::New(jsrt::IsolateShim*, bool, bool, void*) in libchakrashim.a(jsrtcontextshim.o) "_JsCreateError", referenced from: v8::Exception::Error(v8::Local) in libchakrashim.a(v8exception.o) "_JsCreateExternalArrayBuffer", referenced from: v8::ArrayBuffer::New(v8::Isolate*, void*, unsigned long, v8::ArrayBufferCreationMode) in libchakrashim.a(v8arraybuffer.o) jsrt::IsolateShim::GetChakraShimJsArrayBuffer() in libchakrashim.a(jsrtisolateshim.o) jsrt::IsolateShim::GetChakraInspectorShimJsArrayBuffer() in libchakrashim.a(jsrtisolateshim.o) "_JsCreateExternalObject", referenced from: v8::ObjectTemplate::New(v8::Isolate*) in libchakrashim.a(v8objecttemplate.o) v8::ObjectTemplate::NewInstance(v8::Local) in libchakrashim.a(v8objecttemplate.o) v8::FunctionTemplate::New(v8::Isolate*, void (*)(v8::FunctionCallbackInfo const&), v8::Local, v8::Local, int) in libchakrashim.a(v8functiontemplate.o) v8::FunctionTemplateData::EnsureFunction() in libchakrashim.a(v8functiontemplate.o) v8::External::New(v8::Isolate*, void*) in libchakrashim.a(v8external.o) v8::Script::GetUnboundScript() in libchakrashim.a(v8script.o) jsrt::AddExternalData(void*, void*, void*, void (*)(void*)) in libchakrashim.a(jsrtutils.o) ... "_JsCreateFunction", referenced from: v8::FunctionTemplateData::EnsureFunction() in libchakrashim.a(v8functiontemplate.o) jsrt::CreateFunctionWithExternalData(void* (*)(void*, bool, void**, unsigned short, void*), void*, void (*)(void*), void**) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::ExposeGc() in libchakrashim.a(jsrtcontextshim.o) jsrt::SetPropertyOnTrapConfig(jsrt::ProxyTraps, void* (*)(void*, bool, void**, unsigned short, void*), void*) in libchakrashim.a(jsrtproxyutils.o) "_JsCreateNamedFunction", referenced from: v8::FunctionTemplateData::EnsureFunction() in libchakrashim.a(v8functiontemplate.o) jsrt::Inspector::InstallHostCallback(void*, char const*, void* (*)(void*, bool, void**, unsigned short, void*)) in libchakrashim.a(jsrtinspector.o) "_JsCreateObject", referenced from: v8::Object::New(v8::Isolate*) in libchakrashim.a(v8object.o) v8::CreateScriptObject(void*, void*, void*, void**) in libchakrashim.a(v8script.o) jsrt::CreatePropertyDescriptor(jsrt::PropertyDescriptorOptionValues, jsrt::PropertyDescriptorOptionValues, jsrt::PropertyDescriptorOptionValues, void*, void*, void*, void**) in libchakrashim.a(jsrtutils.o) jsrt::SetPrivate(void*, void*, void*) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) jsrt::CreateProxyTrapConfig(void* (* const*)(void*, bool, void**, unsigned short, void*), void**) in libchakrashim.a(jsrtproxyutils.o) "_JsCreatePropertyId", referenced from: jsrt::GetPropertyIdFromName(void*, void**) in libchakrashim.a(jsrtutils.o) jsrt::CreatePropertyId(char const*, void**) in libchakrashim.a(jsrtutils.o) "_JsCreateRangeError", referenced from: v8::Exception::RangeError(v8::Local) in libchakrashim.a(v8exception.o) "_JsCreateReferenceError", referenced from: v8::Exception::ReferenceError(v8::Local) in libchakrashim.a(v8exception.o) "_JsCreateRuntime", referenced from: jsrt::IsolateShim::New(unsigned long, char const*, bool, bool, bool, unsigned int, unsigned int) in libchakrashim.a(jsrtisolateshim.o) "_JsCreateString", referenced from: v8::Utils::CheckSignature(v8::Local, v8::Local, v8::Local*) in libchakrashim.a(v8signature.o) v8::Utils::NewString(char const*, int) in libchakrashim.a(v8string.o) v8::String::NewFromUtf8(v8::Isolate*, char const*, v8::NewStringType, int) in libchakrashim.a(v8string.o) v8::String::NewFromOneByte(v8::Isolate*, unsigned char const*, v8::NewStringType, int) in libchakrashim.a(v8string.o) v8::Script::Compile(v8::Local, v8::Local, v8::ScriptOrigin*) in libchakrashim.a(v8script.o) v8::UnboundScript::BindToCurrentContext() in libchakrashim.a(v8script.o) jsrt::SetProperty(void*, void*, char const*) in libchakrashim.a(jsrtutils.o) ... "_JsCreateStringUtf16", referenced from: v8::String::NewFromTwoByte(v8::Isolate*, unsigned short const*, v8::NewStringType, int) in libchakrashim.a(v8string.o) "_JsCreateSymbol", referenced from: v8::Symbol::From(v8::Local) in libchakrashim.a(v8symbol.o) v8::Private::New(v8::Isolate*, v8::Local) in libchakrashim.a(v8private.o) jsrt::IsolateShim::GetCachedSymbolPropertyIdRef(jsrt::CachedSymbolPropertyIdRef) in libchakrashim.a(jsrtisolateshim.o) "_JsCreateSyntaxError", referenced from: v8::Exception::SyntaxError(v8::Local) in libchakrashim.a(v8exception.o) "_JsCreateTypeError", referenced from: v8::Utils::CheckSignature(v8::Local, v8::Local, v8::Local*) in libchakrashim.a(v8signature.o) v8::Exception::TypeError(v8::Local) in libchakrashim.a(v8exception.o) "_JsDefineProperty", referenced from: v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) jsrt::DefineProperty(void*, void*, jsrt::PropertyDescriptorOptionValues, jsrt::PropertyDescriptorOptionValues, jsrt::PropertyDescriptorOptionValues, void*, void*, void*) in libchakrashim.a(jsrtutils.o) "_JsDeleteIndexedProperty", referenced from: jsrt::DeleteIndexedProperty(void*, unsigned int) in libchakrashim.a(jsrtutils.o) "_JsDeleteProperty", referenced from: v8::Object::Delete(v8::Local, v8::Local) in libchakrashim.a(v8object.o) jsrt::DeleteProperty(void*, void*, void**) in libchakrashim.a(jsrtutils.o) "_JsDiagGetBreakpoints", referenced from: jsrt::Inspector::ClearBreakpoints() in libchakrashim.a(jsrtinspector.o) "_JsDiagGetFunctionPosition", referenced from: jsrt::JsGetFunctionPosition(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) "_JsDiagGetScripts", referenced from: jsrt::JsGetScripts(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) "_JsDiagRemoveBreakpoint", referenced from: jsrt::JsRemoveBreakpoint(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) jsrt::Inspector::RemoveBreakpoint(unsigned int) in libchakrashim.a(jsrtinspector.o) "_JsDiagRequestAsyncBreak", referenced from: jsrt::Inspector::RequestAsyncBreak(void*, void (*)(v8::Isolate*, void*), void*) in libchakrashim.a(jsrtinspector.o) jsrt::Inspector::RequestAsyncBreak(v8::Isolate*) in libchakrashim.a(jsrtinspector.o) "_JsDiagSetBreakpoint", referenced from: jsrt::JsSetBreakpoint(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) "_JsDiagStartDebugging", referenced from: jsrt::Inspector::StartDebugging(void*) in libchakrashim.a(jsrtinspector.o) "_JsDisableRuntimeExecution", referenced from: jsrt::IsolateShim::DisableExecution() in libchakrashim.a(jsrtisolateshim.o) "_JsDisposeRuntime", referenced from: jsrt::IsolateShim::Dispose() in libchakrashim.a(jsrtisolateshim.o) "_JsDoubleToNumber", referenced from: v8::Number::New(v8::Isolate*, double) in libchakrashim.a(v8number.o) v8::Number::From(double) in libchakrashim.a(v8number.o) jsrt::UintToValue(unsigned int, void**) in libchakrashim.a(jsrtutils.o) "_JsEnableRuntimeExecution", referenced from: jsrt::IsolateShim::EnableExecution() in libchakrashim.a(jsrtisolateshim.o) "_JsEquals", referenced from: v8::Value::IsTrue() const in libchakrashim.a(v8value.o) v8::Value::IsFalse() const in libchakrashim.a(v8value.o) v8::Value::Equals(v8::Local, v8::Local) const in libchakrashim.a(v8value.o) v8::Value::Equals(v8::Local) const in libchakrashim.a(v8value.o) jsrt::IsZero(void*, bool*) in libchakrashim.a(jsrtutils.o) jsrt::IsUndefined(void*, bool*) in libchakrashim.a(jsrtutils.o) jsrt::GetHiddenValuesTable(void*, void**, void**, bool*) in libchakrashim.a(jsrtutils.o) ... "_JsGetAndClearException", referenced from: jsrt::Fatal(char const*, ...) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::RunMicrotasks() in libchakrashim.a(jsrtcontextshim.o) jsrt::IsolateShim::PopScope(jsrt::ContextShim::Scope*) in libchakrashim.a(jsrtisolateshim.o) "_JsGetAndClearExceptionWithMetadata", referenced from: v8::TryCatch::GetAndClearException() in libchakrashim.a(v8trycatch.o) "_JsGetArrayBufferStorage", referenced from: v8::ArrayBuffer::ByteLength() const in libchakrashim.a(v8arraybuffer.o) v8::ArrayBuffer::GetContents() in libchakrashim.a(v8arraybuffer.o) "_JsGetContextData", referenced from: jsrt::IsolateShim::GetContextShim(void*) in libchakrashim.a(jsrtisolateshim.o) jsrt::IsolateShim::GetContextShimOfObject(void*) in libchakrashim.a(jsrtisolateshim.o) "_JsGetContextOfObject", referenced from: jsrt::IsolateShim::GetContextShimOfObject(void*) in libchakrashim.a(jsrtisolateshim.o) "_JsGetExternalData", referenced from: _JsErrorCode v8::ExternalData::GetExternalData(void*, v8::ObjectData**) in libchakrashim.a(v8objecttemplate.o) _JsErrorCode v8::ExternalData::GetExternalData(void*, v8::ObjectTemplateData**) in libchakrashim.a(v8objecttemplate.o) _JsErrorCode v8::ExternalData::GetExternalData(void*, v8::FunctionCallbackData**) in libchakrashim.a(v8functiontemplate.o) _JsErrorCode v8::ExternalData::GetExternalData(void*, v8::FunctionTemplateData**) in libchakrashim.a(v8functiontemplate.o) _JsErrorCode v8::ExternalData::GetExternalData(void*, v8::ObjectData**) in libchakrashim.a(v8object.o) v8::External::Value() const in libchakrashim.a(v8external.o) v8::Template::Set(v8::Local, v8::Local, v8::PropertyAttribute) in libchakrashim.a(v8template.o) ... "_JsGetFalseValue", referenced from: jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) "_JsGetGlobalObject", referenced from: jsrt::GetPropertyOfGlobal(char const*, void**) in libchakrashim.a(jsrtutils.o) jsrt::SetPropertyOfGlobal(char const*, void*) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::CheckConfigGlobalObjectTemplate() in libchakrashim.a(jsrtcontextshim.o) jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) "_JsGetIndexedProperty", referenced from: v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) jsrt::GetIndexedProperty(void*, unsigned int, void**) in libchakrashim.a(jsrtutils.o) "_JsGetNullValue", referenced from: jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) "_JsGetOwnPropertyDescriptor", referenced from: v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) jsrt::GetOwnPropertyDescriptor(void*, void*, void**) in libchakrashim.a(jsrtutils.o) "_JsGetOwnPropertyNames", referenced from: v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) "_JsGetProperty", referenced from: v8::FunctionTemplateData::EnsureFunction() in libchakrashim.a(v8functiontemplate.o) v8::Object::Get(v8::Local, v8::Local) in libchakrashim.a(v8object.o) v8::Object::GetConstructorName() in libchakrashim.a(v8object.o) v8::Utils::GetObjectData(v8::Object*, v8::ObjectData**) in libchakrashim.a(v8object.o) v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) v8::TryCatch::EnsureException() const in libchakrashim.a(v8trycatch.o) v8::TryCatch::StackTrace(v8::Local) const in libchakrashim.a(v8trycatch.o) ... "_JsGetPropertyIdFromSymbol", referenced from: v8::Utils::GetCallback(void*, bool, void**, unsigned short, void*) in libchakrashim.a(v8objecttemplate.o) jsrt::GetPropertyIdFromName(void*, void**) in libchakrashim.a(jsrtutils.o) jsrt::IsolateShim::GetCachedSymbolPropertyIdRef(jsrt::CachedSymbolPropertyIdRef) in libchakrashim.a(jsrtisolateshim.o) jsrt::IsolateShim::GetToStringTagSymbolPropertyIdRef() in libchakrashim.a(jsrtisolateshim.o) "_JsGetPrototype", referenced from: v8::Object::GetPrototype() in libchakrashim.a(v8object.o) jsrt::CloneObject(void*, void*, bool) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::CheckConfigGlobalObjectTemplate() in libchakrashim.a(jsrtcontextshim.o) "_JsGetRuntimeMemoryUsage", referenced from: jsrt::IsolateShim::GetMemoryUsage(unsigned long*) in libchakrashim.a(jsrtisolateshim.o) "_JsGetStringLength", referenced from: v8::String::Value::Value(v8::Local) in libchakrashim.a(v8string.o) v8::String::Length() const in libchakrashim.a(v8string.o) "_JsGetTrueValue", referenced from: jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) "_JsGetTypedArrayInfo", referenced from: v8::ArrayBufferView::Buffer() in libchakrashim.a(v8typedarray.o) v8::ArrayBufferView::ByteOffset() in libchakrashim.a(v8typedarray.o) v8::ArrayBufferView::ByteLength() in libchakrashim.a(v8typedarray.o) v8::ArrayBufferView::HasBuffer() const in libchakrashim.a(v8typedarray.o) v8::Value::IsUint8Array() const in libchakrashim.a(v8value.o) v8::Value::IsUint8ClampedArray() const in libchakrashim.a(v8value.o) v8::Value::IsInt8Array() const in libchakrashim.a(v8value.o) ... "_JsGetUndefinedValue", referenced from: v8::Utils::AccessorHandler(void*, bool, void**, unsigned short, void*) in libchakrashim.a(v8object.o) jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) "_JsGetValueType", referenced from: v8::Utils::GetCallback(void*, bool, void**, unsigned short, void*) in libchakrashim.a(v8objecttemplate.o) v8::Value::IsUndefined() const in libchakrashim.a(v8value.o) v8::Value::IsNull() const in libchakrashim.a(v8value.o) v8::Value::IsNullOrUndefined() const in libchakrashim.a(v8value.o) v8::Value::IsString() const in libchakrashim.a(v8value.o) v8::Value::IsSymbol() const in libchakrashim.a(v8value.o) v8::Value::IsFunction() const in libchakrashim.a(v8value.o) ... "_JsHasException", referenced from: v8::TryCatch::GetAndClearException() in libchakrashim.a(v8trycatch.o) v8::TryCatch::HasCaught() const in libchakrashim.a(v8trycatch.o) jsrt::Fatal(char const*, ...) in libchakrashim.a(jsrtutils.o) jsrt::IsolateShim::PopScope(jsrt::ContextShim::Scope*) in libchakrashim.a(jsrtisolateshim.o) "_JsHasIndexedProperty", referenced from: jsrt::HasIndexedProperty(void*, unsigned int, bool*) in libchakrashim.a(jsrtutils.o) "_JsHasOwnProperty", referenced from: jsrt::HasOwnProperty(void*, void*, void**) in libchakrashim.a(jsrtutils.o) "_JsHasProperty", referenced from: v8::Object::Has(v8::Local, v8::Local) in libchakrashim.a(v8object.o) v8::External::IsExternal(v8::Value const*) in libchakrashim.a(v8external.o) jsrt::HasProperty(void*, void*, bool*) in libchakrashim.a(jsrtutils.o) jsrt::HasProperty(void*, jsrt::CachedPropertyIdRef, bool*) in libchakrashim.a(jsrtutils.o) "_JsIdle", referenced from: jsrt::IdleGC(uv_timer_s*) in libchakrashim.a(jsrtutils.o) "_JsInstanceOf", referenced from: jsrt::InstanceOf(void*, void*) in libchakrashim.a(jsrtutils.o) "_JsIntToNumber", referenced from: v8::Integer::New(v8::Isolate*, int) in libchakrashim.a(v8integer.o) v8::Integer::From(int) in libchakrashim.a(v8integer.o) v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) jsrt::UintToValue(unsigned int, void**) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::KeepAlive(void*) in libchakrashim.a(jsrtcontextshim.o) jsrt::ContextShim::InitializeBuiltIns() in libchakrashim.a(jsrtcontextshim.o) "_JsIsRuntimeExecutionDisabled", referenced from: jsrt::IsolateShim::IsExeuctionDisabled() in libchakrashim.a(jsrtisolateshim.o) "_JsNumberToDouble", referenced from: v8::Value::NumberValue(v8::Local) const in libchakrashim.a(v8value.o) jsrt::GetArrayLength(void*, unsigned int*) in libchakrashim.a(jsrtutils.o) "_JsNumberToInt", referenced from: v8::Utils::GetOwnPropertyDescriptorCallback(void*, bool, void**, unsigned short, void*) in libchakrashim.a(v8objecttemplate.o) v8::Object::GetPropertyAttributes(v8::Local, v8::Local) in libchakrashim.a(v8object.o) v8::Value::Int32Value(v8::Local) const in libchakrashim.a(v8value.o) jsrt::GetProperty(void*, void*, int*) in libchakrashim.a(jsrtutils.o) jsrt::CallGetter(void*, jsrt::CachedPropertyIdRef, int*) in libchakrashim.a(jsrtutils.o) jsrt::JsSetBreakpoint(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) jsrt::JsRemoveBreakpoint(void*, bool, void**, unsigned short, void*) in libchakrashim.a(jsrtinspector.o) ... "_JsParse", referenced from: jsrt::ParseScript(jsrt::StringUtf8*, unsigned long, void*, bool, void**) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::ExecuteChakraShimJS() in libchakrashim.a(jsrtcontextshim.o) jsrt::ContextShim::ExecuteChakraInspectorShimJS(void**) in libchakrashim.a(jsrtcontextshim.o) "_JsRelease", referenced from: node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(node::AliasedBuffer const&) in test_aliased_buffer.o node::AliasedBuffer::~AliasedBuffer() in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(node::AliasedBuffer const&) in test_aliased_buffer.o node::AliasedBuffer::~AliasedBuffer() in test_aliased_buffer.o node::AliasedBuffer::AliasedBuffer(v8::Isolate*, unsigned long) in test_aliased_buffer.o ... "_JsSetContextData", referenced from: jsrt::IsolateShim::NewContext(void**, bool, bool, void*) in libchakrashim.a(jsrtisolateshim.o) "_JsSetCurrentContext", referenced from: jsrt::ContextShim::DoInitializeContextShim() in libchakrashim.a(jsrtcontextshim.o) jsrt::IsolateShim::PushScope(jsrt::ContextShim::Scope*, jsrt::ContextShim*) in libchakrashim.a(jsrtisolateshim.o) jsrt::IsolateShim::PopScope(jsrt::ContextShim::Scope*) in libchakrashim.a(jsrtisolateshim.o) "_JsSetException", referenced from: v8::Utils::CheckSignature(v8::Local, v8::Local, v8::Local*) in libchakrashim.a(v8signature.o) v8::Isolate::ThrowException(v8::Local) in libchakrashim.a(v8isolate.o) v8::TryCatch::ReThrow() in libchakrashim.a(v8trycatch.o) jsrt::IsolateShim::PopScope(jsrt::ContextShim::Scope*) in libchakrashim.a(jsrtisolateshim.o) "_JsSetIndexedProperty", referenced from: jsrt::SetIndexedProperty(void*, unsigned int, void*) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::KeepAlive(void*) in libchakrashim.a(jsrtcontextshim.o) "_JsSetObjectBeforeCollectCallback", referenced from: v8::chakrashim::ClearObjectWeakReferenceCallback(void*, bool) in libchakrashim.a(v8persistent.o) v8::chakrashim::SetObjectWeakReferenceCallback(void*, void (*)(v8::WeakCallbackInfo const&), void*, v8::chakrashim::WeakReferenceCallbackWrapper**) in libchakrashim.a(v8persistent.o) v8::chakrashim::SetObjectWeakReferenceCallback(void*, void (*)(v8::WeakCallbackData const&), void*, v8::chakrashim::WeakReferenceCallbackWrapper**) in libchakrashim.a(v8persistent.o) jsrt::IsolateShim::NewContext(void**, bool, bool, void*) in libchakrashim.a(jsrtisolateshim.o) "_JsSetPromiseContinuationCallback", referenced from: jsrt::InitializePromise() in libchakrashim.a(jsrtpromise.o) "_JsSetProperty", referenced from: v8::FunctionTemplateData::EnsureFunction() in libchakrashim.a(v8functiontemplate.o) v8::Object::Set(v8::Local, v8::Local, v8::PropertyAttribute, bool) in libchakrashim.a(v8object.o) v8::Object::DefineProperty(v8::Local, v8::Local, v8::PropertyDescriptor&) in libchakrashim.a(v8object.o) v8::TemplateData::CopyPropertiesTo(void*) in libchakrashim.a(v8chakra.o) jsrt::SetProperty(void*, jsrt::CachedPropertyIdRef, void*) in libchakrashim.a(jsrtutils.o) jsrt::SetProperty(void*, void*, void*) in libchakrashim.a(jsrtutils.o) jsrt::SetProperty(void*, char const*, void*) in libchakrashim.a(jsrtutils.o) ... "_JsSetPrototype", referenced from: v8::ObjectTemplate::NewInstance(v8::Local) in libchakrashim.a(v8objecttemplate.o) v8::FunctionTemplateData::EnsureFunction() in libchakrashim.a(v8functiontemplate.o) v8::Object::SetPrototype(v8::Local, v8::Local) in libchakrashim.a(v8object.o) v8::Object::SetPrototype(v8::Local) in libchakrashim.a(v8object.o) v8::External::New(v8::Isolate*, void*) in libchakrashim.a(v8external.o) jsrt::CloneObject(void*, void*, bool) in libchakrashim.a(jsrtutils.o) jsrt::ContextShim::CheckConfigGlobalObjectTemplate() in libchakrashim.a(jsrtcontextshim.o) ... "_JsStrictEquals", referenced from: v8::Value::StrictEquals(v8::Local) const in libchakrashim.a(v8value.o) "_JsTTDCheckAndAssertIfTTDRunning", referenced from: node::Buffer::(anonymous namespace)::Fill(v8::FunctionCallbackInfo const&) in libnode.a(node_buffer.o) "_JsTTDCreateContext", referenced from: jsrt::ContextShim::New(jsrt::IsolateShim*, bool, bool, void*) in libchakrashim.a(jsrtcontextshim.o) "_JsTTDCreateRecordRuntime", referenced from: jsrt::IsolateShim::New(unsigned long, char const*, bool, bool, bool, unsigned int, unsigned int) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDCreateReplayRuntime", referenced from: jsrt::IsolateShim::New(unsigned long, char const*, bool, bool, bool, unsigned int, unsigned int) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDGetPreviousSnapshotInterval", referenced from: jsrt::IsolateShim::RunSingleStepOfReverseMoveLoop(v8::Isolate*, unsigned long long*, long long*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDGetSnapShotBoundInterval", referenced from: jsrt::IsolateShim::RunSingleStepOfReverseMoveLoop(v8::Isolate*, unsigned long long*, long long*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDGetSnapTimeTopLevelEventMove", referenced from: jsrt::IsolateShim::RunSingleStepOfReverseMoveLoop(v8::Isolate*, unsigned long long*, long long*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDHostExit", referenced from: node::Exit(v8::FunctionCallbackInfo const&) in libnode.a(node.o) "_JsTTDMoveToTopLevelEvent", referenced from: jsrt::IsolateShim::RunSingleStepOfReverseMoveLoop(v8::Isolate*, unsigned long long*, long long*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDNotifyContextDestroy", referenced from: jsrt::IsolateShim::JsContextBeforeCollectCallback(void*, void*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDNotifyYield", referenced from: node::Start(v8::Isolate*, void*, int, char const* const*, int, char const* const*) in libnode.a(node.o) "_JsTTDPauseTimeTravelBeforeRuntimeOperation", referenced from: jsrt::Inspector::JsDiagDebugEventHandler(_JsDiagDebugEvent, void*, void*) in libchakrashim.a(jsrtinspector.o) "_JsTTDPreExecuteSnapShotInterval", referenced from: jsrt::IsolateShim::RunSingleStepOfReverseMoveLoop(v8::Isolate*, unsigned long long*, long long*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDRawBufferAsyncModificationRegister", referenced from: v8::ArrayBuffer::TTDRawBufferNotifyRegisterForModification(unsigned char*) in libchakrashim.a(v8arraybuffer.o) "_JsTTDRawBufferAsyncModifyComplete", referenced from: v8::ArrayBuffer::TTDRawBufferAsyncModifyComplete(unsigned char*) in libchakrashim.a(v8arraybuffer.o) "_JsTTDRawBufferCopySyncIndirect", referenced from: v8::ArrayBuffer::TTDRawBufferCopyNotify(v8::Local, unsigned int, v8::Local, unsigned int, unsigned int) in libchakrashim.a(v8arraybuffer.o) "_JsTTDRawBufferModifySyncIndirect", referenced from: v8::ArrayBuffer::TTDRawBufferModifyNotifySync(unsigned int, unsigned int) in libchakrashim.a(v8arraybuffer.o) "_JsTTDReStartTimeTravelAfterRuntimeOperation", referenced from: jsrt::Inspector::JsDiagDebugEventHandler(_JsDiagDebugEvent, void*, void*) in libchakrashim.a(jsrtinspector.o) "_JsTTDReplayExecution", referenced from: jsrt::IsolateShim::RunSingleStepOfReverseMoveLoop(v8::Isolate*, unsigned long long*, long long*) in libchakrashim.a(jsrtisolateshim.o) "_JsTTDStart", referenced from: node::Start_TTDReplay(v8::Isolate*, void*, int, char const* const*, int, char const* const*) in libnode.a(node.o) node::Start(v8::Isolate*, void*, int, char const* const*, int, char const* const*) in libnode.a(node.o) "_JsTTDStop", referenced from: node::Start_TTDReplay(v8::Isolate*, void*, int, char const* const*, int, char const* const*) in libnode.a(node.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [/Users/zoe/Developer/IDE-Node/nodejs-mobile/out/Release/cctest] Error 1 make: *** [node] Error 2 ```

Steps:

  1. clone repository
  2. run ./tools/ios_framework_prepare.sh

Expected result:

Frameworks exist inside of out_ios/Release-iphones*

Actual Result:

I get the above error. out_ios is not created / does not exist.

jaimecbernardo commented 5 years ago

Hi @pudility ,

I've just tried:

git clone https://github.com/janeasystems/nodejs-mobile
cd nodejs-mobile
./tools/ios_framework_prepare.sh

Couldn't get the same error. I suspect the error that's actually causing the problems has occurred before the one you shared (The build system is trying to use all CPUs). Is there any change you could provide the whole build log? Sharing it in a public gist ( https://gist.github.com/ ) would work fine.

It might be helpful to try the build with only one thread so it stops right at the error. You can achieve this by replacing make -j$(getconf _NPROCESSORS_ONLN) with simply make here and here.

I hope this is helpful. Let us know once you get more information.

zoecarver commented 5 years ago

@jaimecbernardo Thank you for your quick response.

I changed it to only use one cpu like you suggested but unfortunately this did not fix it. Here is the full build log.

jaimecbernardo commented 5 years ago

Hi @pudility ,

Thank you for sharing the logs.

From the log file, it seems libChakraCoreStatic.a that was found was not built for the arm64 architecture, and that's what's causing the error (the line is just before the error message you had posted in the original message):

ld: warning: ignoring file /Users/zoe/Developer/IDE-Node/nodejs-mobile/out/Release/../../deps/chakrashim/core/out/Release/lib/libChakraCoreStatic.a, file was built for archive which is not the architecture being linked (arm64): /Users/zoe/Developer/IDE-Node/nodejs-mobile/out/Release/../../deps/chakrashim/core/out/Release/lib/libChakraCoreStatic.a

You can check what architecture that file was built for by running: lipo -info deps/chakrashim/core/out/Release/lib/libChakraCoreStatic.a In a correct build, it would say that it is arm64 at that build step.

Also, from the logs file, it seems your log is not from the reprodution steps you indicated:

clone repository run ./tools/ios_framework_prepare.sh

This line indicates it is building on top of a previous build:

-- /Users/zoe/Developer/IDE-Node/nodejs-mobile/deps/chakrashim/core/bin/ch/DbgController.js.h is up to date. skipping.

Could you share the logs from building the project from a clean repo instead?

git clone https://github.com/janeasystems/nodejs-mobile
cd nodejs-mobile
./tools/ios_framework_prepare.sh
zoecarver commented 5 years ago

@jaimecbernardo sorry for my late reply, I really all appreciate your help.

I have updated the build log after building with a clean repo.

The output of lipo -info deps/chakrashim/core/out/Release/lib/libChakraCoreStatic.a is:

input file deps/chakrashim/core/out/Release/lib/libChakraCoreStatic.a is not a fat file
Non-fat file: deps/chakrashim/core/out/Release/lib/libChakraCoreStatic.a is architecture: arm64

Which from what you said, I think means that it worked?

jaimecbernardo commented 5 years ago

Hi @pudility ,

Yes, the warning about it not being arm64 makes no sense then. There's the possibility that some parts that are being included are not arm64.

Upon comparing my system's build logs with yours (I used the first ones, since single thread logs are easier to run a diff on), it seems your system is adding custom compile (-I/usr/local/opt/openssl/include) and link (-L/usr/local/opt/openssl/lib) flags which aren't being added in mine.

It looks like you have an "openssl" version installed and that its flags are being added to the build. If your macOS openssl library is being used it makes sense the build isn't working, since it may be trying to use a macOS x86_64 library for openssl instead of the iOS arm64 that was built as part of the node build.

Might you have built something in the past that needed a custom openssl in you macOS? Is there a chance you might have something adding these flags to the build? One common way that you might've been asked to do this could've been by setting the LDFLAGS and CPPFLAGS environment variables.

I hope this is helpful. Please send single thread build logs going forward, as those will be easier to compare.

zoecarver commented 5 years ago

@jaimecbernardo Thanks for the help. I actually have used a custom openssl to build things in the past, I am building it again now (without the custom openssl) and will update this issue once its done.

Sorry about the multithreading thing, forgot to turn that off. I will update the gist with a single threaded, clean build, with the default openssl 😄.

zoecarver commented 5 years ago

Okay updated it. I am still getting the same error. I got rid of LDFLAGS and CPPFLAGS but it does not seem to have helped. I am not sure if I successfully disabled the custom ssl or even how to check that.

Thanks again for the help.

jaimecbernardo commented 5 years ago

Hi @pudility , It seems your change made it not use the LDFLAGS and CPPFLAGS. Now your build log is equal to mine (after replacing the dir I'm building on with yours) until it tries to run the command right before the error. (You get the error and I don't)

This makes the error much harder to debug, and is most likely something to do with the build environment. It might have something to do with the versions we are using? I think I am using the latest versions of the needed components.

Might this be it? Might you have some other environment variables that are affecting the build?

Sorry about the lengthy back and forward, but I've been unable to replicate your issue on two different machines.

zoecarver commented 5 years ago

Here are my versions:

They are pretty similar to yours so I doubt that is the issue, either way I am going to update everything to be the same and try again (especially cmake).

I am also going to try without any of my custom environment variables - we will see if that helps.

Thanks again for the help and quick responses.

zoecarver commented 5 years ago

Unfortunately still same error. I made a new gist here with the build log.

Updated versions:

jaimecbernardo commented 5 years ago

xcodebuild doesn't seem to have beem updated, but the version is so close I doubt it would affect the build.

Upon further inspection, I've had another idea. Your build is failing while building the cctest target, which node always builds, but this isn't needed for ios, as it is a tool for testing node as a static library.

I've pushed a commit to skip this target and continue the build, to see if we can get more information, or if the build succeeds without that target: https://github.com/janeasystems/nodejs-mobile/commit/719857f95e5b3fb3a2daf08c745be9648356bcc1

This change is on a staging branch, named staging-build-ios-no-cctest, where the change to not build with many processors is also applied. To try building like this, please follow these steps:

git clone https://github.com/janeasystems/nodejs-mobile
cd nodejs-mobile
git checkout staging-build-ios-no-cctest
./tools/ios_framework_prepare.sh

Hopefully, this build will succeed or we may get more information from subsequent build steps.

zoecarver commented 5 years ago

@jaimecbernardo thank you for your help and for making that other branch.

I tried with that but unfortunately still got an error (I think it is the same one):

ld: file is universal (2 slices) but does not contain a(n) arm64 slice: /Users/zoe/Developer/tmp/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a file '/Users/zoe/Developer/tmp/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a' for architecture arm64

It also said something about cuda but I could not tell if that had anything to do with the build failure.

The full build log is here.

jaimecbernardo commented 5 years ago

Hi @pudility ,

It seems the build has succeeded in terms of building nodejs-mobile. It is now failing when trying to use the nodejs-mobile static libraries for building the framework, here: https://github.com/janeasystems/nodejs-mobile/blob/9e90dd8c14fce5b047aa16d00e22a8ef44222a99/tools/ios_framework_prepare.sh#L75

The iOS build goes something like this: 1 - build nodejs-mobile static libraries for arm64 2 - build nodejs-mobile static libraries for x86_64 3 - merge the libraries into a FAT library (so they have both architectures) 4 - build the NodeMobile framework for running in devices 5 - build the NodeMobile framework for running in simulators 6 - merge the NodeMobile frameworks into an universal framework

While before your build was failing at the end of step 1, it is now failing at the end of step 4.

Our logs are the same for step 1 and then they start diverging on step 2 (some steps are ordered differently and I get warnings from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib, which you don't. I suspect it must be something related to some of the tools used being different on your case.

On the beginning of step 4, you get these suspicious lines, which might indicate you have XCode plugins that might be affecting the build (ClangFormat?):

2018-08-09 16:48:32.946 xcodebuild[26644:27115896] [MT] PluginLoading: Required plug-in compatibility UUID 426A087B-D3AA-431A-AFDF-F135EC00DE1C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/ClangFormat.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2018-08-09 16:48:32.947 xcodebuild[26644:27115896] [MT] PluginLoading: Required plug-in compatibility UUID 426A087B-D3AA-431A-AFDF-F135EC00DE1C for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs

Your PATH environment variable also seems to contain many tools that might be affecting the build. The command that seems to be failing is ld, which is the linker. You could try running lipo -info /Users/zoe/Developer/tmp/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a to verify if it has the needed architectures (arm64 and x86_64).

One way you could go about this now is trying to open the xcodeproj manually in XCode (it's in tools/ios-framework/NodeMobile.xcodeproj) and seeing if you can build the frameworks from there, since the static libraries are already built, and seeing if you're able to build it from there.

zoecarver commented 5 years ago

@jaimecbernardo thank you for all the information!

Hhm looking at the error again, like you said, its failing because it thinks the right architectures are not there. However, when I used lipo like you suggested to check, the library seems to have both architectures:

Architectures in the fat file: /Users/zoe/Developer/IDE-Node/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a are: x86_64 arm64

I removed both Alcatraz and ClangFormat but it still did not work. Also tried using xcode to build but got the same error.

jaimecbernardo commented 5 years ago

Hi @pudility,

Thank you for the feedback.

I'm not sure what else might be, but different tools are you giving you different information on what the architecture of the binaries at that file are. I am unable to reproduce the issue on my end, so I'm not sure what else to do.

Do you have other machine that you might use to try and build it?

zoecarver commented 5 years ago

@jaimecbernardo I will try with another machine.

I also tested the architectures with file and xcrun which printed

Mach-O universal binary with 2 architectures: [x86_64] [arm64:current ar archive]
/Users/zoe/Developer/IDE-Node/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a (for architecture x86_64):    current ar archive
/Users/zoe/Developer/IDE-Node/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a (for architecture arm64): current ar archive

and

Architectures in the fat file: /Users/zoe/Developer/IDE-Node/nodejs-mobile/tools/ios-framework/bin/libChakraCoreStatic.a are: x86_64 arm64

respectively, both indicating that they also thought it had both architectures so, I am not sure why xcode cant find them.

Anyway, I will keep trying and keep this thread updated. Because you cannot reproduce it, I am okay if you want to close this issue.

jaimecbernardo commented 5 years ago

Please do give some updates. We'll keep the issue open for a while, as other people can run into this. Thank you.

zoecarver commented 5 years ago

Good news is that I was able to successfully build the project on another machine. Bad news is I still cant figure out why it wont build on my machine.