I'm trying to cross-compile node v7.x for a MIPS device running OpenWrt. At first I ran into an issue where mkpeephole was failing because it was trying to do something on the host system for the target but it was using the target compiler (CC and CXX env vars set).
In file included from ../deps/v8/src/base/logging.h:8:0,
from ../deps/v8/src/base/macros.h:10,
from ../deps/v8/src/base/accounting-allocator.h:9,
from ../deps/v8/src/base/accounting-allocator.cc:5:
/usr/include/c++/5/cstring:41:28: fatal error: bits/c++config.h: No such file or directory
because it's trying to use the host compiler to compile that accounting-allocator.cc, even though it used the target compiler to build other V8 source files before this error.
With CC_host/CXX_host set and these configure flags: --without-snapshot --without-intl --without-inspector --without-ssl --dest-os=linux --dest-cpu=mips
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'asan': 0,
'debug_devtools': 'node',
'force_dynamic_crt': 0,
'host_arch': 'x64',
'icu_small': 'false',
'mips_arch_variant': 'r2',
'mips_fpu_mode': 'fp32',
'node_byteorder': 'little',
'node_enable_d8': 'false',
'node_enable_v8_vtunejit': 'false',
'node_install_npm': 'true',
'node_module_version': 51,
'node_no_browser_globals': 'false',
'node_prefix': '/usr/local',
'node_release_urlbase': '',
'node_shared': 'false',
'node_shared_cares': 'false',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_openssl': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_use_bundled_v8': 'true',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_lttng': 'false',
'node_use_openssl': 'false',
'node_use_perfctr': 'false',
'node_use_v8_platform': 'true',
'openssl_fips': '',
'openssl_no_asm': 0,
'shlib_suffix': 'so.51',
'target_arch': 'mips',
'uv_parent_path': '/deps/uv/',
'uv_use_dtrace': 'false',
'v8_can_use_fpu_instructions': 'true',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 0,
'v8_inspector': 'false',
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_random_seed': 0,
'v8_use_mips_abi_hardfloat': 'true',
'v8_use_snapshot': 'false',
'want_separate_host_toolset': 0,
'want_separate_host_toolset_mkpeephole': 1}}
I'm trying to cross-compile node v7.x for a MIPS device running OpenWrt. At first I ran into an issue where mkpeephole was failing because it was trying to do something on the host system for the target but it was using the target compiler (CC and CXX env vars set).
So then I tried setting
CC_host=gccandCXX_host=g++and now I get this:because it's trying to use the host compiler to compile that accounting-allocator.cc, even though it used the target compiler to build other V8 source files before this error.
With CC_host/CXX_host set and these configure flags: --without-snapshot --without-intl --without-inspector --without-ssl --dest-os=linux --dest-cpu=mips
I get this config.gypi: