mirror of
https://gitee.com/open-loongarch/buildroot-2024.08.git
synced 2026-10-25 20:57:12 +08:00
first commit: base 2024.08
Signed-off-by: maoxiaochuan <maoxiaochuan@loongson.cn>
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
From 1f6c55d7318e7075169004b4314708f4766ec193 Mon Sep 17 00:00:00 2001
|
||||
From: Adam Duskett <aduskett@gmail.com>
|
||||
Date: Mon, 27 Sep 2021 12:55:09 -0700
|
||||
Subject: [PATCH] add qemu-wrapper support
|
||||
|
||||
V8's JIT infrastructure requires binaries such as mksnapshot and mkpeephole to
|
||||
be run in the host during the build. However, these binaries must have the
|
||||
same bit-width as the target (e.g. a x86_64 host targeting ARMv6 needs to
|
||||
produce a 32-bit binary). To work around this issue, cross-compile the
|
||||
binaries for the target and run them on the host with QEMU, much like
|
||||
gobject-introspection.
|
||||
|
||||
However, for the host-variant we do not want to use a
|
||||
qemu-wrapper, so add @MAYBE_WRAPPER@ to the needed files and sed the path to
|
||||
the qemu-wrapper on target builds, and remove @MAYBE_WRAPPER@ entirely on
|
||||
host-builds.
|
||||
|
||||
[Adam: Update for 20.9.0]
|
||||
Signed-off-by: Adam Duskett <aduskett@gmail.com>
|
||||
---
|
||||
node.gyp | 6 ++++--
|
||||
tools/v8_gypfiles/v8.gyp | 10 +++++-----
|
||||
2 files changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/node.gyp b/node.gyp
|
||||
index 97cdbb531d..db5cf51ce6 100644
|
||||
--- a/node.gyp
|
||||
+++ b/node.gyp
|
||||
@@ -662,7 +662,7 @@
|
||||
'action_name': 'node_mksnapshot',
|
||||
'process_outputs_as_sources': 1,
|
||||
'inputs': [
|
||||
- '<(node_mksnapshot_exec)',
|
||||
+ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
|
||||
'<(node_snapshot_main)',
|
||||
],
|
||||
'outputs': [
|
||||
@@ -682,7 +682,7 @@
|
||||
'action_name': 'node_mksnapshot',
|
||||
'process_outputs_as_sources': 1,
|
||||
'inputs': [
|
||||
- '<(node_mksnapshot_exec)',
|
||||
+ @MAYBE_WRAPPER@ '<(node_mksnapshot_exec)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/node_snapshot.cc',
|
||||
@@ -966,6 +966,7 @@
|
||||
'action_name': 'node_js2c',
|
||||
'process_outputs_as_sources': 1,
|
||||
'inputs': [
|
||||
+ @MAYBE_WRAPPER@
|
||||
'<(node_js2c_exec)',
|
||||
'<@(library_files)',
|
||||
'<@(deps_files)',
|
||||
@@ -975,6 +976,7 @@
|
||||
'<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',
|
||||
],
|
||||
'action': [
|
||||
+ @MAYBE_WRAPPER@
|
||||
'<(node_js2c_exec)',
|
||||
'<@(_outputs)',
|
||||
'lib',
|
||||
diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp
|
||||
index 73099a03e4..88ca91efb4 100644
|
||||
--- a/tools/v8_gypfiles/v8.gyp
|
||||
+++ b/tools/v8_gypfiles/v8.gyp
|
||||
@@ -81,7 +81,7 @@
|
||||
{
|
||||
'action_name': 'run_torque_action',
|
||||
'inputs': [ # Order matters.
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
|
||||
'<@(torque_files)',
|
||||
],
|
||||
'outputs': [
|
||||
@@ -112,7 +112,7 @@
|
||||
'<@(torque_outputs_inc)',
|
||||
],
|
||||
'action': [
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)torque<(EXECUTABLE_SUFFIX)',
|
||||
'-o', '<(SHARED_INTERMEDIATE_DIR)/torque-generated',
|
||||
'-v8-root', '<(V8_ROOT)',
|
||||
'<@(torque_files_without_v8_root)',
|
||||
@@ -224,7 +224,7 @@
|
||||
{
|
||||
'action_name': 'generate_bytecode_builtins_list_action',
|
||||
'inputs': [
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)bytecode_builtins_list_generator<(EXECUTABLE_SUFFIX)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(generate_bytecode_builtins_list_output)',
|
||||
@@ -401,7 +401,7 @@
|
||||
],
|
||||
},
|
||||
'inputs': [
|
||||
- '<(mksnapshot_exec)',
|
||||
+ @MAYBE_WRAPPER@ '<(mksnapshot_exec)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(INTERMEDIATE_DIR)/snapshot.cc',
|
||||
@@ -1660,7 +1660,7 @@
|
||||
{
|
||||
'action_name': 'run_gen-regexp-special-case_action',
|
||||
'inputs': [
|
||||
- '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
|
||||
+ @MAYBE_WRAPPER@ '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)gen-regexp-special-case<(EXECUTABLE_SUFFIX)',
|
||||
],
|
||||
'outputs': [
|
||||
'<(SHARED_INTERMEDIATE_DIR)/src/regexp/special-case.cc',
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From f1a15cea9a47d0a9b0ae78fb22fef3a268e355ad Mon Sep 17 00:00:00 2001
|
||||
From: Martin Bark <martin@barkynet.com>
|
||||
Date: Sat, 4 Mar 2017 20:41:40 +0000
|
||||
Subject: [PATCH] check if uclibc has backtrace support
|
||||
|
||||
Signed-off-by: Martin Bark <martin@barkynet.com>
|
||||
---
|
||||
deps/v8/src/base/debug/stack_trace_posix.cc | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/deps/v8/src/base/debug/stack_trace_posix.cc b/deps/v8/src/base/debug/stack_trace_posix.cc
|
||||
index 270f1ca4e0..5227e88671 100644
|
||||
--- a/deps/v8/src/base/debug/stack_trace_posix.cc
|
||||
+++ b/deps/v8/src/base/debug/stack_trace_posix.cc
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
-#if V8_LIBC_GLIBC || V8_LIBC_BSD || V8_LIBC_UCLIBC || V8_OS_SOLARIS
|
||||
+#if V8_LIBC_GLIBC || V8_LIBC_BSD || ( V8_LIBC_UCLIBC && __UCLIBC_HAS_BACKTRACE__ ) || V8_OS_SOLARIS
|
||||
#define HAVE_EXECINFO_H 1
|
||||
#endif
|
||||
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From af47d317e5ae12978c1cdc40627008ada144f98b Mon Sep 17 00:00:00 2001
|
||||
From: Min RK <benjaminrk@gmail.com>
|
||||
Date: Fri, 19 Feb 2021 11:57:04 +0100
|
||||
Subject: [PATCH] include obj name in shared intermediate
|
||||
|
||||
avoids duplicate ninja rules for v8 used in host and target
|
||||
|
||||
From: https://github.com/minrk/node/commit/5e533cb943eef68b270f55f0cba02c0ec67c699d
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
tools/gyp/pylib/gyp/generator/ninja.py | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/gyp/pylib/gyp/generator/ninja.py b/tools/gyp/pylib/gyp/generator/ninja.py
|
||||
index 3db3771ac9..2e0a021703 100644
|
||||
--- a/tools/gyp/pylib/gyp/generator/ninja.py
|
||||
+++ b/tools/gyp/pylib/gyp/generator/ninja.py
|
||||
@@ -42,7 +42,7 @@ generator_default_variables = {
|
||||
# the start of a string, while $| is used for variables that can appear
|
||||
# anywhere in a string.
|
||||
"INTERMEDIATE_DIR": "$!INTERMEDIATE_DIR",
|
||||
- "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/gen",
|
||||
+ "SHARED_INTERMEDIATE_DIR": "$!PRODUCT_DIR/$|OBJ/gen",
|
||||
"PRODUCT_DIR": "$!PRODUCT_DIR",
|
||||
"CONFIGURATION_NAME": "$|CONFIGURATION_NAME",
|
||||
# Special variables that may be used by gyp 'rule' targets.
|
||||
@@ -285,6 +285,12 @@ class NinjaWriter:
|
||||
CONFIGURATION_NAME = "$|CONFIGURATION_NAME"
|
||||
path = path.replace(CONFIGURATION_NAME, self.config_name)
|
||||
|
||||
+ obj = "obj"
|
||||
+ if self.toolset != "target":
|
||||
+ obj += "." + self.toolset
|
||||
+
|
||||
+ path = path.replace("$|OBJ", obj)
|
||||
+
|
||||
return path
|
||||
|
||||
def ExpandRuleVariables(self, path, root, dirname, source, ext, name):
|
||||
--
|
||||
2.37.3
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
From a31425bdfcb5d695ab25c3d295898326784cffec Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Sun, 25 Sep 2022 11:10:06 +0200
|
||||
Subject: [PATCH] lib/internal/modules/cjs/loader.js: adjust default path to
|
||||
search modules
|
||||
|
||||
NPM installs modules in /usr/lib/node_modules/, but by default NodeJS
|
||||
searches for them only in /usr/lib/node/. We could also set the
|
||||
NODE_PATH environment variable, but it is more convienient to have
|
||||
NodeJS configured by default to find modules where they are installed.
|
||||
|
||||
This issue is discussed at
|
||||
https://stackoverflow.com/questions/15636367/nodejs-require-a-global-module-package.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
lib/internal/modules/cjs/loader.js | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
|
||||
index f1971c40a4..5fe3884156 100644
|
||||
--- a/lib/internal/modules/cjs/loader.js
|
||||
+++ b/lib/internal/modules/cjs/loader.js
|
||||
@@ -1378,7 +1378,8 @@ Module._initPaths = function() {
|
||||
path.resolve(process.execPath, '..') :
|
||||
path.resolve(process.execPath, '..', '..');
|
||||
|
||||
- const paths = [path.resolve(prefixDir, 'lib', 'node')];
|
||||
+ const paths = [path.resolve(prefixDir, 'lib', 'node'),
|
||||
+ path.resolve(prefixDir, 'lib', 'node_modules')];
|
||||
|
||||
if (homeDir) {
|
||||
ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries'));
|
||||
--
|
||||
2.37.3
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
config BR2_PACKAGE_NODEJS_SRC
|
||||
bool
|
||||
@@ -0,0 +1 @@
|
||||
../nodejs.hash
|
||||
@@ -0,0 +1,269 @@
|
||||
################################################################################
|
||||
#
|
||||
# nodejs-src
|
||||
#
|
||||
################################################################################
|
||||
|
||||
NODEJS_SRC_VERSION = $(NODEJS_COMMON_VERSION)
|
||||
NODEJS_SRC_SOURCE = $(NODEJS_COMMON_SOURCE)
|
||||
NODEJS_SRC_SITE = $(NODEJS_COMMON_SITE)
|
||||
NODEJS_SRC_DL_SUBDIR = nodejs
|
||||
|
||||
NODEJS_SRC_LICENSE = $(NODEJS_LICENSE)
|
||||
NODEJS_SRC_LICENSE_FILES = $(NODEJS_LICENSE_FILES)
|
||||
NODEJS_SRC_CPE_ID_VENDOR = $(NODEJS_CPE_ID_VENDOR)
|
||||
NODEJS_SRC_CPE_ID_PRODUCT = $(NODEJS_CPE_ID_PRODUCT)
|
||||
|
||||
HOST_NODEJS_SRC_PROVIDES = host-nodejs
|
||||
|
||||
NODEJS_SRC_DEPENDENCIES = \
|
||||
host-ninja \
|
||||
host-pkgconf \
|
||||
host-python3 \
|
||||
host-qemu \
|
||||
c-ares \
|
||||
libuv \
|
||||
nghttp2 \
|
||||
zlib \
|
||||
$(call qstrip,$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL_DEPS))
|
||||
HOST_NODEJS_SRC_DEPENDENCIES = \
|
||||
host-icu \
|
||||
host-libopenssl \
|
||||
host-ninja \
|
||||
host-pkgconf \
|
||||
host-python3 \
|
||||
host-zlib
|
||||
NODEJS_SRC_INSTALL_STAGING = YES
|
||||
|
||||
NODEJS_SRC_CONF_OPTS = \
|
||||
--shared-zlib \
|
||||
--shared-cares \
|
||||
--shared-libuv \
|
||||
--shared-nghttp2 \
|
||||
--cross-compiling \
|
||||
--dest-os=linux \
|
||||
--ninja
|
||||
|
||||
HOST_NODEJS_SRC_MAKE_OPTS = \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
CXXFLAGS="$(HOST_NODEJS_SRC_CXXFLAGS)" \
|
||||
LDFLAGS.host="$(HOST_LDFLAGS)" \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
JOBS=$(PARALLEL_JOBS)
|
||||
|
||||
NODEJS_SRC_MAKE_OPTS = \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
NO_LOAD=cctest.target.mk \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LDFLAGS="$(NODEJS_SRC_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)" \
|
||||
JOBS=$(PARALLEL_JOBS)
|
||||
|
||||
# nodejs's build system uses python which can be a symlink to an unsupported
|
||||
# python version (e.g. python 3.10 with nodejs 14.18.1). We work around this by
|
||||
# forcing host-python3 early in the PATH, via a python->python3 symlink.
|
||||
define NODEJS_SRC_PYTHON3_SYMLINK
|
||||
mkdir -p $(@D)/bin
|
||||
ln -sf $(HOST_DIR)/bin/python3 $(@D)/bin/python
|
||||
endef
|
||||
HOST_NODEJS_SRC_PRE_CONFIGURE_HOOKS += NODEJS_SRC_PYTHON3_SYMLINK
|
||||
NODEJS_SRC_PRE_CONFIGURE_HOOKS += NODEJS_SRC_PYTHON3_SYMLINK
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
NODEJS_SRC_DEPENDENCIES += openssl
|
||||
NODEJS_SRC_CONF_OPTS += --shared-openssl
|
||||
else
|
||||
NODEJS_SRC_CONF_OPTS += --without-ssl
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ICU),y)
|
||||
NODEJS_SRC_DEPENDENCIES += icu
|
||||
NODEJS_SRC_CONF_OPTS += --with-intl=system-icu
|
||||
else
|
||||
NODEJS_SRC_CONF_OPTS += --with-intl=none
|
||||
endif
|
||||
|
||||
ifneq ($(BR2_PACKAGE_NODEJS_NPM),y)
|
||||
NODEJS_SRC_CONF_OPTS += --without-npm
|
||||
endif
|
||||
|
||||
define HOST_NODEJS_SRC_CONFIGURE_CMDS
|
||||
cd $(@D); \
|
||||
$(HOST_CONFIGURE_OPTS) \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_DIR)/bin/python3 configure.py \
|
||||
--prefix=$(HOST_DIR) \
|
||||
--shared-openssl \
|
||||
--shared-openssl-includes=$(HOST_DIR)/include \
|
||||
--shared-openssl-libpath=$(HOST_DIR)/lib \
|
||||
--shared-zlib \
|
||||
--no-cross-compiling \
|
||||
--with-intl=system-icu \
|
||||
--ninja
|
||||
endef
|
||||
|
||||
HOST_NODEJS_SRC_CXXFLAGS = $(HOST_CXXFLAGS)
|
||||
|
||||
define HOST_NODEJS_SRC_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(HOST_NODEJS_SRC_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_NODEJS_COREPACK),y)
|
||||
define HOST_NODEJS_SRC_ENABLE_COREPACK
|
||||
$(COREPACK) enable
|
||||
endef
|
||||
endif
|
||||
|
||||
define HOST_NODEJS_SRC_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
$(HOST_NODEJS_SRC_MAKE_OPTS)
|
||||
$(HOST_NODEJS_SRC_ENABLE_COREPACK)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_i386),y)
|
||||
NODEJS_SRC_CPU = ia32
|
||||
else ifeq ($(BR2_x86_64),y)
|
||||
NODEJS_SRC_CPU = x64
|
||||
else ifeq ($(BR2_mips),y)
|
||||
NODEJS_SRC_CPU = mips
|
||||
else ifeq ($(BR2_mipsel),y)
|
||||
NODEJS_SRC_CPU = mipsel
|
||||
else ifeq ($(BR2_arm),y)
|
||||
NODEJS_SRC_CPU = arm
|
||||
# V8 needs to know what floating point ABI the target is using.
|
||||
NODEJS_SRC_ARM_FP = $(GCC_TARGET_FLOAT_ABI)
|
||||
# it also wants to know which FPU to use, but only has support for
|
||||
# vfp, vfpv3, vfpv3-d16 and neon.
|
||||
ifeq ($(BR2_ARM_FPU_VFPV2),y)
|
||||
NODEJS_SRC_ARM_FPU = vfp
|
||||
# vfpv4 is a superset of vfpv3
|
||||
else ifeq ($(BR2_ARM_FPU_VFPV3)$(BR2_ARM_FPU_VFPV4),y)
|
||||
NODEJS_SRC_ARM_FPU = vfpv3
|
||||
# vfpv4-d16 is a superset of vfpv3-d16
|
||||
else ifeq ($(BR2_ARM_FPU_VFPV3D16)$(BR2_ARM_FPU_VFPV4D16),y)
|
||||
NODEJS_SRC_ARM_FPU = vfpv3-d16
|
||||
else ifeq ($(BR2_ARM_FPU_NEON),y)
|
||||
NODEJS_SRC_ARM_FPU = neon
|
||||
endif
|
||||
else ifeq ($(BR2_aarch64),y)
|
||||
NODEJS_SRC_CPU = arm64
|
||||
endif
|
||||
|
||||
# MIPS architecture specific options
|
||||
ifeq ($(BR2_mips)$(BR2_mipsel),y)
|
||||
ifeq ($(BR2_MIPS_CPU_MIPS32R6),y)
|
||||
NODEJS_SRC_MIPS_ARCH_VARIANT = r6
|
||||
NODEJS_SRC_MIPS_FPU_MODE = fp64
|
||||
else ifeq ($(BR2_MIPS_CPU_MIPS32R2),y)
|
||||
NODEJS_SRC_MIPS_ARCH_VARIANT = r2
|
||||
else ifeq ($(BR2_MIPS_CPU_MIPS32),y)
|
||||
NODEJS_SRC_MIPS_ARCH_VARIANT = r1
|
||||
endif
|
||||
endif
|
||||
|
||||
NODEJS_SRC_LDFLAGS = $(TARGET_LDFLAGS)
|
||||
|
||||
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
||||
NODEJS_SRC_LDFLAGS += -latomic
|
||||
endif
|
||||
|
||||
# V8's JIT infrastructure requires binaries such as mksnapshot and
|
||||
# mkpeephole to be run in the host during the build. However, these
|
||||
# binaries must have the same bit-width as the target (e.g. a x86_64
|
||||
# host targeting ARMv6 needs to produce a 32-bit binary). To work around this
|
||||
# issue, cross-compile the binaries for the target and run them on the
|
||||
# host with QEMU, much like gobject-introspection.
|
||||
define NODEJS_SRC_INSTALL_V8_QEMU_WRAPPER
|
||||
$(INSTALL) -D -m 755 $(NODEJS_SRC_PKGDIR)/v8-qemu-wrapper.in \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
$(SED) "s%@QEMU_USERMODE_ARGS@%$(call qstrip,$(BR2_PACKAGE_HOST_QEMU_USER_MODE_ARGS))%g" \
|
||||
$(@D)/out/Release/v8-qemu-wrapper
|
||||
endef
|
||||
NODEJS_SRC_PRE_CONFIGURE_HOOKS += NODEJS_SRC_INSTALL_V8_QEMU_WRAPPER
|
||||
|
||||
define NODEJS_SRC_WRAPPER_FIXUP
|
||||
$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/node.gyp
|
||||
$(SED) "s%@MAYBE_WRAPPER@%'<(PRODUCT_DIR)/v8-qemu-wrapper',%g" $(@D)/tools/v8_gypfiles/v8.gyp
|
||||
endef
|
||||
NODEJS_SRC_PRE_CONFIGURE_HOOKS += NODEJS_SRC_WRAPPER_FIXUP
|
||||
|
||||
# Do not run the qemu-wrapper for the host build.
|
||||
define HOST_NODEJS_SRC_WRAPPER_FIXUP
|
||||
$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/node.gyp
|
||||
$(SED) "s%@MAYBE_WRAPPER@%%g" $(@D)/tools/v8_gypfiles/v8.gyp
|
||||
endef
|
||||
HOST_NODEJS_SRC_PRE_CONFIGURE_HOOKS += HOST_NODEJS_SRC_WRAPPER_FIXUP
|
||||
|
||||
define NODEJS_SRC_CONFIGURE_CMDS
|
||||
(cd $(@D); \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
PATH=$(@D)/bin:$(BR_PATH) \
|
||||
LDFLAGS="$(NODEJS_SRC_LDFLAGS)" \
|
||||
LD="$(TARGET_CXX)" \
|
||||
PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(HOST_DIR)/bin/python3 configure.py \
|
||||
--prefix=/usr \
|
||||
--dest-cpu=$(NODEJS_SRC_CPU) \
|
||||
$(if $(NODEJS_SRC_ARM_FP),--with-arm-float-abi=$(NODEJS_SRC_ARM_FP)) \
|
||||
$(if $(NODEJS_SRC_ARM_FPU),--with-arm-fpu=$(NODEJS_SRC_ARM_FPU)) \
|
||||
$(if $(NODEJS_SRC_MIPS_ARCH_VARIANT),--with-mips-arch-variant=$(NODEJS_SRC_MIPS_ARCH_VARIANT)) \
|
||||
$(if $(NODEJS_SRC_MIPS_FPU_MODE),--with-mips-fpu-mode=$(NODEJS_SRC_MIPS_FPU_MODE)) \
|
||||
$(NODEJS_SRC_CONF_OPTS) \
|
||||
)
|
||||
endef
|
||||
|
||||
define NODEJS_SRC_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) \
|
||||
$(NODEJS_SRC_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
#
|
||||
# Build the list of modules to install.
|
||||
#
|
||||
NODEJS_SRC_MODULES_LIST= $(call qstrip,\
|
||||
$(BR2_PACKAGE_NODEJS_MODULES_ADDITIONAL))
|
||||
|
||||
#
|
||||
# We can only call NPM if there's something to install.
|
||||
#
|
||||
ifneq ($(NODEJS_SRC_MODULES_LIST),)
|
||||
NODEJS_SRC_DEPENDENCIES += host-nodejs
|
||||
define NODEJS_SRC_INSTALL_MODULES
|
||||
# If you're having trouble with module installation, adding -d to the
|
||||
# npm install call below and setting npm_config_rollback=false can both
|
||||
# help in diagnosing the problem.
|
||||
$(NPM) install -g $(NODEJS_SRC_MODULES_LIST)
|
||||
endef
|
||||
|
||||
# Exclude prebuilt binaries with different architectures and OS from check
|
||||
NODEJS_SRC_BIN_ARCH_EXCLUDE = /usr/lib/node_modules/
|
||||
endif
|
||||
|
||||
define NODEJS_SRC_INSTALL_STAGING_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(STAGING_DIR) \
|
||||
$(NODEJS_SRC_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define NODEJS_SRC_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) PYTHON=$(HOST_DIR)/bin/python3 \
|
||||
$(MAKE) -C $(@D) install \
|
||||
DESTDIR=$(TARGET_DIR) \
|
||||
$(NODEJS_SRC_MAKE_OPTS)
|
||||
$(NODEJS_SRC_INSTALL_MODULES)
|
||||
endef
|
||||
|
||||
# node.js configure is a Python script and does not use autotools
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-generic-package))
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
# Pass -r to qemu-user as to trick glibc into not errorings out if the host kernel
|
||||
# is older than the target kernel.
|
||||
exec @QEMU_USER@ -r @TOOLCHAIN_HEADERS_VERSION@ \
|
||||
@QEMU_USERMODE_ARGS@ \
|
||||
-L "${STAGING_DIR}/" \
|
||||
-E LD_LIBRARY_PATH="${STAGING_DIR}/lib:${STAGING_DIR}/usr/lib/" \
|
||||
"$@"
|
||||
|
||||
Reference in New Issue
Block a user