Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failure trying to compile for arm+android #9869

Closed
bibitiger opened this issue Dec 1, 2016 · 13 comments
Closed

failure trying to compile for arm+android #9869

bibitiger opened this issue Dec 1, 2016 · 13 comments
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. i18n-api Issues and PRs related to the i18n implementation.

Comments

@bibitiger
Copy link

bibitiger commented Dec 1, 2016

  • Platform: Linux yangguang-Vostro-230 3.13.0-66-generic testing caine #108~precise1-Ubuntu SMP Thu Oct 8 10:07:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

build with : android-ndk-r12b

LD_LIBRARY_PATH=/home/yangguang/node-master/out/Release/lib.host:/home/yangguang/node-master/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/icu; mkdir -p /home/yangguang/node-master/out/Release/obj/gen/icutmp; python icutrim.py -P "/home/yangguang/node-master/out/Release" -D ../../deps/icu-small/source/data/in/icudt58l.dat --delete-tmp -T "/home/yangguang/node-master/out/Release/obj/gen/icutmp" -F icu_small.json -O icudt58l.dat -v -L en,root
Options: {'verbose': 1, 'filterfile': 'icu_small.json', 'toolpath': '/home/yangguang/node-master/out/Release', 'deltmpdir': 1, 'outfile': 'icudt58l.dat', 'datfile': '../../deps/icu-small/source/data/in/icudt58l.dat', 'locales': 'en,root', 'endian': 'little', 'tmpdir': '/home/yangguang/node-master/out/Release/obj/gen/icutmp'}
icu_small.json: icutrim.py config: Trim down ICU to just a certain locale set, needed for node.js use.
/home/yangguang/node-master/out/Release/icupkg: 1: /home/yangguang/node-master/out/Release/icupkg: Syntax error: word unexpected (expecting ")")
FAILED: /home/yangguang/node-master/out/Release/icupkg -tl ../../deps/icu-small/source/data/in/icudt58l.dat /home/yangguang/node-master/out/Release/obj/gen/icutmp/icudt58l.dat
make[1]: *** [/home/yangguang/node-master/out/Release/obj/gen/icutmp/icudt58l.dat] 错误 1
make[1]:正在离开目录 `/home/yangguang/node-master/out'

thank you for help

@mscdex mscdex added arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. i18n-api Issues and PRs related to the i18n implementation. labels Dec 1, 2016
@mscdex
Copy link
Contributor

mscdex commented Dec 1, 2016

Have you tried the suggested solutions (besides --without-intl) in #7173 ?

@bibitiger
Copy link
Author

@mscdex
I have change my android-configure to:

GYP_DEFINES="target_arch=$ARCH"
GYP_DEFINES+=" v8_target_arch=$ARCH"
GYP_DEFINES+=" android_target_arch=$ARCH"
GYP_DEFINES+=" host_os=linux OS=android"
export GYP_DEFINES

if [ -f "configure" ]; then
    ./configure \
        --dest-cpu=$DEST_CPU \
        --dest-os=android \
        --without-snapshot \
        --openssl-no-asm \
        --without-intl
fi

make

then, the error is :

LD_LIBRARY_PATH=/home/yangguang/node-master/out/Release/lib.host:/home/yangguang/node-master/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../deps/v8/src; mkdir -p /home/yangguang/node-master/out/Release/obj.target/v8_base/geni; "/home/yangguang/node-master/out/Release/mkpeephole" "/home/yangguang/node-master/out/Release/obj.target/v8_base/geni/bytecode-peephole-table.cc"
/home/yangguang/node-master/out/Release/mkpeephole: 1: /home/yangguang/node-master/out/Release/mkpeephole: Syntax error: word unexpected (expecting ")")

@bnoordhuis
Copy link
Member

What version of node are you trying to build? Not to sound too grumpy but we don't ask that in the issue template for nothing.

@bibitiger
Copy link
Author

@bnoordhuis
master

@bnoordhuis
Copy link
Member

Can you post the contents of your config.gypi? Please wrap it in backticks so it gets formatted properly.

want_separate_host_toolset_mkpeephole should be set to 1 in your case, I think. What is the DEST_CPU environment variable set to?

@bibitiger
Copy link
Author

@bnoordhuis
config.gypi

# Do not edit. Generated by the configure script.
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'OS': 'android',
                 'arm_float_abi': 'default',
                 'arm_fpu': 'vfpv3',
                 'arm_thumb': 0,
                 'arm_version': '7',
                 'asan': 0,
                 'debug_devtools': 'node',
                 'force_dynamic_crt': 0,
                 'host_arch': 'x64',
                 'icu_data_file': 'icudt58l.dat',
                 'icu_data_in': '../../deps/icu-small/source/data/in/icudt58l.dat',
                 'icu_endianness': 'l',
                 'icu_gyp_path': 'tools/icu/icu-generic.gyp',
                 'icu_locales': 'en,root',
                 'icu_path': 'deps/icu-small',
                 'icu_small': 'true',
                 'icu_ver_major': '58',
                 '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': 'true',
                 'node_use_perfctr': 'false',
                 'node_use_v8_platform': 'true',
                 'openssl_fips': '',
                 'openssl_no_asm': 1,
                 'shlib_suffix': 'so.51',
                 'target_arch': 'arm',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 1,
                 'v8_inspector': 'true',
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'false',
                 'want_separate_host_toolset': 0,
                 'want_separate_host_toolset_mkpeephole': 1}}

and I change android_configure to:

!/bin/bash
  2 
  3 # In order to cross-compile node for Android using NDK, run:
  4 #   source android-configure <path_to_ndk> [arch]
  5 #
  6 # By running android-configure with source, will allow environment variables to
  7 # be persistent in current session. This is useful for installing native node
  8 # modules with npm. Also, don't forget to set the arch in npm config using
  9 # 'npm config set arch=<arch>'
 10 
 11 
 12 if [ -z "$2" ]; then
 13     ARCH=arm
 14 else
 15     ARCH="$2"
 16 fi
 17 
 18 CC_VER="4.9"
 19 case $ARCH in
 20     arm)
 21         DEST_CPU="$ARCH"
 22         SUFFIX="$ARCH-linux-androideabi"
 23         TOOLCHAIN_NAME="$SUFFIX"
 24         ;;
 25     x86)
 26         DEST_CPU="ia32"
 27         SUFFIX="i686-linux-android"
 28         TOOLCHAIN_NAME="$ARCH"
 29         ;;
 30     x86_64)
 31         DEST_CPU="ia32"
 32         SUFFIX="$ARCH-linux-android"
 33         TOOLCHAIN_NAME="$ARCH"
 34         ;;
 35     *)
 36         echo "Unsupported architecture provided: $ARCH"
 37         exit 1
 38         ;;
 39 esac
 40 
 41 export TOOLCHAIN=$PWD/android-toolchain
 42 mkdir -p $TOOLCHAIN
 43 $1/build/tools/make-standalone-toolchain.sh \
 44     --toolchain=$TOOLCHAIN_NAME-$CC_VER \
 45     --arch=$ARCH \
 46     --install-dir=$TOOLCHAIN \
 47     --platform=android-21
 48 export PATH=$TOOLCHAIN/bin:$PATH
 49 export AR_target=$TOOLCHAIN/bin/$SUFFIX-ar
 50 export CC_target=$TOOLCHAIN/bin/$SUFFIX-gcc
 51 export CXX_target=$TOOLCHAIN/bin/$SUFFIX-g++
 52 export LINK_target=$TOOLCHAIN/bin/$SUFFIX-g++
 53 
 54 GYP_DEFINES="target_arch=$ARCH v8_target_arch=$ARCH android_target_arch=$ARCH host_os=linux OS=android"
 55 export GYP_DEFINES
 56 
 57 if [ -f "configure" ]; then
 58     ./configure \
 59         --dest-cpu=$DEST_CPU \
 60         --dest-os=android \
 61         --without-snapshot \
 62         --openssl-no-asm
 63 fi

then I compile successed,but the out like this :

yangguang@yangguang-Vostro-230:~/node-master/out$ ls
cctest.target.mk mkssldef.target.mk node_dtrace_ustack.target.mk node_perfctr.target.mk specialize_node_d.target.mk
deps node_dtrace_header.target.mk node_etw.target.mk node.target.mk tools
Makefile node_dtrace_provider.target.mk node_js2c.host.mk Release v8_inspector_compress_protocol_json.host.mk

yangguang@yangguang-Vostro-230:~/node-master/out/Release$ ls
cctest genccode genrb iculslocs icupkg mkpeephole node obj obj.host obj.target openssl-cli

I push "node" to my android device, run "node -v", it shows:

root@hexing71_cwet_kk:/ # node -v
CANNOT LINK EXECUTABLE: cannot locate symbol "sigfillset" referenced by "node"...

my android device os :

Linux localhost 3.4.67 #50 SMP PREEMPT Thu Nov 17 17:37:24 CST 2016 armv7l GNU/Linux, android:4.42

thanks for your help

@bnoordhuis
Copy link
Member

sigfillset() wasn't added until android 5.0, IIRC. If you can't upgrade, you're probably out of luck.

@bibitiger
Copy link
Author

@bnoordhuis which version of nodejs not use sigfillset, my android version is 4.4.2,thanks

@bnoordhuis
Copy link
Member

I don't know. Probably not any recent version, possibly not any version.

I'll go ahead and close the issue, if you don't mind.

@yeewang
Copy link

yeewang commented Dec 4, 2016

I have encountered the similar error when I tried to cross-build. The reason should be: The "icu" utilities (here is corrupted in "icupkg") were compiled as the target arch, but they should be the host arch.

@sromovskypeter
Copy link

There is still the issue with LTS version. As @yeewang is saying.

@MylesBorins
Copy link
Contributor

/cc @srl295 re ICU

@artynet
Copy link

artynet commented Dec 22, 2016

@thealphanerd

please take a look here at the end. Somehow I have managed to cross-build the sources

#9707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI. i18n-api Issues and PRs related to the i18n implementation.
Projects
None yet
Development

No branches or pull requests

7 participants