nodejs: don't force cross-compilation in native builds

By not forcing the cross-compile build logic in native builds the build
is a _lot_ faster.  Walltime in buildstats-diff on my machine:

  nodejs-native    do_compile  -475.6s   -41.2%    1153.4s -> 677.7s

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Ross Burton
2023-02-20 15:46:12 +00:00
committed by Khem Raj
parent 1ed7324c57
commit fcddf51b7c
@@ -137,18 +137,22 @@ addtask create_v8_qemu_wrapper after do_configure before do_compile
LDFLAGS:append:x86 = " -latomic" LDFLAGS:append:x86 = " -latomic"
CROSS_FLAGS = "--cross-compiling"
CROSS_FLAGS:class-native = "--no-cross-compiling"
# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi # Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround gypi
do_configure () { do_configure () {
export LD="${CXX}" export LD="${CXX}"
GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES GYP_DEFINES="${GYP_DEFINES}" export GYP_DEFINES
# $TARGET_ARCH settings don't match --dest-cpu settings # $TARGET_ARCH settings don't match --dest-cpu settings
python3 configure.py --verbose --prefix=${prefix} --cross-compiling \ python3 configure.py --verbose --prefix=${prefix} \
--shared-openssl \ --shared-openssl \
--without-dtrace \ --without-dtrace \
--without-etw \ --without-etw \
--dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \ --dest-cpu="${@map_nodejs_arch(d.getVar('TARGET_ARCH'), d)}" \
--dest-os=linux \ --dest-os=linux \
--libdir=${baselib} \ --libdir=${baselib} \
${CROSS_FLAGS} \
${ARCHFLAGS} \ ${ARCHFLAGS} \
${PACKAGECONFIG_CONFARGS} ${PACKAGECONFIG_CONFARGS}
} }