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

arm and LD_LIBRARY_PATH (ld-linux-armhf.so.3: No such file or directory) #7770

Closed
xbolshe opened this issue Jul 17, 2016 · 13 comments
Closed
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.

Comments

@xbolshe
Copy link

xbolshe commented Jul 17, 2016

I make a cross-compiled version of NodeJS 6.3.0
Build machine: Ubuntu 14.10, Yocto poky
Target machine: Raspberry Pi2 (arm armv7a vfp thumb neon callconvention-hard vfpv4 cortexa7 vfp-vfpv4-neon)

Problem:
/lib/ld-linux-armhf.so.3: No such file or directory

It tries to find this library in the root of Build machine instead of defined sysroot directory.

Environment during a compilation:

| LD_LIBRARY_PATH=/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/lib.host:/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/icu; mkdir -p /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj/gen/icutmp; python icutrim.py -P "/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release" -D ../../deps/icu-small/source/data/in/icudt57l.dat --delete-tmp -T "/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj/gen/icutmp" -F icu_small.json -O icudt57l.dat -v -L en,root

Source of this environment: node-v6.3.0/out/tools/icu/icudata.target.mk

Same configuration works without problem for Target machine i586-poky-linux.

@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

It looks like the same issue: #7491 (comment)

@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

My investigation shows that displayed LD_LIBRARY_PATH is not LD_LIBRARY_PATH variable.
It is not a bug, but a feature to show a command before execution. But it confuses.

My problem (ld-linux-armhf.so.3: No such file or directory) is related with icupkg compiled for ARM and executed on x86 machine.

@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

Funny but ARM is selected on x86 build machine in Yocto environment:

*** do configure ***
Selected host_arch = arm
creating  ./icu_config.gypi
* Using ICU in deps/icu-small
creating  ./icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'arm_float_abi': 'hard',
                 'arm_fpu': 'neon',
                 'arm_thumb': 0,
                 'arm_version': '7',
                 'asan': 0,
                 'debug_devtools': 'node',
                 'gas_version': '2.25',
                 'host_arch': 'arm',
                 'icu_data_file': 'icudt57l.dat',
                 'icu_data_in': '../../deps/icu-small/source/data/in/icudt57l.dat',

If I run ./configure from a command line, host_arch = x64 is detected.

Need to add an option to setup host_arch for cross-compiling.

@ChALkeR ChALkeR added the arm Issues and PRs related to the ARM platform. label Jul 17, 2016
@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

After host_arch = x64 selection CC.host is still ARM:

CC.target ?= arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/sdd/raspi3/rpi-build/tmp/sysroots/raspberrypi2
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= arm-poky-linux-gnueabi-g++  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/sdd/raspi3/rpi-build/tmp/sysroots/raspberrypi2
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= $(LINK)
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)

# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)

# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= arm-poky-linux-gnueabi-gcc  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/sdd/raspi3/rpi-build/tmp/sysroots/raspberrypi2
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= arm-poky-linux-gnueabi-g++  -march=armv7-a -marm  -mthumb-interwork -mfloat-abi=hard -mfpu=neon-vfpv4 -mtune=cortex-a7 --sysroot=/sdd/raspi3/rpi-build/tmp/sysroots/raspberrypi2
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= $(CXX.host)
LDFLAGS.host ?=
AR.host ?= arm-poky-linux-gnueabi-ar

@mscdex mscdex added the build Issues and PRs related to build files or the CI. label Jul 17, 2016
@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

After applying a workaround have new problem with -m32 added somewere:

   g++ '-DV8_TARGET_ARCH_ARM' '-DCAN_USE_ARMV7_INSTRUCTIONS' '-DCAN_USE_VFP3_INSTRUCTIONS' '-DCAN_USE_VFP32DREGS' '-DCAN_USE_NEON' '-DENABLE_DISASSEMBLER' '-DV8_I18N_SUPPORT' '-DUCONFIG_NO_TRANSLITERATION=1' '-DUCONFIG_NO_SERVICE=1' '-DUCONFIG_NO_REGULAR_EXPRESSIONS=1' '-DU_ENABLE_DYLOAD=0' '-DU_STATIC_IMPLEMENTATION=1' '-DU_HAVE_STD_STRING=0' '-DUCONFIG_NO_BREAK_ITERATION=0' '-DUCONFIG_NO_LEGACY_CONVERSION=1' '-DUSE_EABI_HARDFLOAT=1' -I../deps/v8 -I../deps/icu-small/source/common -I../deps/icu-small/source/i18n -I../deps/icu-small/source/io -I../deps/icu-small/source/tools/toolutil  -pthread -Wall -Wextra -Wno-unused-parameter -fno-strict-aliasing -m32 -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++0x -MMD -MF /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/.deps//sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/mksnapshot/deps/v8/src/snapshot/mksnapshot.o.d.raw   -c -o /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/mksnapshot/deps/v8/src/snapshot/mksnapshot.o ../deps/v8/src/snapshot/mksnapshot.cc
