From 8681c837caef01ba0169581b8bcf85ae807db84c Mon Sep 17 00:00:00 2001 From: Shi Pujin Date: Wed, 19 Jan 2022 03:39:50 +0800 Subject: [PATCH] build: add loong64 configure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/41323 Reviewed-By: Michaël Zasso Reviewed-By: Tobias Nießen Reviewed-By: Michael Dawson Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Mary Marchini --- configure.py | 4 +++- tools/v8_gypfiles/toolchain.gypi | 5 +++++ tools/v8_gypfiles/v8.gyp | 22 +++++++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index dcdd0c9013b79f..02c8e0c5a7affc 100755 --- a/configure.py +++ b/configure.py @@ -47,7 +47,8 @@ valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android', 'aix', 'cloudabi') valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc', - 'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x', 'riscv64') + 'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x', 'riscv64', + 'loong64') valid_arm_float_abi = ('soft', 'softfp', 'hard') valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon') valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx') @@ -1074,6 +1075,7 @@ def host_arch_cc(): '__x86_64__' : 'x64', '__s390x__' : 's390x', '__riscv' : 'riscv', + '__loongarch64': 'loong64', } rtn = 'ia32' # default diff --git a/tools/v8_gypfiles/toolchain.gypi b/tools/v8_gypfiles/toolchain.gypi index d10525af57c7f2..d66672d43f12a7 100644 --- a/tools/v8_gypfiles/toolchain.gypi +++ b/tools/v8_gypfiles/toolchain.gypi @@ -280,6 +280,11 @@ 'CAN_USE_FPU_INSTRUCTIONS' ], }], + ['v8_target_arch=="loong64"', { + 'defines': [ + 'V8_TARGET_ARCH_LOONG64', + ], + }], ['v8_target_arch=="s390x"', { 'defines': [ 'V8_TARGET_ARCH_S390', diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index 00306045c9d51e..0ba58b8d14a1d1 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -292,6 +292,11 @@ '<(V8_ROOT)/src/builtins/riscv64/builtins-riscv64.cc', ], }], + ['v8_target_arch=="loong64" or v8_target_arch=="loong64"', { + 'sources': [ + '<(V8_ROOT)/src/builtins/loong64/builtins-loong64.cc', + ], + }], ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', { 'sources': [ '<(V8_ROOT)/src/builtins/mips64/builtins-mips64.cc', @@ -647,6 +652,11 @@ '