Skip to content

Commit 8681c83

Browse files
shipujinBethGriggs
authored andcommittedJan 24, 2022
build: add loong64 configure
PR-URL: #41323 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Mary Marchini <[email protected]>
1 parent f6b5b8d commit 8681c83

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed
 

‎configure.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
4848
'android', 'aix', 'cloudabi')
4949
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el', 'ppc',
50-
'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x', 'riscv64')
50+
'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x', 'riscv64',
51+
'loong64')
5152
valid_arm_float_abi = ('soft', 'softfp', 'hard')
5253
valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon')
5354
valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx')
@@ -1074,6 +1075,7 @@ def host_arch_cc():
10741075
'__x86_64__' : 'x64',
10751076
'__s390x__' : 's390x',
10761077
'__riscv' : 'riscv',
1078+
'__loongarch64': 'loong64',
10771079
}
10781080

10791081
rtn = 'ia32' # default

‎tools/v8_gypfiles/toolchain.gypi

+5
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@
280280
'CAN_USE_FPU_INSTRUCTIONS'
281281
],
282282
}],
283+
['v8_target_arch=="loong64"', {
284+
'defines': [
285+
'V8_TARGET_ARCH_LOONG64',
286+
],
287+
}],
283288
['v8_target_arch=="s390x"', {
284289
'defines': [
285290
'V8_TARGET_ARCH_S390',

‎tools/v8_gypfiles/v8.gyp

+21-1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,11 @@
292292
'<(V8_ROOT)/src/builtins/riscv64/builtins-riscv64.cc',
293293
],
294294
}],
295+
['v8_target_arch=="loong64" or v8_target_arch=="loong64"', {
296+
'sources': [
297+
'<(V8_ROOT)/src/builtins/loong64/builtins-loong64.cc',
298+
],
299+
}],
295300
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
296301
'sources': [
297302
'<(V8_ROOT)/src/builtins/mips64/builtins-mips64.cc',
@@ -647,6 +652,11 @@
647652
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
648653
],
649654
}],
655+
['v8_target_arch=="loong64"', {
656+
'sources': [
657+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"loong64\\".*?sources \\+= ")',
658+
],
659+
}],
650660
],
651661
},
652662
}, # v8_internal_headers
@@ -875,6 +885,11 @@
875885
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
876886
],
877887
}],
888+
['v8_target_arch=="loong64"', {
889+
'sources': [
890+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"loong64\\".*?sources \\+= ")',
891+
],
892+
}],
878893
['OS=="win"', {
879894
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
880895
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
@@ -940,7 +955,7 @@
940955
}],
941956
# Platforms that don't have Compare-And-Swap (CAS) support need to link atomic library
942957
# to implement atomic memory access
943-
['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm", "riscv64"]', {
958+
['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm", "riscv64", "loong64"]', {
944959
'link_settings': {
945960
'libraries': ['-latomic', ],
946961
},
@@ -1611,6 +1626,11 @@
16111626
'<(V8_ROOT)/src/heap/base/asm/riscv64/push_registers_asm.cc',
16121627
],
16131628
}],
1629+
['_toolset == "host" and host_arch == "loong64" or _toolset == "target" and target_arch=="loong64"', {
1630+
'sources': [
1631+
'<(V8_ROOT)/src/heap/base/asm/loong64/push_registers_asm.cc',
1632+
],
1633+
}],
16141634
]
16151635
}],
16161636
['OS=="win"', {

0 commit comments

Comments
 (0)
Please sign in to comment.