Build v8 for arm on linux

316 views
Skip to first unread message

ibon tolosana

unread,
Oct 24, 2016, 10:17:25 AM10/24/16
to v8-users
Hi there,

I am having some trouble with v8 resulting libs. I compile on ubuntu linux 16.04 setting arm as target using gn.
The process works just ok, but when I try to link the 4 libs with my appon Mac, i get:
  that tmpfile64 is an undefined symbol reference. It is referenced from platform-posix.o on libplatform.

Any ideas about how to overcome this issue ?
I have tried creating that function myself FILE* tmpfile64(void);, creating a strong link between tmpfile64 and tmpfile functions but nothing seems to work.
Also, I crosscompile on linux, because gclient sync seems to install linux's NDK on my Mac laptop ?? Have not dig into this though. Probably a symlink to the correct darwin toolchain would work.

In case it helps, here's a rough description of the process needed to have v8 compiling:

install ia32 libraries support
execute v8/build/linux/sysroot_scripts/install-sysroot.py --arch arm
apt install binutils-arm-linux-gnueabihf

after compilation, two thin libraries are created, which i recreate with
ar -t <lib> | xargs ar rvs <newlib>
i also create two libraries for lib_base and lib_snapshot with:
ar rcsD <libname> v8_base/*.o
ar rcsD <libname> v8_snapshot/*.o

here's my args.gn file:

is_debug = false
target_cpu = "arm"
v8_target_cpu = "arm"
v8_enable_i18n_support = false
v8_enable_inspector = true

I don't set float_abi. I assume default for the platform would be softfp.

Please, help.
Thanks.

- i

Rodolph Perfetta

unread,
Oct 25, 2016, 11:16:18 AM10/25/16
to v8-users
Hi,

have you tried building using GYP and using ./tools/cross_build_gcc.sh? I can't really help with the issue on the Mac but just one observation: if you use arm-linux-gnueabihf-gcc then the float_abi will default to hardfp.

Rodolph

--
--
v8-users mailing list
v8-u...@googlegroups.com
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 v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ibon tolosana

unread,
Oct 25, 2016, 11:54:08 AM10/25/16
to v8-users
Hey Rodolph, thanks for answering.

I haven't tried cross build with gcc, but will for sure give it a try immediately.
Do you suggest using arm-linux-gnueabi-gcc instead of the hf version ? I though the abi would be softfp instead of hard though.

Can you point me somewhere where I could have a proper example for cross_compile_gcc ?

Thanks.

Rodolph Perfetta

unread,
Oct 25, 2016, 2:34:43 PM10/25/16
to v8-users
Hi,

hf stands for hard float, hence the default setting. If you are targeting softfp then better use arm-gnueabi-gcc.

I can cross build with gcc using the following comand line: ./tools/cross_build_gcc.sh tools/gcc-linaro-5.1-2015.08-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- arm.release i18nsupport=off werror=no

HTH,
Rodolph

ibon tolosana

unread,
Oct 28, 2016, 5:56:47 AM10/28/16
to v8-users
Works perfectly on my pi.

thanks.
Reply all
Reply to author
Forward
0 new messages