Repository: node
Issue: Issue in cross compiling node-v12.18.3 
Labels: build

### Version

12.18.3 

### Platform

Linux zynq-generic 4.9.0-xilinx #20 SMP PREEMPT Tue Apr 23 10:53:18 IST 2019 armv7l GNU/Linux

### Subsystem

_No response_

### What steps will reproduce the bug?

I am facing issue while cross compiling version 12.18.3.
below are steps,
export PATH=$PATH:/opt/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/
export AR_target=arm-linux-gnueabihf-ar
export CC_target=arm-linux-gnueabihf-gcc
export CXX_target=arm-linux-gnueabihf-g++
export LINK_target=arm-linux-gnueabihf-g++
python3 configure.py  --without-npm --without-ssl --without-intl --without-snapshot --dest-cpu=arm --dest-os=linux --debug
make

then following error is occured,

LD_LIBRARY_PATH=/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/lib.host:/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated; python ../../deps/v8/tools/run.py "/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/bytecode_builtins_list_generator" "/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h"
Traceback (most recent call last):
  File "../../deps/v8/tools/run.py", line 12, in <module>
    sys.exit(subprocess.call(sys.argv[1:]))
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
**OSError: [Errno 8] Exec format error: '/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/bytecode_builtins_list_generator'**
make[1]: *** [tools/v8_gypfiles/generate_bytecode_builtins_list.target.mk:13: /home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h] Error 1


Below are details of nodejs/out/makefile

CC.target ?= arm-linux-gnueabihf-gcc
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= arm-linux-gnueabihf-g++
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= arm-linux-gnueabihf-g++
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
LINK ?= $(CXX.target)
CC.host ?= gcc
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= g++
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= $(CXX.host)
LDFLAGS.host ?=
AR.host ?= ar

further found that file "bytecode_builtins_list_generator" is getting compiled with target compiler not with host. 
when i execute command **file bytecode_builtins_list_generator** i found below details,

bytecode_builtins_list_generator: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=966f03a5137585e3b17cb0102b192b5a227b3639, with debug_info, not stripped

my host system is 64 bit Ubuntu 20.

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

Always

### What is the expected behavior?

code should get compiled without any issue

### What do you see instead?

LD_LIBRARY_PATH=/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/lib.host:/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/lib.target:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH; cd ../tools/v8_gypfiles; mkdir -p /home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated; python ../../deps/v8/tools/run.py "/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/bytecode_builtins_list_generator" "/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h"
Traceback (most recent call last):
  File "../../deps/v8/tools/run.py", line 12, in <module>
    sys.exit(subprocess.call(sys.argv[1:]))
  File "/usr/lib/python3.8/subprocess.py", line 340, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
**OSError: [Errno 8] Exec format error: '/home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/bytecode_builtins_list_generator'**
make[1]: *** [tools/v8_gypfiles/generate_bytecode_builtins_list.target.mk:13: /home/rahul/Desktop/Rahul/nodejs/node-v12.18.3/out/Release/obj/gen/generate-bytecode-output-root/builtins-generated/bytecodes-builtins-list.h] Error 1

### Additional information

_No response_