From 11ff3859746a535f776dd742d71bc6a9cb372dec Mon Sep 17 00:00:00 2001 From: Shi Pujin Date: Fri, 24 Dec 2021 11:40:49 +0800 Subject: [PATCH] build: add loong64 configure --- 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 991da107f62f08..80e7f489ae33a4 100755 --- a/configure.py +++ b/configure.py @@ -53,7 +53,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') @@ -1064,6 +1065,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 @@ '