diff --git a/BUILD.bazel b/BUILD.bazel index 01a6c608ff..140f8bf35e 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -302,6 +302,11 @@ v8_config( "V8_TARGET_ARCH_RISCV64", "CAN_USE_FPU_INSTRUCTIONS", ], + "@v8//bazel/config:v8_target_ppc64le": [ + # NOTE: Bazel rules for ppc64le weren't tested on a real system. + "V8_TARGET_ARCH_PPC64", + "V8_TARGET_ARCH_PPC_LE", + ], }, no_match_error = "Please specify a target cpu supported by v8", ) + select({ @@ -2263,6 +2268,37 @@ filegroup( "src/regexp/riscv64/regexp-macro-assembler-riscv64.h", "src/wasm/baseline/riscv64/liftoff-assembler-riscv64.h", ], + "@v8//bazel/config:v8_target_ppc64le": [ + "src/baseline/ppc/baseline-assembler-ppc-inl.h", + "src/baseline/ppc/baseline-compiler-ppc-inl.h", + "src/codegen/ppc/assembler-ppc.cc", + "src/codegen/ppc/assembler-ppc.h", + "src/codegen/ppc/assembler-ppc-inl.h", + "src/codegen/ppc/constants-ppc.cc", + "src/codegen/ppc/constants-ppc.h", + "src/codegen/ppc/cpu-ppc.cc", + "src/codegen/ppc/interface-descriptors-ppc-inl.h", + "src/codegen/ppc/macro-assembler-ppc.cc", + "src/codegen/ppc/macro-assembler-ppc.h", + "src/codegen/ppc/register-ppc.h", + "src/compiler/backend/ppc/code-generator-ppc.cc", + "src/compiler/backend/ppc/instruction-codes-ppc.h", + "src/compiler/backend/ppc/instruction-scheduler-ppc.cc", + "src/compiler/backend/ppc/instruction-selector-ppc.cc", + "src/compiler/backend/ppc/unwinding-info-writer-ppc.cc", + "src/compiler/backend/ppc/unwinding-info-writer-ppc.h", + "src/deoptimizer/ppc/deoptimizer-ppc.cc", + "src/diagnostics/ppc/disasm-ppc.cc", + "src/diagnostics/ppc/eh-frame-ppc.cc", + "src/diagnostics/ppc/unwinder-ppc.cc", + "src/execution/ppc/frame-constants-ppc.cc", + "src/execution/ppc/frame-constants-ppc.h", + "src/execution/ppc/simulator-ppc.cc", + "src/execution/ppc/simulator-ppc.h", + "src/regexp/ppc/regexp-macro-assembler-ppc.cc", + "src/regexp/ppc/regexp-macro-assembler-ppc.h", + "src/wasm/baseline/ppc/liftoff-assembler-ppc.h", + ], }) + select({ # Only for x64 builds and for arm64 with x64 host simulator. "@v8//bazel/config:is_posix_x64": [ @@ -2778,6 +2814,7 @@ filegroup( "@v8//bazel/config:v8_target_arm64": ["src/builtins/arm64/builtins-arm64.cc"], "@v8//bazel/config:v8_target_s390x": ["src/builtins/s390/builtins-s390.cc"], "@v8//bazel/config:v8_target_riscv64": ["src/builtins/riscv64/builtins-riscv64.cc"], + "@v8//bazel/config:v8_target_ppc64le": ["src/builtins/ppc/builtins-ppc.cc"], }) + select({ ":is_v8_enable_webassembly": [ "src/builtins/builtins-wasm-gen.cc", @@ -2900,6 +2937,7 @@ filegroup( "@v8//bazel/config:is_inline_asm_arm64": ["src/heap/base/asm/arm64/push_registers_asm.cc"], "@v8//bazel/config:is_inline_asm_s390x": ["src/heap/base/asm/s390/push_registers_asm.cc"], "@v8//bazel/config:is_inline_asm_riscv64": ["src/heap/base/asm/riscv64/push_registers_asm.cc"], + "@v8//bazel/config:is_inline_asm_ppc64le": ["src/heap/base/asm/ppc/push_registers_asm.cc"], "@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/push_registers_masm.S"], "@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/push_registers_masm.S"], "@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/push_registers_masm.S"], diff --git a/bazel/config/BUILD.bazel b/bazel/config/BUILD.bazel index 552c892b02..1ed946ed7c 100644 --- a/bazel/config/BUILD.bazel +++ b/bazel/config/BUILD.bazel @@ -59,6 +59,11 @@ config_setting( constraint_values = ["@platforms//cpu:riscv64"], ) +config_setting( + name = "platform_cpu_ppc64le", + constraint_values = ["@platforms//cpu:ppc"], +) + v8_target_cpu( name = "v8_target_cpu", build_setting_default = "none", @@ -101,6 +106,11 @@ v8_configure_target_cpu( matching_configs = [":platform_cpu_riscv64"], ) +v8_configure_target_cpu( + name = "ppc64le", + matching_configs = [":platform_cpu_ppc64le"], +) + selects.config_setting_group( name = "v8_target_is_32_bits", match_any = [ @@ -146,6 +156,7 @@ selects.config_setting_group( ":is_arm64", ":is_s390x", ":is_riscv64", + ":is_ppc64le", ], ) @@ -204,6 +215,11 @@ selects.config_setting_group( match_all = [":is_posix", ":is_riscv64"], ) +selects.config_setting_group( + name = "is_inline_asm_ppc64le", + match_all = [":is_posix", ":is_ppc64le"], +) + selects.config_setting_group( name = "is_msvc_asm_x64", match_all = [":is_windows", ":is_x64"], diff --git a/bazel/config/v8-target-cpu.bzl b/bazel/config/v8-target-cpu.bzl index b336063cce..a0ce9d1cb3 100644 --- a/bazel/config/v8-target-cpu.bzl +++ b/bazel/config/v8-target-cpu.bzl @@ -14,7 +14,7 @@ V8CpuTypeInfo = provider( ) def _host_target_cpu_impl(ctx): - allowed_values = ["arm", "arm64", "ia32", "riscv64", "s390x", "x64", "none"] + allowed_values = ["arm", "arm64", "ia32", "ppc64le", "riscv64", "s390x", "x64", "none"] cpu_type = ctx.build_setting_value if cpu_type in allowed_values: return V8CpuTypeInfo(value = cpu_type) diff --git a/bazel/defs.bzl b/bazel/defs.bzl index 2a95c05724..f162149f0a 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl @@ -378,13 +378,13 @@ def _v8_target_cpu_transition_impl(settings, attr): "darwin_x86_64": "x64", "x64_windows": "x64", "x86": "ia32", - "ppc": "ppc64", "aarch64": "arm64", "arm64-v8a": "arm64", "arm": "arm64", "armeabi-v7a": "arm32", "s390x": "s390x", "riscv64": "riscv64", + "ppc": "ppc64le", } v8_target_cpu = mapping[settings["//command_line_option:cpu"]] return {"@v8//bazel/config:v8_target_cpu": v8_target_cpu}