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

arm64 cross-compile fails on amd64 #42643

Open
jgowdy opened this issue Apr 7, 2022 · 2 comments
Open

arm64 cross-compile fails on amd64 #42643

jgowdy opened this issue Apr 7, 2022 · 2 comments
Labels
arm Issues and PRs related to the ARM platform. build Issues and PRs related to build files or the CI.

Comments

@jgowdy
Copy link
Contributor

jgowdy commented Apr 7, 2022

Version

16.14.2

Platform

Linux bx.ee 5.4.0-89-generic #100-Ubuntu SMP Fri Sep 24 14:50:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

./configure --cross-compiling --dest-cpu arm64 --dest-os linux && make -j8

How often does it reproduce? Is there a required condition?

Every time

What is the expected behavior?

If cross-compiling is supported, I would expect that supplying the --cross-compiling flag would avoid attempting to run cross-compiled executables like icupkg on the host architecture which wouldn't rationally be expected to succeed.

What do you see instead?

  LD_LIBRARY_PATH=/home/jgowdy/projects/build-node-pac/node/out/Release/lib.host:/home/jgowdy/projects/build-node-pac/node/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/icu; mkdir -p /home/jgowdy/projects/build-node-pac/node/out/Release/obj/gen; "/home/jgowdy/projects/build-node-pac/node/out/Release/icupkg" -tl ../../deps/icu-tmp/icudt70l.dat "/home/jgowdy/projects/build-node-pac/node/out/Release/obj/gen/icudt70l.dat"
/bin/sh: 1: /home/jgowdy/projects/build-node-pac/node/out/Release/icupkg: Exec format error

Additional information

I did see #11931 however this isn't related to Android, just being able to cross-compile arm64 Linux binaries on amd64.

@jgowdy
Copy link
Contributor Author

jgowdy commented Apr 7, 2022

file /home/jgowdy/projects/build-node-pac/node/out/Release/icupkg
/home/jgowdy/projects/build-node-pac/node/out/Release/icupkg: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=22c61f6274ea8f86832526cdd4a88a782da323e9, for GNU/Linux 3.7.0, not stripped

@VoltrexKeyva VoltrexKeyva added build Issues and PRs related to build files or the CI. arm Issues and PRs related to the ARM platform. labels Apr 7, 2022
@bnoordhuis
Copy link
Member

icupkg's build rules say it should be built for the host arch, not the target arch.

The rules are in tools/icu/icu-generic.gyp. Note how icpupkg itself declares 'toolsets': ['host'] and its dependents list it as icupkg#host.

My guess is this is related to your local toolchains, it's not picking up the right one. Run make AR_host=.. CC_host=.. CXX_host=.. to point it to the host toolchain and AR_target=.. etc. for the target toolchain.

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

3 participants