build: add loong64 configure

PR-URL: https://github.com/nodejs/node/pull/41323
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
This commit is contained in:
Shi Pujin 2022-01-19 03:39:50 +08:00 committed by GitHub
parent a199387f04
commit 81e88f27b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View File

@ -47,7 +47,8 @@ parser = argparse.ArgumentParser()
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')
@ -1075,6 +1076,7 @@ def host_arch_cc():
'__x86_64__' : 'x64',
'__s390x__' : 's390x',
'__riscv' : 'riscv',
'__loongarch64': 'loong64',
}
rtn = 'ia32' # default

View File

@ -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',

View File

@ -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 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="loong64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"loong64\\".*?sources \\+= ")',
],
}],
],
},
}, # v8_internal_headers
@ -875,6 +885,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="loong64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"loong64\\".*?sources \\+= ")',
],
}],
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
@ -940,7 +955,7 @@
}],
# Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
# to implement atomic memory access
['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm", "riscv64"]', {
['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm", "riscv64", "loong64"]', {
'link_settings': {
'libraries': ['-latomic', ],
},
@ -1611,6 +1626,11 @@
'<(V8_ROOT)/src/heap/base/asm/riscv64/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "loong64" or _toolset == "target" and target_arch=="loong64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/loong64/push_registers_asm.cc',
],
}],
]
}],
['OS=="win"', {