Skip to content

Commit

Permalink
build: add riscv64 configure
Browse files Browse the repository at this point in the history
v8 had been add riscv64 backend, so i open this
pr to add riscv64 configure.

Refs: #37856

PR-URL: #37980
Fixes: #37856
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
  • Loading branch information
luyahan authored and BethGriggs committed Apr 15, 2021
1 parent 4183231 commit b634922
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
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')
'ppc64', 'x32','x64', 'x86', 'x86_64', 's390x', 'riscv64')
valid_arm_float_abi = ('soft', 'softfp', 'hard')
valid_arm_fpu = ('vfp', 'vfpv3', 'vfpv3-d16', 'neon')
valid_mips_arch = ('loongson', 'r1', 'r2', 'r6', 'rx')
Expand Down
7 changes: 7 additions & 0 deletions tools/v8_gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@
}],
],
}],
['v8_target_arch=="riscv64"', {
'defines': [
'V8_TARGET_ARCH_RISCV64',
'__riscv_xlen=64',
'CAN_USE_FPU_INSTRUCTIONS'
],
}],
['v8_target_arch=="s390x"', {
'defines': [
'V8_TARGET_ARCH_S390',
Expand Down
17 changes: 16 additions & 1 deletion tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@
'<(V8_ROOT)/src/builtins/mips/builtins-mips.cc',
],
}],
['v8_target_arch=="riscv64" or v8_target_arch=="riscv64"', {
'sources': [
'<(V8_ROOT)/src/builtins/riscv64/builtins-riscv64.cc',
],
}],
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
'sources': [
'<(V8_ROOT)/src/builtins/mips64/builtins-mips64.cc',
Expand Down Expand Up @@ -686,6 +691,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips\\".*?sources \+= ")',
],
}],
['v8_target_arch=="riscv64"', {
'sources': [ ### gcmole(arch:riscv64) ###
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"riscv64.*?sources \+= ")',
],
}],
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
'sources': [ ### gcmole(arch:mips64el) ###
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips64\\".*?sources \+= ")',
Expand Down Expand Up @@ -764,7 +774,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"]', {
['v8_current_cpu in ["mips", "mipsel", "mips64", "mips64el", "ppc", "arm", "riscv64"]', {
'link_settings': {
'libraries': ['-latomic', ],
},
Expand Down Expand Up @@ -1410,6 +1420,11 @@
'<(V8_ROOT)/src/heap/base/asm/mips64/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "riscv64" or _toolset == "target" and target_arch=="riscv64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/riscv64/push_registers_asm.cc',
],
}],
]
}],
['OS=="win"', {
Expand Down

0 comments on commit b634922

Please sign in to comment.