Did you ever get to the bottom of this? I've been trying to build V8 and embed it today, but for the life of me I cannot get a static build to work; I see exactly the same issue you describe, but adding the gyp build target (
export GYP_DEFINES="clang=1 mac_deployment_target=10.8" as you suggest in the bug report) doesn't seem to help. ~ Doug. On Sunday, January 5, 2014 7:44:09 AM UTC+8, Chris Galardi wrote: > > I filed a bug about > this<https://code.google.com/p/v8/issues/detail?id=3072&sort=-id&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20HW%20OS%20Area%20Stars> > last > week but while I've had success filing reports in the past I feel like this > one doesn't really tell the devs what the problem is so I decided to ask > for help here because I think the formatting makes my explanation look a > little less like error vomit =) > > I'm linking against v8 in a personal c++11 project and all was well as of > https://codereview.chromium.org/109963003, but sometime between some STL > libraries have started making their way into the source and now, while > building the static library works, linking against it in XCode 5 yields the > following: > > Undefined symbols for architecture x86_64: >> "std::__throw_length_error(char const*)", referenced from: >> std::vector<v8::internal::WorkerThread*, >> std::allocator<v8::internal::WorkerThread*> >> >::_M_insert_aux(__gnu_cxx::__normal_iterator<v8::internal::WorkerThread**, >> std::vector<v8::internal::WorkerThread*, >> std::allocator<v8::internal::WorkerThread*> > >, v8::internal::WorkerThread* >> const&) in libv8_base.x64.a(default-platform.o) >> ld: symbol(s) not found for architecture x86_64 >> clang: error: linker command failed with exit code 1 (use -v to see >> invocation) >> >> > I have xcoding using -std=c++11 and -stdlib=libc++ . Basically somewhere > in v8's implementation of workerthread it's using std::Queue and gyp is > linking against a different version of the std library than I am. I did an > experiment and I tried building libv8 in the following way: > > export CXX="`which clang++` -std=c++11 -stdlib=libc++" > export GYP_DEFINES="clang=1 mac_deployment_target=10.8" > > make dependencies && make native -j8 OUTDIR=../v8-build > > > mac_deployment_target=10.8 is required because otherwise C++11 was not > available before 10.6 and gyp allows you to target 10.5. The build gets to > the linking stage and fails in the following way: > > > >> LIBTOOL-STATIC >> /Users/ixtli/Public/project/cpp/space-junk/v8/../v8-build/native/libv8_nosnapshot.x64.a > > CXX(target) >> /Users/ixtli/Public/project/cpp/space-junk/v8/../v8-build/native/obj.target/mksnapshot.x64/src/mksnapshot.o > > LINK(target) >> /Users/ixtli/Public/project/cpp/space-junk/v8/../v8-build/native/mksnapshot.x64 > > Undefined symbols for architecture x86_64: > > "std::__1::__vector_base_common<true>::__throw_length_error() const", >> referenced from: > > void std::__1::vector<v8::internal::WorkerThread*, >> std::__1::allocator<v8::internal::WorkerThread*> >> >::__push_back_slow_path<v8::internal::WorkerThread*>(v8::internal::WorkerThread*&&) >> > >> in libv8_base.x64.a(default-platform.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: > > v8::internal::StoreBuffer::SortUniq() in libv8_base.x64.a(store-buffer.o) > > ld: symbol(s) not found for architecture x86_64 > > clang: error: linker command failed with exit code 1 (use -v to see >> invocation) > > make[1]: *** >> [/Users/ixtli/Public/project/cpp/space-junk/v8/../v8-build/native/mksnapshot.x64] >> >> Error 1 > > make: *** [native] Error 2 > > > > My intuition is either something is very wrong on my end, or these recent > changes to use std::stort (<algorithm>) and std::queue aren't reflected in > the built configuration that gyp generates for OS X. > > -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
