cannot build v8 with enable snapshot

335 views
Skip to first unread message

pav...@coherent-labs.com

unread,
Dec 8, 2016, 5:05:43 AM12/8/16
to v8-users
Hallo, im trying to build v8 on android and i generate the project files with gyp as follows :
python gypfiles/gyp_v8 -Dtarget_arch=android_arm -Dcomponent=shared_library -Dv8_enable_inspector=1 -Dv8_code=0 -Dv8_enable_slow_dchecks=0 -Dv8_use_external_startup_data=0 -Dv8_enable_i18n_support=0 -Darm_version=7
When i run: ninja -C out/Debug there are linking errors, for example when i try to build: ninja -C out/Debug mksnapshot, there are dozens of linking errors because of internal stuff not found
When i run gyp with the same arguemnts plus -Dv8_use_snapshot='false'  the build succeeds, 
Note i'm building 5.6-lkgr of v8
Thanks,
~ Pavel 

pav...@coherent-labs.com

unread,
Dec 8, 2016, 7:57:30 AM12/8/16
to v8-users
[1/1] LINK mksnapshot                                                                                                                            FAILED: mksnapshot                                                                                                                               c++ -pthread -Wl,-rpath=\$ORIGIN/lib/ -Wl,-rpath-link=lib/ -o mksnapshot -Wl,--start-group obj/src/snapshot/mksnapshot.mksnapshot.o obj/src/libv8_base.a obj/src/libv8_nosnapshot.a obj/src/libv8_libsampler.a -Wl,--end-group lib/libv8_libbase.so lib/libv8_libplatform.so -ldl -lrt            obj/src/snapshot/mksnapshot.mksnapshot.o: In function `v8::internal::CpuFeatures::Probe(bool)':                                                  /home/coherent/v8/out/Debug/../../src/assembler.h:229: undefined reference to `v8::internal::CpuFeatures::ProbeImpl(bool)'                       obj/src/v8_base.assembler.o: In function `v8::internal::Assembler::dp(unsigned long)':                                                           /home/coherent/v8/out/Debug/../../src/x64/assembler-x64.h:2011: undefined reference to `v8::internal::Assembler::dq(unsigned long)'              obj/src/v8_base.assembler.o: In function `v8::internal::EnsureSpace::EnsureSpace(v8::internal::Assembler*)':                                     /home/coherent/v8/out/Debug/../../src/x64/assembler-x64.h:2517: undefined reference to `v8::internal::Assembler::GrowBuffer()'                   obj/src/v8_base.assembler.o: In function `v8::internal::AssemblerBase::FlushICache(v8::internal::Isolate*, void*, unsigned long)':               /home/coherent/v8/out/Debug/../../src/assembler.cc:196: undefined reference to `v8::internal::CpuFeatures::FlushICache(void*, unsigned long)'    obj/src/v8_base.assembler.o: In function `v8::internal::RelocInfo::update_wasm_memory_reference(unsigned char*, unsigned char*, unsigned int, unsigned int, v8::internal::ICacheFlushMode)':                                                                                                      /home/coherent/v8/out/Debug/../../src/assembler.cc:347: undefined reference to `v8::internal::RelocInfo::wasm_memory_reference()'                /home/coherent/v8/out/Debug/../../src/assembler.cc:351: undefined reference to `v8::internal::RelocInfo::unchecked_update_wasm_memory_reference(unsigned char*, v8::internal::ICacheFlushMode)'                                                                                                   /home/coherent/v8/out/Debug/../../src/assembler.cc:353: undefined reference to `v8::internal::RelocInfo::wasm_memory_size_reference()'           /home/coherent/v8/out/Debug/../../src/assembler.cc:357: undefined reference to `v8::internal::RelocInfo::unchecked_update_wasm_memory_size(unsigned int, v8::internal::ICacheFlushMode)'                                                                                                          obj/src/v8_base.assembler.o: In function `v8::internal::RelocInfo::update_wasm_global_reference(unsigned char*, unsigned char*, v8::internal::ICacheFlushMode)':                                                                                                                                  /home/coherent/v8/out/Debug/../../src/assembler.cc:372: undefined reference to `v8::internal::RelocInfo::wasm_global_reference()'                /home/coherent/v8/out/Debug/../../src/assembler.cc:375: undefined reference to `v8::internal::RelocInfo::unchecked_update_wasm_memory_reference(unsigned char*, v8::internal::ICacheFlushMode)'                                                                                                   obj/src/v8_base.assembler.o: In function `v8::internal::RelocIterator::RelocIterator(v8::internal::Code*, int)':                                 /home/coherent/v8/out/Debug/../../src/assembler.cc:688: undefined reference to `v8::internal::Code::IsYoungSequence(v8::internal::Isolate*, unsigned char*)'                                                                                                                                      obj/src/v8_base.assembler.o: In function `v8::internal::RelocInfo::IsPatchedDebugBreakSlotSequence()':                                           /home/coherent/v8/out/Debug/../../src/assembler.cc:718: undefined reference to `v8::internal::DebugCodegen::DebugBreakSlotIsPatched(unsigned char*)'                                                                                                                                              obj/src/v8_base.assembler.o: In function `v8::internal::ExternalReference::re_check_stack_guard_state(v8::internal::Isolate*)':                  /home/coherent/v8/out/Debug/../../src/assembler.cc:1390: undefined reference to `v8::internal::RegExpMacroAssemblerX64::CheckStackGuardState(unsigned char**, v8::internal::Code*, unsigned char*)'                                                                                               obj/src/v8_base.assembler.o: In function `v8::internal::ConstantPoolBuilder::EmitSharedEntries(v8::internal::Assembler*, v8::internal::ConstantPoolEntry::Type)':                                                                                                                                 /home/coherent/v8/out/Debug/../../src/assembler.cc:1795: undefined reference to `v8::internal::Assembler::dq(unsigned long)'                     obj/src/v8_base.assembler.o: In function `v8::internal::ConstantPoolBuilder::EmitGroup(v8::internal::Assembler*, v8::internal::ConstantPoolEntry::Access, v8::internal::ConstantPoolEntry::Type)':                                                                                                /home/coherent/v8/out/Debug/../../src/assembler.cc:1847: undefined reference to `v8::internal::Assembler::dq(unsigned long)'                     obj/src/v8_base.assembler.o: In function `v8::internal::ConstantPoolBuilder::Emit(v8::internal::Assembler*)':                                    /home/coherent/v8/out/Debug/../../src/assembler.cc:1873: undefined reference to `v8::internal::Assembler::bind(v8::internal::Label*)'            obj/src/v8_base.assembler.o: In function `v8::internal::Assembler::RecordDeoptReason(v8::internal::DeoptimizeReason, v8::internal::SourcePosition, int)':                                                                                                                                         /home/coherent/v8/out/Debug/../../src/assembler.cc:1901: undefined reference to `v8::internal::Assembler::RecordRelocInfo(v8::internal::RelocInfo::Mode, long)'                                                                                                                                   /home/coherent/v8/out/Debug/../../src/assembler.cc:1902: undefined reference to `v8::internal::Assembler::RecordRelocInfo(v8::internal::RelocInfo::Mode, long)'                                                                                                                                   /home/coherent/v8/out/Debug/../../src/assembler.cc:1903: undefined reference to `v8::internal::Assembler::RecordRelocInfo(v8::internal::RelocInfo::Mode, long)'                                                                                                                                   /home/coherent/v8/out/Debug/../../src/assembler.cc:1904: undefined reference to `v8::internal::Assembler::RecordRelocInfo(v8::internal::RelocInfo::Mode, long)'                                                                                                                                   obj/src/v8_base.assembler.o: In function `v8::internal::Assembler::RecordComment(char const*)':                                                  /home/coherent/v8/out/Debug/../../src/assembler.cc:1912: undefined reference to `v8::internal::Assembler::RecordRelocInfo(v8::internal::RelocInfo::Mode, long)'   

Yang Guo

unread,
Dec 9, 2016, 1:59:12 AM12/9/16
to v8-users
When we build for Android, we use the ARM simulator to run V8 on the host machine to create the snapshot for ARM. Maybe the host machine build did not succeed?

pav...@coherent-labs.com

unread,
Dec 9, 2016, 4:02:15 AM12/9/16
to v8-users
It seems that even though i run -Dtarget_arch=android_arm the resulting .a files are x64 architecture, why does my ninja build do x64 build even though i specified -Dtarget_arch=android_arm -Darm_version=7


On Thursday, December 8, 2016 at 12:05:43 PM UTC+2, pav...@coherent-labs.com wrote:

Yang Guo

unread,
Dec 15, 2016, 1:22:55 AM12/15/16
to v8-users
Because when you build for Android, we still have to create the snapshot on the machine you are building from. What happens is:

- build V8 for the host (x64)
- run mksnapshot on the host, with the simulator for the target (arm), to get the snapshot for the target.
- build V8 for the target
Reply all
Reply to author
Forward
0 new messages