| 535 | # Note: This class is imported by update-compile-commands.py. When renaming |
| 536 | # anything here, please update that script too! |
| 537 | class ManagedConfig(RawConfig): |
| 538 | |
| 539 | def __init__(self, |
| 540 | arch, |
| 541 | mode, |
| 542 | targets, |
| 543 | tests=[], |
| 544 | clean=False, |
| 545 | testrunner_args=[]): |
| 546 | super().__init__( |
| 547 | get_path(arch, mode), targets, tests, clean, testrunner_args) |
| 548 | self.arch = arch |
| 549 | self.mode = mode |
| 550 | |
| 551 | def get_target_cpu(self): |
| 552 | cpu = "x86" |
| 553 | if self.arch == "android_arm": |
| 554 | cpu = "arm" |
| 555 | elif self.arch == "android_arm64" or self.arch == "fuchsia_arm64": |
| 556 | cpu = "arm64" |
| 557 | elif self.arch == "android_riscv64": |
| 558 | cpu = "riscv64" |
| 559 | elif self.arch == "arm64" and _get_machine() in ("aarch64", "arm64"): |
| 560 | # arm64 build host: |
| 561 | cpu = "arm64" |
| 562 | elif self.arch == "arm" and _get_machine() in ("aarch64", "arm64"): |
| 563 | cpu = "arm" |
| 564 | elif self.arch == "loong64" and _get_machine() == "loongarch64": |
| 565 | cpu = "loong64" |
| 566 | elif self.arch == "mips64el" and _get_machine() == "mips64": |
| 567 | cpu = "mips64el" |
| 568 | elif "64" in self.arch or self.arch == "s390x": |
| 569 | # Native x64 or simulator build. |
| 570 | cpu = "x64" |
| 571 | return [f"target_cpu = \"{cpu}\""] |
| 572 | |
| 573 | def get_v8_target_cpu(self): |
| 574 | if self.arch == "android_arm": |
| 575 | v8_cpu = "arm" |
| 576 | elif self.arch == "android_arm64" or self.arch == "fuchsia_arm64": |
| 577 | v8_cpu = "arm64" |
| 578 | elif self.arch == "android_riscv64": |
| 579 | v8_cpu = "riscv64" |
| 580 | elif self.arch in ("arm", "arm64", "mips64el", "ppc64", "riscv64", |
| 581 | "riscv32", "s390x", "loong64"): |
| 582 | v8_cpu = self.arch |
| 583 | else: |
| 584 | return [] |
| 585 | return [f"v8_target_cpu = \"{v8_cpu}\""] |
| 586 | |
| 587 | def get_target_os(self): |
| 588 | if self.arch in ("android_arm", "android_arm64", "android_riscv64"): |
| 589 | return ["target_os = \"android\""] |
| 590 | elif self.arch in ("fuchsia_x64", "fuchsia_arm64"): |
| 591 | return ["target_os = \"fuchsia\""] |
| 592 | return [] |
| 593 | |
| 594 | def get_specialized_compiler(self): |