Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add loong64 configure #41323

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once upon a time these entries were sorted, it's not critical but maybe while you're in here you could fix up these last 3 entries

'loong64')
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 Expand Up @@ -1064,6 +1065,7 @@ def host_arch_cc():
'__x86_64__' : 'x64',
'__s390x__' : 's390x',
'__riscv' : 'riscv',
'__loongarch64': 'loong64',
}

rtn = 'ia32' # default
Expand Down
5 changes: 5 additions & 0 deletions tools/v8_gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
22 changes: 21 additions & 1 deletion tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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', ],
},
Expand Down Expand Up @@ -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"', {
Expand Down