|   g++ -pthread -rdynamic -m32  -o /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/mksnapshot -Wl,--start-group /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/mksnapshot/deps/v8/src/snapshot/mksnapshot.o /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/deps/v8/tools/gyp/libv8_base.a /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/deps/v8/tools/gyp/libv8_nosnapshot.a /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/deps/v8/tools/gyp/libv8_libplatform.a /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/deps/v8/tools/gyp/libv8_libbase.a /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a -Wl,--end-group -ldl -lrt
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(ucase.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(uchar.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(normlzr.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(uchriter.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(loclikely.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(cstring.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(propname.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(ucurr.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(uscript_props.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(uloc_tag.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(uloc.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(schriter.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(utrie2.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(umath.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(stringpiece.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(uniset_props.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(locmap.o)' is incompatible with i386 output

.......

| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(collationweights.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(collationruleparser.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(collationfastlatinbuilder.o)' is incompatible with i386 output
| /usr/bin/ld: i386:x86-64 architecture of input file `/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/tools/icu/libicutools.a(rbbistbl.o)' is incompatible with i386 output
| /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/deps/v8/tools/gyp/libv8_base.a(runtime-i18n.o): In function `v8::internal::Runtime_BreakIteratorAdoptText(int, v8::internal::Object**, v8::internal::Isolate*)':
| runtime-i18n.cc:(.text._ZN2v88internal30Runtime_BreakIteratorAdoptTextEiPPNS0_6ObjectEPNS0_7IsolateE+0x144): undefined reference to `icu_57::UMemory::operator new(unsigned int)'
| /sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/obj.host/deps/v8/tools/gyp/libv8_base.a(i18n.o): In function `v8::internal::(anonymous namespace)::CreateICUDateFormat(v8::internal::Isolate*, icu_57::Locale const&, v8::internal::Handle<v8::internal::JSObject>)':
| i18n.cc:(.text._ZN2v88internal12_GLOBAL__N_119CreateICUDateFormatEPNS0_7IsolateERKN6icu_576LocaleENS0_6HandleINS0_8JSObjectEEE+0x172): undefined reference to `icu_57::UMemory::operator new(unsigned int)'
| collect2: error: ld returned 1 exit status
| deps/v8/tools/gyp/mksnapshot.host.mk:161: recipe for target '/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/mksnapshot' failed
| make[1]: *** [/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out/Release/mksnapshot] Error 1
| rm _sdd_raspi3_rpi_build_tmp_work_cortexa7hf_vfp_vfpv4_neon_poky_linux_gnueabi_nodejs_6_3_0_r0_node_v6_3_0_deps_v8_inspector_platform_v8_inspector_v8_inspector_gyp_protocol_sources_target_generateV8InspectorProtocolBackendSources.intermediate
| make[1]: Leaving directory '/sdd/raspi3/rpi-build/tmp/work/cortexa7hf-vfp-vfpv4-neon-poky-linux-gnueabi/nodejs/6.3.0-r0/node-v6.3.0/out'

@bnoordhuis
Copy link
Member

Have you seen #7731?

@xbolshe
Copy link
Author

xbolshe commented Jul 17, 2016

@bnoordhuis It is not my case. My problem was related with V8.

Now I have:
pinode

I will try to make a pull request with changes to simplify cross-compiling process.

BR,
xbolshe

@bnoordhuis
Copy link
Member

Okay, I'll close the issue for now.

@xbolshe
Copy link
Author

xbolshe commented Jul 18, 2016

PR: #7787

@JavaCS3
Copy link

JavaCS3 commented Jan 17, 2018

I met the same issue when I cross compiling nodejs for arm. It use icupkg, however icupkg cannot run on x86 platform. So compilation is failed.

@bnoordhuis
Copy link
Member

Make sure the CC.host and CXX.host environment variables point to compilers for the host machine, not the target machine. make V=1 should print them when compiling icupkg.

@JavaCS3
Copy link

JavaCS3 commented Jan 18, 2018

@bnoordhuis How to set CC.hostand CXX.host to the host gcc and g++?
export CC_host="gcc" export CXX_host="g++"?

@amtash
Copy link

amtash commented Oct 31, 2018

have the same issue, but I'm trying to cross compile QT application for ARM7 lubuntu using raspberry pi3 toolchain via visual GDB, the executable generated and work normally, but the debugging through with break :(

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.
Projects
None yet
Development

No branches or pull requests

6 participants