Skip to content

Failed to compile from source for armv7l (busybox) on  #7173

Description

@mrvini
  • Version: 6.2.1
  • Platform: busybox (Linux dm3730_zoom_torpedo 3.0.0-ts-armv7l io.js messaging #23 Thu Feb 18 13:29:10 PST 2016 armv7l GNU/Linux)
  • Subsystem:

I am trying to compile node version 6.2.1 for armv7l (tried using out of the box one before, it would not run for me at all). While I was successfully able to compile all versions prior 6.2.0 (i.e. from 4.x -6.1), 6.2.0 and 6.2.1 start giving me a problem with icu and throws the following error

Options: {'verbose': 1, 'filterfile': 'icu_small.json', 'toolpath': '/var/jenkins_home/jobs/Node/workspace/out/Release', 'deltmpdir': 1, 'outfile': 'icudt57l.dat', 'datfile': '../../deps/icu-small/source/data/in/icudt57l.dat', 'locales': 'en,root', 'endian': 'little', 'tmpdir': '/var/jenkins_home/jobs/Node/workspace/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.

FAILED: /var/jenkins_home/jobs/Node/workspace/out/Release/icupkg -tl ../../deps/icu-small/source/data/in/icudt57l.dat 

/var/jenkins_home/jobs/Node/workspace/out/Release/obj/gen/icutmp/icudt57l.dat
tools/icu/icudata.target.mk:13: recipe for target '/var/jenkins_home/jobs/Node/workspace/out/Release/obj/gen/icutmp/icudt57l.dat' failed
make[1]: *** [/var/jenkins_home/jobs/Node/workspace/out/Release/obj/gen/icutmp/icudt57l.dat] Error 1

The script that i am using to build it is the following:

#!/bin/sh
export AR=~/timesys/bin/armv7l-timesys-linux-gnueabi-ar
export CC=~/timesys/bin/armv7l-timesys-linux-gnueabi-gcc
export CXX=~/timesys/toolchain/bin/armv7l-timesys-linux-gnueabi-g++
export LINK=~/timesys/bin/armv7l-timesys-linux-gnueabi-g++

export TARGET_ARCH="-march=armv7l"
export TARGET_TUNE="-mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb"

#DEFINE FLAGS
export CXX_TARGET_ARCH="-march-armv7l"
export V8_TARGET_ARCH="-march-armv7l"

make clean
./configure with --without-snapshot;
export DESTDIR="~/dist/node-6.2.1"
make -j4 install

Am I missing some kind of dependencies? Please advise if

Activity

  1. added
    buildIssues and PRs related to Node.js builds or CI infrastructure.
    armIssues and PRs related to the ARM architecture.
    i18n-apiIssues and PRs related to Node.js internationalization support.
    on Jun 6, 2016
  2. bnoordhuis commented on Jun 6, 2016

    @bnoordhuis
    Member

    I'm not saying it's the cause, but if you want to build with -mfloat-abi=softfp, you should at least pass --with-arm-float-abi=softfp to configure. If you can't get icu to build, see if --without-intl works.

    Just to be clear, you're compiling on the target machine itself, right? You're not cross-compiling?

    /cc @srl295

  3. mscdex commented on Jun 6, 2016

    @mscdex
    Contributor

    I would assume they are cross-compiling if they're setting those environment variables.

  4. mrvini commented on Jun 6, 2016

    @mrvini
    Author

    We are cross-compiling, @mscdex is correct. I will try to set the flag variable and will report on the results shortly. Thanks

  5. srl295 commented on Jun 6, 2016

    @srl295
    Member

    So the /var/jenkins_home/jobs/Node/workspace/out/Release/icupkg file should be run on the host architecture. Is it possible to verify the architecture of that file?
    edit From icu-generic.gyp:

          'target_name': 'icupkg',
          'toolsets': [ 'host' ],
    

    so, icupkg ought to be built for the host side.

    Actually, I can skip the icutrim step for the small ICU builds and save us some build time, but I am not sure if it will necessarily fix the issue here.

    If someone can get instructions for setting up the cross-compilation environment I could try to debug this some also.

  6. mrvini commented on Jun 6, 2016

    @mrvini
    Author

    @bnoordhuis, I've tried to compile with the correct flags as you've specified and results were successful.

    Host System:Linux 38f5fc85140e 3.13.0-61-generic #100-Ubuntu SMP

    configure line

    ./configure --without-snapshot --dest-cpu=arm --dest-os=linux --with-arm-float-abi=softfp --without-intl  

    To set it for cross compiling, I believe all you need to do is to point env. variables like in the issue that I've posted above

    thank you

  7. srl295 commented on Jun 6, 2016

    @srl295
    Member

    @mrvini ok - what packages do i need?
    edit and can you also try compiling with --with-intl=full-icu --download=all ? This will download the full ICU and build it in a slightly different code path. while i'm debugging this it could add a data point.

  8. mrvini commented on Jun 6, 2016

    @mrvini
    Author

    @srl295, we are using timesys distribution, and the entire distribution is 530MB, I can attached what's in bin folder if that's sufficient (its only 37MB). We are using timesys embedded linux flavor on the top of busybox. Please let me know

  9. srl295 commented on Jun 6, 2016

    @srl295
    Member

    @mrvini I mean - what do I need to compile on the host?

  10. mrvini commented on Jun 6, 2016

    @mrvini
    Author

    @srl295 , I've added flags that you've recommended

    ./configure --without-snapshot --dest-cpu=arm --dest-os=linux --with-arm-float-abi=softfp --with-intl=full-icu --download=all;
    

    now I see slightly different error

    ../../deps/icu/source/data/in/icudt57l.dat "/var/jenkins_home/jobs/Node/workspace/out/Release/obj/gen/icudt57l.dat"
    /var/jenkins_home/jobs/Node/workspace/out/Release/icupkg: 1: /var/jenkins_home/jobs/Node/workspace/out/Release/icupkg: Syntax error: word unexpected (expecting ")")
    tools/icu/icudata.target.mk:13: recipe for target '/var/jenkins_home/jobs/Node/workspace/out/Release/obj/gen/icudt57l.dat' failed

    when I specify small-icu, the error changes

    '../../deps/icu-small/source/data/in/icudt57l.dat', 'locales': 'en,root', 'endian': 'little', 'tmpdir': '/var/jenkins_home/jobs/Node/workspace/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.
    FAILED: /var/jenkins_home/jobs/Node/workspace/out/Release/icupkg -tl ../../deps/icu-small/source/data/in/icudt57l.dat /var/jenkins_home/jobs/Node/workspace/out/Release/obj/gen/icutmp/icudt57l.dat

    in terms of the variables that I'm settings before I run the .configure script, they are the following

    #!/bin/sh
    export AR=~/timesys/bin/armv7l-timesys-linux-gnueabi-ar
    export CC=~/timesys/bin/armv7l-timesys-linux-gnueabi-gcc
    export CXX=~/timesys/bin/armv7l-timesys-linux-gnueabi-g++
    export LINK=~/timesys/bin/armv7l-timesys-linux-gnueabi-g++
    
    export TARGET_ARCH="-march=armv7l"
    export TARGET_TUNE="-mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb"
    
    #DEFINE FLAGS
    export CXX_TARGET_ARCH="-march-armv7l"
    export V8_TARGET_ARCH="-march-armv7l"

    to compile on the host, I think you need to be able to set up timesys distribution on your machine,, i think bin folder the bin folder for me takes 37MB. I'll check if that's available from timesys website ( i doubt though), those were given to me.

  11. srl295 commented on Jun 7, 2016

    @srl295
    Member

    I (maybe) got setup for cross compiling on raspberry pi (set AR/CC/CXX/LINK), and was able to reproduce:

    ./out/Release/icupkg:                                 ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=364920e9400e9bb597ff0829c9fc56b9026a1ab5, not stripped
    

    So what gives here? Why was icupkg compiled for the target when it's clearly toolset: host?
    Looking…

  12. self-assigned this
    on Jun 7, 2016
  13. 16 remaining items

  14. joaocgreis commented on Jun 9, 2016

    @joaocgreis
    Member

    @mrvini Good to know, thanks for the summary!

  15. srl295 commented on Jun 10, 2016

    @srl295
    Member

    @mrvini you have --with-intl=full-icu --download=all - that's great, gives you the full i18n data. You can also just omit those flags and you'll get the default for node, English only.

  16. mrvini commented on Jun 10, 2016

    @mrvini
    Author

    thanks @srl295 , got u

  17. nappy commented on Jul 11, 2016

    @nappy
    Contributor

    @joaocgreis I am trying to get the Intl feature working on android with the suggestions above.

    sudo dpkg --add-architecture i386
    sudo apt-get install gcc-multilib g++-multilib
    
    export CXX_host="g++ -m32"
    export CC_host="gcc -m32"
    export LINK_host="g++ -m32"
    

    But I get the following error on the ICU part:

    g++ -m32 -rdynamic -fPIE -pie  -o /home/nodejs/node/out/Release/iculslocs /home/nodejs/node/out/Release/obj.host/iculslocs/tools/icu/iculslocs.o /home/nodejs/node/out/Release/obj.host/iculslocs/tools/icu/no-op.o /home/nodejs/node/out/Release/obj.host/tools/icu/libicutools.a -llog
    /usr/bin/ld: cannot find -llog
    

    To my knowledge -llog is a android specific library, so how to ensure the flag is not provided to the host toolchain? I found it being set in common.gypi, but I have no clue how to make the switch.

  18. srl295 commented on Jul 11, 2016

    @srl295
    Member

    @nappy this seems like a separate issue.

    common.gypi has

          [ 'OS=="android"', {
            'defines': ['_GLIBCXX_USE_C99_MATH'],
            'libraries': [ '-llog' ],
          }],
    

    seems like it may need a conditional there? Perhaps it's yet another latent bug that building with intl exposes?

  19. huseyinkozan commented on Sep 9, 2016

    @huseyinkozan

    I tried to compile by removing the --without-intl option,

    CONFIGURE_ARGS = --dest-cpu=$(DEST_CPU) --dest-os=linux \
      --shared-openssl --shared-openssl-includes="$(STAGING_DIR)/usr/include" --shared-openssl-libpath="$(STAGING_DIR)/usr/lib" \
      --shared-zlib --shared-zlib-includes="$(STAGING_DIR)/usr/include" --shared-zlib-libpath="$(STAGING_DIR)/usr/lib" \
      --v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5" \
      --without-snapshot --with-mips-arch-variant=r2 --with-mips-fpu-mode=fp32 --with-mips-float-abi=soft
    

    installed 32bit libs with,

    sudo dpkg --add-architecture i386
    sudo apt-get install gcc-multilib g++-multilib
    

    set *_host flags as noted above,

    export CXX_host="g++ -m32"
    export CC_host="gcc -m32"
    export LINK_host="g++ -m32"
    

    and got this error :

    g++ -m32 -pthread -rdynamic  -o /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out/Release/genccode -Wl,--start-group /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out/Release/obj.host/genccode/deps/icu-small/source/tools/genccode/genccode.o /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out/Release/obj.host/genccode/tools/icu/no-op.o /home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out/Release/obj.host/tools/icu/libicutools.a -Wl,--end-group -L/home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib -lz -lssl -lcrypto
    /usr/bin/ld: skipping incompatible /home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libz.so when searching for -lz
    /usr/bin/ld: skipping incompatible /home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libz.a when searching for -lz
    /usr/bin/ld: cannot find -lz
    /usr/bin/ld: skipping incompatible /home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libssl.so when searching for -lssl
    /usr/bin/ld: skipping incompatible /home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libssl.a when searching for -lssl
    /usr/bin/ld: cannot find -lssl
    /usr/bin/ld: skipping incompatible /home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libcrypto.so when searching for -lcrypto
    /usr/bin/ld: skipping incompatible /home/hk/p/openwrt-tessel/openwrt/staging_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/usr/lib/libcrypto.a when searching for -lcrypto
    /usr/bin/ld: cannot find -lcrypto
    collect2: error: ld returned 1 exit status
    tools/icu/genccode.host.mk:136: recipe for target '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out/Release/genccode' failed
    make[4]: *** [/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out/Release/genccode] Error 1
    make[4]: Leaving directory '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/out'
    Makefile:66: recipe for target 'node' failed
    make[3]: *** [node] Error 2
    make[3]: Leaving directory '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0'
    Makefile:67: recipe for target '/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/.built' failed
    make[2]: *** [/home/hk/p/openwrt-tessel/openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/node-v6.5.0/.built] Error 2
    make[2]: Leaving directory '/home/hk/p/openwrt-tessel/package/node/node'
    package/Makefile:191: recipe for target 'package/feeds/tessel/node/compile' failed
    make[1]: *** [package/feeds/tessel/node/compile] Error 2
    make[1]: Leaving directory '/home/hk/p/openwrt-tessel/openwrt'
    /home/hk/p/openwrt-tessel/openwrt/include/toplevel.mk:181: recipe for target 'package/node/compile' failed
    make: *** [package/node/compile] Error 2
    

    Any idea ?

  20. bnoordhuis commented on Sep 9, 2016

    @bnoordhuis
    Member

    @huseyinkozan Either install those libraries or omit --shared-openssl, --shared-zlib, etc. if you don't have them?

  21. huseyinkozan commented on Sep 9, 2016

    @huseyinkozan

    @bnoordhuis I did:

    CONFIGURE_ARGS = --dest-cpu=$(DEST_CPU) --dest-os=linux \
      --shared-openssl --shared-openssl-includes="$(STAGING_DIR)/usr/include" --shared-openssl-libpath="$(STAGING_DIR)/usr/lib" \
      --shared-zlib --shared-zlib-includes="$(STAGING_DIR)/usr/include" --shared-zlib-libpath="$(STAGING_DIR)/usr/lib" \
      --v8-options="--max_old_space_size=20 --initial_old_space_size=4 --max_semi_space_size=2 --max_executable_size=5" \
      --without-snapshot --with-mips-arch-variant=r2 --with-mips-fpu-mode=fp32 --with-mips-float-abi=soft
    
  22. huseyinkozan commented on Sep 9, 2016

    @huseyinkozan

    Hmm, sorry. Miss understand.
    They are built, but I thing they built against target, not host (or vice versa).

  23. srl295 commented on Sep 9, 2016

    @srl295
    Member

    ICU needs to link and run code on both host and target. Can you make sure the libraries are available on both?

  24. huseyinkozan commented on Sep 9, 2016

    @huseyinkozan

    Yes, I have both at host and target.

    I tried two different ways; --with-intl=sysyem-icu, and exporting *_host variables with default icu options. One of them fails at genccode, other fails at execinfo.h. Dont remember which one is.

  25. huseyinkozan commented on Sep 10, 2016

    @huseyinkozan

    Found execinfo.h issue : #8233. Trying ...

  26. srl295 commented on Sep 10, 2016

    @srl295
    Member
  27. huseyinkozan commented on Sep 10, 2016

    @huseyinkozan

    Yes. I give up with icu. I built with --without-intl option. My trials are here :
    https://github.com/huseyinkozan/openwrt-tessel/tree/node-6.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

armIssues and PRs related to the ARM architecture.buildIssues and PRs related to Node.js builds or CI infrastructure.confirmed-bugIssues and PRs for confirmed bugs.i18n-apiIssues and PRs related to Node.js internationalization support.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions