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

Using Compiled version of JavascriptCore library/framework gives compile time error #25

Open
shahdhiren opened this issue Nov 25, 2014 · 7 comments

Comments

@shahdhiren
Copy link

I am able to successfully build JSC library and while trying to use it in my project gives below error

Undefined symbols for architecture armv7:
  "std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*))", referenced from:
      JSC::initializeThreading() in libiOSJavaScriptCore.a(InitializeThreading.o)
      WTF::initializeCompilationThreads() in libiOSJavaScriptCore.a(CompilationThread.o)
  "void std::__1::__sort<std::__1::__less<unsigned long, unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, std::__1::__less<unsigned long, unsigned long>&)", referenced from:
      JSC::DFG::NaturalLoops::compute(JSC::DFG::Graph&) in libiOSJavaScriptCore.a(DFGNaturalLoops.o)
  "void std::__1::__sort<std::__1::__less<unsigned int, unsigned int>&, unsigned int*>(unsigned int*, unsigned int*, std::__1::__less<unsigned int, unsigned int>&)", referenced from:
      JSC::JSObject::getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode) in libiOSJavaScriptCore.a(JSObject.o)
      JSC::DFG::Graph::dumpBlockHeader(WTF::PrintStream&, char const*, JSC::DFG::BasicBlock*, JSC::DFG::Graph::PhiNodeDumpMode, JSC::DumpContext*) in libiOSJavaScriptCore.a(DFGGraph.o)
      JSC::computePreciseJumpTargets(JSC::CodeBlock*, WTF::Vector<unsigned int, 32ul, WTF::CrashOnOverflow>&) in libiOSJavaScriptCore.a(PreciseJumpTargets.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have verified all the required architecture of JSC and my project and it is common. But still while using JSC library I am having above error. Can you please suggest what is problem in above errors?

@carrotcomputer
Copy link

+1 to this. Tried all kinds of variations of JavascriptCore and cannot compile. My issue is mainly around arm64, but tried armv7 with no success either

@phoboslab
Copy link
Owner

All architectures (armv7, armv7s, arm64, i386, x86_64) compile cleanly for me with XCode 6.1 installed. Are you using the make.py as stated in the README?

@denkeni
Copy link

denkeni commented Jan 19, 2015

+1 the same issue. JavaScriptCore can be built successfully, but the problem lies in compiling working project using the pre-compiled JavaScriptCore library, with Xcode 6.1.1. No luck with one built by Xcode 6 or copied from Ejecta project.

@weakfl
Copy link

weakfl commented Feb 10, 2015

+1, same issue.
Did build using make.py as stated in the README. Also using Xcode 6.1.1.

Undefined symbols for architecture armv7:
  "void std::__1::__sort<std::__1::__less<unsigned long, unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, std::__1::__less<unsigned long, unsigned long>&)", referenced from:
      JSC::DFG::NaturalLoops::compute(JSC::DFG::Graph&) in JavaScriptCore(DFGNaturalLoops.o)
  "void std::__1::__sort<std::__1::__less<unsigned int, unsigned int>&, unsigned int*>(unsigned int*, unsigned int*, std::__1::__less<unsigned int, unsigned int>&)", referenced from:
      JSC::JSObject::getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode) in JavaScriptCore(JSObject.o)
      JSC::DFG::Graph::dumpBlockHeader(WTF::PrintStream&, char const*, JSC::DFG::BasicBlock*, JSC::DFG::Graph::PhiNodeDumpMode, JSC::DumpContext*) in JavaScriptCore(DFGGraph.o)
      JSC::computePreciseJumpTargets(JSC::CodeBlock*, WTF::Vector<unsigned int, 32ul, WTF::CrashOnOverflow>&) in JavaScriptCore(PreciseJumpTargets.o)
  "std::__1::__call_once(unsigned long volatile&, void*, void (*)(void*))", referenced from:
      JSC::initializeThreading() in JavaScriptCore(InitializeThreading.o)
      WTF::exchangeIsCompilationThread(bool) in JavaScriptCore(CompilationThread.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@denkeni
Copy link

denkeni commented Feb 12, 2015

A workaround here. We built this project for arm64 slice in order to build our project for Standard architectures (armv7, arm64). But since Apple's arm64 devices all start at least iOS 7, we should be safe to drop this project in favor of iOS 7 built-in JavaScriptCore framework for arm64:

#ifdef __LP64__
#import <JavaScriptCore/JavaScriptCore.h>       // use iOS7 JavaScriptCore framework
#else
#import <JavaScriptCore-iOS/JavaScriptCore.h>   // use PhobosLab JavaScriptCore-iOS
#endif

So this project could be retired. Thanks for the contribution so far.

@weakfl
Copy link

weakfl commented Feb 12, 2015

@denkeni: Nice solution, thanks.

@phoboslab
Copy link
Owner

Sadly, we still need this custom JSC version for Ejecta, because the official JSC doesn't yet have an API to read/write Typed Arrays.

See: https://bugs.webkit.org/show_bug.cgi?id=120112

No idea what's going wrong with compilation, though. Last time I tried it, everything compiled smoothly.

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

4 participants