Cross Compiling for Raspberry

137 views
Skip to first unread message

Jean-Daniel Michaud

unread,
Oct 10, 2016, 2:43:51 PM10/10/16
to v8-users
Context: Trying to cross-compile RethinkDB for raspberry. Trying to cross-compile V8 3.30 for Raspberry on a Ubuntu 16.04.
The rethinkdb filesystem execute:

+ cd /home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build
+ make arm.release CXX=/home/jedi/rpi-toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ LINK=/home/jedi/rpi-toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ LINK.target=/home/jedi/rpi-toolchain/arm-bcm2708/gcc-linaro-arm-linux-gnu
eabihf
-raspbian-x64/bin/arm-linux-gnueabihf-g++ 'GYPFLAGS=-Dwerror= -Darm_version=6 -Darm_fpu=vfpv2' V=1

It starts by compiling ../src/accessors.cc with the toolchain compiler.
But after a while fails this way:

  LD_LIBRARY_PATH=/home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/lib.host:/home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/gyp; mkdir -p /home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/obj/gen; python ../../tools/js2c.py "/home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/obj/gen/libraries.cc" CORE off ../../src/runtime.js ../../src/v8natives.js ../../src/symbol.js ../../src/array.js ../../src/string.js ../../src/uri.js ../../src/third_party/fdlibm/fdlibm.js ../../src/math.js ../../src/apinatives.js ../../src/date.js ../../src/regexp.js ../../src/arraybuffer.js ../../src/typedarray.js ../../src/generator.js ../../src/object-observe.js ../../src/collection.js ../../src/weak-collection.js ../../src/collection-iterator.js ../../src/promise.js ../../src/messages.js ../../src/json.js ../../src/array-iterator.js ../../src/string-iterator.js ../../src/debug-debugger.js ../../src/mirror-debugger.js ../../src/liveedit-debugger.js ../../src/macros.py ../../src/i18n.js
  g
++ '-DV8_TARGET_ARCH_ARM' '-DV8_DEPRECATION_WARNINGS' '-DV8_I18N_SUPPORT' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' '-DU_USING_ICU_NAMESPACE=0' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION' '-DUSE_EABI_HARDFLOAT=0' -I../. -I../third_party/icu/source/i18n -I../third_party/icu/source/common  -Wall -W -Wno-unused-parameter -Wno-long-long -pthread -fno-exceptions -pedantic -Wno-missing-field-initializers -fvisibility=hidden -m32 -m32 -fdata-sections -ffunction-sections -O3 -fdata-sections -ffunction-sections -O3 -Wnon-virtual-dtor -fno-rtti -std=gnu++0x -MMD -MF /home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/.deps//home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/obj.host/v8_base/src/accessors.o.d.raw  -c -o /home/jedi/rethinkdb-2.3.5/build/packages/dsc/build/external/v8_3.30.33.16/build/out/arm.release/obj.host/v8_base/src/accessors.o ../src/accessors.cc
In file included from /usr/include/stdint.h:25:0,
                 
from /usr/lib/gcc/x86_64-linux-gnu/5/include/stdint.h:9,
                 
from .././include/v8.h:19,
                 
from .././src/v8.h:29,
                 
from ../src/accessors.cc:5:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory


It's trying to compile accessors.cc again but this time using the host c++ compiler which does not have the proper headers.
Couldn't find where in Makefile.arm.release the host compiler is called.
Any help is appreciated.

JD


Rodolph Perfetta

unread,
Oct 11, 2016, 8:26:50 AM10/11/16
to v8-users
The build system will generate a host binary to generate snapshots. IIRC disabling snapshot (snapshot=off) will still result in the host binary being built. So why not installing the host tools completely?

V8 3.30 is rather old and unsupported though I presume this is a rethinkDB requirement. There is a script in the tool directory to help with cross builds, e.g ./tools/cross_build_gcc.sh /path/to/gcc-armhf- arm.release i18nsupport=off werror=no . You may also have to pass linux_use_bundled_gold=0 to GYP.

HTH,
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.

Jean-Daniel Michaud

unread,
Oct 11, 2016, 9:19:52 AM10/11/16
to v8-u...@googlegroups.com

On Oct 11, 2016 14:26, "Rodolph Perfetta" <rodolph....@gmail.com> wrote:
>
> The build system will generate a host binary to generate snapshots. IIRC disabling snapshot (snapshot=off) will still result in the host binary being built. So why not installing the host tools completely?
>

Haven't realized there was a need to compile stuff on the host, I thought I was facing a bug. I see if I can fetch a list of host tools to install.

> V8 3.30 is rather old and unsupported though I presume this is a rethinkDB requirement. There is a script in the tool directory to help with cross builds, e.g ./tools/cross_build_gcc.sh /path/to/gcc-armhf- arm.release i18nsupport=off werror=no . You may also have to pass linux_use_bundled_gold=0 to GYP.
>

Indeed, this is a rethinkdb req. And I prefer to stick to their build system if I can so I'll go ahead and install the tools on the host.

> HTH,

It does, thanks.

> You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/QjWvswUF73k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to v8-users+u...@googlegroups.com.

Jean-Daniel Michaud

unread,
Oct 11, 2016, 3:52:58 PM10/11/16
to v8-users
Conclusion: v8 compiles the host tool in 32bits (-m32), so we need to install the 32bits version of the system libs.
On Ubuntu 16.04:
sudo apt-get install -y g++-multilib  zlib1g-dev zlib1g-dev:i386

JD

>> To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.


>>
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> --
> v8-users mailing list
> v8-u...@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the Google Groups "v8-users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/v8-users/QjWvswUF73k/unsubscribe.

> To unsubscribe from this group and all its topics, send an email to v8-users+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages