diff --git a/0001-add-aupport-for-loongarch64.patch b/0001-add-aupport-for-loongarch64.patch new file mode 100644 index 0000000000000000000000000000000000000000..01f6778035d7a38c290a7f2297f7ff161bb32b46 --- /dev/null +++ b/0001-add-aupport-for-loongarch64.patch @@ -0,0 +1,6141 @@ +From edca241293b855eb5d292c2d05e8fc1939b81a00 Mon Sep 17 00:00:00 2001 +From: Haiyong Sun + Wenlong Zhang +Date: Fri, 19 Sep 2025 10:39:01 +0800 +Subject: [PATCH] add aupport for loongarch64 + +--- + cmake/Functions.cmake | 4 + + .../chromium/base/process/launch_posix.cc | 2 +- + src/3rdparty/chromium/build/build_config.h | 20 +- + .../chromium/build/config/compiler/BUILD.gn | 7 +- + .../linux/sysroot_scripts/install-sysroot.py | 2 +- + .../build/linux/sysroot_scripts/sysroots.json | 6 + + .../runtime/chrome_runtime_api_delegate.cc | 4 + + .../extensions/common/api/runtime.json | 4 +- + .../services/webrtc_video_perf_history.cc | 2 + + src/3rdparty/chromium/sandbox/features.gni | 2 +- + src/3rdparty/chromium/sandbox/linux/BUILD.gn | 1 + + .../linux/bpf_dsl/linux_syscall_ranges.h | 7 + + .../sandbox/linux/bpf_dsl/seccomp_macros.h | 43 + + .../bpf_dsl_seccomp_unittest.cc | 5 +- + .../seccomp_broker_process_unittest.cc | 43 +- + .../seccomp-bpf-helpers/baseline_policy.cc | 8 +- + .../baseline_policy_unittest.cc | 12 +- + .../seccomp-bpf-helpers/sigsys_handlers.cc | 2 + + .../syscall_parameters_restrictions.cc | 8 +- + .../linux/seccomp-bpf-helpers/syscall_sets.cc | 64 +- + .../linux/seccomp-bpf-helpers/syscall_sets.h | 10 +- + .../sandbox/linux/seccomp-bpf/syscall.cc | 32 +- + .../linux/seccomp-bpf/syscall_unittest.cc | 1 + + .../sandbox/linux/services/credentials.cc | 2 +- + .../linux/services/syscall_wrappers.cc | 62 +- + .../sandbox/linux/services/syscall_wrappers.h | 6 + + .../services/syscall_wrappers_unittest.cc | 2 + + .../linux/syscall_broker/broker_client.cc | 15 + + .../linux/syscall_broker/broker_client.h | 3 + + .../linux/syscall_broker/broker_command.h | 1 + + .../linux/syscall_broker/broker_host.cc | 20 +- + .../linux/syscall_broker/broker_process.cc | 21 +- + .../syscall_broker/broker_process_unittest.cc | 12 +- + .../remote_syscall_arg_handler_unittest.cc | 4 + + .../syscall_broker/syscall_dispatcher.cc | 7 + + .../linux/syscall_broker/syscall_dispatcher.h | 3 + + .../linux/system_headers/linux_seccomp.h | 9 + + .../linux/system_headers/linux_signal.h | 10 +- + .../sandbox/linux/system_headers/linux_stat.h | 47 +- + .../linux/system_headers/linux_syscalls.h | 4 + + .../loongarch64_linux_syscalls.h | 851 ++++++++++++++++ + .../policy/linux/bpf_broker_policy_linux.cc | 6 + + .../linux/bpf_cros_amd_gpu_policy_linux.cc | 2 +- + .../policy/linux/bpf_gpu_policy_linux.cc | 2 +- + .../sandbox/policy/linux/sandbox_linux.cc | 4 + + src/3rdparty/chromium/skia/BUILD.gn | 10 + + .../chromium/third_party/angle/gni/angle.gni | 2 +- + .../track/vtt/vtt_cue_layout_algorithm.cc | 2 + + .../core/streams/miscellaneous_operations.cc | 2 + + .../renderer/core/streams/queue_with_sizes.cc | 2 + + .../core/style/style_crossfade_image.cc | 2 + + .../blink/renderer/platform/BUILD.gn | 7 + + .../blink/renderer/platform/graphics/color.cc | 4 + + .../boringssl/src/include/openssl/base.h | 3 + + .../linux/dump_writer_common/thread_info.h | 2 +- + .../crashpad/compat/linux/sys/ptrace.h | 4 + + .../crashpad/crashpad/compat/non_win/winnt.h | 1 + + .../crashpad/minidump/minidump_context.h | 30 + + .../minidump/minidump_context_writer.cc | 44 + + .../minidump/minidump_context_writer.h | 38 + + .../minidump/minidump_context_writer_test.cc | 15 + + .../crashpad/minidump/minidump_extensions.h | 1 + + .../minidump/minidump_misc_info_writer.cc | 2 + + .../crashpad/crashpad/snapshot/BUILD.gn | 6 +- + .../crashpad/snapshot/capture_memory.cc | 4 + + .../crashpad/snapshot/cpu_architecture.h | 3 + + .../crashpad/crashpad/snapshot/cpu_context.cc | 5 + + .../crashpad/crashpad/snapshot/cpu_context.h | 10 + + .../crashpad/snapshot/elf/elf_image_reader.cc | 14 + + .../snapshot/elf/elf_symbol_table_reader.cc | 27 +- + .../snapshot/linux/cpu_context_linux.cc | 25 + + .../snapshot/linux/cpu_context_linux.h | 24 + + .../linux/exception_snapshot_linux.cc | 74 ++ + .../snapshot/linux/exception_snapshot_linux.h | 2 + + .../linux/exception_snapshot_linux_test.cc | 42 + + .../snapshot/linux/process_reader_linux.cc | 2 + + .../crashpad/snapshot/linux/signal_context.h | 38 + + .../snapshot/linux/system_snapshot_linux.cc | 11 + + .../crashpad/snapshot/linux/test_modules.cc | 4 + + .../snapshot/linux/thread_snapshot_linux.cc | 6 + + .../snapshot/linux/thread_snapshot_linux.h | 2 + + .../minidump/minidump_context_converter.cc | 22 + + .../minidump/system_snapshot_minidump.cc | 2 + + .../crashpad/crashpad/util/linux/ptracer.cc | 48 + + .../crashpad/util/linux/thread_info.h | 21 +- + .../crashpad/util/misc/capture_context.h | 1 + + .../util/misc/capture_context_linux.S | 83 +- + .../util/misc/capture_context_test.cc | 2 +- + .../misc/capture_context_test_util_linux.cc | 6 + + .../util/net/http_transport_libcurl.cc | 2 + + .../dav1d/config/linux/loongarch64/config.h | 38 + + .../src/scripts/build/ninja/bundle.gni | 1 - + .../chromium/third_party/libaom/BUILD.gn | 2 +- + .../core/fpdfapi/page/cpdf_psengine.cpp | 2 + + .../pdfium/fxjs/cjs_publicmethods.cpp | 2 + + .../pdfium/fxjs/fx_date_helpers.cpp | 3 + + .../fxjs/xfa/cfxjse_formcalc_context.cpp | 2 + + .../xfa/fgas/graphics/cfgas_gegraphics.cpp | 2 + + .../third_party/llvm-10.0/BUILD.gn | 923 ++++++++++++------ + .../llvm-10.0/scripts/template_BUILD.gn | 248 +++++ + .../swiftshader/third_party/marl/BUILD.gn | 2 +- + src/3rdparty/chromium/ui/gl/features.gni | 2 +- + src/3rdparty/chromium/v8/BUILD.gn | 16 +- + .../gn/src/gn/ninja_action_target_writer.cc | 8 + + src/3rdparty/gn/src/util/build_config.h | 4 +- + 105 files changed, 2907 insertions(+), 387 deletions(-) + create mode 100644 src/3rdparty/chromium/sandbox/linux/system_headers/loongarch64_linux_syscalls.h + create mode 100644 src/3rdparty/chromium/third_party/dav1d/config/linux/loongarch64/config.h + create mode 100644 src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/scripts/template_BUILD.gn + +diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake +index 73a06d59f..068a6f17c 100644 +--- a/cmake/Functions.cmake ++++ b/cmake/Functions.cmake +@@ -674,6 +674,8 @@ function(get_gn_arch result arch) + set(${result} "mips64el" PARENT_SCOPE) + elseif(arch STREQUAL "riscv64") + set(${result} "riscv64" PARENT_SCOPE) ++ elseif(arch STREQUAL "loongarch64") ++ set(${result} "loongarch64" PARENT_SCOPE) + else() + message(DEBUG "Unsupported architecture: ${arch}") + endif() +@@ -695,6 +697,8 @@ function(get_v8_arch result targetArch hostArch) + set(${result} "mipsel" PARENT_SCOPE) + elseif(hostArch STREQUAL "riscv64") + set(${result} "riscv64" PARENT_SCOPE) ++ elseif(hostArch STREQUAL "loongarch64") ++ set(${result} "loongarch64" PARENT_SCOPE) + elseif(hostArch IN_LIST list32) + set(${result} "${hostArch}" PARENT_SCOPE) + else() +diff --git a/src/3rdparty/chromium/base/process/launch_posix.cc b/src/3rdparty/chromium/base/process/launch_posix.cc +index beaf1529b..782517834 100644 +--- a/src/3rdparty/chromium/base/process/launch_posix.cc ++++ b/src/3rdparty/chromium/base/process/launch_posix.cc +@@ -710,7 +710,7 @@ CloneAndLongjmpInChild(int flags, pid_t* ptid, pid_t* ctid, jmp_buf* env) { + alignas(16) char stack_buf[PTHREAD_STACK_MIN]; + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \ + defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_S390_FAMILY) || \ +- defined(ARCH_CPU_PPC64_FAMILY) || defined(ARCH_CPU_LOONG_FAMILY) || \ ++ defined(ARCH_CPU_PPC64_FAMILY) || defined(ARCH_CPU_LOONGARCH_FAMILY) || \ + defined(ARCH_CPU_RISCV_FAMILY) + // The stack grows downward. + void* stack = stack_buf + sizeof(stack_buf); +diff --git a/src/3rdparty/chromium/build/build_config.h b/src/3rdparty/chromium/build/build_config.h +index 8f90f474e..638f35b65 100644 +--- a/src/3rdparty/chromium/build/build_config.h ++++ b/src/3rdparty/chromium/build/build_config.h +@@ -36,7 +36,7 @@ + // ARCH_CPU_X86_64 / ARCH_CPU_RISCV64 + // Processor family: + // ARCH_CPU_ARM_FAMILY: ARMEL or ARM64 +-// ARCH_CPU_LOONG_FAMILY: LOONG32 or LOONG64 ++// ARCH_CPU_LOONGARCH_FAMILY: LOONG32 or LOONG64 + // ARCH_CPU_MIPS_FAMILY: MIPS64EL or MIPSEL or MIPS64 or MIPS + // ARCH_CPU_PPC64_FAMILY: PPC64 + // ARCH_CPU_S390_FAMILY: S390 or S390X +@@ -326,16 +326,20 @@ + #define ARCH_CPU_32_BITS 1 + #define ARCH_CPU_BIG_ENDIAN 1 + #endif +-#elif defined(__loongarch32) +-#define ARCH_CPU_LOONG_FAMILY 1 +-#define ARCH_CPU_LOONG32 1 +-#define ARCH_CPU_32_BITS 1 ++ ++#elif defined(__loongarch__) ++#define ARCH_CPU_LOONGARCH_FAMILY 1 + #define ARCH_CPU_LITTLE_ENDIAN 1 +-#elif defined(__loongarch64) +-#define ARCH_CPU_LOONG_FAMILY 1 ++#if defined(__loongarch64) ++#define ARCH_CPU_LOONGARCH64 1 + #define ARCH_CPU_LOONG64 1 + #define ARCH_CPU_64_BITS 1 +-#define ARCH_CPU_LITTLE_ENDIAN 1 ++#else ++#define ARCH_CPU_LOONGARCH32 1 ++#define ARCH_CPU_LOONG32 1 ++#define ARCH_CPU_32_BITS 1 ++#endif ++ + #elif defined(__riscv) && (__riscv_xlen == 64) + #define ARCH_CPU_RISCV_FAMILY 1 + #define ARCH_CPU_RISCV64 1 +diff --git a/src/3rdparty/chromium/build/config/compiler/BUILD.gn b/src/3rdparty/chromium/build/config/compiler/BUILD.gn +index 1e8964634..1f9b3b02f 100644 +--- a/src/3rdparty/chromium/build/config/compiler/BUILD.gn ++++ b/src/3rdparty/chromium/build/config/compiler/BUILD.gn +@@ -1252,7 +1252,7 @@ config("compiler_cpu_abi") { + ldflags += [ "--target=riscv64-linux-gnu" ] + } + cflags += [ "-mabi=lp64d" ] +- } else if (current_cpu == "loong64") { ++ } else if (current_cpu == "loongarch64") { + if (is_clang) { + cflags += [ "--target=loongarch64-linux-gnu" ] + ldflags += [ "--target=loongarch64-linux-gnu" ] +@@ -1713,6 +1713,9 @@ config("default_warnings") { + # -Wunused-local-typedefs is broken in gcc, + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63872 + cflags += [ "-Wno-unused-local-typedefs" ] ++ if (current_cpu == "loongarch64") { ++ cflags += [ "-mcmodel=medium" ] ++ } + + # Don't warn about "maybe" uninitialized. Clang doesn't include this + # in -Wall but gcc does, and it gives false positives. +@@ -1884,7 +1887,7 @@ config("chromium_code") { + if (!is_debug && !using_sanitizer && current_cpu != "s390x" && + current_cpu != "s390" && current_cpu != "ppc64" && + current_cpu != "mips" && current_cpu != "mips64" && +- current_cpu != "riscv64" && current_cpu != "loong64" && !is_mingw) { ++ current_cpu != "riscv64" && current_cpu != "loongarch64" && !is_mingw) { + # Non-chromium code is not guaranteed to compile cleanly with + # _FORTIFY_SOURCE. Also, fortified build may fail when optimizations are + # disabled, so only do that for Release build. +diff --git a/src/3rdparty/chromium/build/linux/sysroot_scripts/install-sysroot.py b/src/3rdparty/chromium/build/linux/sysroot_scripts/install-sysroot.py +index d7e36862f..f3ff01001 100755 +--- a/src/3rdparty/chromium/build/linux/sysroot_scripts/install-sysroot.py ++++ b/src/3rdparty/chromium/build/linux/sysroot_scripts/install-sysroot.py +@@ -45,7 +45,7 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) + URL_PREFIX = 'https://commondatastorage.googleapis.com' + URL_PATH = 'chrome-linux-sysroot/toolchain' + +-VALID_ARCHS = ('arm', 'arm64', 'i386', 'amd64', 'mips', 'mips64el') ++VALID_ARCHS = ('arm', 'arm64', 'i386', 'amd64', 'mips', 'mips64el', 'loong64') + + ARCH_TRANSLATIONS = { + 'x64': 'amd64', +diff --git a/src/3rdparty/chromium/build/linux/sysroot_scripts/sysroots.json b/src/3rdparty/chromium/build/linux/sysroot_scripts/sysroots.json +index d06a94d35..615d85ffb 100644 +--- a/src/3rdparty/chromium/build/linux/sysroot_scripts/sysroots.json ++++ b/src/3rdparty/chromium/build/linux/sysroot_scripts/sysroots.json +@@ -35,6 +35,12 @@ + "SysrootDir": "debian_bullseye_mips-sysroot", + "Tarball": "debian_bullseye_mips_sysroot.tar.xz" + }, ++ "bullseye_loong64": { ++ "Key": "20221105T211506Z-0", ++ "Sha1Sum": "6f27b4f65d8e190864e7c18fa281ffb418cf2e43", ++ "SysrootDir": "debian_bullseye_loong64-sysroot", ++ "Tarball": "debian_bullseye_loong64_sysroot.tar.xz" ++ }, + "bullseye_mips64el": { + "Key": "20220331T153654Z-0", + "Sha1Sum": "3b52b8b86138b2392daf915928f29281000e2461", +diff --git a/src/3rdparty/chromium/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc b/src/3rdparty/chromium/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc +index 8e3bdd4a0..4d5c945ac 100644 +--- a/src/3rdparty/chromium/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc ++++ b/src/3rdparty/chromium/chrome/browser/extensions/api/runtime/chrome_runtime_api_delegate.cc +@@ -311,6 +311,8 @@ bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { + info->arch = extensions::api::runtime::PLATFORM_ARCH_MIPS; + } else if (strcmp(arch, "mips64el") == 0) { + info->arch = extensions::api::runtime::PLATFORM_ARCH_MIPS64; ++ } else if (strcmp(arch, "loongarch64") == 0) { ++ info->arch = extensions::api::runtime::PlatformArch::kLoongarch64; + } else { + NOTREACHED(); + return false; +@@ -327,6 +329,8 @@ bool ChromeRuntimeAPIDelegate::GetPlatformInfo(PlatformInfo* info) { + info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_MIPS; + } else if (strcmp(nacl_arch, "mips64") == 0) { + info->nacl_arch = extensions::api::runtime::PLATFORM_NACL_ARCH_MIPS64; ++ } else if (strcmp(nacl_arch, "loongarch64") == 0) { ++ info->nacl_arch = extensions::api::runtime::PlatformNaclArch::kLoongarch64; + } else { + NOTREACHED(); + return false; +diff --git a/src/3rdparty/chromium/extensions/common/api/runtime.json b/src/3rdparty/chromium/extensions/common/api/runtime.json +index 5fdf15bbc..edcb5d525 100644 +--- a/src/3rdparty/chromium/extensions/common/api/runtime.json ++++ b/src/3rdparty/chromium/extensions/common/api/runtime.json +@@ -92,14 +92,14 @@ + { + "id": "PlatformArch", + "type": "string", +- "enum": ["arm", "arm64", "x86-32", "x86-64", "mips", "mips64"], ++ "enum": ["arm", "arm64", "x86-32", "x86-64", "mips", "mips64", "loongarch64"], + "description": "The machine's processor architecture." + }, + { + "id": "PlatformNaclArch", + "description": "The native client architecture. This may be different from arch on some platforms.", + "type": "string", +- "enum": ["arm", "x86-32", "x86-64", "mips", "mips64"] ++ "enum": ["arm", "x86-32", "x86-64", "mips", "mips64", "loongarch64"] + }, + { + "id": "PlatformInfo", +diff --git a/src/3rdparty/chromium/media/mojo/services/webrtc_video_perf_history.cc b/src/3rdparty/chromium/media/mojo/services/webrtc_video_perf_history.cc +index 019474892..0fb221e46 100644 +--- a/src/3rdparty/chromium/media/mojo/services/webrtc_video_perf_history.cc ++++ b/src/3rdparty/chromium/media/mojo/services/webrtc_video_perf_history.cc +@@ -5,6 +5,8 @@ + #include "media/mojo/services/webrtc_video_perf_history.h" + + #include ++#include ++using std::isnan; + + #include "base/bind.h" + #include "base/callback.h" +diff --git a/src/3rdparty/chromium/sandbox/features.gni b/src/3rdparty/chromium/sandbox/features.gni +index 8aa52983f..69b108b03 100644 +--- a/src/3rdparty/chromium/sandbox/features.gni ++++ b/src/3rdparty/chromium/sandbox/features.gni +@@ -10,7 +10,7 @@ use_seccomp_bpf = (is_linux || is_chromeos || is_android) && + (current_cpu == "x86" || current_cpu == "x64" || + current_cpu == "arm" || current_cpu == "arm64" || + current_cpu == "mipsel" || current_cpu == "mips64el" || +- current_cpu == "riscv64") ++ current_cpu == "riscv64" || current_cpu == "loongarch64") + + # SSBD (Speculative Store Bypass Disable) is a mitigation of Spectre Variant 4. + # As Spectre Variant 4 can be mitigated by site isolation, opt-out SSBD on site +diff --git a/src/3rdparty/chromium/sandbox/linux/BUILD.gn b/src/3rdparty/chromium/sandbox/linux/BUILD.gn +index 5eeed352f..010a2fef2 100644 +--- a/src/3rdparty/chromium/sandbox/linux/BUILD.gn ++++ b/src/3rdparty/chromium/sandbox/linux/BUILD.gn +@@ -386,6 +386,7 @@ source_set("sandbox_services_headers") { + "system_headers/linux_stat.h", + "system_headers/linux_syscalls.h", + "system_headers/linux_time.h", ++ "system_headers/loongarch64_linux_syscalls.h", + "system_headers/mips64_linux_syscalls.h", + "system_headers/mips_linux_syscalls.h", + "system_headers/x86_32_linux_syscalls.h", +diff --git a/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h b/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h +index 3bf3cb257..03f72409b 100644 +--- a/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h ++++ b/src/3rdparty/chromium/sandbox/linux/bpf_dsl/linux_syscall_ranges.h +@@ -62,6 +62,13 @@ + #define MAX_PUBLIC_SYSCALL 1024u + #define MAX_SYSCALL MAX_PUBLIC_SYSCALL + ++#elif defined(__loongarch_lp64) ++ ++#include ++#define MIN_SYSCALL 0u ++#define MAX_PUBLIC_SYSCALL __NR_syscalls ++#define MAX_SYSCALL MAX_PUBLIC_SYSCALL ++ + #else + #error "Unsupported architecture" + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h b/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h +index cc9b89ba3..2d88fc129 100644 +--- a/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h ++++ b/src/3rdparty/chromium/sandbox/linux/bpf_dsl/seccomp_macros.h +@@ -383,6 +383,49 @@ struct regs_struct { + #define SECCOMP_PT_PARM4(_regs) (_regs).regs[REG_A0+3] + #define SECCOMP_PT_PARM5(_regs) (_regs).regs[REG_A0+4] + #define SECCOMP_PT_PARM6(_regs) (_regs).regs[REG_A0+5] ++ ++#elif defined(__loongarch_lp64) ++struct regs_struct { ++ uint64_t regs[32]; ++ uint64_t pc; ++}; ++ ++typedef unsigned long int greg_t; ++ ++#define SECCOMP_ARCH AUDIT_ARCH_LOONGARCH64 ++ ++#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.__gregs[_reg]) ++ ++#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 4) ++#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 11) ++#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.__pc ++#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 4) ++#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 5) ++#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 6) ++#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 7) ++#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 8) ++#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 9) ++ ++#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr)) ++#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch)) ++#define SECCOMP_IP_MSB_IDX \ ++ (offsetof(struct arch_seccomp_data, instruction_pointer) + 4) ++#define SECCOMP_IP_LSB_IDX \ ++ (offsetof(struct arch_seccomp_data, instruction_pointer) + 0) ++#define SECCOMP_ARG_MSB_IDX(nr) \ ++ (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4) ++#define SECCOMP_ARG_LSB_IDX(nr) \ ++ (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0) ++ ++#define SECCOMP_PT_RESULT(_regs) (_regs).regs[4] ++#define SECCOMP_PT_SYSCALL(_regs) (_regs).regs[11] ++#define SECCOMP_PT_IP(_regs) (_regs).pc ++#define SECCOMP_PT_PARM1(_regs) (_regs).regs[4] ++#define SECCOMP_PT_PARM2(_regs) (_regs).regs[5] ++#define SECCOMP_PT_PARM3(_regs) (_regs).regs[6] ++#define SECCOMP_PT_PARM4(_regs) (_regs).regs[7] ++#define SECCOMP_PT_PARM5(_regs) (_regs).regs[8] ++#define SECCOMP_PT_PARM6(_regs) (_regs).regs[9] + #else + #error Unsupported target platform + +diff --git a/src/3rdparty/chromium/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc b/src/3rdparty/chromium/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc +index a05791e41..891b7b780 100644 +--- a/src/3rdparty/chromium/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc +@@ -1964,7 +1964,8 @@ BPF_TEST_C(SandboxBPF, PthreadBitMask, PthreadPolicyBitMask) { + // + // Depending on the architecture, this may modify regs, so the caller is + // responsible for committing these changes using PTRACE_SETREGS. +-#if !defined(__arm__) && !defined(__aarch64__) && !defined(__mips__) ++#if !defined(__arm__) && !defined(__aarch64__) && !defined(__mips__) && \ ++ !defined(__loongarch__) + long SetSyscall(pid_t pid, regs_struct* regs, int syscall_number) { + #if defined(__arm__) + // On ARM, the syscall is changed using PTRACE_SET_SYSCALL. We cannot use the +@@ -2004,7 +2005,7 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) { + // See https://code.google.com/p/chromium/issues/detail?id=383977 + #if defined(__arm__) || defined(__aarch64__) + printf("This test is currently disabled on ARM32/64 due to a kernel bug."); +-#elif defined(__mips__) ++#elif defined(__mips__) || defined(__loongarch__) + // TODO: Figure out how to support specificity of handling indirect syscalls + // in this test and enable it. + printf("This test is currently disabled on MIPS."); +diff --git a/src/3rdparty/chromium/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc b/src/3rdparty/chromium/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc +index b8ec997cf..30eddcdd0 100644 +--- a/src/3rdparty/chromium/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/integration_tests/seccomp_broker_process_unittest.cc +@@ -217,6 +217,7 @@ const int kFakeErrnoSentinel = 254; + + void ConvertKernelStatToLibcStat(default_stat_struct& in_stat, + struct stat& out_stat) { ++#if !defined(ARCH_CPU_LOONGARCH64) + out_stat.st_dev = in_stat.st_dev; + out_stat.st_ino = in_stat.st_ino; + out_stat.st_mode = in_stat.st_mode; +@@ -233,6 +234,28 @@ void ConvertKernelStatToLibcStat(default_stat_struct& in_stat, + out_stat.st_mtim.tv_nsec = in_stat.st_mtime_nsec_; + out_stat.st_ctim.tv_sec = in_stat.st_ctime_; + out_stat.st_ctim.tv_nsec = in_stat.st_ctime_nsec_; ++#else ++ out_stat.st_dev = ++ ((in_stat.stx_dev_minor & 0xff) | (in_stat.stx_dev_major << 8) | ++ ((in_stat.stx_dev_minor & ~0xff) << 12)); ++ out_stat.st_rdev = ++ ((in_stat.stx_rdev_minor & 0xff) | (in_stat.stx_rdev_major << 8) | ++ ((in_stat.stx_rdev_minor & ~0xff) << 12)); ++ out_stat.st_ino = in_stat.stx_ino; ++ out_stat.st_mode = in_stat.stx_mode; ++ out_stat.st_nlink = in_stat.stx_nlink; ++ out_stat.st_uid = in_stat.stx_uid; ++ out_stat.st_gid = in_stat.stx_gid; ++ out_stat.st_atim.tv_sec = in_stat.stx_atime.tv_sec; ++ out_stat.st_atim.tv_nsec = in_stat.stx_atime.tv_nsec; ++ out_stat.st_mtim.tv_sec = in_stat.stx_mtime.tv_sec; ++ out_stat.st_mtim.tv_nsec = in_stat.stx_mtime.tv_nsec; ++ out_stat.st_ctim.tv_sec = in_stat.stx_ctime.tv_sec; ++ out_stat.st_ctim.tv_nsec = in_stat.stx_ctime.tv_nsec; ++ out_stat.st_size = in_stat.stx_size; ++ out_stat.st_blocks = in_stat.stx_blocks; ++ out_stat.st_blksize = in_stat.stx_blksize; ++#endif + } + } // namespace + +@@ -388,6 +411,7 @@ class DirectSyscaller : public Syscaller { + }; + #endif // defined(DIRECT_SYSCALLER_ENABLED) + ++#if !defined(ARCH_CPU_LOONGARCH64) + class LibcSyscaller : public Syscaller { + public: + ~LibcSyscaller() override = default; +@@ -449,6 +473,7 @@ class LibcSyscaller : public Syscaller { + return ret; + } + }; ++#endif + + enum class SyscallerType { IPCSyscaller = 0, DirectSyscaller, LibcSyscaller }; + +@@ -597,7 +622,12 @@ class BPFTesterBrokerDelegate : public BPFTesterDelegate { + #endif + break; + case SyscallerType::LibcSyscaller: ++#if !defined(ARCH_CPU_LOONGARCH64) + syscaller_ = std::make_unique(); ++#else ++ CHECK(false) << "Requested instantiation of LibcSyscaller on a " ++ "platform that doesn't support it"; ++#endif + break; + } + } +@@ -628,16 +658,21 @@ const std::vector broker_test_configs = { + {"FastCheckInClient_DirectSyscaller", true, SyscallerType::DirectSyscaller, + BrokerType::SIGNAL_BASED}, + #endif ++#if !defined(ARCH_CPU_LOONGARCH64) + {"FastCheckInClient_LibcSyscaller", true, SyscallerType::LibcSyscaller, + BrokerType::SIGNAL_BASED}, ++#endif + {"NoFastCheckInClient_IPCSyscaller", false, SyscallerType::IPCSyscaller, + BrokerType::SIGNAL_BASED}, + #if defined(DIRECT_SYSCALLER_ENABLED) + {"NoFastCheckInClient_DirectSyscaller", false, + SyscallerType::DirectSyscaller, BrokerType::SIGNAL_BASED}, + #endif ++#if !defined(ARCH_CPU_LOONGARCH64) + {"NoFastCheckInClient_LibcSyscaller", false, SyscallerType::LibcSyscaller, +- BrokerType::SIGNAL_BASED}}; ++ BrokerType::SIGNAL_BASED} ++#endif ++}; + } // namespace + + void RunSingleBrokerTest(BrokerTestDelegate* test_delegate, +@@ -1319,6 +1354,7 @@ class StatNonexistentFileWithPermissionsDelegate final + } + + void RunTestInSandboxedChild(Syscaller* syscaller) override { ++#if !defined(ARCH_CPU_LOONGARCH64) + BPF_ASSERT_EQ(-ENOENT, syscaller->Stat(nonesuch_name, follow_links, &sb_)); + + // Gets denied all the way back to root since no create permission. +@@ -1342,6 +1378,7 @@ class StatNonexistentFileWithPermissionsDelegate final + syscaller->Stat(bad_leading_path5, follow_links, &sb_)); + BPF_ASSERT_EQ(-kFakeErrnoSentinel, + syscaller->Stat(bad_leading_path6, follow_links, &sb_)); ++#endif + } + }; + +@@ -1371,6 +1408,7 @@ class StatNonexistentFileWithCreatePermissionsDelegate final + } + + void RunTestInSandboxedChild(Syscaller* syscaller) override { ++#if !defined(ARCH_CPU_LOONGARCH64) + BPF_ASSERT_EQ(-ENOENT, syscaller->Stat(nonesuch_name, follow_links, &sb_)); + + // Gets ENOENT all the way back to root since it has create permission. +@@ -1393,6 +1431,7 @@ class StatNonexistentFileWithCreatePermissionsDelegate final + syscaller->Stat(bad_leading_path5, follow_links, &sb_)); + BPF_ASSERT_EQ(-kFakeErrnoSentinel, + syscaller->Stat(bad_leading_path6, follow_links, &sb_)); ++#endif + } + }; + +@@ -1421,6 +1460,7 @@ class StatFileWithPermissionsDelegate final : public StatFileDelegate { + } + + void RunTestInSandboxedChild(Syscaller* syscaller) override { ++#if !defined(ARCH_CPU_LOONGARCH64) + BPF_ASSERT_EQ(0, syscaller->Stat(tempfile_name_, follow_links, &sb_)); + + // Following fields may never be consistent but should be non-zero. +@@ -1443,6 +1483,7 @@ class StatFileWithPermissionsDelegate final : public StatFileDelegate { + BPF_ASSERT_LT(1500000000u, static_cast(sb_.st_atime)); + BPF_ASSERT_LT(1500000000u, static_cast(sb_.st_mtime)); + BPF_ASSERT_LT(1500000000u, static_cast(sb_.st_ctime)); ++#endif + } + }; + +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +index 9a48d83e6..33fb44892 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +@@ -197,7 +197,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + return RestrictFcntlCommands(); + #endif + +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + // fork() is never used as a system call (clone() is used instead), but we + // have seen it in fallback code on Android. + if (sysno == __NR_fork) { +@@ -259,7 +259,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + } + + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch_lp64) + if (sysno == __NR_mmap) + return RestrictMmapFlags(); + #endif +@@ -280,7 +280,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + return RestrictPrctl(); + + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch_lp64) + if (sysno == __NR_socketpair) { + // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen. + static_assert(AF_UNIX == PF_UNIX, +@@ -306,12 +306,14 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + return Allow(); + } + ++#if !defined(__loongarch__) + // The fstatat syscalls are file system syscalls, which will be denied below + // with fs_denied_errno. However some allowed fstat syscalls are rewritten by + // libc implementations to fstatat syscalls, and we need to rewrite them back. + if (sysno == __NR_fstatat_default) { + return RewriteFstatatSIGSYS(fs_denied_errno); + } ++#endif + + // The statx syscall is a filesystem syscall, which will be denied below with + // fs_denied_errno. However, on some platforms, glibc will default to statx +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc +index 2001e5d27..1ee856608 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc +@@ -54,9 +54,12 @@ namespace { + + // This also tests that read(), write(), fstat(), and fstatat(.., "", .., + // AT_EMPTY_PATH) are allowed. ++// Use statx instead of stat,lstat and fstatat on loongarch64 architecture, ++// So not test fstat(), and fstatat on loongarch64. + void TestPipeOrSocketPair(base::ScopedFD read_end, base::ScopedFD write_end) { + BPF_ASSERT_LE(0, read_end.get()); + BPF_ASSERT_LE(0, write_end.get()); ++#if !defined(__loongarch_lp64) + struct stat stat_buf; + int sys_ret = fstat(read_end.get(), &stat_buf); + BPF_ASSERT_EQ(0, sys_ret); +@@ -75,6 +78,7 @@ void TestPipeOrSocketPair(base::ScopedFD read_end, base::ScopedFD write_end) { + sys_ret = fstatat(read_end.get(), "", &stat_buf, 0); + BPF_ASSERT_EQ(sys_ret, -1); + BPF_ASSERT_EQ(EPERM, errno); ++#endif + + const ssize_t kTestTransferSize = 4; + static const char kTestString[kTestTransferSize] = {'T', 'E', 'S', 'T'}; +@@ -247,7 +251,8 @@ BPF_TEST_C(BaselinePolicy, GetRandom, BaselinePolicy) { + } + + // Not all architectures can restrict the domain for socketpair(). +-#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) ++#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \ ++ defined(__loongarch_lp64) + BPF_DEATH_TEST_C(BaselinePolicy, + SocketpairWrongDomain, + DEATH_SEGV_MESSAGE(GetErrorMessageContentForTests()), +@@ -256,7 +261,8 @@ BPF_DEATH_TEST_C(BaselinePolicy, + std::ignore = socketpair(AF_INET, SOCK_STREAM, 0, sv); + _exit(1); + } +-#endif // defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) ++#endif // defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || ++ // defined(__loongarch_lp64) + + BPF_TEST_C(BaselinePolicy, EPERM_open, BaselinePolicy) { + errno = 0; +@@ -320,7 +326,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo) + TEST_BASELINE_SIGSYS(__NR_syslog) + TEST_BASELINE_SIGSYS(__NR_timer_create) + +-#if !defined(__aarch64__) ++#if !defined(__aarch64__) && !defined(__loongarch_lp64) + TEST_BASELINE_SIGSYS(__NR_inotify_init) + TEST_BASELINE_SIGSYS(__NR_vserver) + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc +index f08d9e2d6..075805a5e 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc +@@ -354,6 +354,7 @@ intptr_t SIGSYSSchedHandler(const struct arch_seccomp_data& args, + + intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, + void* fs_denied_errno) { ++#if !defined(__loongarch__) + if (args.nr == __NR_fstatat_default) { + if (*reinterpret_cast(args.args[1]) == '\0' && + args.args[3] == static_cast(AT_EMPTY_PATH)) { +@@ -362,6 +363,7 @@ intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, + } + return -reinterpret_cast(fs_denied_errno); + } ++#endif + + CrashSIGSYS_Handler(args, fs_denied_errno); + +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +index dab293fec..3365bdd82 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +@@ -38,6 +38,7 @@ + #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !defined(__arm__) && !defined(__aarch64__) && \ + !defined(__riscv) && \ ++ !defined(__loongarch__) && \ + !defined(PTRACE_GET_THREAD_AREA) + // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance + // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA. +@@ -444,9 +445,14 @@ ResultExpr RestrictPtrace() { + #endif + return Switch(request) + .CASES(( +-#if !defined(__aarch64__) && !defined(__riscv) ++ ++// PTRACE_GET_THREAD_AREA is undefined on loongarch64 ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA, + PTRACE_GETREGSET, ++//#if !defined(__loongarch_lp64) ++// PTRACE_GET_THREAD_AREA, ++//#endif + #endif + #if defined(__arm__) + PTRACE_GETVFPREGS, +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +index 9356b0519..4c73e55d6 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -103,7 +103,7 @@ bool SyscallSets::IsUmask(int sysno) { + // Both EPERM and ENOENT are valid errno unless otherwise noted in comment. + bool SyscallSets::IsFileSystem(int sysno) { + switch (sysno) { +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_access: // EPERM not a valid errno. + case __NR_chmod: + case __NR_chown: +@@ -133,7 +133,9 @@ bool SyscallSets::IsFileSystem(int sysno) { + + case __NR_execve: + case __NR_faccessat: // EPERM not a valid errno. ++#if !defined(__loongarch__) + case __NR_faccessat2: ++#endif + case __NR_fchmodat: + case __NR_fchownat: // Should be called chownat ? + #if defined(__x86_64__) || defined(__aarch64__) || defined(__riscv) +@@ -196,7 +198,12 @@ bool SyscallSets::IsFileSystem(int sysno) { + + bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { + switch (sysno) { ++#if !defined(__loongarch__) + case __NR_fstat: ++#endif ++#if defined(__loongarch__) ++ case __NR_statx: ++#endif + case __NR_ftruncate: + #if defined(__i386__) || defined(__arm__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) +@@ -226,7 +233,7 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { + case __NR_oldfstat: + #endif + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_sync_file_range: // EPERM not a valid errno. + #elif defined(__arm__) + case __NR_arm_sync_file_range: // EPERM not a valid errno. +@@ -245,7 +252,7 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) { + #if defined(__i386__) || defined(__arm__) + case __NR_fchown32: + #endif +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_getdents: // EPERM not a valid errno. + #endif + case __NR_getdents64: // EPERM not a valid errno. +@@ -324,7 +331,7 @@ bool SyscallSets::IsProcessPrivilegeChange(int sysno) { + bool SyscallSets::IsProcessGroupOrSession(int sysno) { + switch (sysno) { + case __NR_setpgid: +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_getpgrp: + #endif + case __NR_setsid: +@@ -358,7 +365,7 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { + case __NR_rt_sigqueueinfo: + case __NR_rt_sigsuspend: + case __NR_rt_tgsigqueueinfo: +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_signalfd: + #endif + case __NR_signalfd4: +@@ -382,12 +389,12 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) { + switch (sysno) { + case __NR_close: + case __NR_dup: +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_dup2: + #endif + case __NR_dup3: + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch_lp64) + case __NR_shutdown: + #endif + return true; +@@ -426,7 +433,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + return true; + case __NR_clone: // Should be parameter-restricted. + case __NR_setns: // Privileged. +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_fork: + #endif + #if defined(__i386__) || defined(__x86_64__) +@@ -437,7 +444,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + #endif + case __NR_set_tid_address: + case __NR_unshare: +-#if !defined(__mips__) && !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__mips__) && !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch__) + case __NR_vfork: + #endif + default: +@@ -462,7 +469,7 @@ bool SyscallSets::IsAllowedFutex(int sysno) { + + bool SyscallSets::IsAllowedEpoll(int sysno) { + switch (sysno) { +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_epoll_create: + case __NR_epoll_wait: + #endif +@@ -483,7 +490,7 @@ bool SyscallSets::IsAllowedEpoll(int sysno) { + + bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { + switch (sysno) { +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch64) + case __NR_pipe: + #endif + case __NR_pipe2: +@@ -500,7 +507,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { + bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) { + switch (sysno) { + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_accept: + case __NR_accept4: + case __NR_bind: +@@ -529,7 +536,8 @@ bool SyscallSets::IsSocketCall(int sysno) { + } + #endif + +-#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) ++#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ ++ defined(__loongarch__) + bool SyscallSets::IsNetworkSocketInformation(int sysno) { + switch (sysno) { + case __NR_getpeername: +@@ -554,7 +562,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { + case __NR_mincore: + case __NR_mlockall: + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_mmap: + #endif + #if defined(__i386__) || defined(__arm__) || \ +@@ -587,7 +595,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) + case __NR__llseek: + #endif +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_poll: + #endif + case __NR_ppoll: +@@ -608,7 +616,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { + case __NR_recv: + #endif + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_recvfrom: // Could specify source. + case __NR_recvmsg: // Could specify source. + #endif +@@ -623,7 +631,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { + case __NR_send: + #endif + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_sendmsg: // Could specify destination. + case __NR_sendto: // Could specify destination. + #endif +@@ -672,7 +680,7 @@ bool SyscallSets::IsSeccomp(int sysno) { + bool SyscallSets::IsAllowedBasicScheduler(int sysno) { + switch (sysno) { + case __NR_sched_yield: +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_pause: + #endif + case __NR_nanosleep: +@@ -756,7 +764,7 @@ bool SyscallSets::IsNuma(int sysno) { + case __NR_getcpu: + case __NR_mbind: + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_migrate_pages: + #endif + case __NR_move_pages: +@@ -791,7 +799,7 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) { + switch (sysno) { + case __NR_acct: // Privileged. + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch__) + case __NR_getrlimit: + #endif + #if defined(__i386__) || defined(__arm__) +@@ -826,7 +834,7 @@ bool SyscallSets::IsDebug(int sysno) { + + bool SyscallSets::IsGlobalSystemStatus(int sysno) { + switch (sysno) { +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR__sysctl: + case __NR_sysfs: + #endif +@@ -844,7 +852,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) { + + bool SyscallSets::IsEventFd(int sysno) { + switch (sysno) { +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_eventfd: + #endif + case __NR_eventfd2: +@@ -897,7 +905,7 @@ bool SyscallSets::IsKeyManagement(int sysno) { + + #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ +- defined(__riscv) ++ defined(__riscv) || defined(__loongarch_lp64) + bool SyscallSets::IsSystemVSemaphores(int sysno) { + switch (sysno) { + case __NR_semctl: +@@ -916,7 +924,7 @@ bool SyscallSets::IsSystemVSemaphores(int sysno) { + #endif + + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ +- defined(__aarch64__) || \ ++ defined(__aarch64__) || defined(__loongarch_lp64) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ + defined(__riscv) + // These give a lot of ambient authority and bypass the setuid sandbox. +@@ -935,7 +943,7 @@ bool SyscallSets::IsSystemVSharedMemory(int sysno) { + + #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ +- defined(__riscv) ++ defined(__riscv) || defined(__loongarch_lp64) + bool SyscallSets::IsSystemVMessageQueue(int sysno) { + switch (sysno) { + case __NR_msgctl: +@@ -967,7 +975,7 @@ bool SyscallSets::IsSystemVIpc(int sysno) { + bool SyscallSets::IsAnySystemV(int sysno) { + #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ +- defined(__riscv) ++ defined(__riscv) || defined(__loongarch_lp64) + return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) || + IsSystemVSharedMemory(sysno); + #elif defined(__i386__) || \ +@@ -1004,7 +1012,7 @@ bool SyscallSets::IsAdvancedScheduler(int sysno) { + bool SyscallSets::IsInotify(int sysno) { + switch (sysno) { + case __NR_inotify_add_watch: +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_inotify_init: + #endif + case __NR_inotify_init1: +@@ -1142,7 +1150,7 @@ bool SyscallSets::IsMisc(int sysno) { + #if defined(__x86_64__) + case __NR_tuxcall: + #endif +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_vserver: + #endif + return true; +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +index 981a29702..bdb7250db 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +@@ -52,7 +52,7 @@ class SANDBOX_EXPORT SyscallSets { + #endif + + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch_lp64) + static bool IsNetworkSocketInformation(int sysno); + #endif + +@@ -80,25 +80,25 @@ class SANDBOX_EXPORT SyscallSets { + static bool IsKeyManagement(int sysno); + #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ +- defined(__riscv) ++ defined(__riscv) || defined(__loongarch_lp64) + static bool IsSystemVSemaphores(int sysno); + #endif + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ + defined(__aarch64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ +- defined(__riscv) ++ defined(__riscv) || defined(__loongarch_lp64) + // These give a lot of ambient authority and bypass the setuid sandbox. + static bool IsSystemVSharedMemory(int sysno); + #endif + + #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \ +- defined(__riscv) ++ defined(__riscv) || defined(__loongarch_lp64) + static bool IsSystemVMessageQueue(int sysno); + #endif + + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || defined(__looongarch__) + // Big system V multiplexing system call. + static bool IsSystemVIpc(int sysno); + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc +index 61453ecf9..b086a3346 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall.cc +@@ -18,7 +18,7 @@ namespace sandbox { + namespace { + + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \ +- defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY) ++ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY) || defined(ARCH_CPU_LOONGARCH_FAMILY) + // Number that's not currently used by any Linux kernel ABIs. + const int kInvalidSyscallNumber = 0x351d3; + #else +@@ -330,6 +330,25 @@ asm(// We need to be able to tell the kernel exactly where we made a + "2:ret\n" + ".cfi_endproc\n" + ".size SyscallAsm, .-SyscallAsm\n" ++#elif defined(__loongarch_lp64) ++ ".text\n" ++ ".global SyscallAsm\n" ++ ".type SyscallAsm, %function\n" ++ "SyscallAsm:\n" ++ "bge $a0, $zero, 1f\n" ++ "la $a0, 2f\n" ++ "b 2f\n" ++ "1:ld.d $a5, $a6, 40\n" ++ "ld.d $a4, $a6, 32\n" ++ "ld.d $a3, $a6, 24\n" ++ "ld.d $a2, $a6, 16\n" ++ "ld.d $a1, $a6, 8\n" ++ "move $a7, $a0\n" ++ "ld.d $a0, $a6, 0\n" ++ // Enter the kernel ++ "syscall 0\n" ++ "2:jirl $zero, $ra, 0\n" ++ ".size SyscallAsm, .-SyscallAsm\n" + #endif + ); // asm + +@@ -459,6 +478,17 @@ intptr_t Syscall::Call(int nr, + ret = inout; + } + ++#elif defined(__loongarch_lp64) ++ intptr_t ret; ++ { ++ register intptr_t inout __asm__("$r4") = nr; ++ register const intptr_t* data __asm__("$r10") = args; ++ asm volatile("bl SyscallAsm\n" ++ : "=r"(inout) ++ : "0"(inout), "r"(data) ++ : "memory", "$r5", "$r6", "$r7", "$r8", "$r9", "$r11", "$r1"); ++ ret = inout; ++ } + #else + #error "Unimplemented architecture" + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall_unittest.cc b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall_unittest.cc +index 9667feaae..80403a2f6 100644 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf/syscall_unittest.cc +@@ -65,6 +65,7 @@ TEST(Syscall, WellKnownEntryPoint) { + EXPECT_EQ(0x0cu, (((uint32_t*)Syscall::Call(-1))[-1]) & 0x0000FFFF); + #elif defined(__aarch64__) + EXPECT_EQ(0xD4000001u, ((uint32_t*)Syscall::Call(-1))[-1]); // SVC 0 ++#elif defined(__loongarch_lp64) + #else + #warning Incomplete test case; need port for target platform + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/services/credentials.cc b/src/3rdparty/chromium/sandbox/linux/services/credentials.cc +index a400688e1..4b4c21d5c 100644 +--- a/src/3rdparty/chromium/sandbox/linux/services/credentials.cc ++++ b/src/3rdparty/chromium/sandbox/linux/services/credentials.cc +@@ -80,7 +80,7 @@ bool ChrootToSafeEmptyDir() { + pid_t pid = -1; + alignas(16) char stack_buf[PTHREAD_STACK_MIN]; + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \ +- defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY) ++ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY) || defined(ARCH_CPU_LOONGARCH_FAMILY) + // The stack grows downward. + void* stack = stack_buf + sizeof(stack_buf); + #else +diff --git a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc +index bb4bd3323..675c1d52a 100644 +--- a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc ++++ b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.cc +@@ -58,7 +58,7 @@ long sys_clone(unsigned long flags, + if (ctid) MSAN_UNPOISON(ctid, sizeof(*ctid)); + // See kernel/fork.c in Linux. There is different ordering of sys_clone + // parameters depending on CONFIG_CLONE_BACKWARDS* configuration options. +-#if defined(ARCH_CPU_X86_64) ++#if defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_LOONGARCH64) + return syscall(__NR_clone, flags, child_stack, ptid, ctid, tls); + #elif defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARM_FAMILY) || \ + defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY) +@@ -163,11 +163,58 @@ int sys_sigaction(int signum, + return sigaction(signum, act, oldact); + } + ++void statx_to_stat(struct kernel_stat* to, struct kernel_statx* from) { ++ memset(to, 0, sizeof(struct kernel_stat)); ++ to->st_dev = ((from->stx_dev_minor & 0xff) | (from->stx_dev_major << 8) | ++ ((from->stx_dev_minor & ~0xff) << 12)); ++ to->st_rdev = ((from->stx_rdev_minor & 0xff) | (from->stx_rdev_major << 8) | ++ ((from->stx_rdev_minor & ~0xff) << 12)); ++ to->st_ino = from->stx_ino; ++ to->st_mode = from->stx_mode; ++ to->st_nlink = from->stx_nlink; ++ to->st_uid = from->stx_uid; ++ to->st_gid = from->stx_gid; ++ to->st_atime_ = from->stx_atime.tv_sec; ++ to->st_atime_nsec_ = from->stx_atime.tv_nsec; ++ to->st_mtime_ = from->stx_mtime.tv_sec; ++ to->st_mtime_nsec_ = from->stx_mtime.tv_nsec; ++ to->st_ctime_ = from->stx_ctime.tv_sec; ++ to->st_ctime_nsec_ = from->stx_ctime.tv_nsec; ++ to->st_size = from->stx_size; ++ to->st_blocks = from->stx_blocks; ++ to->st_blksize = from->stx_blksize; ++} ++ ++int sys_statx(int fd, ++ const char* path, ++ int flags, ++ unsigned int mask, ++ struct kernel_statx* statx_buf) { ++#if defined(__NR_statx) ++ int res; ++ res = syscall(__NR_statx, fd, path, flags, mask, statx_buf); ++ if (res == 0) ++ MSAN_UNPOISON(stat_buf, sizeof(*stat_buf)); ++ return res; ++#else // defined(__NR_statx) ++ RAW_CHECK(false); ++ return -ENOSYS; ++#endif ++} ++ + int sys_stat(const char* path, struct kernel_stat* stat_buf) { + int res; + #if !defined(__NR_stat) ++#if defined(__NR_statx) ++ kernel_statx statx_buf; ++ res = sys_statx(AT_FDCWD, path, AT_STATX_SYNC_AS_STAT, STATX_BASIC_STATS, ++ &statx_buf); ++ if (res == 0) ++ statx_to_stat(stat_buf, &statx_buf); ++#else // defined(__NR_statx) + res = syscall(__NR_newfstatat, AT_FDCWD, path, stat_buf, 0); +-#else ++#endif ++#else //! defined(__NR_stat) + res = syscall(__NR_stat, path, stat_buf); + #endif + if (res == 0) +@@ -178,8 +225,17 @@ int sys_stat(const char* path, struct kernel_stat* stat_buf) { + int sys_lstat(const char* path, struct kernel_stat* stat_buf) { + int res; + #if !defined(__NR_lstat) ++#if defined(__NR_statx) ++ kernel_statx statx_buf; ++ int flag = 0; ++ flag = AT_NO_AUTOMOUNT | AT_SYMLINK_NOFOLLOW; ++ res = sys_statx(AT_FDCWD, path, flag, STATX_BASIC_STATS, &statx_buf); ++ if (res == 0) ++ statx_to_stat(stat_buf, &statx_buf); ++#else // defined(__NR_statx) + res = syscall(__NR_newfstatat, AT_FDCWD, path, stat_buf, AT_SYMLINK_NOFOLLOW); +-#else ++#endif ++#else //! defined(__NR_lstat) + res = syscall(__NR_lstat, path, stat_buf); + #endif + if (res == 0) +diff --git a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.h b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.h +index a05d44702..2952f9a34 100644 +--- a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.h ++++ b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers.h +@@ -18,6 +18,7 @@ struct rlimit64; + struct cap_hdr; + struct cap_data; + struct kernel_stat; ++struct kernel_statx; + struct kernel_stat64; + + namespace sandbox { +@@ -91,6 +92,11 @@ SANDBOX_EXPORT int sys_sigaction(int signum, + // architectures, with the same capabilities as stat() and lstat(). + SANDBOX_EXPORT int sys_stat(const char* path, struct kernel_stat* stat_buf); + SANDBOX_EXPORT int sys_lstat(const char* path, struct kernel_stat* stat_buf); ++SANDBOX_EXPORT int sys_statx(int fd, ++ const char* path, ++ int flags, ++ unsigned int mask, ++ struct kernel_statx* statx_buf); + + // Takes care of unpoisoning |stat_buf| for MSAN. Check-fails if fstatat64() is + // not a supported syscall on the current platform. +diff --git a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers_unittest.cc b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers_unittest.cc +index d8a0fbc48..e93321321 100644 +--- a/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/services/syscall_wrappers_unittest.cc +@@ -99,6 +99,7 @@ TEST(SyscallWrappers, LinuxSigSet) { + linux_sigset); + } + ++#if !defined(__loongarch_lp64) + TEST(SyscallWrappers, Stat) { + // Create a file to stat, with 12 bytes of data. + ScopedTemporaryFile tmp_file; +@@ -165,6 +166,7 @@ TEST(SyscallWrappers, Stat) { + EXPECT_EQ(0u, sb->__unused5); + #endif + } ++#endif + + #if defined(__NR_fstatat64) + TEST(SyscallWrappers, Stat64) { +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.cc +index 69c07c3a2..7a391f911 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.cc ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.cc +@@ -193,6 +193,21 @@ int BrokerClient::Stat64(const char* pathname, + sizeof(*sb)); + } + ++int BrokerClient::Statx(const char* pathname, ++ bool follow_links, ++ struct kernel_statx* sb) const { ++ if (!pathname || !sb) ++ return -EFAULT; ++ ++ if (fast_check_in_client_ && ++ !CommandStatIsSafe(policy_.allowed_command_set, ++ *policy_.file_permissions, pathname, nullptr)) { ++ return -policy_.file_permissions->denied_errno(); ++ } ++ return StatFamilySyscall(COMMAND_STATX, pathname, follow_links, sb, ++ sizeof(*sb)); ++} ++ + int BrokerClient::Unlink(const char* path) const { + if (!path) + return -EFAULT; +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.h b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.h +index bdc35d9cd..6165d5b5f 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.h ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_client.h +@@ -66,6 +66,9 @@ class SANDBOX_EXPORT BrokerClient : public SyscallDispatcher { + int Stat64(const char* pathname, + bool follow_links, + struct kernel_stat64* sb) const override; ++ int Statx(const char* pathname, ++ bool follow_links, ++ struct kernel_statx* sb) const override; + int Unlink(const char* unlink) const override; + + const BrokerSandboxConfig& policy() const { return policy_; } +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_command.h b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_command.h +index 514c5f642..98a6b1adb 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_command.h ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_command.h +@@ -41,6 +41,7 @@ enum BrokerCommand { + COMMAND_RMDIR, + COMMAND_STAT, + COMMAND_STAT64, ++ COMMAND_STATX, + COMMAND_UNLINK, + + // NOTE: update when adding new commands. +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_host.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_host.cc +index 3203ea3c8..8b532ac99 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_host.cc ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_host.cc +@@ -222,7 +222,22 @@ void StatFileForIPC(const BrokerCommandSet& allowed_command_set, + RAW_CHECK(reply->AddIntToMessage(0)); + RAW_CHECK( + reply->AddDataToMessage(reinterpret_cast(&sb), sizeof(sb))); +-#else // defined(__NR_fstatat64) ++#elif defined(__NR_statx) ++ DCHECK(command_type == COMMAND_STATX); ++ struct kernel_statx sb; ++ ++ int sts = sandbox::sys_statx(AT_FDCWD, file_to_access, ++ follow_links ? 0 : AT_SYMLINK_NOFOLLOW, ++ STATX_BASIC_STATS, &sb); ++ if (sts < 0) { ++ RAW_CHECK(reply->AddIntToMessage(-errno)); ++ return; ++ } ++ RAW_CHECK(reply->AddIntToMessage(0)); ++ RAW_CHECK( ++ reply->AddDataToMessage(reinterpret_cast(&sb), sizeof(sb))); ++ ++#else + // We should not reach here on 64-bit systems, as the *stat*64() are only + // necessary on 32-bit. + RAW_CHECK(false); +@@ -320,7 +335,8 @@ bool HandleRemoteCommand(const BrokerCommandSet& allowed_command_set, + break; + } + case COMMAND_STAT: +- case COMMAND_STAT64: { ++ case COMMAND_STAT64: ++ case COMMAND_STATX: { + const char* requested_filename; + if (!message->ReadString(&requested_filename)) + return false; +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc +index 18fea09ac..5fc22ea43 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process.cc +@@ -117,32 +117,34 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { + // and are default disabled in Android. So, we should refuse to broker them + // to be consistent with the platform's restrictions. + switch (sysno) { +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_access: + #endif + case __NR_faccessat: ++#if !defined(__loongarch_lp64) + case __NR_faccessat2: ++#endif + return !fast_check || policy_->allowed_command_set.test(COMMAND_ACCESS); + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_mkdir: + #endif + case __NR_mkdirat: + return !fast_check || policy_->allowed_command_set.test(COMMAND_MKDIR); + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_open: + #endif + case __NR_openat: + return !fast_check || policy_->allowed_command_set.test(COMMAND_OPEN); + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_readlink: + #endif + case __NR_readlinkat: + return !fast_check || policy_->allowed_command_set.test(COMMAND_READLINK); + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_rename: + #endif + #ifdef __NR_renameat +@@ -151,12 +153,12 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { + case __NR_renameat2: + return !fast_check || policy_->allowed_command_set.test(COMMAND_RENAME); + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_rmdir: + return !fast_check || policy_->allowed_command_set.test(COMMAND_RMDIR); + #endif + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_stat: + case __NR_lstat: + #endif +@@ -168,6 +170,9 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { + #endif + #if defined(__x86_64__) || defined(__aarch64__) || defined(__riscv) + case __NR_newfstatat: ++#endif ++#if defined(__NR_statx) ++ case __NR_statx: + #endif + return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT); + +@@ -181,7 +186,7 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { + return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT); + #endif + +-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) ++#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_unlink: + return !fast_check || policy_->allowed_command_set.test(COMMAND_UNLINK); + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process_unittest.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process_unittest.cc +index 526574ec8..03f163861 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/broker_process_unittest.cc +@@ -821,6 +821,9 @@ TEST(BrokerProcess, CreateFile) { + unlink(permfile_name); + } + ++// Use statx instead of stat,lstat and fstatat on loongarch64 architecture, ++// So not test run TestStatHelper on loongarch64. ++#if !defined(__loongarch_lp64) + void TestStatHelper(bool fast_check_in_client, bool follow_links) { + ScopedTemporaryFile tmp_file; + EXPECT_EQ(12, write(tmp_file.fd(), "blahblahblah", 12)); +@@ -1001,7 +1004,6 @@ void TestStatHelper(bool fast_check_in_client, bool follow_links) { + EXPECT_EQ(0, + open_broker.GetBrokerClientSignalBased()->DefaultStatForTesting( + tempfile_name, follow_links, &sb)); +- + // Following fields may never be consistent but should be non-zero. + // Don't trust the platform to define fields with any particular sign. + EXPECT_NE(0u, static_cast(sb.st_dev)); +@@ -1033,6 +1035,7 @@ TEST(BrokerProcess, StatFileHost) { + TestStatHelper(false, true); + TestStatHelper(false, false); + } ++#endif + + void TestRenameHelper(bool fast_check_in_client) { + std::string oldpath; +@@ -1751,7 +1754,10 @@ TEST(BrokerProcess, UnlinkHost) { + TEST(BrokerProcess, IsSyscallAllowed) { + const base::flat_map> kSysnosForCommand = { + {COMMAND_ACCESS, +- {__NR_faccessat, __NR_faccessat2, ++ {__NR_faccessat, ++#if !defined(__loongarch_lp64) ++ __NR_faccessat2, ++#endif + #if defined(__NR_access) && !BUILDFLAG(IS_ANDROID) + __NR_access + #endif +@@ -1768,12 +1774,14 @@ TEST(BrokerProcess, IsSyscallAllowed) { + __NR_open + #endif + }}, ++#if !defined(__loongarch_lp64) + {COMMAND_READLINK, + {__NR_readlinkat, + #if defined(__NR_readlink) && !BUILDFLAG(IS_ANDROID) + __NR_readlink + #endif + }}, ++#endif + {COMMAND_RENAME, + {__NR_renameat, + #if defined(__NR_rename) && !BUILDFLAG(IS_ANDROID) +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc +index e5e0b0486..3dc695694 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/remote_syscall_arg_handler_unittest.cc +@@ -28,7 +28,11 @@ namespace { + const char kPathPart[] = "/i/am/path"; + + void FillBufferWithPath(char* buf, size_t size, bool null_terminate) { ++#if defined(__loongarch_lp64) ++ SANDBOX_ASSERT_LE(size, static_cast(PATH_MAX * 4)); ++#else + SANDBOX_ASSERT_LE(size, static_cast(PATH_MAX)); ++#endif + size_t str_len = strlen(kPathPart); + size_t len_left_to_write = size; + char* curr_buf_pos = buf; +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.cc b/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.cc +index 6d9782cfe..9b9cded79 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.cc ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.cc +@@ -26,6 +26,8 @@ int SyscallDispatcher::DefaultStatForTesting(const char* pathname, + return Stat64(pathname, follow_links, sb); + #elif defined(__NR_newfstatat) + return Stat(pathname, follow_links, sb); ++#elif defined(__NR_statx) ++ return Statx(pathname, follow_links, sb); + #endif + } + +@@ -165,6 +167,11 @@ int SyscallDispatcher::DispatchSyscall(const arch_seccomp_data& args) { + return Stat64(reinterpret_cast(args.args[0]), true, + reinterpret_cast(args.args[1])); + #endif ++#if defined(__NR_statx) ++ case __NR_statx: ++ return Statx(reinterpret_cast(args.args[0]), true, ++ reinterpret_cast(args.args[1])); ++#endif + #if defined(__NR_lstat) + case __NR_lstat: + // See https://crbug.com/847096 +diff --git a/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.h b/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.h +index 3c5b26034..e11746d22 100644 +--- a/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.h ++++ b/src/3rdparty/chromium/sandbox/linux/syscall_broker/syscall_dispatcher.h +@@ -49,6 +49,9 @@ class SANDBOX_EXPORT SyscallDispatcher { + virtual int Stat64(const char* pathname, + bool follow_links, + struct kernel_stat64* sb) const = 0; ++ virtual int Statx(const char* pathname, ++ bool follow_links, ++ struct kernel_statx* sb) const = 0; + + // Emulates unlink()/unlinkat(). + virtual int Unlink(const char* unlink) const = 0; +diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h +index 5e3403866..0b95165a2 100644 +--- a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h ++++ b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_seccomp.h +@@ -42,6 +42,10 @@ + #define EM_RISCV 243 + #endif + ++#ifndef EM_LOONGARCH ++#define EM_LOONGARCH 258 ++#endif ++ + #ifndef __AUDIT_ARCH_64BIT + #define __AUDIT_ARCH_64BIT 0x80000000 + #endif +@@ -77,6 +81,11 @@ + #define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) + #endif + ++#ifndef AUDIT_ARCH_LOONGARCH64 ++#define AUDIT_ARCH_LOONGARCH64 \ ++ (EM_LOONGARCH | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) ++#endif ++ + // For prctl.h + #ifndef PR_SET_SECCOMP + #define PR_SET_SECCOMP 22 +diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h +index 2ffe30973..5adb47237 100644 +--- a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h ++++ b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_signal.h +@@ -13,7 +13,7 @@ + // (not undefined, but defined different values and in different memory + // layouts). So, fill the gap here. + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ +- defined(__aarch64__) || defined(__riscv) ++ defined(__aarch64__) || defined(__riscv) || defined(__loongarch_lp64) + + #define LINUX_SIGHUP 1 + #define LINUX_SIGINT 2 +@@ -97,6 +97,7 @@ typedef siginfo_t LinuxSigInfo; + struct LinuxSigSet { + unsigned long sig[_NSIG_WORDS]; + }; ++// TODO:LA64 Check this _NSIG_WORDS and LinuxSigAction + #elif defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS) + #if !defined(_NSIG_WORDS) + #define _NSIG_WORDS 2 +@@ -104,6 +105,13 @@ struct LinuxSigSet { + struct LinuxSigSet { + unsigned long sig[_NSIG_WORDS]; + }; ++#elif defined(ARCH_CPU_LOONGARCH_FAMILY) ++#if !defined(_NSIG_WORDS) ++#define _NSIG_WORDS 1 ++#endif ++struct LinuxSigSet { ++ unsigned long sig[_NSIG_WORDS]; ++}; + #else + typedef uint64_t LinuxSigSet; + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_stat.h b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_stat.h +index 74977adb5..47b8beba5 100644 +--- a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_stat.h ++++ b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_stat.h +@@ -150,7 +150,7 @@ struct kernel_stat { + int st_blocks; + int st_pad4[14]; + }; +-#elif defined(__aarch64__) || defined(__riscv) ++#elif defined(__aarch64__) || defined(__riscv) || defined(__loongarch_lp64) + struct kernel_stat { + unsigned long st_dev; + unsigned long st_ino; +@@ -175,6 +175,37 @@ struct kernel_stat { + }; + #endif + ++#if defined(__loongarch_lp64) ++struct kernel_statx_timestamp { ++ long tv_sec; ++ unsigned int tv_nsec; ++ int __reserved; ++}; ++struct kernel_statx { ++ unsigned int stx_mask; ++ unsigned int stx_blksize; ++ unsigned long stx_attributes; ++ unsigned int stx_nlink; ++ unsigned int stx_uid; ++ unsigned int stx_gid; ++ unsigned short stx_mode; ++ unsigned short __spare0[1]; ++ unsigned long stx_ino; ++ unsigned long stx_size; ++ unsigned long stx_blocks; ++ unsigned long stx_attributes_mask; ++ struct kernel_statx_timestamp stx_atime; ++ struct kernel_statx_timestamp stx_btime; ++ struct kernel_statx_timestamp stx_ctime; ++ struct kernel_statx_timestamp stx_mtime; ++ unsigned int stx_rdev_major; ++ unsigned int stx_rdev_minor; ++ unsigned int stx_dev_major; ++ unsigned int stx_dev_minor; ++ unsigned long __spare2[14]; ++}; ++#endif ++ + #if !defined(AT_EMPTY_PATH) + #define AT_EMPTY_PATH 0x1000 + #endif +@@ -207,6 +238,20 @@ using default_stat_struct = struct kernel_stat; + #define __NR_fstatat_default __NR_newfstatat + #define __NR_fstat_default __NR_fstat + ++#elif defined(__NR_statx) ++ ++namespace sandbox { ++using default_stat_struct = struct kernel_statx; ++} // namespace sandbox ++ ++#define AT_STATX_SYNC_TYPE 0x6000 ++#define AT_STATX_SYNC_AS_STAT 0x0000 ++#define AT_STATX_FORCE_SYNC 0x2000 ++#define AT_STATX_DONT_SYNC 0x4000 ++#define STATX_ALL 0x00000fffU ++ ++#define __NR_statx_default __NR_statx ++ + #else + #error "one of fstatat64 and newfstatat must be defined" + #endif +diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h +index d6de8c1cb..5b81220ac 100644 +--- a/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h ++++ b/src/3rdparty/chromium/sandbox/linux/system_headers/linux_syscalls.h +@@ -39,5 +39,9 @@ + #include "sandbox/linux/system_headers/riscv64_linux_syscalls.h" + #endif + ++#if defined(__loongarch_lp64) ++#include "sandbox/linux/system_headers/loongarch64_linux_syscalls.h" ++#endif ++ + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_ + +diff --git a/src/3rdparty/chromium/sandbox/linux/system_headers/loongarch64_linux_syscalls.h b/src/3rdparty/chromium/sandbox/linux/system_headers/loongarch64_linux_syscalls.h +new file mode 100644 +index 000000000..65bd0ac8e +--- /dev/null ++++ b/src/3rdparty/chromium/sandbox/linux/system_headers/loongarch64_linux_syscalls.h +@@ -0,0 +1,851 @@ ++// Copyright 2021 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_LOONGARCH64_LINUX_SYSCALLS_H_ ++#define SANDBOX_LINUX_SYSTEM_HEADERS_LOONGARCH64_LINUX_SYSCALLS_H_ ++ ++#if !defined(__loongarch__) ++#error "Including header on wrong architecture" ++#endif ++#include ++#if !defined(__NR_io_setup) ++#define __NR_io_setup 0 ++#endif ++#if !defined(__NR_io_destroy) ++#define __NR_io_destroy 1 ++#endif ++#if !defined(__NR_io_submit) ++#define __NR_io_submit 2 ++#endif ++#if !defined(__NR_io_cancel) ++#define __NR_io_cancel 3 ++#endif ++#if !defined(__NR_io_getevents) ++#define __NR_io_getevents 4 ++#endif ++#if !defined(__NR_setxattr) ++#define __NR_setxattr 5 ++#endif ++#if !defined(__NR_lsetxattr) ++#define __NR_lsetxattr 6 ++#endif ++#if !defined(__NR_fsetxattr) ++#define __NR_fsetxattr 7 ++#endif ++#if !defined(__NR_getxattr) ++#define __NR_getxattr 8 ++#endif ++#if !defined(__NR_lgetxattr) ++#define __NR_lgetxattr 9 ++#endif ++#if !defined(__NR_fgetxattr) ++#define __NR_fgetxattr 10 ++#endif ++#if !defined(__NR_listxattr) ++#define __NR_listxattr 11 ++#endif ++#if !defined(__NR_llistxattr) ++#define __NR_llistxattr 12 ++#endif ++#if !defined(__NR_flistxattr) ++#define __NR_flistxattr 13 ++#endif ++#if !defined(__NR_removexattr) ++#define __NR_removexattr 14 ++#endif ++#if !defined(__NR_lremovexattr) ++#define __NR_lremovexattr 15 ++#endif ++#if !defined(__NR_fremovexattr) ++#define __NR_fremovexattr 16 ++#endif ++#if !defined(__NR_getcwd) ++#define __NR_getcwd 17 ++#endif ++#if !defined(__NR_lookup_dcookie) ++#define __NR_lookup_dcookie 18 ++#endif ++#if !defined(__NR_eventfd2) ++#define __NR_eventfd2 19 ++#endif ++#if !defined(__NR_epoll_create1) ++#define __NR_epoll_create1 20 ++#endif ++#if !defined(__NR_epoll_ctl) ++#define __NR_epoll_ctl 21 ++#endif ++#if !defined(__NR_epoll_pwait) ++#define __NR_epoll_pwait 22 ++#endif ++#if !defined(__NR_dup) ++#define __NR_dup 23 ++#endif ++#if !defined(__NR_dup3) ++#define __NR_dup3 24 ++#endif ++#if !defined(__NR_fcntl) ++#define __NR_fcntl 25 ++#endif ++#if !defined(__NR_inotify_init1) ++#define __NR_inotify_init1 26 ++#endif ++#if !defined(__NR_inotify_add_watch) ++#define __NR_inotify_add_watch 27 ++#endif ++#if !defined(__NR_inotify_rm_watch) ++#define __NR_inotify_rm_watch 28 ++#endif ++#if !defined(__NR_ioctl) ++#define __NR_ioctl 29 ++#endif ++#if !defined(__NR_ioprio_set) ++#define __NR_ioprio_set 30 ++#endif ++#if !defined(__NR_ioprio_get) ++#define __NR_ioprio_get 31 ++#endif ++#if !defined(__NR_flock) ++#define __NR_flock 32 ++#endif ++#if !defined(__NR_mknodat) ++#define __NR_mknodat 33 ++#endif ++#if !defined(__NR_mkdirat) ++#define __NR_mkdirat 34 ++#endif ++#if !defined(__NR_unlinkat) ++#define __NR_unlinkat 35 ++#endif ++#if !defined(__NR_symlinkat) ++#define __NR_symlinkat 36 ++#endif ++#if !defined(__NR_linkat) ++#define __NR_linkat 37 ++#endif ++#if !defined(__NR_renameat) ++#define __NR_renameat 38 ++#endif ++#if !defined(__NR_umount2) ++#define __NR_umount2 39 ++#endif ++#if !defined(__NR_mount) ++#define __NR_mount 40 ++#endif ++#if !defined(__NR_pivot_root) ++#define __NR_pivot_root 41 ++#endif ++#if !defined(__NR_nfsservctl) ++#define __NR_nfsservctl 42 ++#endif ++#if !defined(__NR_statfs) ++#define __NR_statfs 43 ++#endif ++#if !defined(__NR_fstatfs) ++#define __NR_fstatfs 44 ++#endif ++#if !defined(__NR_truncate) ++#define __NR_truncate 45 ++#endif ++#if !defined(__NR_ftruncate) ++#define __NR_ftruncate 46 ++#endif ++#if !defined(__NR_fallocate) ++#define __NR_fallocate 47 ++#endif ++#if !defined(__NR_faccessat) ++#define __NR_faccessat 48 ++#endif ++#if !defined(__NR_chdir) ++#define __NR_chdir 49 ++#endif ++#if !defined(__NR_fchdir) ++#define __NR_fchdir 50 ++#endif ++#if !defined(__NR_chroot) ++#define __NR_chroot 51 ++#endif ++#if !defined(__NR_fchmod) ++#define __NR_fchmod 52 ++#endif ++#if !defined(__NR_fchmodat) ++#define __NR_fchmodat 53 ++#endif ++#if !defined(__NR_fchownat) ++#define __NR_fchownat 54 ++#endif ++#if !defined(__NR_fchown) ++#define __NR_fchown 55 ++#endif ++#if !defined(__NR_openat) ++#define __NR_openat 56 ++#endif ++#if !defined(__NR_close) ++#define __NR_close 57 ++#endif ++#if !defined(__NR_vhangup) ++#define __NR_vhangup 58 ++#endif ++#if !defined(__NR_pipe2) ++#define __NR_pipe2 59 ++#endif ++#if !defined(__NR_quotactl) ++#define __NR_quotactl 60 ++#endif ++#if !defined(__NR_getdents64) ++#define __NR_getdents64 61 ++#endif ++#if !defined(__NR_lseek) ++#define __NR_lseek 62 ++#endif ++#if !defined(__NR_read) ++#define __NR_read 63 ++#endif ++#if !defined(__NR_write) ++#define __NR_write 64 ++#endif ++#if !defined(__NR_readv) ++#define __NR_readv 65 ++#endif ++#if !defined(__NR_writev) ++#define __NR_writev 66 ++#endif ++#if !defined(__NR_pread64) ++#define __NR_pread64 67 ++#endif ++#if !defined(__NR_pwrite64) ++#define __NR_pwrite64 68 ++#endif ++#if !defined(__NR_preadv) ++#define __NR_preadv 69 ++#endif ++#if !defined(__NR_pwritev) ++#define __NR_pwritev 70 ++#endif ++#if !defined(__NR_sendfile) ++#define __NR_sendfile 71 ++#endif ++#if !defined(__NR_pselect6) ++#define __NR_pselect6 72 ++#endif ++#if !defined(__NR_ppoll) ++#define __NR_ppoll 73 ++#endif ++#if !defined(__NR_signalfd4) ++#define __NR_signalfd4 74 ++#endif ++#if !defined(__NR_vmsplice) ++#define __NR_vmsplice 75 ++#endif ++#if !defined(__NR_splice) ++#define __NR_splice 76 ++#endif ++#if !defined(__NR_tee) ++#define __NR_tee 77 ++#endif ++#if !defined(__NR_readlinkat) ++#define __NR_readlinkat 78 ++#endif ++#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) ++#if !defined(__NR_newfstatat) ++#define __NR_newfstatat 79 ++#endif ++#if !defined(__NR_fstat) ++#define __NR_fstat 80 ++#endif ++#endif ++#if !defined(__NR_sync) ++#define __NR_sync 81 ++#endif ++#if !defined(__NR_fsync) ++#define __NR_fsync 82 ++#endif ++#if !defined(__NR_fdatasync) ++#define __NR_fdatasync 83 ++#endif ++#if !defined(__NR_sync_file_range) ++#define __NR_sync_file_range 84 ++#endif ++#if !defined(__NR_timerfd_create) ++#define __NR_timerfd_create 85 ++#endif ++#if !defined(__NR_timerfd_settime) ++#define __NR_timerfd_settime 86 ++#endif ++#if !defined(__NR_timerfd_gettime) ++#define __NR_timerfd_gettime 87 ++#endif ++#if !defined(__NR_utimensat) ++#define __NR_utimensat 88 ++#endif ++#if !defined(__NR_acct) ++#define __NR_acct 89 ++#endif ++#if !defined(__NR_capget) ++#define __NR_capget 90 ++#endif ++#if !defined(__NR_capset) ++#define __NR_capset 91 ++#endif ++#if !defined(__NR_personality) ++#define __NR_personality 92 ++#endif ++#if !defined(__NR_exit) ++#define __NR_exit 93 ++#endif ++#if !defined(__NR_exit_group) ++#define __NR_exit_group 94 ++#endif ++#if !defined(__NR_waitid) ++#define __NR_waitid 95 ++#endif ++#if !defined(__NR_set_tid_address) ++#define __NR_set_tid_address 96 ++#endif ++#if !defined(__NR_unshare) ++#define __NR_unshare 97 ++#endif ++#if !defined(__NR_futex) ++#define __NR_futex 98 ++#endif ++#if !defined(__NR_set_robust_list) ++#define __NR_set_robust_list 99 ++#endif ++#if !defined(__NR_get_robust_list) ++#define __NR_get_robust_list 100 ++#endif ++#if !defined(__NR_nanosleep) ++#define __NR_nanosleep 101 ++#endif ++#if !defined(__NR_getitimer) ++#define __NR_getitimer 102 ++#endif ++#if !defined(__NR_setitimer) ++#define __NR_setitimer 103 ++#endif ++#if !defined(__NR_kexec_load) ++#define __NR_kexec_load 104 ++#endif ++#if !defined(__NR_init_module) ++#define __NR_init_module 105 ++#endif ++#if !defined(__NR_delete_module) ++#define __NR_delete_module 106 ++#endif ++#if !defined(__NR_timer_create) ++#define __NR_timer_create 107 ++#endif ++#if !defined(__NR_timer_gettime) ++#define __NR_timer_gettime 108 ++#endif ++#if !defined(__NR_timer_getoverrun) ++#define __NR_timer_getoverrun 109 ++#endif ++#if !defined(__NR_timer_settime) ++#define __NR_timer_settime 110 ++#endif ++#if !defined(__NR_timer_delete) ++#define __NR_timer_delete 111 ++#endif ++#if !defined(__NR_clock_settime) ++#define __NR_clock_settime 112 ++#endif ++#if !defined(__NR_clock_gettime) ++#define __NR_clock_gettime 113 ++#endif ++#if !defined(__NR_clock_getres) ++#define __NR_clock_getres 114 ++#endif ++#if !defined(__NR_clock_nanosleep) ++#define __NR_clock_nanosleep 115 ++#endif ++#if !defined(__NR_syslog) ++#define __NR_syslog 116 ++#endif ++#if !defined(__NR_ptrace) ++#define __NR_ptrace 117 ++#endif ++#if !defined(__NR_sched_setparam) ++#define __NR_sched_setparam 118 ++#endif ++#if !defined(__NR_sched_setscheduler) ++#define __NR_sched_setscheduler 119 ++#endif ++#if !defined(__NR_sched_getscheduler) ++#define __NR_sched_getscheduler 120 ++#endif ++#if !defined(__NR_sched_getparam) ++#define __NR_sched_getparam 121 ++#endif ++#if !defined(__NR_sched_setaffinity) ++#define __NR_sched_setaffinity 122 ++#endif ++#if !defined(__NR_sched_getaffinity) ++#define __NR_sched_getaffinity 123 ++#endif ++#if !defined(__NR_sched_yield) ++#define __NR_sched_yield 124 ++#endif ++#if !defined(__NR_sched_get_priority_max) ++#define __NR_sched_get_priority_max 125 ++#endif ++#if !defined(__NR_sched_get_priority_min) ++#define __NR_sched_get_priority_min 126 ++#endif ++#if !defined(__NR_sched_rr_get_interval) ++#define __NR_sched_rr_get_interval 127 ++#endif ++#if !defined(__NR_restart_syscall) ++#define __NR_restart_syscall 128 ++#endif ++#if !defined(__NR_kill) ++#define __NR_kill 129 ++#endif ++#if !defined(__NR_tkill) ++#define __NR_tkill 130 ++#endif ++#if !defined(__NR_tgkill) ++#define __NR_tgkill 131 ++#endif ++#if !defined(__NR_sigaltstack) ++#define __NR_sigaltstack 132 ++#endif ++#if !defined(__NR_rt_sigsuspend) ++#define __NR_rt_sigsuspend 133 ++#endif ++#if !defined(__NR_rt_sigaction) ++#define __NR_rt_sigaction 134 ++#endif ++#if !defined(__NR_rt_sigprocmask) ++#define __NR_rt_sigprocmask 135 ++#endif ++#if !defined(__NR_rt_sigpending) ++#define __NR_rt_sigpending 136 ++#endif ++#if !defined(__NR_rt_sigtimedwait) ++#define __NR_rt_sigtimedwait 137 ++#endif ++#if !defined(__NR_rt_sigqueueinfo) ++#define __NR_rt_sigqueueinfo 138 ++#endif ++#if !defined(__NR_rt_sigreturn) ++#define __NR_rt_sigreturn 139 ++#endif ++#if !defined(__NR_setpriority) ++#define __NR_setpriority 140 ++#endif ++#if !defined(__NR_getpriority) ++#define __NR_getpriority 141 ++#endif ++#if !defined(__NR_reboot) ++#define __NR_reboot 142 ++#endif ++#if !defined(__NR_setregid) ++#define __NR_setregid 143 ++#endif ++#if !defined(__NR_setgid) ++#define __NR_setgid 144 ++#endif ++#if !defined(__NR_setreuid) ++#define __NR_setreuid 145 ++#endif ++#if !defined(__NR_setuid) ++#define __NR_setuid 146 ++#endif ++#if !defined(__NR_setresuid) ++#define __NR_setresuid 147 ++#endif ++#if !defined(__NR_getresuid) ++#define __NR_getresuid 148 ++#endif ++#if !defined(__NR_setresgid) ++#define __NR_setresgid 149 ++#endif ++#if !defined(__NR_getresgid) ++#define __NR_getresgid 150 ++#endif ++#if !defined(__NR_setfsuid) ++#define __NR_setfsuid 151 ++#endif ++#if !defined(__NR_setfsgid) ++#define __NR_setfsgid 152 ++#endif ++#if !defined(__NR_times) ++#define __NR_times 153 ++#endif ++#if !defined(__NR_setpgid) ++#define __NR_setpgid 154 ++#endif ++#if !defined(__NR_getpgid) ++#define __NR_getpgid 155 ++#endif ++#if !defined(__NR_getsid) ++#define __NR_getsid 156 ++#endif ++#if !defined(__NR_setsid) ++#define __NR_setsid 157 ++#endif ++#if !defined(__NR_getgroups) ++#define __NR_getgroups 158 ++#endif ++#if !defined(__NR_setgroups) ++#define __NR_setgroups 159 ++#endif ++#if !defined(__NR_uname) ++#define __NR_uname 160 ++#endif ++#if !defined(__NR_sethostname) ++#define __NR_sethostname 161 ++#endif ++#if !defined(__NR_setdomainname) ++#define __NR_setdomainname 162 ++#endif ++#if !defined(__NR_getrlimit) ++#define __NR_getrlimit 163 ++#endif ++#if !defined(__NR_setrlimit) ++#define __NR_setrlimit 164 ++#endif ++#if !defined(__NR_getrusage) ++#define __NR_getrusage 165 ++#endif ++#if !defined(__NR_umask) ++#define __NR_umask 166 ++#endif ++#if !defined(__NR_prctl) ++#define __NR_prctl 167 ++#endif ++#if !defined(__NR_getcpu) ++#define __NR_getcpu 168 ++#endif ++#if !defined(__NR_gettimeofday) ++#define __NR_gettimeofday 169 ++#endif ++#if !defined(__NR_settimeofday) ++#define __NR_settimeofday 170 ++#endif ++#if !defined(__NR_adjtimex) ++#define __NR_adjtimex 171 ++#endif ++#if !defined(__NR_getpid) ++#define __NR_getpid 172 ++#endif ++#if !defined(__NR_getppid) ++#define __NR_getppid 173 ++#endif ++#if !defined(__NR_getuid) ++#define __NR_getuid 174 ++#endif ++#if !defined(__NR_geteuid) ++#define __NR_geteuid 175 ++#endif ++#if !defined(__NR_getgid) ++#define __NR_getgid 176 ++#endif ++#if !defined(__NR_getegid) ++#define __NR_getegid 177 ++#endif ++#if !defined(__NR_gettid) ++#define __NR_gettid 178 ++#endif ++#if !defined(__NR_sysinfo) ++#define __NR_sysinfo 179 ++#endif ++#if !defined(__NR_mq_open) ++#define __NR_mq_open 180 ++#endif ++#if !defined(__NR_mq_unlink) ++#define __NR_mq_unlink 181 ++#endif ++#if !defined(__NR_mq_timedsend) ++#define __NR_mq_timedsend 182 ++#endif ++#if !defined(__NR_mq_timedreceive) ++#define __NR_mq_timedreceive 183 ++#endif ++#if !defined(__NR_mq_notify) ++#define __NR_mq_notify 184 ++#endif ++#if !defined(__NR_mq_getsetattr) ++#define __NR_mq_getsetattr 185 ++#endif ++#if !defined(__NR_msgget) ++#define __NR_msgget 186 ++#endif ++#if !defined(__NR_msgctl) ++#define __NR_msgctl 187 ++#endif ++#if !defined(__NR_msgrcv) ++#define __NR_msgrcv 188 ++#endif ++#if !defined(__NR_msgsnd) ++#define __NR_msgsnd 189 ++#endif ++#if !defined(__NR_semget) ++#define __NR_semget 190 ++#endif ++#if !defined(__NR_semctl) ++#define __NR_semctl 191 ++#endif ++#if !defined(__NR_semtimedop) ++#define __NR_semtimedop 192 ++#endif ++#if !defined(__NR_semop) ++#define __NR_semop 193 ++#endif ++#if !defined(__NR_shmget) ++#define __NR_shmget 194 ++#endif ++#if !defined(__NR_shmctl) ++#define __NR_shmctl 195 ++#endif ++#if !defined(__NR_shmat) ++#define __NR_shmat 196 ++#endif ++#if !defined(__NR_shmdt) ++#define __NR_shmdt 197 ++#endif ++#if !defined(__NR_socket) ++#define __NR_socket 198 ++#endif ++#if !defined(__NR_socketpair) ++#define __NR_socketpair 199 ++#endif ++#if !defined(__NR_bind) ++#define __NR_bind 200 ++#endif ++#if !defined(__NR_listen) ++#define __NR_listen 201 ++#endif ++#if !defined(__NR_accept) ++#define __NR_accept 202 ++#endif ++#if !defined(__NR_connect) ++#define __NR_connect 203 ++#endif ++#if !defined(__NR_getsockname) ++#define __NR_getsockname 204 ++#endif ++#if !defined(__NR_getpeername) ++#define __NR_getpeername 205 ++#endif ++#if !defined(__NR_sendto) ++#define __NR_sendto 206 ++#endif ++#if !defined(__NR_recvfrom) ++#define __NR_recvfrom 207 ++#endif ++#if !defined(__NR_setsockopt) ++#define __NR_setsockopt 208 ++#endif ++#if !defined(__NR_getsockopt) ++#define __NR_getsockopt 209 ++#endif ++#if !defined(__NR_shutdown) ++#define __NR_shutdown 210 ++#endif ++#if !defined(__NR_sendmsg) ++#define __NR_sendmsg 211 ++#endif ++#if !defined(__NR_recvmsg) ++#define __NR_recvmsg 212 ++#endif ++#if !defined(__NR_readahead) ++#define __NR_readahead 213 ++#endif ++#if !defined(__NR_brk) ++#define __NR_brk 214 ++#endif ++#if !defined(__NR_munmap) ++#define __NR_munmap 215 ++#endif ++#if !defined(__NR_mremap) ++#define __NR_mremap 216 ++#endif ++#if !defined(__NR_add_key) ++#define __NR_add_key 217 ++#endif ++#if !defined(__NR_request_key) ++#define __NR_request_key 218 ++#endif ++#if !defined(__NR_keyctl) ++#define __NR_keyctl 219 ++#endif ++#if !defined(__NR_clone) ++#define __NR_clone 220 ++#endif ++#if !defined(__NR_execve) ++#define __NR_execve 221 ++#endif ++#if !defined(__NR_mmap) ++#define __NR_mmap 222 ++#endif ++#if !defined(__NR_fadvise64) ++#define __NR_fadvise64 223 ++#endif ++#if !defined(__NR_swapon) ++#define __NR_swapon 224 ++#endif ++#if !defined(__NR_swapoff) ++#define __NR_swapoff 225 ++#endif ++#if !defined(__NR_mprotect) ++#define __NR_mprotect 226 ++#endif ++#if !defined(__NR_msync) ++#define __NR_msync 227 ++#endif ++#if !defined(__NR_mlock) ++#define __NR_mlock 228 ++#endif ++#if !defined(__NR_munlock) ++#define __NR_munlock 229 ++#endif ++#if !defined(__NR_mlockall) ++#define __NR_mlockall 230 ++#endif ++#if !defined(__NR_munlockall) ++#define __NR_munlockall 231 ++#endif ++#if !defined(__NR_mincore) ++#define __NR_mincore 232 ++#endif ++#if !defined(__NR_madvise) ++#define __NR_madvise 233 ++#endif ++#if !defined(__NR_remap_file_pages) ++#define __NR_remap_file_pages 234 ++#endif ++#if !defined(__NR_mbind) ++#define __NR_mbind 235 ++#endif ++#if !defined(__NR_get_mempolicy) ++#define __NR_get_mempolicy 236 ++#endif ++#if !defined(__NR_set_mempolicy) ++#define __NR_set_mempolicy 237 ++#endif ++#if !defined(__NR_migrate_pages) ++#define __NR_migrate_pages 238 ++#endif ++#if !defined(__NR_move_pages) ++#define __NR_move_pages 239 ++#endif ++#if !defined(__NR_rt_tgsigqueueinfo) ++#define __NR_rt_tgsigqueueinfo 240 ++#endif ++#if !defined(__NR_perf_event_open) ++#define __NR_perf_event_open 241 ++#endif ++#if !defined(__NR_accept4) ++#define __NR_accept4 242 ++#endif ++#if !defined(__NR_recvmmsg) ++#define __NR_recvmmsg 243 ++#endif ++#if !defined(__NR_wait4) ++#define __NR_wait4 260 ++#endif ++#if !defined(__NR_prlimit64) ++#define __NR_prlimit64 261 ++#endif ++#if !defined(__NR_fanotify_init) ++#define __NR_fanotify_init 262 ++#endif ++#if !defined(__NR_fanotify_mark) ++#define __NR_fanotify_mark 263 ++#endif ++#if !defined(__NR_name_to_handle_at) ++#define __NR_name_to_handle_at 264 ++#endif ++#if !defined(__NR_open_by_handle_at) ++#define __NR_open_by_handle_at 265 ++#endif ++#if !defined(__NR_clock_adjtime) ++#define __NR_clock_adjtime 266 ++#endif ++#if !defined(__NR_syncfs) ++#define __NR_syncfs 267 ++#endif ++#if !defined(__NR_setns) ++#define __NR_setns 268 ++#endif ++#if !defined(__NR_sendmmsg) ++#define __NR_sendmmsg 269 ++#endif ++#if !defined(__NR_process_vm_readv) ++#define __NR_process_vm_readv 270 ++#endif ++#if !defined(__NR_process_vm_writev) ++#define __NR_process_vm_writev 271 ++#endif ++#if !defined(__NR_kcmp) ++#define __NR_kcmp 272 ++#endif ++#if !defined(__NR_finit_module) ++#define __NR_finit_module 273 ++#endif ++#if !defined(__NR_sched_setattr) ++#define __NR_sched_setattr 274 ++#endif ++#if !defined(__NR_sched_getattr) ++#define __NR_sched_getattr 275 ++#endif ++#if !defined(__NR_renameat2) ++#define __NR_renameat2 276 ++#endif ++#if !defined(__NR_seccomp) ++#define __NR_seccomp 277 ++#endif ++#if !defined(__NR_getrandom) ++#define __NR_getrandom 278 ++#endif ++#if !defined(__NR_memfd_create) ++#define __NR_memfd_create 279 ++#endif ++#if !defined(__NR_bpf) ++#define __NR_bfp 280 ++#endif ++#if !defined(__NR_execveat) ++#define __NR_execveat 281 ++#endif ++#if !defined(__NR_userfaultfd) ++#define __NR_userfaultfd 282 ++#endif ++#if !defined(__NR_membarrier) ++#define __NR_membarrier 283 ++#endif ++#if !defined(__NR_mlock2) ++#define __NR_mlock2 284 ++#endif ++#if !defined(__NR_copy_file_range) ++#define __NR_copy_file_range 285 ++#endif ++#if !defined(__NR_preadv2) ++#define __NR_preadv2 286 ++#endif ++#if !defined(__NR_pwritev2) ++#define __NR_pwritev2 287 ++#endif ++#if !defined(__NR_pkey_mprotect) ++#define __NR_pkey_mprotect 288 ++#endif ++#if !defined(__NR_pkey_alloc) ++#define __NR_pkey_alloc 289 ++#endif ++#if !defined(__NR_pkey_free) ++#define __NR_pkey_free 290 ++#endif ++#if !defined(__NR_statx) ++#define __NR_statx 291 ++#endif ++#if !defined(__NR_io_pgetevents) ++#define __NR_io_pgetevents 292 ++#endif ++#if !defined(__NR_rseq) ++#define __NR_rseq 293 ++#endif ++#if !defined(__NR_clone3) ++#define __NR_clone3 435 ++#endif ++#endif // SANDBOX_LINUX_SYSTEM_HEADERS_LOONGARCH64_LINUX_SYSCALLS_H_ +diff --git a/src/3rdparty/chromium/sandbox/policy/linux/bpf_broker_policy_linux.cc b/src/3rdparty/chromium/sandbox/policy/linux/bpf_broker_policy_linux.cc +index 0dc454a46..96056dc21 100644 +--- a/src/3rdparty/chromium/sandbox/policy/linux/bpf_broker_policy_linux.cc ++++ b/src/3rdparty/chromium/sandbox/policy/linux/bpf_broker_policy_linux.cc +@@ -86,6 +86,12 @@ ResultExpr BrokerProcessPolicy::EvaluateSyscall(int sysno) const { + return Allow(); + break; + #endif ++#if defined(__NR_statx) ++ case __NR_statx: ++ if (allowed_command_set_.test(syscall_broker::COMMAND_STAT)) ++ return Allow(); ++ break; ++#endif + #if defined(__NR_lstat) + case __NR_lstat: + if (allowed_command_set_.test(syscall_broker::COMMAND_STAT)) +diff --git a/src/3rdparty/chromium/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc b/src/3rdparty/chromium/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +index 41e158a29..e786e33eb 100644 +--- a/src/3rdparty/chromium/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc ++++ b/src/3rdparty/chromium/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc +@@ -38,7 +38,7 @@ ResultExpr CrosAmdGpuProcessPolicy::EvaluateSyscall(int sysno) const { + case __NR_sched_setscheduler: + case __NR_sysinfo: + case __NR_uname: +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_readlink: + case __NR_stat: + #endif +diff --git a/src/3rdparty/chromium/sandbox/policy/linux/bpf_gpu_policy_linux.cc b/src/3rdparty/chromium/sandbox/policy/linux/bpf_gpu_policy_linux.cc +index 333425782..1c023b4ed 100644 +--- a/src/3rdparty/chromium/sandbox/policy/linux/bpf_gpu_policy_linux.cc ++++ b/src/3rdparty/chromium/sandbox/policy/linux/bpf_gpu_policy_linux.cc +@@ -80,7 +80,7 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const { + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) + case __NR_ftruncate64: + #endif +-#if !defined(__aarch64__) && !defined(__riscv) ++#if !defined(__aarch64__) && !defined(__riscv) && !defined(__loongarch_lp64) + case __NR_getdents: + #endif + case __NR_getdents64: +diff --git a/src/3rdparty/chromium/sandbox/policy/linux/sandbox_linux.cc b/src/3rdparty/chromium/sandbox/policy/linux/sandbox_linux.cc +index 90a94b602..337104af2 100644 +--- a/src/3rdparty/chromium/sandbox/policy/linux/sandbox_linux.cc ++++ b/src/3rdparty/chromium/sandbox/policy/linux/sandbox_linux.cc +@@ -532,7 +532,11 @@ bpf_dsl::ResultExpr SandboxLinux::HandleViaBroker(int sysno) const { + const bpf_dsl::ResultExpr handle_via_broker = + bpf_dsl::Trap(syscall_broker::BrokerClient::SIGSYS_Handler, + broker_process_->GetBrokerClientSignalBased()); ++#if defined(__loongarch_lp64) ++ if (sysno == __NR_statx) { // __NR_fstatat_default or __NR_statx_default ++#else + if (sysno == __NR_fstatat_default) { ++#endif + // This may be an fstatat(fd, "", stat_buf, AT_EMPTY_PATH), which should be + // rewritten as fstat(fd, stat_buf). This should be consistent with how the + // baseline policy handles fstatat(). +diff --git a/src/3rdparty/chromium/skia/BUILD.gn b/src/3rdparty/chromium/skia/BUILD.gn +index ad7122e1b..97c9f57d3 100644 +--- a/src/3rdparty/chromium/skia/BUILD.gn ++++ b/src/3rdparty/chromium/skia/BUILD.gn +@@ -44,6 +44,7 @@ config("skia_config") { + "SK_UNTIL_CRBUG_1187654_IS_FIXED", + "SK_USER_CONFIG_HEADER=\"../../skia/config/SkUserConfig.h\"", + "SK_WIN_FONTMGR_NO_SIMULATIONS", ++ "SK_ENABLE_OPTIMIZE_SIZE", + ] + + include_dirs = [ "//third_party/skia" ] +@@ -111,6 +112,13 @@ config("skia_config") { + if (is_win) { + defines += [ "GR_GL_FUNCTION_TYPE=__stdcall" ] + } ++ ++ if (current_cpu == "loong64") { ++ cflags = [ ++ "-mlsx", ++ "-flax-vector-conversions", ++ ] ++ } + } + + # Internal-facing config for Skia library code. +@@ -759,6 +767,8 @@ skia_source_set("skia_opts") { + # Conditional and empty body needed to avoid assert() below. + } else if (current_cpu == "riscv64") { + # Conditional and empty body needed to avoid assert() below. ++ } else if (current_cpu == "loongarch64") { ++ # Conditional and empty body needed to avoid assert() below. + } else { + assert(false, "Unknown cpu target") + } +diff --git a/src/3rdparty/chromium/third_party/angle/gni/angle.gni b/src/3rdparty/chromium/third_party/angle/gni/angle.gni +index 60c3874f8..3d7adc772 100644 +--- a/src/3rdparty/chromium/third_party/angle/gni/angle.gni ++++ b/src/3rdparty/chromium/third_party/angle/gni/angle.gni +@@ -97,7 +97,7 @@ declare_args() { + + if (current_cpu == "arm64" || current_cpu == "x64" || + current_cpu == "mips64el" || current_cpu == "s390x" || +- current_cpu == "ppc64" || current_cpu == "loong64" || ++ current_cpu == "ppc64" || current_cpu == "loongarch64" || + current_cpu == "riscv64") { + angle_64bit_current_cpu = true + } else if (current_cpu == "arm" || current_cpu == "x86" || +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.cc b/src/3rdparty/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.cc +index c6da61a3f..7421a30d2 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.cc ++++ b/src/3rdparty/chromium/third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.cc +@@ -5,6 +5,8 @@ + #include "third_party/blink/renderer/core/html/track/vtt/vtt_cue_layout_algorithm.h" + + #include ++#include ++using std::isfinite; + + #include "third_party/blink/renderer/core/frame/settings.h" + #include "third_party/blink/renderer/core/html/track/vtt/vtt_cue.h" +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/streams/miscellaneous_operations.cc b/src/3rdparty/chromium/third_party/blink/renderer/core/streams/miscellaneous_operations.cc +index baf918e76..018a8908c 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/core/streams/miscellaneous_operations.cc ++++ b/src/3rdparty/chromium/third_party/blink/renderer/core/streams/miscellaneous_operations.cc +@@ -8,6 +8,8 @@ + #include "third_party/blink/renderer/core/streams/miscellaneous_operations.h" + + #include ++#include ++using std::isnan; + + #include "third_party/abseil-cpp/absl/types/optional.h" + #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/streams/queue_with_sizes.cc b/src/3rdparty/chromium/third_party/blink/renderer/core/streams/queue_with_sizes.cc +index 52b040dc1..6a9759131 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/core/streams/queue_with_sizes.cc ++++ b/src/3rdparty/chromium/third_party/blink/renderer/core/streams/queue_with_sizes.cc +@@ -5,6 +5,8 @@ + #include "third_party/blink/renderer/core/streams/queue_with_sizes.h" + + #include ++#include ++using std::isfinite; + + #include "third_party/blink/renderer/platform/bindings/exception_state.h" + #include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h" +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/core/style/style_crossfade_image.cc b/src/3rdparty/chromium/third_party/blink/renderer/core/style/style_crossfade_image.cc +index f5d1509dd..2c13ea054 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/core/style/style_crossfade_image.cc ++++ b/src/3rdparty/chromium/third_party/blink/renderer/core/style/style_crossfade_image.cc +@@ -3,6 +3,8 @@ + // found in the LICENSE file. + + #include "third_party/blink/renderer/core/style/style_crossfade_image.h" ++#include ++using std::isnan; + + #include "third_party/blink/renderer/core/css/css_crossfade_value.h" + #include "third_party/blink/renderer/core/style/computed_style.h" +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn b/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn +index fc76c4d8c..8a559de3b 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/BUILD.gn +@@ -1554,6 +1554,13 @@ jumbo_component("platform") { + } + } + ++ if (current_cpu == "loong64") { ++ cflags = [ ++ "-mlsx", ++ "-flax-vector-conversions", ++ ] ++ } ++ + jumbo_excluded_sources = [ + "fonts/font_matching_metrics.cc", + "mediastream/media_stream_audio_source.cc", +diff --git a/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/color.cc b/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/color.cc +index 177c9a75a..893212c46 100644 +--- a/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/color.cc ++++ b/src/3rdparty/chromium/third_party/blink/renderer/platform/graphics/color.cc +@@ -24,6 +24,10 @@ + */ + + #include "third_party/blink/renderer/platform/graphics/color.h" ++#include ++using std::isfinite; ++using std::isnan; ++using std::isinf; + + #include "base/notreached.h" + #include "build/build_config.h" +diff --git a/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h b/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h +index 7afcc4fc9..0b7bb8d07 100644 +--- a/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h ++++ b/src/3rdparty/chromium/third_party/boringssl/src/include/openssl/base.h +@@ -105,6 +105,9 @@ extern "C" { + #elif defined(__MIPSEL__) && defined(__LP64__) + #define OPENSSL_64_BIT + #define OPENSSL_MIPS64 ++#elif defined(__loongarch64) ++#define OPENSSL_64_BIT ++#define OPENSSL_LOONGARCH64 + #elif defined(__riscv) && __SIZEOF_POINTER__ == 8 + #define OPENSSL_64_BIT + #define OPENSSL_RISCV64 +diff --git a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h +index 65c231b4e..8581392d4 100644 +--- a/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h ++++ b/src/3rdparty/chromium/third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h +@@ -68,7 +68,7 @@ struct ThreadInfo { + // Use the structures defined in + struct user_regs_struct regs; + struct user_fpsimd_struct fpregs; +-#elif defined(__mips__) || defined(__riscv) ++#elif defined(__mips__) || defined(__riscv) || defined(__loongarch64) + // Use the structure defined in . + mcontext_t mcontext; + #endif +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h +index 604a46ab0..068a7c979 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/linux/sys/ptrace.h +@@ -38,6 +38,10 @@ static constexpr __ptrace_request PTRACE_GET_THREAD_AREA = + static constexpr __ptrace_request PTRACE_GET_THREAD_AREA_3264 = + static_cast<__ptrace_request>(0xc4); + #define PTRACE_GET_THREAD_AREA_3264 PTRACE_GET_THREAD_AREA_3264 ++#elif defined(__loongarch_lp64) ++static constexpr __ptrace_request PTRACE_GET_THREAD_AREA = ++ static_cast<__ptrace_request>(25); ++#define PTRACE_GET_THREAD_AREA PTRACE_GET_THREAD_AREA + #endif + #endif // !PTRACE_GET_THREAD_AREA && !PT_GET_THREAD_AREA && defined(__GLIBC__) + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_win/winnt.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_win/winnt.h +index 5fd78b0d8..57a972000 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_win/winnt.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/compat/non_win/winnt.h +@@ -67,6 +67,7 @@ + #define PROCESSOR_ARCHITECTURE_NEUTRAL 11 + #define PROCESSOR_ARCHITECTURE_ARM64 12 + #define PROCESSOR_ARCHITECTURE_ARM32_ON_WIN64 13 ++#define PROCESSOR_ARCHITECTURE_LOONGARCH64 14 + #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xffff + //! \} + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h +index 3476ea996..edce058a5 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context.h +@@ -672,6 +672,36 @@ struct MinidumpContextRISCV64 { + uint64_t fcsr; + }; + ++//! \brief LOONGARCH64-specifc flags for MinidumpContextLOONGARCH64::context_flags. ++//! Based on minidump_cpu_loongarch64.h from breakpad ++enum MinidumpContextLOONGARCH64Flags : uint32_t { ++ //! \brief Identifies the context structure as LOONGARCH64. ++ kMinidumpContextLOONGARCH64 = 0x00800000, ++ ++ //! \brief Indicates the validity of integer registers. ++ //! ++ //! Registers `0`-`31`, `epc` are valid. ++ kMinidumpContextLOONGARCH64Integer = kMinidumpContextLOONGARCH64 | 0x00000002, ++ ++ //! \brief Indicates the validity of floating point registers. ++ //! ++ //! Floating point registers `0`-`31`, `fpcsr` and `fir` are valid ++ kMinidumpContextLOONGARCH64FloatingPoint = kMinidumpContextLOONGARCH64 | 0x00000004, ++ ++ //! \brief Indicates the validity of all registers. ++ kMinidumpContextLOONGARCH64All = kMinidumpContextLOONGARCH64Integer | ++ kMinidumpContextLOONGARCH64FloatingPoint, ++}; ++ ++//! \brief A LOONGARCH64 CPU context (register state) carried in a minidump file. ++struct MinidumpContextLOONGARCH64 { ++ uint32_t context_flags; ++ uint64_t sc_pc; ++ uint64_t sc_regs[32]; ++ uint64_t fregs[32]; ++ uint64_t fcc; ++ uint32_t fcsr; ++}; + } // namespace crashpad + + #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_ +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc +index 87c0556ff..0910dfdb9 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.cc +@@ -109,6 +109,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) { + break; + } + ++ case kCPUArchitectureLOONGARCH64: { ++ context = std::make_unique(); ++ reinterpret_cast(context.get()) ++ ->InitializeFromSnapshot(context_snapshot->loongarch64); ++ break; ++ } ++ + default: { + LOG(ERROR) << "unknown context architecture " + << context_snapshot->architecture; +@@ -600,4 +607,41 @@ size_t MinidumpContextRISCV64Writer::ContextSize() const { + return sizeof(context_); + } + ++MinidumpContextLOONGARCH64Writer::MinidumpContextLOONGARCH64Writer() ++ : MinidumpContextWriter(), context_() { ++ context_.context_flags = kMinidumpContextLOONGARCH64; ++} ++ ++MinidumpContextLOONGARCH64Writer::~MinidumpContextLOONGARCH64Writer() = default; ++ ++void MinidumpContextLOONGARCH64Writer::InitializeFromSnapshot( ++ const CPUContextLOONGARCH64* context_snapshot) { ++ DCHECK_EQ(state(), kStateMutable); ++ DCHECK_EQ(context_.context_flags, kMinidumpContextLOONGARCH64); ++ ++ context_.context_flags = kMinidumpContextLOONGARCH64All; ++ ++ static_assert(sizeof(context_.sc_regs) == sizeof(context_snapshot->sc_regs), ++ "GPRs size mismatch"); ++ memcpy(context_.sc_regs, context_snapshot->sc_regs, sizeof(context_.sc_regs)); ++ context_.sc_pc = context_snapshot->sc_pc; ++ ++ static_assert(sizeof(context_.fregs) == sizeof(context_snapshot->fregs), ++ "FPU size mismatch"); ++ memcpy(context_.fregs, context_snapshot->fregs, sizeof(context_.fregs)); ++ context_.fcsr = context_snapshot->fcsr; ++ context_.fcc = context_snapshot->fcc; ++} ++ ++bool MinidumpContextLOONGARCH64Writer::WriteObject( ++ FileWriterInterface* file_writer) { ++ DCHECK_EQ(state(), kStateWritable); ++ return file_writer->Write(&context_, sizeof(context_)); ++} ++ ++size_t MinidumpContextLOONGARCH64Writer::ContextSize() const { ++ DCHECK_GE(state(), kStateFrozen); ++ return sizeof(context_); ++} ++ + } // namespace crashpad +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h +index 62daaa62a..33deaf789 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer.h +@@ -412,6 +412,44 @@ class MinidumpContextRISCV64Writer final : public MinidumpContextWriter { + MinidumpContextRISCV64 context_; + }; + ++//! \brief The writer for a MinidumpContextLOONGARCH64 structure in a minidump file. ++class MinidumpContextLOONGARCH64Writer final : public MinidumpContextWriter { ++ public: ++ MinidumpContextLOONGARCH64Writer(); ++ ~MinidumpContextLOONGARCH64Writer() override; ++ ++ //! \brief Initializes the MinidumpContextLOONGARCH based on \a context_snapshot. ++ //! ++ //! \param[in] context_snapshot The context snapshot to use as source data. ++ //! ++ //! \note Valid in #kStateMutable. No mutation of context() may be done before ++ //! calling this method, and it is not normally necessary to alter ++ //! context() after calling this method. ++ void InitializeFromSnapshot(const CPUContextLOONGARCH64* context_snapshot); ++ ++ //! \brief Returns a pointer to the context structure that this object will ++ //! write. ++ //! ++ //! \attention This returns a non-`const` pointer to this object’s private ++ //! data so that a caller can populate the context structure directly. ++ //! This is done because providing setter interfaces to each field in the ++ //! context structure would be unwieldy and cumbersome. Care must be taken ++ //! to populate the context structure correctly. The context structure ++ //! must only be modified while this object is in the #kStateMutable ++ //! state. ++ MinidumpContextLOONGARCH64* context() { return &context_; } ++ ++ protected: ++ // MinidumpWritable: ++ bool WriteObject(FileWriterInterface* file_writer) override; ++ ++ // MinidumpContextWriter: ++ size_t ContextSize() const override; ++ ++ private: ++ MinidumpContextLOONGARCH64 context_; ++}; ++ + } // namespace crashpad + + #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_ +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc +index e2a04d1dc..f8bb94dfc 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc +@@ -268,6 +268,21 @@ TYPED_TEST(MinidumpContextWriter, MIPS64_FromSnapshot) { + TypeParam>(context, ExpectMinidumpContextMIPS64, kSeed); + } + ++TYPED_TEST(MinidumpContextWriter, LOONGARCH64_Zeros) { ++ EmptyContextTest( ++ ExpectMinidumpContextLOONGARCH64); ++} ++ ++TYPED_TEST(MinidumpContextWriter, LOONGARCH64_FromSnapshot) { ++ constexpr uint32_t kSeed = 64; ++ CPUContextLOONGARCH64 context_loongarch64; ++ CPUContext context; ++ context.loongarch64 = &context_loongarch64; ++ InitializeCPUContextLOONGARCH64(&context, kSeed); ++ FromSnapshotTest( ++ context, ExpectMinidumpContextLOONGARCH64, kSeed); ++} ++ + } // namespace + } // namespace test + } // namespace crashpad +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_extensions.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_extensions.h +index 3cb0ca42c..5f9f5f713 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_extensions.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_extensions.h +@@ -154,6 +154,7 @@ enum MinidumpCPUArchitecture : uint16_t { + kMinidumpCPUArchitectureX86 = PROCESSOR_ARCHITECTURE_INTEL, + + kMinidumpCPUArchitectureMIPS = PROCESSOR_ARCHITECTURE_MIPS, ++ kMinidumpCPUArchitectureLOONGARCH64 = PROCESSOR_ARCHITECTURE_LOONGARCH64, + kMinidumpCPUArchitectureAlpha = PROCESSOR_ARCHITECTURE_ALPHA, + + //! \brief 32-bit PowerPC. +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc +index ce44c0614..25726a520 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc +@@ -179,6 +179,8 @@ std::string MinidumpMiscInfoDebugBuildString() { + static constexpr char kCPU[] = "riscv32"; + #elif defined(ARCH_CPU_RISCV64) + static constexpr char kCPU[] = "riscv64"; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ static constexpr char kCPU[] = "loongarch64"; + #else + #error define kCPU for this CPU + #endif +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/BUILD.gn b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/BUILD.gn +index 09a3f78a4..a4070e3b7 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/BUILD.gn +@@ -468,7 +468,8 @@ source_set("snapshot_test") { + } + + if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) && +- target_cpu != "mipsel" && target_cpu != "mips64el") { ++ target_cpu != "mipsel" && target_cpu != "mips64el" && ++ target_cpu != "loongarch64") { + data_deps += [ ":crashpad_snapshot_test_both_dt_hash_styles" ] + } + +@@ -536,7 +537,8 @@ crashpad_loadable_module("crashpad_snapshot_test_module_small") { + } + + if ((crashpad_is_linux || crashpad_is_android || crashpad_is_fuchsia) && +- target_cpu != "mipsel" && target_cpu != "mips64el") { ++ target_cpu != "mipsel" && target_cpu != "mips64el" && ++ target_cpu != "loongarch64") { + crashpad_loadable_module("crashpad_snapshot_test_both_dt_hash_styles") { + testonly = true + sources = [ "hash_types_test.cc" ] +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc +index 26c598605..065e49ecb 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/capture_memory.cc +@@ -127,6 +127,10 @@ void CaptureMemory::PointedToByContext(const CPUContext& context, + MaybeCaptureMemoryAround(delegate, context.riscv32->regs[i]); + } + } ++#elif defined(ARCH_CPU_LOONGARCH64) ++ for (size_t i = 0; i < std::size(context.loongarch64->sc_regs); ++i) { ++ MaybeCaptureMemoryAround(delegate, context.loongarch64->sc_regs[i]); ++ } + #else + #error Port. + #endif +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h +index fc8a9d653..9c7e627a6 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_architecture.h +@@ -50,6 +50,9 @@ enum CPUArchitecture { + + //! \brief 64-bit RISCV. + kCPUArchitectureRISCV64 ++ ++ //! \brief 64-bit LOONGARCH. ++ kCPUArchitectureLOONGARCH64, + }; + + } // namespace crashpad +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc +index 9c511e8c7..213168a7a 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.cc +@@ -170,6 +170,8 @@ uint64_t CPUContext::InstructionPointer() const { + return arm->pc; + case kCPUArchitectureARM64: + return arm64->pc; ++ case kCPUArchitectureLOONGARCH64: ++ return loongarch64->sc_pc; + default: + NOTREACHED(); + return ~0ull; +@@ -186,6 +188,8 @@ uint64_t CPUContext::StackPointer() const { + return arm->sp; + case kCPUArchitectureARM64: + return arm64->sp; ++ case kCPUArchitectureLOONGARCH64: ++ return loongarch64->sc_regs[3]; + default: + NOTREACHED(); + return ~0ull; +@@ -227,6 +231,7 @@ bool CPUContext::Is64Bit() const { + case kCPUArchitectureARM64: + case kCPUArchitectureMIPS64EL: + case kCPUArchitectureRISCV64: ++ case kCPUArchitectureLOONGARCH64: + return true; + case kCPUArchitectureX86: + case kCPUArchitectureARM: +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h +index bdd95b781..f14d7a91f 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/cpu_context.h +@@ -376,6 +376,15 @@ struct CPUContextRISCV64 { + uint32_t fcsr; + }; + ++//! \brief A context structure carrying LOONGARCH64 CPU state. ++struct CPUContextLOONGARCH64 { ++ uint64_t sc_pc; ++ uint64_t sc_regs[32]; ++ uint64_t fregs[32]; ++ uint64_t fcc; ++ uint32_t fcsr; ++}; ++ + //! \brief A context structure capable of carrying the context of any supported + //! CPU architecture. + struct CPUContext { +@@ -418,6 +427,7 @@ struct CPUContext { + CPUContextMIPS64* mips64; + CPUContextRISCV32* riscv32; + CPUContextRISCV64* riscv64; ++ CPUContextLOONGARCH64* loongarch64; + }; + }; + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc +index 9d3ba43ab..1a4be2153 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_image_reader.cc +@@ -593,6 +593,7 @@ bool ElfImageReader::ReadDynamicStringTableAtOffset(VMSize offset, + return false; + } + ++#if !defined(__loongarch_lp64) + // GNU ld.so doesn't adjust the vdso's dynamic array entries by the load bias. + // If the address is too small to point into the loaded module range and is + // small enough to be an offset from the base of the module, adjust it now. +@@ -600,6 +601,11 @@ bool ElfImageReader::ReadDynamicStringTableAtOffset(VMSize offset, + string_table_address < memory_.Size()) { + string_table_address += GetLoadBias(); + } ++#else ++ // LoongArch ABI specifies that the dynamic section has to be read-only. ++ // See glibc: sysdeps/loongarch/ldsodefs.h ++ string_table_address += GetLoadBias(); ++#endif + + if (!memory_.ReadCStringSizeLimited( + string_table_address + offset, string_table_size - offset, string)) { +@@ -754,6 +760,10 @@ bool ElfImageReader::GetNumberOfSymbolEntriesFromDtHash( + return false; + } + ++#if defined(__loongarch_lp64) ++ dt_hash_address += GetLoadBias(); ++#endif ++ + struct { + uint32_t nbucket; + uint32_t nchain; +@@ -779,6 +789,10 @@ bool ElfImageReader::GetNumberOfSymbolEntriesFromDtGnuHash( + return false; + } + ++#if defined(__loongarch_lp64) ++ dt_gnu_hash_address += GetLoadBias(); ++#endif ++ + // See https://flapenguin.me/2017/05/10/elf-lookup-dt-gnu-hash/ and + // https://sourceware.org/ml/binutils/2006-10/msg00377.html. + struct { +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_symbol_table_reader.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_symbol_table_reader.cc +index 4c59d7459..a082e9a86 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_symbol_table_reader.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/elf/elf_symbol_table_reader.cc +@@ -72,16 +72,25 @@ bool ElfSymbolTableReader::ScanSymbolTable(const std::string& name, + SymEnt entry; + std::string string; + size_t i = 0; ++ const char vdso_prefix[] = "__vdso_"; ++ ++#if defined(__loongarch_lp64) ++ address += elf_reader_->GetLoadBias(); ++#endif ++ + while (i < num_entries_ && memory_->Read(address, sizeof(entry), &entry)) { +- if (elf_reader_->ReadDynamicStringTableAtOffset(entry.st_name, &string) && +- string == name) { +- info_out->address = entry.st_value; +- info_out->size = entry.st_size; +- info_out->shndx = entry.st_shndx; +- info_out->binding = GetBinding(entry); +- info_out->type = GetType(entry); +- info_out->visibility = GetVisibility(entry); +- return true; ++ if (elf_reader_->ReadDynamicStringTableAtOffset(entry.st_name, &string)) { ++ if (string.find(vdso_prefix) == 0) ++ string.erase(0, sizeof(vdso_prefix) - 1); ++ if (string == name) { ++ info_out->address = entry.st_value; ++ info_out->size = entry.st_size; ++ info_out->shndx = entry.st_shndx; ++ info_out->binding = GetBinding(entry); ++ info_out->type = GetType(entry); ++ info_out->visibility = GetVisibility(entry); ++ return true; ++ } + } + // TODO(scottmg): This should respect DT_SYMENT if present. + address += sizeof(entry); +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc +index fb8ab4ae8..5106b5dd5 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.cc +@@ -289,6 +289,31 @@ template void InitializeCPUContextRISCV( + const ContextTraits64::SignalThreadContext& thread_context, + const ContextTraits64::SignalFloatContext& float_context, + ContextTraits64::CPUContext* context); ++#elif defined(ARCH_CPU_LOONGARCH64) ++void InitializeCPUContextLOONGARCH64(const ThreadContext::t64_t& thread_context, ++ const FloatContext::f64_t& float_context, ++ CPUContextLOONGARCH64* context) { ++ InitializeCPUContextLOONGARCH64_NoFloatingPoint(thread_context, context); ++ ++ static_assert(sizeof(context->fregs) == sizeof(float_context.fregs), ++ "fpu context size mismatch"); ++ memcpy(context->fregs, float_context.fregs, sizeof(context->fregs)); ++ context->fcc = float_context.fcc; ++ context->fcsr = float_context.fcsr; ++} ++ ++void InitializeCPUContextLOONGARCH64_NoFloatingPoint( ++ const ThreadContext::t64_t& thread_context, ++ CPUContextLOONGARCH64* context) { ++ static_assert(sizeof(context->sc_regs) == sizeof(thread_context.regs), ++ "gpr context size mismtach"); ++ memcpy(context->sc_regs, thread_context.regs, sizeof(context->sc_regs)); ++ context->sc_pc = thread_context.csr_era; ++ ++ memset(&context->fregs, 0, sizeof(context->fregs)); ++ context->fcc = 0; ++ context->fcsr = 0; ++} + + #endif // ARCH_CPU_X86_FAMILY + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h +index 5f1044f65..cf64aaec9 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h +@@ -190,6 +190,30 @@ void InitializeCPUContextRISCV( + + #endif // ARCH_CPU_RISCV_FAMILY || DOXYGEN + ++#if defined(ARCH_CPU_LOONGARCH64) || DOXYGEN ++//! \brief Initializes a CPUContextARM64 structure from native context ++//! structures on Linux. ++//! ++//! \param[in] thread_context The native thread context. ++//! \param[in] float_context The native float context. ++//! \param[out] context The CPUContextARM64 structure to initialize. ++void InitializeCPUContextLOONGARCH64(const ThreadContext::t64_t& thread_context, ++ const FloatContext::f64_t& float_context, ++ CPUContextLOONGARCH64* context); ++ ++//! \brief Initializes GPR state in a CPUContextARM64 from a native context ++//! structure on Linux. ++//! ++//! Floating point state is initialized to zero. ++//! ++//! \param[in] thread_context The native thread context. ++//! \param[out] context The CPUContextARM64 structure to initialize. ++void InitializeCPUContextLOONGARCH64_NoFloatingPoint( ++ const ThreadContext::t64_t& thread_context, ++ CPUContextLOONGARCH64* context); ++ ++#endif // ARCH_CPU_LOONGARCH64 || DOXYGEN ++ + } // namespace internal + } // namespace crashpad + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc +index b48832087..bd68cad9b 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc +@@ -380,6 +380,78 @@ bool ExceptionSnapshotLinux::ReadContext( + reader, context_address, context_.riscv64); + } + ++#elif defined(ARCH_CPU_LOONGARCH64) ++ ++template ++static bool ReadContext(ProcessReaderLinux* reader, ++ LinuxVMAddress context_address, ++ typename Traits::CPUContext* dest_context) { ++ const ProcessMemory* memory = reader->Memory(); ++ ++ LinuxVMAddress gregs_address = context_address + ++ offsetof(UContext, mcontext) + ++ offsetof(typename Traits::MContext, gregs); ++ ++ typename Traits::SignalThreadContext thread_context; ++ if (!memory->Read(gregs_address, sizeof(thread_context), &thread_context)) { ++ LOG(ERROR) << "Couldn't read gregs"; ++ return false; ++ } ++ ++ LinuxVMAddress reserved_address = ++ context_address + offsetof(typename Traits::MContext, sc_extcontext); ++ if ((reserved_address & 15) != 0) { ++ LOG(ERROR) << "invalid alignment 0x" << std::hex << reserved_address; ++ return false; ++ } ++ ++ constexpr VMSize kMaxContextSpace = 4096; ++ ++ ProcessMemoryRange range; ++ if (!range.Initialize(memory, true, reserved_address, kMaxContextSpace)) { ++ return false; ++ } ++ ++ do { ++ SCTXInfo sctx; ++ if (!range.Read(reserved_address, sizeof(sctx), &sctx)) { ++ LOG(ERROR) << "missing context sctx"; ++ return false; ++ } ++ ++ switch (sctx.magic) { ++ case FPU_CTX_MAGIC: ++ FPUContext fpu; ++ if (!range.Read(reserved_address, sizeof(fpu), &fpu)) { ++ LOG(ERROR) << "Couldn't read fpu " << sctx.size; ++ return false; ++ } ++ return true; ++ case 0: ++ LOG(WARNING) << "fpu not found"; ++ return true; ++ ++ default: ++ LOG(ERROR) << "invalid magic number 0x" << std::hex << sctx.magic; ++ return false; ++ } ++ } while (true); ++ ++ return true; ++ ++} ++ ++template <> ++bool ExceptionSnapshotLinux::ReadContext( ++ ProcessReaderLinux* reader, ++ LinuxVMAddress context_address) { ++ context_.architecture = kCPUArchitectureLOONGARCH64; ++ context_.loongarch64 = &context_union_.loongarch64; ++ ++ return internal::ReadContext( ++ reader, context_address, context_.loongarch64); ++} ++ + #endif // ARCH_CPU_X86_FAMILY + + bool ExceptionSnapshotLinux::Initialize( +@@ -410,10 +482,12 @@ bool ExceptionSnapshotLinux::Initialize( + return false; + } + } else { ++#if !defined(ARCH_CPU_RISCV64) && !defined(ARCH_CPU_LOONGARCH64) + if (!ReadContext(process_reader, context_address) || + !ReadSiginfo(process_reader, siginfo_address)) { + return false; + } ++#endif + } + + CaptureMemoryDelegateLinux capture_memory_delegate( +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h +index c6e913238..e1065b236 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h +@@ -92,6 +92,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot { + #elif defined(ARCH_CPU_RISCV_FAMILY) + CPUContextRISCV32 riscv32; + CPUContextRISCV64 riscv64; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ CPUContextLOONGARCH64 loongarch64; + #endif + } context_union_; + CPUContext context_; +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc +index b0c75b98a..26bfd75f1 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc +@@ -297,6 +297,48 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) { + 0); + #undef CPU_ARCH_NAME + } ++#elif defined(ARCH_CPU_LOONGARCH64) ++using NativeCPUContext = ucontext_t; ++struct TestCoprocessorContext { ++ sctx_info sctx; ++ fpu_context fpu; ++}; ++ ++void InitializeContext(NativeCPUContext* context) { ++ context->uc_mcontext.__pc = 1; ++ for (size_t reg = 0; reg < std::size(context->uc_mcontext.__gregs); ++reg) { ++ context->uc_mcontext.__gregs[reg] = reg; ++ } ++ ++auto test_context = reinterpret_cast( ++ context->uc_mcontext.__extcontext); ++ test_context->sctx.magic = 0; ++ test_context->sctx.size = 0;; ++ ++ for (size_t reg = 0; reg < std::size(test_context->fpu.regs); ++reg) { ++ test_context->fpu.regs[reg] = reg; ++ ++ test_context->fpu.fcc = 1; ++ test_context->fpu.fcsr = 2; ++ } ++} ++ ++void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) { ++ EXPECT_EQ(actual.architecture, kCPUArchitectureLOONGARCH64); ++ ++ auto test_context = reinterpret_cast< const TestCoprocessorContext*>( ++ expected.uc_mcontext.__extcontext); ++ for (size_t reg = 0; reg < std::size(expected.uc_mcontext.__gregs); ++reg) { ++ EXPECT_EQ(actual.loongarch64->sc_regs[reg], expected.uc_mcontext.__gregs[reg]); ++ } ++ ++ EXPECT_EQ(memcmp(&actual.loongarch64->fregs, ++ &test_context->fpu.regs, ++ sizeof(actual.loongarch64->fregs)), ++ 0); ++ EXPECT_EQ(actual.loongarch64->fcc, test_context->fpu.fcc); ++ EXPECT_EQ(actual.loongarch64->fcsr, test_context->fpu.fcsr); ++} + + #else + #error Port. +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc +index 001efc569..f672a178d 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc +@@ -130,6 +130,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) { + #elif defined(ARCH_CPU_RISCV_FAMILY) + stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.sp + : thread_info.thread_context.t32.sp; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ stack_pointer = thread_info.thread_context.t64.regs[3]; + #else + #error Port. + #endif +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h +index 9a5f39db2..42d442da4 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/signal_context.h +@@ -483,6 +483,44 @@ static_assert(offsetof(UContext, mcontext.fpregs) == + "context offset mismatch"); + #endif + ++#elif defined(ARCH_CPU_LOONGARCH64) ++ ++struct MContext64 { ++ uint64_t sc_pc; ++ uint64_t gregs[32]; ++ uint32_t sc_flags; ++ uint64_t sc_extcontext[0] __attribute__((__aligned__(16))); ++}; ++ ++struct SCTXInfo { ++ uint32_t magic; ++ uint32_t size; ++ uint64_t padding; ++}; ++ ++struct FPUContext { ++ uint64_t regs[32]; ++ uint64_t fcc; ++ uint32_t fcsr; ++}; ++ ++struct ContextTraits64 : public Traits64 { ++ using MContext = MContext64; ++ using SignalThreadContext = ThreadContext::t64_t; ++ using SignalFloatContext = FloatContext::f64_t; ++ using CPUContext = CPUContextLOONGARCH64; ++}; ++ ++template ++struct UContext { ++ typename Traits::ULong flags; ++ typename Traits::Address link; ++ SignalStack stack; ++ Sigset sigmask; ++ char padding[128 - sizeof(sigmask)]; ++ typename Traits::MContext mcontext; ++}; ++ + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc +index 12770e838..3d8c3ec16 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc +@@ -208,6 +208,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const { + #elif defined(ARCH_CPU_RISCV_FAMILY) + return process_reader_->Is64Bit() ? kCPUArchitectureRISCV64 + : kCPUArchitectureRISCV32; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ return kCPUArchitectureLOONGARCH64; + #else + #error port to your architecture + #endif +@@ -226,6 +228,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const { + #elif defined(ARCH_CPU_RISCV_FAMILY) + // Not implementable on RISCV + return 0; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ // Not implementable on LOONGARCH64 ++ return 0; + #else + #error port to your architecture + #endif +@@ -249,6 +254,9 @@ std::string SystemSnapshotLinux::CPUVendor() const { + #elif defined(ARCH_CPU_RISCV_FAMILY) + // Not implementable on RISCV + return std::string(); ++#elif defined(ARCH_CPU_LOONGARCH64) ++ // Not implementable on LOONGARCH64 ++ return std::string(); + #else + #error port to your architecture + #endif +@@ -385,6 +393,9 @@ bool SystemSnapshotLinux::NXEnabled() const { + #elif defined(ARCH_CPU_RISCV_FAMILY) + // Not implementable on RISCV + return false; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ // Not implementable on LOONGARCH64 ++ return false; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/test_modules.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/test_modules.cc +index 7d9d08d2e..fed362c68 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/test_modules.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/test_modules.cc +@@ -110,6 +110,10 @@ bool WriteTestModule(const base::FilePath& module_path, + module.ehdr.e_machine = EM_AARCH64; + #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL) + module.ehdr.e_machine = EM_MIPS; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ module.ehdr.e_machine = EM_LOONGARCH; ++ module.ehdr.e_flags |= EF_LARCH_ABI_DOUBLE_FLOAT; ++ module.ehdr.e_flags |= EF_LARCH_OBJABI_V1; + #endif + + module.ehdr.e_version = EV_CURRENT; +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc +index e24e3009c..1189287be 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc +@@ -206,6 +206,12 @@ bool ThreadSnapshotLinux::Initialize( + thread.thread_info.float_context.f32, + context_.riscv32); + } ++#elif defined(ARCH_CPU_LOONGARCH64) ++ context_.architecture = kCPUArchitectureLOONGARCH64; ++ context_.loongarch64 = &context_union_.loongarch64; ++ InitializeCPUContextLOONGARCH64(thread.thread_info.thread_context.t64, ++ thread.thread_info.float_context.f64, ++ context_.loongarch64); + #else + #error Port. + #endif +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h +index 39d7f6943..d046399d8 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h +@@ -77,6 +77,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot { + #elif defined(ARCH_CPU_RISCV_FAMILY) + CPUContextRISCV32 riscv32; + CPUContextRISCV64 riscv64; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ CPUContextLOONGARCH64 loongarch64; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc +index f2fa2ab37..9b749a5f1 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/minidump_context_converter.cc +@@ -266,6 +266,28 @@ bool MinidumpContextConverter::Initialize( + context_.mips64->fir = src->fir; + + memcpy(&context_.mips64->fpregs, &src->fpregs, sizeof(src->fpregs)); ++ } else if (context_.architecture == ++ CPUArchitecture::kCPUArchitectureLOONGARCH64) { ++ context_memory_.resize(sizeof(CPUContextLOONGARCH64)); ++ context_.loongarch64 = ++ reinterpret_cast(context_memory_.data()); ++ const MinidumpContextLOONGARCH64* src = ++ reinterpret_cast(minidump_context.data()); ++ if (minidump_context.size() < sizeof(MinidumpContextLOONGARCH64)) { ++ return false; ++ } ++ ++ if (!(src->context_flags & kMinidumpContextLOONGARCH64)) { ++ return false; ++ } ++ ++ for (size_t i = 0; i < std::size(src->sc_regs); i++) { ++ context_.loongarch64->sc_regs[i] = src->sc_regs[i]; ++ } ++ ++ context_.loongarch64->sc_pc = src->sc_pc; ++ context_.loongarch64->fcsr = src->fcsr; ++ context_.loongarch64->fcc = src->fcc; + } else { + // Architecture is listed as "unknown". + DLOG(ERROR) << "Unknown architecture"; +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc +index e6007b1e9..8fa6b5e95 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/snapshot/minidump/system_snapshot_minidump.cc +@@ -68,6 +68,8 @@ CPUArchitecture SystemSnapshotMinidump::GetCPUArchitecture() const { + case kMinidumpCPUArchitectureMIPS: + return kCPUArchitectureMIPSEL; + // No word on how MIPS64 is signalled ++ case kMinidumpCPUArchitectureLOONGARCH64: ++ return kCPUArchitectureLOONGARCH64; + + default: + return CPUArchitecture::kCPUArchitectureUnknown; +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc +index 7e3324f86..edbfec3af 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/ptracer.cc +@@ -443,6 +443,54 @@ bool GetThreadArea64(pid_t tid, + return true; + } + ++#elif defined(ARCH_CPU_LOONGARCH64) ++ ++bool GetFloatingPointRegisters32(pid_t tid, ++ FloatContext* context, ++ bool can_log) { ++ return false; ++} ++ ++bool GetFloatingPointRegisters64(pid_t tid, ++ FloatContext* context, ++ bool can_log) { ++ iovec iov; ++ iov.iov_base = context; ++ iov.iov_len = sizeof(*context); ++ if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast(NT_PRFPREG), &iov) != 0) { ++ PLOG_IF(ERROR, can_log) << "ptrace"; ++ return false; ++ } ++ if (iov.iov_len != sizeof(context->f64)) { ++ LOG_IF(ERROR, can_log) << "Unexpected registers size " << iov.iov_len ++ << " != " << sizeof(context->f64); ++ return false; ++ } ++ ++ return true; ++} ++ ++bool GetThreadArea32(pid_t tid, ++ const ThreadContext& context, ++ LinuxVMAddress* address, ++ bool can_log) { ++ return false; ++} ++ ++bool GetThreadArea64(pid_t tid, ++ const ThreadContext& context, ++ LinuxVMAddress* address, ++ bool can_log) { ++ void* result; ++ ++ if (ptrace(PTRACE_GET_THREAD_AREA, tid, nullptr, &result) != 0) { ++ PLOG_IF(ERROR, can_log) << "ptrace"; ++ return false; ++ } ++ *address = FromPointerCast(result); ++ return true; ++} ++ + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h +index 7f890a180..401e465a3 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/linux/thread_info.h +@@ -113,6 +113,8 @@ union ThreadContext { + uint32_t t4; + uint32_t t5; + uint32_t t6; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ // 32 bit LOONGARCH not supported + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -200,6 +202,11 @@ union ThreadContext { + uint64_t t4; + uint64_t t5; + uint64_t t6; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ // Reflects user_regs_struct in sys/user.h. ++ uint64_t regs[32]; ++ uint64_t csr_era; ++ uint64_t _pad[12]; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -209,14 +216,14 @@ union ThreadContext { + using NativeThreadContext = user_regs_struct; + #elif defined(ARCH_CPU_ARMEL) + using NativeThreadContext = user_regs; +-#elif defined(ARCH_CPU_MIPS_FAMILY) ++#elif defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_LOONGARCH64) + // No appropriate NativeThreadsContext type available for MIPS + #elif defined(ARCH_CPU_RISCV_FAMILY) + #else + #error Port. +-#endif // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64 ++#endif // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64 || ARCH_CPU_LOONGARCH64 + +-#if !defined(ARCH_CPU_MIPS_FAMILY) && !defined(ARCH_CPU_RISCV_FAMILY) ++#if !defined(ARCH_CPU_MIPS_FAMILY) && !defined(ARCH_CPU_RISCV_FAMILY) && !defined(ARCH_CPU_LOONGARCH64) + #if defined(ARCH_CPU_32_BITS) + static_assert(sizeof(t32_t) == sizeof(NativeThreadContext), "Size mismatch"); + #else // ARCH_CPU_64_BITS +@@ -290,6 +297,8 @@ union FloatContext { + #elif defined(ARCH_CPU_RISCV_FAMILY) + uint64_t f[32]; + uint32_t fcsr; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ // 32 bit LOONGARCH not supported + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -327,6 +336,10 @@ union FloatContext { + #elif defined(ARCH_CPU_RISCV_FAMILY) + uint64_t f[32]; + uint32_t fcsr; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ uint64_t fregs[32]; ++ uint32_t fcsr; ++ uint64_t fcc; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -354,7 +367,7 @@ union FloatContext { + #endif + #elif defined(ARCH_CPU_ARM64) + static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch"); +-#elif defined(ARCH_CPU_MIPS_FAMILY) ++#elif defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_LOONGARCH64) + // No appropriate floating point context native type for available MIPS. + #elif defined(ARCH_CPU_RISCV_FAMILY) + #else +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h +index a5503d682..668be84c2 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context.h +@@ -69,6 +69,7 @@ using NativeCPUContext = ucontext_t; + //! macOS/Linux/Fuchsia | x86_64 | `%%rdi` + //! Linux | ARM/ARM64 | `r0`/`x0` + //! Linux | MIPS/MIPS64 | `$a0` ++//! Linux | LOONGARCH64 | `$a0` + //! + //! Additionally, the value `LR` on ARM/ARM64 will be the return address of + //! this function. +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S +index 9c3a72638..0fe8a54ef 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_linux.S +@@ -30,7 +30,7 @@ + .globl CAPTURECONTEXT_SYMBOL2 + #if defined(__i386__) || defined(__x86_64__) + .balign 16, 0x90 +-#elif defined(__arm__) || defined(__aarch64__) ++#elif defined(__arm__) || defined(__aarch64__) || defined(__loongarch_lp64) + .balign 4, 0x0 + .type CAPTURECONTEXT_SYMBOL, %function + .type CAPTURECONTEXT_SYMBOL2, %function +@@ -337,6 +337,87 @@ CAPTURECONTEXT_SYMBOL2: + // TODO(https://crashpad.chromium.org/bug/300): save floating-point registers. + + ret ++ ++#elif defined(__loongarch_lp64) ++ ++#define MCONTEXT_GREG_SIZE 8 ++#define MCONTEXT_FPREG_SIZE 8 ++#define MCONTEXT_PC_OFFSET 64 ++#define MCONTEXT_GREGS_OFFSET 72 ++#define MCONTEXT_FPREGS_OFFSET 352 ++ ++#define STORE_GPR(X) st.d $r##X, $a0, MCONTEXT_GREGS_OFFSET + X * MCONTEXT_GREG_SIZE ++#define STORE_FPR(X) fst.d $f##X, $a0, MCONTEXT_FPREGS_OFFSET + X * MCONTEXT_FPREG_SIZE ++#define STORE_PC st.d $ra, $a0, MCONTEXT_PC_OFFSET ++ ++ STORE_PC ++ STORE_GPR(0) ++ STORE_GPR(1) ++ STORE_GPR(2) ++ STORE_GPR(3) ++ STORE_GPR(4) ++ STORE_GPR(5) ++ STORE_GPR(6) ++ STORE_GPR(7) ++ STORE_GPR(8) ++ STORE_GPR(9) ++ STORE_GPR(10) ++ STORE_GPR(11) ++ STORE_GPR(12) ++ STORE_GPR(13) ++ STORE_GPR(14) ++ STORE_GPR(15) ++ STORE_GPR(16) ++ STORE_GPR(17) ++ STORE_GPR(18) ++ STORE_GPR(19) ++ STORE_GPR(20) ++ STORE_GPR(21) ++ STORE_GPR(22) ++ STORE_GPR(23) ++ STORE_GPR(24) ++ STORE_GPR(25) ++ STORE_GPR(26) ++ STORE_GPR(27) ++ STORE_GPR(28) ++ STORE_GPR(29) ++ STORE_GPR(30) ++ STORE_GPR(31) ++ STORE_FPR(0) ++ STORE_FPR(1) ++ STORE_FPR(2) ++ STORE_FPR(3) ++ STORE_FPR(4) ++ STORE_FPR(5) ++ STORE_FPR(6) ++ STORE_FPR(7) ++ STORE_FPR(8) ++ STORE_FPR(9) ++ STORE_FPR(10) ++ STORE_FPR(11) ++ STORE_FPR(12) ++ STORE_FPR(13) ++ STORE_FPR(14) ++ STORE_FPR(15) ++ STORE_FPR(16) ++ STORE_FPR(17) ++ STORE_FPR(18) ++ STORE_FPR(19) ++ STORE_FPR(20) ++ STORE_FPR(21) ++ STORE_FPR(22) ++ STORE_FPR(23) ++ STORE_FPR(24) ++ STORE_FPR(25) ++ STORE_FPR(26) ++ STORE_FPR(27) ++ STORE_FPR(28) ++ STORE_FPR(29) ++ STORE_FPR(30) ++ STORE_FPR(31) ++ ++ jirl $zero, $ra, 0 ++ + #elif defined(__mips__) + .set noat + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc +index f353aebe6..892d521a1 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test.cc +@@ -57,7 +57,7 @@ void TestCaptureContext() { + uintptr_t pc = ProgramCounterFromContext(context_1); + + #if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \ +- !defined(MEMORY_SANITIZER) ++ !defined(MEMORY_SANITIZER) && !defined(ARCH_CPU_LOONGARCH64) + // Sanitizers can cause enough code bloat that the “nearby” check would + // likely fail. + const uintptr_t kReferencePC = +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc +index 35751bf8b..28c5fb032 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc +@@ -35,6 +35,8 @@ void SanityCheckContext(const NativeCPUContext& context) { + EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast(&context)); + #elif defined(ARCH_CPU_MIPS_FAMILY) + EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast(&context)); ++#elif defined(ARCH_CPU_LOONGARCH64) ++ EXPECT_EQ(context.uc_mcontext.__gregs[4], FromPointerCast(&context)); + #endif + } + +@@ -49,6 +51,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) { + return context.uc_mcontext.pc; + #elif defined(ARCH_CPU_MIPS_FAMILY) + return context.uc_mcontext.pc; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ return context.uc_mcontext.__pc; + #endif + } + +@@ -63,6 +67,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) { + return context.uc_mcontext.sp; + #elif defined(ARCH_CPU_MIPS_FAMILY) + return context.uc_mcontext.gregs[29]; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ return context.uc_mcontext.__gregs[3]; + #endif + } + +diff --git a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc +index a194d7aba..48025db5d 100644 +--- a/src/3rdparty/chromium/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc ++++ b/src/3rdparty/chromium/third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc +@@ -239,6 +239,8 @@ std::string UserAgent() { + #endif + #elif defined(ARCH_CPU_RISCV64) + static constexpr char arch[] = "riscv64"; ++#elif defined(ARCH_CPU_LOONGARCH64) ++ static constexpr char arch[] = "loongarch64"; + #else + #error Port + #endif +diff --git a/src/3rdparty/chromium/third_party/dav1d/config/linux/loongarch64/config.h b/src/3rdparty/chromium/third_party/dav1d/config/linux/loongarch64/config.h +new file mode 100644 +index 000000000..3ad3dc4b1 +--- /dev/null ++++ b/src/3rdparty/chromium/third_party/dav1d/config/linux/loongarch64/config.h +@@ -0,0 +1,38 @@ ++/* ++ * Autogenerated by the Meson build system. ++ * Do not edit, your changes will be lost. ++ */ ++ ++#pragma once ++ ++#define ARCH_AARCH64 0 ++ ++#define ARCH_ARM 0 ++ ++#define ARCH_PPC64LE 0 ++ ++#define ARCH_X86 0 ++ ++#define ARCH_X86_32 0 ++ ++#define ARCH_X86_64 0 ++ ++#define CONFIG_16BPC 1 ++ ++#define CONFIG_8BPC 1 ++ ++// #define CONFIG_LOG 1 -- Logging is controlled by Chromium ++ ++#define ENDIANNESS_BIG 0 ++ ++#define HAVE_ASM 0 ++ ++#define HAVE_AS_FUNC 0 ++ ++#define HAVE_CLOCK_GETTIME 1 ++ ++#define HAVE_GETAUXVAL 1 ++ ++#define HAVE_POSIX_MEMALIGN 1 ++ ++#define HAVE_UNISTD_H 1 +diff --git a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/ninja/bundle.gni b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/ninja/bundle.gni +index 68d6db40a..3136d84b3 100644 +--- a/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/ninja/bundle.gni ++++ b/src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/ninja/bundle.gni +@@ -71,7 +71,6 @@ template("bundle") { + # TODO(crbug.com/1098074): We need to hide warnings that are written stderr, + # as Chromium does not process the returncode of the subprocess correctly + # and instead looks if `stderr` is empty. +- "--silent", + "--config", + rebase_path( + devtools_location_prepend + "scripts/build/rollup.config.js", +diff --git a/src/3rdparty/chromium/third_party/libaom/BUILD.gn b/src/3rdparty/chromium/third_party/libaom/BUILD.gn +index 3f3f64fc7..88ed7b876 100644 +--- a/src/3rdparty/chromium/third_party/libaom/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/libaom/BUILD.gn +@@ -38,7 +38,7 @@ if (current_cpu == "x86") { + } + } else if (current_cpu == "riscv64") { + cpu_arch_full = "generic" +-} else if (current_cpu == "loong64") { ++} else if (current_cpu == "loongarch64") { + cpu_arch_full = "generic" + } else { + cpu_arch_full = current_cpu +diff --git a/src/3rdparty/chromium/third_party/pdfium/core/fpdfapi/page/cpdf_psengine.cpp b/src/3rdparty/chromium/third_party/pdfium/core/fpdfapi/page/cpdf_psengine.cpp +index ecdab3c44..0e255df0a 100644 +--- a/src/3rdparty/chromium/third_party/pdfium/core/fpdfapi/page/cpdf_psengine.cpp ++++ b/src/3rdparty/chromium/third_party/pdfium/core/fpdfapi/page/cpdf_psengine.cpp +@@ -7,6 +7,8 @@ + #include "core/fpdfapi/page/cpdf_psengine.h" + + #include ++#include ++using std::isnan; + + #include + #include +diff --git a/src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp b/src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp +index af27d0fd7..f08047470 100644 +--- a/src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp ++++ b/src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp +@@ -16,6 +16,8 @@ + #include + #include + #include ++#include ++using std::isnan; + + #include "build/build_config.h" + #include "core/fpdfapi/parser/cpdf_stream.h" +diff --git a/src/3rdparty/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp b/src/3rdparty/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp +index 194797fdd..c302d92f1 100644 +--- a/src/3rdparty/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp ++++ b/src/3rdparty/chromium/third_party/pdfium/fxjs/fx_date_helpers.cpp +@@ -11,6 +11,9 @@ + #include + + #include ++#include ++using std::isfinite; ++using std::isnan; + + #include "build/build_config.h" + #include "core/fxcrt/fx_extension.h" +diff --git a/src/3rdparty/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp b/src/3rdparty/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp +index 575b49cb9..cc81119f5 100644 +--- a/src/3rdparty/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp ++++ b/src/3rdparty/chromium/third_party/pdfium/fxjs/xfa/cfxjse_formcalc_context.cpp +@@ -16,6 +16,8 @@ + #include + #include + #include ++#include ++using std::isnan; + + #include "core/fxcrt/cfx_datetime.h" + #include "core/fxcrt/data_vector.h" +diff --git a/src/3rdparty/chromium/third_party/pdfium/xfa/fgas/graphics/cfgas_gegraphics.cpp b/src/3rdparty/chromium/third_party/pdfium/xfa/fgas/graphics/cfgas_gegraphics.cpp +index 1354b0d3f..ceb961979 100644 +--- a/src/3rdparty/chromium/third_party/pdfium/xfa/fgas/graphics/cfgas_gegraphics.cpp ++++ b/src/3rdparty/chromium/third_party/pdfium/xfa/fgas/graphics/cfgas_gegraphics.cpp +@@ -11,6 +11,8 @@ + #include + #include + #include ++#include ++using std::isnan; + + #include "core/fxcrt/fx_system.h" + #include "core/fxge/cfx_defaultrenderdevice.h" +diff --git a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn +index 59e52303c..e0b9d144e 100644 +--- a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/BUILD.gn +@@ -1,4 +1,4 @@ +-# Copyright 2020 The SwiftShader Authors. All Rights Reserved. ++# Copyright 2023 The SwiftShader Authors. All Rights Reserved. + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. +@@ -12,11 +12,19 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + ++# File generated by ./generate_build_files.py ++ + import("../../src/swiftshader.gni") + + # Need a separate config to ensure the warnings are added to the end. + config("swiftshader_llvm_private_config") { +- cflags = [] ++ cflags = [ ++ "-DBLAKE3_NO_AVX512", ++ "-DBLAKE3_NO_AVX2", ++ "-DBLAKE3_NO_SSE41", ++ "-DBLAKE3_NO_SSE2", ++ "-DBLAKE3_USE_NEON=0", ++ ] + + if (is_win) { + cflags += [ +@@ -64,9 +72,13 @@ config("swiftshader_llvm_private_config") { + cflags += [ + "-Wno-attributes", + "-Wno-bitwise-instead-of-logical", ++ "-Wno-deprecated-anon-enum-enum-conversion", + "-Wno-deprecated-declarations", ++ "-Wno-deprecated-pragma", ++ "-Wno-deprecated-enum-enum-conversion", + "-Wno-enum-compare", + "-Wno-header-hygiene", ++ "-Wno-range-loop-bind-reference", + "-Wno-unused-function", + "-Wno-unused-local-typedef", + "-Wno-unused-private-field", +@@ -85,14 +97,17 @@ llvm_include_dirs = [ + "llvm/include/", + "llvm/lib/Target/AArch64/", + "llvm/lib/Target/ARM/", ++ "llvm/lib/Target/LoongArch/", + "llvm/lib/Target/Mips/", + "llvm/lib/Target/PowerPC/", + "llvm/lib/Target/RISCV/", + "llvm/lib/Target/X86/", + "configs/common/include/", ++ "configs/common/lib/ExecutionEngine/JITLink/", + "configs/common/lib/IR/", + "configs/common/lib/Target/AArch64/", + "configs/common/lib/Target/ARM/", ++ "configs/common/lib/Target/LoongArch/", + "configs/common/lib/Target/Mips/", + "configs/common/lib/Target/PowerPC/", + "configs/common/lib/Target/RISCV/", +@@ -140,16 +155,21 @@ swiftshader_llvm_source_set("swiftshader_llvm") { + } + + deps = [ +- ":swiftshader_llvm_most", +- ":swiftshader_llvm_debuginfo", +- ":swiftshader_llvm_support", +- ":swiftshader_llvm_transforms_scalar", ++ ":swiftshader_llvm_source_set_0", ++ ":swiftshader_llvm_source_set_1", ++ + ] + ++ if (is_debug) { ++ deps += [ ":swiftshader_llvm_debug" ] ++ } ++ + if (current_cpu == "arm64") { + deps += [ ":swiftshader_llvm_aarch64" ] + } else if (current_cpu == "arm") { + deps += [ ":swiftshader_llvm_arm" ] ++ } else if (current_cpu == "loongarch64") { ++ deps += [ ":swiftshader_llvm_loongarch64" ] + } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { + deps += [ ":swiftshader_llvm_mips" ] + } else if (current_cpu == "ppc64") { +@@ -172,40 +192,57 @@ swiftshader_llvm_source_set("swiftshader_llvm") { + } + + # This source_set would contain all source files, except that GN doesn't allow for duplicate source +-# file names, even if they are in different subdirectories. Because of this, some directories are ++# file names, even if they are in different subdirectories. Because of this, some files are + # split out into their own source_set. +-swiftshader_llvm_source_set("swiftshader_llvm_most") { ++swiftshader_llvm_source_set("swiftshader_llvm_source_set_0") { + sources = [ + "llvm/lib/Analysis/AliasAnalysis.cpp", +- "llvm/lib/Analysis/AliasAnalysisSummary.cpp", ++ "llvm/lib/Analysis/AliasAnalysisEvaluator.cpp", + "llvm/lib/Analysis/AliasSetTracker.cpp", ++ "llvm/lib/Analysis/AssumeBundleQueries.cpp", + "llvm/lib/Analysis/AssumptionCache.cpp", + "llvm/lib/Analysis/BasicAliasAnalysis.cpp", + "llvm/lib/Analysis/BlockFrequencyInfo.cpp", + "llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp", + "llvm/lib/Analysis/BranchProbabilityInfo.cpp", + "llvm/lib/Analysis/CFG.cpp", +- "llvm/lib/Analysis/CFLAndersAliasAnalysis.cpp", +- "llvm/lib/Analysis/CFLSteensAliasAnalysis.cpp", ++ "llvm/lib/Analysis/CFGPrinter.cpp", ++ "llvm/lib/Analysis/CFGSCCPrinter.cpp", + "llvm/lib/Analysis/CGSCCPassManager.cpp", + "llvm/lib/Analysis/CallGraph.cpp", + "llvm/lib/Analysis/CallGraphSCCPass.cpp", ++ "llvm/lib/Analysis/CallPrinter.cpp", + "llvm/lib/Analysis/CaptureTracking.cpp", + "llvm/lib/Analysis/CmpInstAnalysis.cpp", + "llvm/lib/Analysis/CodeMetrics.cpp", + "llvm/lib/Analysis/ConstantFolding.cpp", ++ "llvm/lib/Analysis/ConstraintSystem.cpp", ++ "llvm/lib/Analysis/CostModel.cpp", ++ "llvm/lib/Analysis/CycleAnalysis.cpp", ++ "llvm/lib/Analysis/DDG.cpp", ++ "llvm/lib/Analysis/DDGPrinter.cpp", ++ "llvm/lib/Analysis/Delinearization.cpp", + "llvm/lib/Analysis/DemandedBits.cpp", + "llvm/lib/Analysis/DependenceAnalysis.cpp", ++ "llvm/lib/Analysis/DependenceGraphBuilder.cpp", + "llvm/lib/Analysis/DivergenceAnalysis.cpp", + "llvm/lib/Analysis/DomTreeUpdater.cpp", + "llvm/lib/Analysis/DominanceFrontier.cpp", + "llvm/lib/Analysis/EHPersonalities.cpp", ++ "llvm/lib/Analysis/FunctionPropertiesAnalysis.cpp", + "llvm/lib/Analysis/GlobalsModRef.cpp", + "llvm/lib/Analysis/GuardUtils.cpp", ++ "llvm/lib/Analysis/HeatUtils.cpp", ++ "llvm/lib/Analysis/IRSimilarityIdentifier.cpp", + "llvm/lib/Analysis/IVDescriptors.cpp", + "llvm/lib/Analysis/IVUsers.cpp", ++ "llvm/lib/Analysis/ImportedFunctionsInliningStatistics.cpp", + "llvm/lib/Analysis/IndirectCallPromotionAnalysis.cpp", ++ "llvm/lib/Analysis/InlineAdvisor.cpp", + "llvm/lib/Analysis/InlineCost.cpp", ++ "llvm/lib/Analysis/InlineOrder.cpp", ++ "llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp", ++ "llvm/lib/Analysis/InstCount.cpp", + "llvm/lib/Analysis/InstructionPrecedenceTracking.cpp", + "llvm/lib/Analysis/InstructionSimplify.cpp", + "llvm/lib/Analysis/LazyBlockFrequencyInfo.cpp", +@@ -213,48 +250,65 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/Analysis/LazyCallGraph.cpp", + "llvm/lib/Analysis/LazyValueInfo.cpp", + "llvm/lib/Analysis/LegacyDivergenceAnalysis.cpp", ++ "llvm/lib/Analysis/Lint.cpp", + "llvm/lib/Analysis/Loads.cpp", ++ "llvm/lib/Analysis/Local.cpp", + "llvm/lib/Analysis/LoopAccessAnalysis.cpp", + "llvm/lib/Analysis/LoopAnalysisManager.cpp", ++ "llvm/lib/Analysis/LoopCacheAnalysis.cpp", + "llvm/lib/Analysis/LoopInfo.cpp", ++ "llvm/lib/Analysis/LoopNestAnalysis.cpp", + "llvm/lib/Analysis/LoopPass.cpp", + "llvm/lib/Analysis/LoopUnrollAnalyzer.cpp", ++ "llvm/lib/Analysis/MemDerefPrinter.cpp", + "llvm/lib/Analysis/MemoryBuiltins.cpp", + "llvm/lib/Analysis/MemoryDependenceAnalysis.cpp", + "llvm/lib/Analysis/MemoryLocation.cpp", ++ "llvm/lib/Analysis/MemoryProfileInfo.cpp", + "llvm/lib/Analysis/MemorySSA.cpp", + "llvm/lib/Analysis/MemorySSAUpdater.cpp", ++ "llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp", + "llvm/lib/Analysis/ModuleSummaryAnalysis.cpp", + "llvm/lib/Analysis/MustExecute.cpp", + "llvm/lib/Analysis/ObjCARCAliasAnalysis.cpp", + "llvm/lib/Analysis/ObjCARCAnalysisUtils.cpp", + "llvm/lib/Analysis/ObjCARCInstKind.cpp", + "llvm/lib/Analysis/OptimizationRemarkEmitter.cpp", +- "llvm/lib/Analysis/OrderedBasicBlock.cpp", +- "llvm/lib/Analysis/OrderedInstructions.cpp", ++ "llvm/lib/Analysis/OverflowInstAnalysis.cpp", + "llvm/lib/Analysis/PHITransAddr.cpp", + "llvm/lib/Analysis/PhiValues.cpp", + "llvm/lib/Analysis/PostDominators.cpp", + "llvm/lib/Analysis/ProfileSummaryInfo.cpp", + "llvm/lib/Analysis/PtrUseVisitor.cpp", + "llvm/lib/Analysis/RegionInfo.cpp", +- "llvm/lib/Analysis/RegionPrinter.cpp", ++ "llvm/lib/Analysis/RegionPass.cpp", ++ "llvm/lib/Analysis/ReplayInlineAdvisor.cpp", + "llvm/lib/Analysis/ScalarEvolution.cpp", + "llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp", +- "llvm/lib/Analysis/ScalarEvolutionExpander.cpp", ++ "llvm/lib/Analysis/ScalarEvolutionDivision.cpp", + "llvm/lib/Analysis/ScalarEvolutionNormalization.cpp", + "llvm/lib/Analysis/ScopedNoAliasAA.cpp", ++ "llvm/lib/Analysis/StackLifetime.cpp", ++ "llvm/lib/Analysis/StackSafetyAnalysis.cpp", + "llvm/lib/Analysis/SyncDependenceAnalysis.cpp", ++ "llvm/lib/Analysis/SyntheticCountsUtils.cpp", + "llvm/lib/Analysis/TargetLibraryInfo.cpp", + "llvm/lib/Analysis/TargetTransformInfo.cpp", ++ "llvm/lib/Analysis/TensorSpec.cpp", + "llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp", + "llvm/lib/Analysis/TypeMetadataUtils.cpp", ++ "llvm/lib/Analysis/UniformityAnalysis.cpp", ++ "llvm/lib/Analysis/VFABIDemangling.cpp", + "llvm/lib/Analysis/ValueLattice.cpp", + "llvm/lib/Analysis/ValueLatticeUtils.cpp", + "llvm/lib/Analysis/ValueTracking.cpp", + "llvm/lib/Analysis/VectorUtils.cpp", +- "llvm/lib/Analysis/VFABIDemangling.cpp", ++ "llvm/lib/AsmParser/LLLexer.cpp", ++ "llvm/lib/AsmParser/LLParser.cpp", ++ "llvm/lib/AsmParser/Parser.cpp", ++ "llvm/lib/BinaryFormat/COFF.cpp", + "llvm/lib/BinaryFormat/Dwarf.cpp", ++ "llvm/lib/BinaryFormat/MachO.cpp", + "llvm/lib/BinaryFormat/Magic.cpp", + "llvm/lib/BinaryFormat/Wasm.cpp", + "llvm/lib/BinaryFormat/XCOFF.cpp", +@@ -267,18 +321,19 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp", + "llvm/lib/CodeGen/AllocationOrder.cpp", + "llvm/lib/CodeGen/Analysis.cpp", ++ "llvm/lib/CodeGen/AsmPrinter/AIXException.cpp", ++ "llvm/lib/CodeGen/AsmPrinter/ARMException.cpp", + "llvm/lib/CodeGen/AsmPrinter/AccelTable.cpp", + "llvm/lib/CodeGen/AsmPrinter/AddressPool.cpp", +- "llvm/lib/CodeGen/AsmPrinter/ARMException.cpp", + "llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp", + "llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp", + "llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp", + "llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp", ++ "llvm/lib/CodeGen/AsmPrinter/DIE.cpp", ++ "llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp", + "llvm/lib/CodeGen/AsmPrinter/DbgEntityHistoryCalculator.cpp", + "llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp", + "llvm/lib/CodeGen/AsmPrinter/DebugLocStream.cpp", +- "llvm/lib/CodeGen/AsmPrinter/DIE.cpp", +- "llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp", + "llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp", + "llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp", + "llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp", +@@ -287,60 +342,73 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/AsmPrinter/DwarfStringPool.cpp", + "llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp", + "llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp", ++ "llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp", + "llvm/lib/CodeGen/AsmPrinter/WasmException.cpp", + "llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp", + "llvm/lib/CodeGen/AsmPrinter/WinException.cpp", ++ "llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp", + "llvm/lib/CodeGen/AtomicExpandPass.cpp", ++ "llvm/lib/CodeGen/BasicBlockSections.cpp", ++ "llvm/lib/CodeGen/BasicBlockSectionsProfileReader.cpp", + "llvm/lib/CodeGen/BasicTargetTransformInfo.cpp", + "llvm/lib/CodeGen/BranchFolding.cpp", + "llvm/lib/CodeGen/BranchRelaxation.cpp", + "llvm/lib/CodeGen/BreakFalseDeps.cpp", +- "llvm/lib/CodeGen/CalcSpillWeights.cpp", +- "llvm/lib/CodeGen/CallingConvLower.cpp", + "llvm/lib/CodeGen/CFGuardLongjmp.cpp", ++ "llvm/lib/CodeGen/CFIFixup.cpp", + "llvm/lib/CodeGen/CFIInstrInserter.cpp", ++ "llvm/lib/CodeGen/CalcSpillWeights.cpp", ++ "llvm/lib/CodeGen/CallingConvLower.cpp", + "llvm/lib/CodeGen/CodeGen.cpp", ++ "llvm/lib/CodeGen/CodeGenCommonISel.cpp", + "llvm/lib/CodeGen/CodeGenPrepare.cpp", ++ "llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp", + "llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp", ++ "llvm/lib/CodeGen/DFAPacketizer.cpp", + "llvm/lib/CodeGen/DeadMachineInstructionElim.cpp", + "llvm/lib/CodeGen/DetectDeadLanes.cpp", +- "llvm/lib/CodeGen/DFAPacketizer.cpp", + "llvm/lib/CodeGen/DwarfEHPrepare.cpp", ++ "llvm/lib/CodeGen/EHContGuardCatchret.cpp", + "llvm/lib/CodeGen/EarlyIfConversion.cpp", + "llvm/lib/CodeGen/EdgeBundles.cpp", + "llvm/lib/CodeGen/ExecutionDomainFix.cpp", ++ "llvm/lib/CodeGen/ExpandLargeDivRem.cpp", ++ "llvm/lib/CodeGen/ExpandLargeFpConvert.cpp", + "llvm/lib/CodeGen/ExpandMemCmp.cpp", + "llvm/lib/CodeGen/ExpandPostRAPseudos.cpp", + "llvm/lib/CodeGen/ExpandReductions.cpp", +- "llvm/lib/CodeGen/FaultMaps.cpp", ++ "llvm/lib/CodeGen/ExpandVectorPredication.cpp", + "llvm/lib/CodeGen/FEntryInserter.cpp", ++ "llvm/lib/CodeGen/FaultMaps.cpp", + "llvm/lib/CodeGen/FinalizeISel.cpp", ++ "llvm/lib/CodeGen/FixupStatepointCallerSaved.cpp", + "llvm/lib/CodeGen/FuncletLayout.cpp", + "llvm/lib/CodeGen/GCMetadata.cpp", + "llvm/lib/CodeGen/GCMetadataPrinter.cpp", + "llvm/lib/CodeGen/GCRootLowering.cpp", +- "llvm/lib/CodeGen/GCStrategy.cpp", ++ "llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp", ++ "llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp", + "llvm/lib/CodeGen/GlobalISel/CallLowering.cpp", + "llvm/lib/CodeGen/GlobalISel/Combiner.cpp", + "llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp", +- "llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp", +- "llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp", + "llvm/lib/CodeGen/GlobalISel/GISelChangeObserver.cpp", + "llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp", + "llvm/lib/CodeGen/GlobalISel/GlobalISel.cpp", ++ "llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp", ++ "llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp", + "llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp", + "llvm/lib/CodeGen/GlobalISel/InstructionSelector.cpp", +- "llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp", ++ "llvm/lib/CodeGen/GlobalISel/LegacyLegalizerInfo.cpp", + "llvm/lib/CodeGen/GlobalISel/LegalityPredicates.cpp", + "llvm/lib/CodeGen/GlobalISel/LegalizeMutations.cpp", + "llvm/lib/CodeGen/GlobalISel/Legalizer.cpp", + "llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp", + "llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp", ++ "llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp", + "llvm/lib/CodeGen/GlobalISel/Localizer.cpp", ++ "llvm/lib/CodeGen/GlobalISel/LostDebugLocObserver.cpp", + "llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp", + "llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp", +- "llvm/lib/CodeGen/GlobalISel/RegisterBank.cpp", +- "llvm/lib/CodeGen/GlobalISel/RegisterBankInfo.cpp", + "llvm/lib/CodeGen/GlobalISel/Utils.cpp", + "llvm/lib/CodeGen/GlobalMerge.cpp", + "llvm/lib/CodeGen/HardwareLoops.cpp", +@@ -352,14 +420,19 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/InterleavedAccessPass.cpp", + "llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp", + "llvm/lib/CodeGen/IntrinsicLowering.cpp", ++ "llvm/lib/CodeGen/JMCInstrumenter.cpp", ++ "llvm/lib/CodeGen/LLVMTargetMachine.cpp", + "llvm/lib/CodeGen/LatencyPriorityQueue.cpp", + "llvm/lib/CodeGen/LazyMachineBlockFrequencyInfo.cpp", + "llvm/lib/CodeGen/LexicalScopes.cpp", +- "llvm/lib/CodeGen/LiveDebugValues.cpp", ++ "llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp", ++ "llvm/lib/CodeGen/LiveDebugValues/LiveDebugValues.cpp", ++ "llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp", + "llvm/lib/CodeGen/LiveDebugVariables.cpp", + "llvm/lib/CodeGen/LiveInterval.cpp", +- "llvm/lib/CodeGen/LiveIntervals.cpp", ++ "llvm/lib/CodeGen/LiveIntervalCalc.cpp", + "llvm/lib/CodeGen/LiveIntervalUnion.cpp", ++ "llvm/lib/CodeGen/LiveIntervals.cpp", + "llvm/lib/CodeGen/LivePhysRegs.cpp", + "llvm/lib/CodeGen/LiveRangeCalc.cpp", + "llvm/lib/CodeGen/LiveRangeEdit.cpp", +@@ -368,31 +441,46 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/LiveRegUnits.cpp", + "llvm/lib/CodeGen/LiveStacks.cpp", + "llvm/lib/CodeGen/LiveVariables.cpp", +- "llvm/lib/CodeGen/LLVMTargetMachine.cpp", + "llvm/lib/CodeGen/LocalStackSlotAllocation.cpp", + "llvm/lib/CodeGen/LoopTraversal.cpp", +- "llvm/lib/CodeGen/LowerEmuTLS.cpp", + "llvm/lib/CodeGen/LowLevelType.cpp", ++ "llvm/lib/CodeGen/LowerEmuTLS.cpp", ++ "llvm/lib/CodeGen/MBFIWrapper.cpp", ++ "llvm/lib/CodeGen/MIRCanonicalizerPass.cpp", ++ "llvm/lib/CodeGen/MIRFSDiscriminator.cpp", ++ "llvm/lib/CodeGen/MIRNamerPass.cpp", ++ "llvm/lib/CodeGen/MIRPrinter.cpp", ++ "llvm/lib/CodeGen/MIRPrintingPass.cpp", ++ "llvm/lib/CodeGen/MIRSampleProfile.cpp", ++ "llvm/lib/CodeGen/MIRVRegNamerUtils.cpp", ++ "llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp", + "llvm/lib/CodeGen/MachineBasicBlock.cpp", + "llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp", + "llvm/lib/CodeGen/MachineBlockPlacement.cpp", + "llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp", ++ "llvm/lib/CodeGen/MachineCFGPrinter.cpp", ++ "llvm/lib/CodeGen/MachineCSE.cpp", ++ "llvm/lib/CodeGen/MachineCheckDebugify.cpp", + "llvm/lib/CodeGen/MachineCombiner.cpp", + "llvm/lib/CodeGen/MachineCopyPropagation.cpp", +- "llvm/lib/CodeGen/MachineCSE.cpp", ++ "llvm/lib/CodeGen/MachineCycleAnalysis.cpp", ++ "llvm/lib/CodeGen/MachineDebugify.cpp", + "llvm/lib/CodeGen/MachineDominanceFrontier.cpp", + "llvm/lib/CodeGen/MachineDominators.cpp", + "llvm/lib/CodeGen/MachineFrameInfo.cpp", + "llvm/lib/CodeGen/MachineFunction.cpp", + "llvm/lib/CodeGen/MachineFunctionPass.cpp", + "llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp", ++ "llvm/lib/CodeGen/MachineFunctionSplitter.cpp", + "llvm/lib/CodeGen/MachineInstr.cpp", + "llvm/lib/CodeGen/MachineInstrBundle.cpp", + "llvm/lib/CodeGen/MachineLICM.cpp", ++ "llvm/lib/CodeGen/MachineLateInstrsCleanup.cpp", + "llvm/lib/CodeGen/MachineLoopInfo.cpp", + "llvm/lib/CodeGen/MachineLoopUtils.cpp", + "llvm/lib/CodeGen/MachineModuleInfo.cpp", + "llvm/lib/CodeGen/MachineModuleInfoImpls.cpp", ++ "llvm/lib/CodeGen/MachineModuleSlotTracker.cpp", + "llvm/lib/CodeGen/MachineOperand.cpp", + "llvm/lib/CodeGen/MachineOptimizationRemarkEmitter.cpp", + "llvm/lib/CodeGen/MachineOutliner.cpp", +@@ -400,53 +488,62 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/MachinePostDominators.cpp", + "llvm/lib/CodeGen/MachineRegionInfo.cpp", + "llvm/lib/CodeGen/MachineRegisterInfo.cpp", ++ "llvm/lib/CodeGen/MachineSSAContext.cpp", ++ "llvm/lib/CodeGen/MachineSSAUpdater.cpp", + "llvm/lib/CodeGen/MachineScheduler.cpp", + "llvm/lib/CodeGen/MachineSink.cpp", + "llvm/lib/CodeGen/MachineSizeOpts.cpp", +- "llvm/lib/CodeGen/MachineSSAUpdater.cpp", ++ "llvm/lib/CodeGen/MachineStableHash.cpp", ++ "llvm/lib/CodeGen/MachineStripDebug.cpp", + "llvm/lib/CodeGen/MachineTraceMetrics.cpp", ++ "llvm/lib/CodeGen/MachineUniformityAnalysis.cpp", + "llvm/lib/CodeGen/MachineVerifier.cpp", + "llvm/lib/CodeGen/MacroFusion.cpp", +- "llvm/lib/CodeGen/MIRCanonicalizerPass.cpp", +- "llvm/lib/CodeGen/MIRNamerPass.cpp", +- "llvm/lib/CodeGen/MIRPrinter.cpp", +- "llvm/lib/CodeGen/MIRPrintingPass.cpp", +- "llvm/lib/CodeGen/MIRVRegNamerUtils.cpp", + "llvm/lib/CodeGen/ModuloSchedule.cpp", + "llvm/lib/CodeGen/OptimizePHIs.cpp", +- "llvm/lib/CodeGen/PatchableFunction.cpp", +- "llvm/lib/CodeGen/PeepholeOptimizer.cpp", + "llvm/lib/CodeGen/PHIElimination.cpp", + "llvm/lib/CodeGen/PHIEliminationUtils.cpp", ++ "llvm/lib/CodeGen/PatchableFunction.cpp", ++ "llvm/lib/CodeGen/PeepholeOptimizer.cpp", + "llvm/lib/CodeGen/PostRAHazardRecognizer.cpp", + "llvm/lib/CodeGen/PostRASchedulerList.cpp", + "llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp", + "llvm/lib/CodeGen/ProcessImplicitDefs.cpp", + "llvm/lib/CodeGen/PrologEpilogInserter.cpp", ++ "llvm/lib/CodeGen/PseudoProbeInserter.cpp", + "llvm/lib/CodeGen/PseudoSourceValue.cpp", ++ "llvm/lib/CodeGen/RDFGraph.cpp", ++ "llvm/lib/CodeGen/RDFLiveness.cpp", ++ "llvm/lib/CodeGen/RDFRegisters.cpp", + "llvm/lib/CodeGen/ReachingDefAnalysis.cpp", + "llvm/lib/CodeGen/RegAllocBase.cpp", + "llvm/lib/CodeGen/RegAllocBasic.cpp", ++ "llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp", + "llvm/lib/CodeGen/RegAllocFast.cpp", + "llvm/lib/CodeGen/RegAllocGreedy.cpp", + "llvm/lib/CodeGen/RegAllocPBQP.cpp", ++ "llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp", ++ "llvm/lib/CodeGen/RegUsageInfoCollector.cpp", ++ "llvm/lib/CodeGen/RegUsageInfoPropagate.cpp", ++ "llvm/lib/CodeGen/RegisterBank.cpp", ++ "llvm/lib/CodeGen/RegisterBankInfo.cpp", + "llvm/lib/CodeGen/RegisterClassInfo.cpp", + "llvm/lib/CodeGen/RegisterCoalescer.cpp", + "llvm/lib/CodeGen/RegisterPressure.cpp", + "llvm/lib/CodeGen/RegisterScavenging.cpp", + "llvm/lib/CodeGen/RegisterUsageInfo.cpp", +- "llvm/lib/CodeGen/RegUsageInfoCollector.cpp", +- "llvm/lib/CodeGen/RegUsageInfoPropagate.cpp", ++ "llvm/lib/CodeGen/RemoveRedundantDebugValues.cpp", + "llvm/lib/CodeGen/RenameIndependentSubregs.cpp", ++ "llvm/lib/CodeGen/ReplaceWithVeclib.cpp", + "llvm/lib/CodeGen/ResetMachineFunctionPass.cpp", + "llvm/lib/CodeGen/SafeStack.cpp", +- "llvm/lib/CodeGen/SafeStackColoring.cpp", + "llvm/lib/CodeGen/SafeStackLayout.cpp", +- "llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp", ++ "llvm/lib/CodeGen/SanitizerBinaryMetadata.cpp", + "llvm/lib/CodeGen/ScheduleDAG.cpp", + "llvm/lib/CodeGen/ScheduleDAGInstrs.cpp", + "llvm/lib/CodeGen/ScheduleDAGPrinter.cpp", + "llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp", ++ "llvm/lib/CodeGen/SelectOptimize.cpp", + "llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp", + "llvm/lib/CodeGen/SelectionDAG/FastISel.cpp", + "llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp", +@@ -459,6 +556,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp", + "llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp", + "llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp", ++ "llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp", + "llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp", + "llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp", + "llvm/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp", +@@ -478,6 +576,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/SpillPlacement.cpp", + "llvm/lib/CodeGen/SplitKit.cpp", + "llvm/lib/CodeGen/StackColoring.cpp", ++ "llvm/lib/CodeGen/StackFrameLayoutAnalysisPass.cpp", + "llvm/lib/CodeGen/StackMapLivenessAnalysis.cpp", + "llvm/lib/CodeGen/StackMaps.cpp", + "llvm/lib/CodeGen/StackProtector.cpp", +@@ -503,17 +602,96 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/CodeGen/WasmEHPrepare.cpp", + "llvm/lib/CodeGen/WinEHPrepare.cpp", + "llvm/lib/CodeGen/XRayInstrumentation.cpp", ++ "llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp", ++ "llvm/lib/DebugInfo/CodeView/CodeViewError.cpp", ++ "llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp", ++ "llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp", ++ "llvm/lib/DebugInfo/CodeView/EnumTables.cpp", ++ "llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp", ++ "llvm/lib/DebugInfo/CodeView/Line.cpp", ++ "llvm/lib/DebugInfo/CodeView/RecordName.cpp", ++ "llvm/lib/DebugInfo/CodeView/RecordSerialization.cpp", ++ "llvm/lib/DebugInfo/CodeView/SimpleTypeSerializer.cpp", ++ "llvm/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp", ++ "llvm/lib/DebugInfo/CodeView/TypeHashing.cpp", ++ "llvm/lib/DebugInfo/CodeView/TypeIndex.cpp", ++ "llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp", ++ "llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp", ++ "llvm/lib/DebugInfo/CodeView/TypeTableCollection.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFContext.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFDie.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFListTable.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFTypePrinter.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp", ++ "llvm/lib/Demangle/DLangDemangle.cpp", ++ "llvm/lib/Demangle/Demangle.cpp", + "llvm/lib/Demangle/ItaniumDemangle.cpp", +- "llvm/lib/ExecutionEngine/ExecutionEngine.cpp", ++ "llvm/lib/Demangle/MicrosoftDemangle.cpp", ++ "llvm/lib/Demangle/MicrosoftDemangleNodes.cpp", ++ "llvm/lib/Demangle/RustDemangle.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/COFFDirectiveParser.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/COFFLinkGraphBuilder.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/COFF_x86_64.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/EHFrameSupport.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELF.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELFLinkGraphBuilder.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELF_aarch64.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELF_loongarch.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELF_riscv.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/ELF_x86_64.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/JITLink.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/JITLinkMemoryManager.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/MachO_arm64.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/MachO_x86_64.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/aarch64.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/i386.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/loongarch.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/riscv.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/x86_64.cpp", + "llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp", + "llvm/lib/ExecutionEngine/Orc/Core.cpp", ++ "llvm/lib/ExecutionEngine/Orc/DebugUtils.cpp", ++ "llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp", ++ "llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp", ++ "llvm/lib/ExecutionEngine/Orc/ExecutorProcessControl.cpp", + "llvm/lib/ExecutionEngine/Orc/IRCompileLayer.cpp", + "llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp", + "llvm/lib/ExecutionEngine/Orc/Layer.cpp", +- "llvm/lib/ExecutionEngine/Orc/Legacy.cpp", ++ "llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp", ++ "llvm/lib/ExecutionEngine/Orc/Mangling.cpp", ++ "llvm/lib/ExecutionEngine/Orc/ObjectFileInterface.cpp", ++ "llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp", + "llvm/lib/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.cpp", ++ "llvm/lib/ExecutionEngine/Orc/Shared/AllocationActions.cpp", ++ "llvm/lib/ExecutionEngine/Orc/Shared/OrcError.cpp", ++ "llvm/lib/ExecutionEngine/Orc/TargetProcess/RegisterEHFrames.cpp", ++ "llvm/lib/ExecutionEngine/Orc/TargetProcess/TargetExecutionUtils.cpp", ++ "llvm/lib/ExecutionEngine/Orc/TaskDispatch.cpp", + "llvm/lib/ExecutionEngine/Orc/ThreadSafeModule.cpp", +- "llvm/lib/ExecutionEngine/OrcError/OrcError.cpp", + "llvm/lib/ExecutionEngine/RuntimeDyld/JITSymbol.cpp", + "llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp", + "llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp", +@@ -522,12 +700,14 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp", + "llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldELFMips.cpp", + "llvm/lib/ExecutionEngine/SectionMemoryManager.cpp", +- "llvm/lib/ExecutionEngine/TargetSelect.cpp", ++ "llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp", + "llvm/lib/IR/AbstractCallSite.cpp", + "llvm/lib/IR/AsmWriter.cpp", ++ "llvm/lib/IR/Assumptions.cpp", + "llvm/lib/IR/Attributes.cpp", + "llvm/lib/IR/AutoUpgrade.cpp", + "llvm/lib/IR/BasicBlock.cpp", ++ "llvm/lib/IR/BuiltinGCs.cpp", + "llvm/lib/IR/Comdat.cpp", + "llvm/lib/IR/ConstantFold.cpp", + "llvm/lib/IR/ConstantRange.cpp", +@@ -543,6 +723,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/IR/Dominators.cpp", + "llvm/lib/IR/FPEnv.cpp", + "llvm/lib/IR/Function.cpp", ++ "llvm/lib/IR/GCStrategy.cpp", + "llvm/lib/IR/GVMaterializer.cpp", + "llvm/lib/IR/Globals.cpp", + "llvm/lib/IR/IRBuilder.cpp", +@@ -553,6 +734,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/IR/IntrinsicInst.cpp", + "llvm/lib/IR/LLVMContext.cpp", + "llvm/lib/IR/LLVMContextImpl.cpp", ++ "llvm/lib/IR/LLVMRemarkStreamer.cpp", + "llvm/lib/IR/LegacyPassManager.cpp", + "llvm/lib/IR/MDBuilder.cpp", + "llvm/lib/IR/Mangler.cpp", +@@ -566,8 +748,12 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/IR/PassManager.cpp", + "llvm/lib/IR/PassRegistry.cpp", + "llvm/lib/IR/PassTimingInfo.cpp", ++ "llvm/lib/IR/PrintPasses.cpp", ++ "llvm/lib/IR/ProfDataUtils.cpp", + "llvm/lib/IR/ProfileSummary.cpp", +- "llvm/lib/IR/RemarkStreamer.cpp", ++ "llvm/lib/IR/PseudoProbe.cpp", ++ "llvm/lib/IR/SSAContext.cpp", ++ "llvm/lib/IR/SafepointIRVerifier.cpp", + "llvm/lib/IR/Statepoint.cpp", + "llvm/lib/IR/Type.cpp", + "llvm/lib/IR/TypeFinder.cpp", +@@ -576,7 +762,8 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/IR/Value.cpp", + "llvm/lib/IR/ValueSymbolTable.cpp", + "llvm/lib/IR/Verifier.cpp", +- "llvm/lib/MC/ConstantPools.cpp", ++ "llvm/lib/IRReader/IRReader.cpp", ++ "llvm/lib/Linker/IRMover.cpp", + "llvm/lib/MC/ELFObjectWriter.cpp", + "llvm/lib/MC/MCAsmBackend.cpp", + "llvm/lib/MC/MCAsmInfo.cpp", +@@ -589,10 +776,9 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/MC/MCCodeEmitter.cpp", + "llvm/lib/MC/MCCodeView.cpp", + "llvm/lib/MC/MCContext.cpp", +- "llvm/lib/MC/MCDisassembler/MCDisassembler.cpp", +- "llvm/lib/MC/MCDisassembler/MCExternalSymbolizer.cpp", ++ "llvm/lib/MC/MCDXContainerStreamer.cpp", ++ "llvm/lib/MC/MCDXContainerWriter.cpp", + "llvm/lib/MC/MCDisassembler/MCRelocationInfo.cpp", +- "llvm/lib/MC/MCDisassembler/MCSymbolizer.cpp", + "llvm/lib/MC/MCDwarf.cpp", + "llvm/lib/MC/MCELFObjectTargetWriter.cpp", + "llvm/lib/MC/MCELFStreamer.cpp", +@@ -614,15 +800,20 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/MC/MCParser/COFFAsmParser.cpp", + "llvm/lib/MC/MCParser/DarwinAsmParser.cpp", + "llvm/lib/MC/MCParser/ELFAsmParser.cpp", ++ "llvm/lib/MC/MCParser/GOFFAsmParser.cpp", + "llvm/lib/MC/MCParser/MCAsmLexer.cpp", + "llvm/lib/MC/MCParser/MCAsmParser.cpp", + "llvm/lib/MC/MCParser/MCAsmParserExtension.cpp", + "llvm/lib/MC/MCParser/MCTargetAsmParser.cpp", + "llvm/lib/MC/MCParser/WasmAsmParser.cpp", ++ "llvm/lib/MC/MCParser/XCOFFAsmParser.cpp", ++ "llvm/lib/MC/MCPseudoProbe.cpp", + "llvm/lib/MC/MCRegisterInfo.cpp", ++ "llvm/lib/MC/MCSPIRVStreamer.cpp", + "llvm/lib/MC/MCSchedule.cpp", + "llvm/lib/MC/MCSection.cpp", + "llvm/lib/MC/MCSectionCOFF.cpp", ++ "llvm/lib/MC/MCSectionDXContainer.cpp", + "llvm/lib/MC/MCSectionELF.cpp", + "llvm/lib/MC/MCSectionMachO.cpp", + "llvm/lib/MC/MCSectionWasm.cpp", +@@ -631,6 +822,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/MC/MCSubtargetInfo.cpp", + "llvm/lib/MC/MCSymbol.cpp", + "llvm/lib/MC/MCSymbolELF.cpp", ++ "llvm/lib/MC/MCSymbolXCOFF.cpp", + "llvm/lib/MC/MCTargetOptions.cpp", + "llvm/lib/MC/MCValue.cpp", + "llvm/lib/MC/MCWasmStreamer.cpp", +@@ -639,8 +831,10 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/MC/MCWinEH.cpp", + "llvm/lib/MC/MCXCOFFStreamer.cpp", + "llvm/lib/MC/MachObjectWriter.cpp", ++ "llvm/lib/MC/SPIRVObjectWriter.cpp", + "llvm/lib/MC/StringTableBuilder.cpp", + "llvm/lib/MC/SubtargetFeature.cpp", ++ "llvm/lib/MC/TargetRegistry.cpp", + "llvm/lib/MC/WasmObjectWriter.cpp", + "llvm/lib/MC/WinCOFFObjectWriter.cpp", + "llvm/lib/MC/XCOFFObjectWriter.cpp", +@@ -648,7 +842,6 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/Object/Binary.cpp", + "llvm/lib/Object/COFFObjectFile.cpp", + "llvm/lib/Object/Decompressor.cpp", +- "llvm/lib/Object/ELF.cpp", + "llvm/lib/Object/ELFObjectFile.cpp", + "llvm/lib/Object/Error.cpp", + "llvm/lib/Object/IRObjectFile.cpp", +@@ -658,6 +851,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/Object/Minidump.cpp", + "llvm/lib/Object/ModuleSymbolTable.cpp", + "llvm/lib/Object/ObjectFile.cpp", ++ "llvm/lib/Object/OffloadBinary.cpp", + "llvm/lib/Object/RecordStreamer.cpp", + "llvm/lib/Object/RelocationResolver.cpp", + "llvm/lib/Object/SymbolicFile.cpp", +@@ -666,8 +860,17 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/Object/WasmObjectFile.cpp", + "llvm/lib/Object/WindowsResource.cpp", + "llvm/lib/Object/XCOFFObjectFile.cpp", ++ "llvm/lib/Option/Arg.cpp", ++ "llvm/lib/Option/ArgList.cpp", ++ "llvm/lib/Option/OptTable.cpp", ++ "llvm/lib/Option/Option.cpp", ++ "llvm/lib/Passes/OptimizationLevel.cpp", ++ "llvm/lib/Passes/PassBuilder.cpp", ++ "llvm/lib/Passes/PassBuilderPipelines.cpp", + "llvm/lib/ProfileData/InstrProf.cpp", ++ "llvm/lib/ProfileData/InstrProfCorrelator.cpp", + "llvm/lib/ProfileData/InstrProfReader.cpp", ++ "llvm/lib/ProfileData/MemProf.cpp", + "llvm/lib/ProfileData/ProfileSummaryBuilder.cpp", + "llvm/lib/ProfileData/SampleProf.cpp", + "llvm/lib/ProfileData/SampleProfReader.cpp", +@@ -676,197 +879,16 @@ swiftshader_llvm_source_set("swiftshader_llvm_most") { + "llvm/lib/Remarks/RemarkFormat.cpp", + "llvm/lib/Remarks/RemarkParser.cpp", + "llvm/lib/Remarks/RemarkSerializer.cpp", ++ "llvm/lib/Remarks/RemarkStreamer.cpp", + "llvm/lib/Remarks/RemarkStringTable.cpp", + "llvm/lib/Remarks/YAMLRemarkParser.cpp", + "llvm/lib/Remarks/YAMLRemarkSerializer.cpp", +- "llvm/lib/Target/TargetLoweringObjectFile.cpp", +- "llvm/lib/Target/TargetMachine.cpp", +- "llvm/lib/TextAPI/MachO/Architecture.cpp", +- "llvm/lib/TextAPI/MachO/ArchitectureSet.cpp", +- "llvm/lib/TextAPI/MachO/InterfaceFile.cpp", +- "llvm/lib/TextAPI/MachO/PackedVersion.cpp", +- "llvm/lib/TextAPI/MachO/Platform.cpp", +- "llvm/lib/TextAPI/MachO/Target.cpp", +- "llvm/lib/TextAPI/MachO/TextStub.cpp", +- "llvm/lib/TextAPI/MachO/TextStubCommon.cpp", +- "llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp", +- "llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp", +- "llvm/lib/Transforms/CFGuard/CFGuard.cpp", +- "llvm/lib/Transforms/Coroutines/CoroCleanup.cpp", +- "llvm/lib/Transforms/Coroutines/CoroEarly.cpp", +- "llvm/lib/Transforms/Coroutines/CoroElide.cpp", +- "llvm/lib/Transforms/Coroutines/CoroFrame.cpp", +- "llvm/lib/Transforms/Coroutines/CoroSplit.cpp", +- "llvm/lib/Transforms/Coroutines/Coroutines.cpp", +- "llvm/lib/Transforms/IPO/ArgumentPromotion.cpp", +- "llvm/lib/Transforms/IPO/Attributor.cpp", +- "llvm/lib/Transforms/IPO/BarrierNoopPass.cpp", +- "llvm/lib/Transforms/IPO/CalledValuePropagation.cpp", +- "llvm/lib/Transforms/IPO/ConstantMerge.cpp", +- "llvm/lib/Transforms/IPO/CrossDSOCFI.cpp", +- "llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp", +- "llvm/lib/Transforms/IPO/ElimAvailExtern.cpp", +- "llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp", +- "llvm/lib/Transforms/IPO/FunctionAttrs.cpp", +- "llvm/lib/Transforms/IPO/GlobalDCE.cpp", +- "llvm/lib/Transforms/IPO/GlobalOpt.cpp", +- "llvm/lib/Transforms/IPO/GlobalSplit.cpp", +- "llvm/lib/Transforms/IPO/HotColdSplitting.cpp", +- "llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp", +- "llvm/lib/Transforms/IPO/InlineSimple.cpp", +- "llvm/lib/Transforms/IPO/Inliner.cpp", +- "llvm/lib/Transforms/IPO/LowerTypeTests.cpp", +- "llvm/lib/Transforms/IPO/MergeFunctions.cpp", +- "llvm/lib/Transforms/IPO/PartialInlining.cpp", +- "llvm/lib/Transforms/IPO/PassManagerBuilder.cpp", +- "llvm/lib/Transforms/IPO/PruneEH.cpp", +- "llvm/lib/Transforms/IPO/SCCP.cpp", +- "llvm/lib/Transforms/IPO/SampleProfile.cpp", +- "llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp", +- "llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp", +- "llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp", +- "llvm/lib/Transforms/InstCombine/InstructionCombining.cpp", +- "llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp", +- "llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp", +- "llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp", +- "llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp", +- "llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp", +- "llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp", +- "llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp", +- "llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp", +- "llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp", +- "llvm/lib/Transforms/Instrumentation/Instrumentation.cpp", +- "llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp", +- "llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp", +- "llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp", +- "llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp", +- "llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp", +- "llvm/lib/Transforms/Instrumentation/ValueProfileCollector.cpp", +- "llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp", +- "llvm/lib/Transforms/Utils/BasicBlockUtils.cpp", +- "llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp", +- "llvm/lib/Transforms/Utils/BuildLibCalls.cpp", +- "llvm/lib/Transforms/Utils/BypassSlowDivision.cpp", +- "llvm/lib/Transforms/Utils/CallPromotionUtils.cpp", +- "llvm/lib/Transforms/Utils/CanonicalizeAliases.cpp", +- "llvm/lib/Transforms/Utils/CloneFunction.cpp", +- "llvm/lib/Transforms/Utils/CloneModule.cpp", +- "llvm/lib/Transforms/Utils/CodeExtractor.cpp", +- "llvm/lib/Transforms/Utils/CtorUtils.cpp", +- "llvm/lib/Transforms/Utils/DemoteRegToStack.cpp", +- "llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp", +- "llvm/lib/Transforms/Utils/EscapeEnumerator.cpp", +- "llvm/lib/Transforms/Utils/Evaluator.cpp", +- "llvm/lib/Transforms/Utils/FunctionComparator.cpp", +- "llvm/lib/Transforms/Utils/GlobalStatus.cpp", +- "llvm/lib/Transforms/Utils/ImportedFunctionsInliningStatistics.cpp", +- "llvm/lib/Transforms/Utils/InlineFunction.cpp", +- "llvm/lib/Transforms/Utils/LCSSA.cpp", +- "llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp", +- "llvm/lib/Transforms/Utils/Local.cpp", +- "llvm/lib/Transforms/Utils/LoopRotationUtils.cpp", +- "llvm/lib/Transforms/Utils/LoopSimplify.cpp", +- "llvm/lib/Transforms/Utils/LoopUnroll.cpp", +- "llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp", +- "llvm/lib/Transforms/Utils/LoopUnrollPeel.cpp", +- "llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp", +- "llvm/lib/Transforms/Utils/LoopUtils.cpp", +- "llvm/lib/Transforms/Utils/LoopVersioning.cpp", +- "llvm/lib/Transforms/Utils/LowerInvoke.cpp", +- "llvm/lib/Transforms/Utils/Mem2Reg.cpp", +- "llvm/lib/Transforms/Utils/MisExpect.cpp", +- "llvm/lib/Transforms/Utils/ModuleUtils.cpp", +- "llvm/lib/Transforms/Utils/NameAnonGlobals.cpp", +- "llvm/lib/Transforms/Utils/PredicateInfo.cpp", +- "llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp", +- "llvm/lib/Transforms/Utils/SSAUpdater.cpp", +- "llvm/lib/Transforms/Utils/SimplifyCFG.cpp", +- "llvm/lib/Transforms/Utils/SimplifyIndVar.cpp", +- "llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp", +- "llvm/lib/Transforms/Utils/SizeOpts.cpp", +- "llvm/lib/Transforms/Utils/SymbolRewriter.cpp", +- "llvm/lib/Transforms/Utils/VNCoercion.cpp", +- "llvm/lib/Transforms/Utils/ValueMapper.cpp", +- "llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp", +- "llvm/lib/Transforms/Vectorize/LoopVectorize.cpp", +- "llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp", +- "llvm/lib/Transforms/Vectorize/VPlan.cpp", +- "llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp", +- "llvm/lib/Transforms/Vectorize/VPlanPredicator.cpp", +- "llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp", +- "llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp", +- ] +-} +- +-swiftshader_llvm_source_set("swiftshader_llvm_debuginfo") { +- sources = [ +- "llvm/lib/DebugInfo/CodeView/CVTypeVisitor.cpp", +- "llvm/lib/DebugInfo/CodeView/CodeViewError.cpp", +- "llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp", +- "llvm/lib/DebugInfo/CodeView/ContinuationRecordBuilder.cpp", +- "llvm/lib/DebugInfo/CodeView/EnumTables.cpp", +- "llvm/lib/DebugInfo/CodeView/GlobalTypeTableBuilder.cpp", +- "llvm/lib/DebugInfo/CodeView/Line.cpp", +- "llvm/lib/DebugInfo/CodeView/RecordName.cpp", +- "llvm/lib/DebugInfo/CodeView/RecordSerialization.cpp", +- "llvm/lib/DebugInfo/CodeView/SimpleTypeSerializer.cpp", +- "llvm/lib/DebugInfo/CodeView/SymbolRecordMapping.cpp", +- "llvm/lib/DebugInfo/CodeView/TypeHashing.cpp", +- "llvm/lib/DebugInfo/CodeView/TypeIndex.cpp", +- "llvm/lib/DebugInfo/CodeView/TypeIndexDiscovery.cpp", +- "llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp", +- "llvm/lib/DebugInfo/CodeView/TypeTableCollection.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFAcceleratorTable.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFAddressRange.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFContext.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDataExtractor.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugAbbrev.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugArangeSet.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugAranges.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugInfoEntry.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugMacro.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugRangeList.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFDie.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFListTable.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp", +- "llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp", +- ] +-} +- +-swiftshader_llvm_source_set("swiftshader_llvm_support") { +- sources = [ +- "llvm/lib/Support/AArch64TargetParser.cpp", + "llvm/lib/Support/ABIBreak.cpp", + "llvm/lib/Support/APFloat.cpp", + "llvm/lib/Support/APInt.cpp", ++ "llvm/lib/Support/APSInt.cpp", + "llvm/lib/Support/ARMAttributeParser.cpp", + "llvm/lib/Support/ARMBuildAttrs.cpp", +- "llvm/lib/Support/ARMTargetParser.cpp", + "llvm/lib/Support/BinaryStreamError.cpp", + "llvm/lib/Support/BinaryStreamReader.cpp", + "llvm/lib/Support/BinaryStreamRef.cpp", +@@ -875,7 +897,6 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { + "llvm/lib/Support/BranchProbability.cpp", + "llvm/lib/Support/CRC.cpp", + "llvm/lib/Support/Chrono.cpp", +- "llvm/lib/Support/circular_raw_ostream.cpp", + "llvm/lib/Support/CodeGenCoverage.cpp", + "llvm/lib/Support/CommandLine.cpp", + "llvm/lib/Support/Compression.cpp", +@@ -886,16 +907,20 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { + "llvm/lib/Support/DataExtractor.cpp", + "llvm/lib/Support/Debug.cpp", + "llvm/lib/Support/DebugCounter.cpp", ++ "llvm/lib/Support/DivisionByConstantInfo.cpp", + "llvm/lib/Support/DynamicLibrary.cpp", ++ "llvm/lib/Support/ELFAttributeParser.cpp", ++ "llvm/lib/Support/ELFAttributes.cpp", + "llvm/lib/Support/Errno.cpp", +- "llvm/lib/Support/Error.cpp", + "llvm/lib/Support/ErrorHandling.cpp", ++ "llvm/lib/Support/ExtensibleRTTI.cpp", + "llvm/lib/Support/FoldingSet.cpp", + "llvm/lib/Support/FormatVariadic.cpp", + "llvm/lib/Support/FormattedStream.cpp", ++ "llvm/lib/Support/GlobPattern.cpp", + "llvm/lib/Support/GraphWriter.cpp", + "llvm/lib/Support/Hashing.cpp", +- "llvm/lib/Support/Host.cpp", ++ "llvm/lib/Support/InstructionCost.cpp", + "llvm/lib/Support/IntEqClasses.cpp", + "llvm/lib/Support/IntervalMap.cpp", + "llvm/lib/Support/ItaniumManglingCanonicalizer.cpp", +@@ -904,21 +929,25 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { + "llvm/lib/Support/LEB128.cpp", + "llvm/lib/Support/LineIterator.cpp", + "llvm/lib/Support/Locale.cpp", +- "llvm/lib/Support/LowLevelType.cpp", + "llvm/lib/Support/MD5.cpp", + "llvm/lib/Support/ManagedStatic.cpp", + "llvm/lib/Support/MathExtras.cpp", ++ "llvm/lib/Support/MemAlloc.cpp", + "llvm/lib/Support/Memory.cpp", + "llvm/lib/Support/MemoryBuffer.cpp", ++ "llvm/lib/Support/MemoryBufferRef.cpp", + "llvm/lib/Support/NativeFormatting.cpp", ++ "llvm/lib/Support/OptimizedStructLayout.cpp", + "llvm/lib/Support/Optional.cpp", + "llvm/lib/Support/Path.cpp", + "llvm/lib/Support/PrettyStackTrace.cpp", + "llvm/lib/Support/Process.cpp", + "llvm/lib/Support/Program.cpp", ++ "llvm/lib/Support/RISCVAttributeParser.cpp", ++ "llvm/lib/Support/RISCVAttributes.cpp", ++ "llvm/lib/Support/RISCVISAInfo.cpp", + "llvm/lib/Support/RandomNumberGenerator.cpp", + "llvm/lib/Support/Regex.cpp", +- "llvm/lib/Support/RWMutex.cpp", + "llvm/lib/Support/SHA1.cpp", + "llvm/lib/Support/ScaledNumber.cpp", + "llvm/lib/Support/ScopedPrinter.cpp", +@@ -933,59 +962,174 @@ swiftshader_llvm_source_set("swiftshader_llvm_support") { + "llvm/lib/Support/StringMap.cpp", + "llvm/lib/Support/StringRef.cpp", + "llvm/lib/Support/StringSaver.cpp", ++ "llvm/lib/Support/SuffixTree.cpp", + "llvm/lib/Support/SymbolRemappingReader.cpp", +- "llvm/lib/Support/TargetRegistry.cpp", +- "llvm/lib/Support/ThreadLocal.cpp", + "llvm/lib/Support/Threading.cpp", + "llvm/lib/Support/TimeProfiler.cpp", + "llvm/lib/Support/Timer.cpp", + "llvm/lib/Support/ToolOutputFile.cpp", + "llvm/lib/Support/TrigramIndex.cpp", +- "llvm/lib/Support/Triple.cpp", + "llvm/lib/Support/Twine.cpp", ++ "llvm/lib/Support/TypeSize.cpp", + "llvm/lib/Support/Unicode.cpp", + "llvm/lib/Support/UnicodeCaseFold.cpp", + "llvm/lib/Support/Valgrind.cpp", ++ "llvm/lib/Support/VersionTuple.cpp", + "llvm/lib/Support/VirtualFileSystem.cpp", +- "llvm/lib/Support/Watchdog.cpp", + "llvm/lib/Support/WithColor.cpp", + "llvm/lib/Support/YAMLParser.cpp", + "llvm/lib/Support/YAMLTraits.cpp", ++ "llvm/lib/Support/circular_raw_ostream.cpp", + "llvm/lib/Support/raw_ostream.cpp", + "llvm/lib/Support/regcomp.c", + "llvm/lib/Support/regerror.c", + "llvm/lib/Support/regexec.c", + "llvm/lib/Support/regfree.c", + "llvm/lib/Support/regstrlcpy.c", +- ] +-} +- +-swiftshader_llvm_source_set("swiftshader_llvm_transforms_scalar") { +- sources = [ ++ "llvm/lib/Support/xxhash.cpp", ++ "llvm/lib/TargetParser/AArch64TargetParser.cpp", ++ "llvm/lib/TargetParser/ARMTargetParser.cpp", ++ "llvm/lib/TargetParser/ARMTargetParserCommon.cpp", ++ "llvm/lib/TargetParser/Host.cpp", ++ "llvm/lib/TargetParser/Triple.cpp", ++ "llvm/lib/TextAPI/Architecture.cpp", ++ "llvm/lib/TextAPI/ArchitectureSet.cpp", ++ "llvm/lib/TextAPI/InterfaceFile.cpp", ++ "llvm/lib/TextAPI/PackedVersion.cpp", ++ "llvm/lib/TextAPI/Platform.cpp", ++ "llvm/lib/TextAPI/Target.cpp", ++ "llvm/lib/TextAPI/TextStub.cpp", ++ "llvm/lib/TextAPI/TextStubCommon.cpp", ++ "llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp", ++ "llvm/lib/Transforms/AggressiveInstCombine/TruncInstCombine.cpp", ++ "llvm/lib/Transforms/CFGuard/CFGuard.cpp", ++ "llvm/lib/Transforms/Coroutines/CoroCleanup.cpp", ++ "llvm/lib/Transforms/Coroutines/CoroConditionalWrapper.cpp", ++ "llvm/lib/Transforms/Coroutines/CoroEarly.cpp", ++ "llvm/lib/Transforms/Coroutines/CoroElide.cpp", ++ "llvm/lib/Transforms/Coroutines/CoroFrame.cpp", ++ "llvm/lib/Transforms/Coroutines/CoroSplit.cpp", ++ "llvm/lib/Transforms/Coroutines/Coroutines.cpp", ++ "llvm/lib/Transforms/IPO/AlwaysInliner.cpp", ++ "llvm/lib/Transforms/IPO/Annotation2Metadata.cpp", ++ "llvm/lib/Transforms/IPO/ArgumentPromotion.cpp", ++ "llvm/lib/Transforms/IPO/Attributor.cpp", ++ "llvm/lib/Transforms/IPO/AttributorAttributes.cpp", ++ "llvm/lib/Transforms/IPO/BlockExtractor.cpp", ++ "llvm/lib/Transforms/IPO/CalledValuePropagation.cpp", ++ "llvm/lib/Transforms/IPO/ConstantMerge.cpp", ++ "llvm/lib/Transforms/IPO/CrossDSOCFI.cpp", ++ "llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp", ++ "llvm/lib/Transforms/IPO/ElimAvailExtern.cpp", ++ "llvm/lib/Transforms/IPO/ForceFunctionAttrs.cpp", ++ "llvm/lib/Transforms/IPO/FunctionAttrs.cpp", ++ "llvm/lib/Transforms/IPO/FunctionImport.cpp", ++ "llvm/lib/Transforms/IPO/FunctionSpecialization.cpp", ++ "llvm/lib/Transforms/IPO/GlobalDCE.cpp", ++ "llvm/lib/Transforms/IPO/GlobalOpt.cpp", ++ "llvm/lib/Transforms/IPO/GlobalSplit.cpp", ++ "llvm/lib/Transforms/IPO/HotColdSplitting.cpp", ++ "llvm/lib/Transforms/IPO/IROutliner.cpp", ++ "llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp", ++ "llvm/lib/Transforms/IPO/Inliner.cpp", ++ "llvm/lib/Transforms/IPO/Internalize.cpp", ++ "llvm/lib/Transforms/IPO/LoopExtractor.cpp", ++ "llvm/lib/Transforms/IPO/LowerTypeTests.cpp", ++ "llvm/lib/Transforms/IPO/MergeFunctions.cpp", ++ "llvm/lib/Transforms/IPO/ModuleInliner.cpp", ++ "llvm/lib/Transforms/IPO/OpenMPOpt.cpp", ++ "llvm/lib/Transforms/IPO/PartialInlining.cpp", ++ "llvm/lib/Transforms/IPO/SCCP.cpp", ++ "llvm/lib/Transforms/IPO/SampleContextTracker.cpp", ++ "llvm/lib/Transforms/IPO/SampleProfile.cpp", ++ "llvm/lib/Transforms/IPO/SampleProfileProbe.cpp", ++ "llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp", ++ "llvm/lib/Transforms/IPO/StripSymbols.cpp", ++ "llvm/lib/Transforms/IPO/SyntheticCountsPropagation.cpp", ++ "llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineAtomicRMW.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineNegator.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp", ++ "llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp", ++ "llvm/lib/Transforms/InstCombine/InstructionCombining.cpp", ++ "llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp", ++ "llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp", ++ "llvm/lib/Transforms/Instrumentation/CGProfile.cpp", ++ "llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp", ++ "llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp", ++ "llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp", ++ "llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp", ++ "llvm/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp", ++ "llvm/lib/Transforms/Instrumentation/InstrOrderFile.cpp", ++ "llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp", ++ "llvm/lib/Transforms/Instrumentation/Instrumentation.cpp", ++ "llvm/lib/Transforms/Instrumentation/KCFI.cpp", ++ "llvm/lib/Transforms/Instrumentation/MemProfiler.cpp", ++ "llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp", ++ "llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp", ++ "llvm/lib/Transforms/Instrumentation/PGOMemOPSizeOpt.cpp", ++ "llvm/lib/Transforms/Instrumentation/PoisonChecking.cpp", ++ "llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp", ++ "llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp", ++ "llvm/lib/Transforms/Instrumentation/ValueProfileCollector.cpp", ++ "llvm/lib/Transforms/ObjCARC/DependencyAnalysis.cpp", ++ "llvm/lib/Transforms/ObjCARC/ObjCARC.cpp", ++ "llvm/lib/Transforms/ObjCARC/ObjCARCAPElim.cpp", ++ "llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp", ++ "llvm/lib/Transforms/ObjCARC/ObjCARCExpand.cpp", ++ "llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp", ++ "llvm/lib/Transforms/ObjCARC/ProvenanceAnalysis.cpp", ++ "llvm/lib/Transforms/ObjCARC/ProvenanceAnalysisEvaluator.cpp", ++ "llvm/lib/Transforms/ObjCARC/PtrState.cpp", + "llvm/lib/Transforms/Scalar/ADCE.cpp", + "llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp", ++ "llvm/lib/Transforms/Scalar/AnnotationRemarks.cpp", + "llvm/lib/Transforms/Scalar/BDCE.cpp", + "llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp", + "llvm/lib/Transforms/Scalar/ConstantHoisting.cpp", ++ "llvm/lib/Transforms/Scalar/ConstraintElimination.cpp", + "llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp", ++ "llvm/lib/Transforms/Scalar/DCE.cpp", ++ "llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp", + "llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp", + "llvm/lib/Transforms/Scalar/DivRemPairs.cpp", + "llvm/lib/Transforms/Scalar/EarlyCSE.cpp", ++ "llvm/lib/Transforms/Scalar/FlattenCFGPass.cpp", + "llvm/lib/Transforms/Scalar/Float2Int.cpp", + "llvm/lib/Transforms/Scalar/GVN.cpp", + "llvm/lib/Transforms/Scalar/GVNHoist.cpp", + "llvm/lib/Transforms/Scalar/GVNSink.cpp", ++ "llvm/lib/Transforms/Scalar/GuardWidening.cpp", ++ "llvm/lib/Transforms/Scalar/IVUsersPrinter.cpp", + "llvm/lib/Transforms/Scalar/IndVarSimplify.cpp", ++ "llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp", ++ "llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp", + "llvm/lib/Transforms/Scalar/InstSimplifyPass.cpp", + "llvm/lib/Transforms/Scalar/JumpThreading.cpp", + "llvm/lib/Transforms/Scalar/LICM.cpp", ++ "llvm/lib/Transforms/Scalar/LoopAccessAnalysisPrinter.cpp", ++ "llvm/lib/Transforms/Scalar/LoopBoundSplit.cpp", + "llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp", + "llvm/lib/Transforms/Scalar/LoopDeletion.cpp", + "llvm/lib/Transforms/Scalar/LoopDistribute.cpp", ++ "llvm/lib/Transforms/Scalar/LoopFlatten.cpp", ++ "llvm/lib/Transforms/Scalar/LoopFuse.cpp", + "llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp", + "llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp", + "llvm/lib/Transforms/Scalar/LoopInterchange.cpp", + "llvm/lib/Transforms/Scalar/LoopLoadElimination.cpp", ++ "llvm/lib/Transforms/Scalar/LoopPassManager.cpp", ++ "llvm/lib/Transforms/Scalar/LoopPredication.cpp", + "llvm/lib/Transforms/Scalar/LoopRerollPass.cpp", + "llvm/lib/Transforms/Scalar/LoopRotation.cpp", + "llvm/lib/Transforms/Scalar/LoopSimplifyCFG.cpp", +@@ -993,36 +1137,164 @@ swiftshader_llvm_source_set("swiftshader_llvm_transforms_scalar") { + "llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp", + "llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp", + "llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp", +- "llvm/lib/Transforms/Scalar/LoopUnswitch.cpp", + "llvm/lib/Transforms/Scalar/LoopVersioningLICM.cpp", ++ "llvm/lib/Transforms/Scalar/LowerAtomicPass.cpp", + "llvm/lib/Transforms/Scalar/LowerConstantIntrinsics.cpp", + "llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp", ++ "llvm/lib/Transforms/Scalar/LowerGuardIntrinsic.cpp", + "llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp", ++ "llvm/lib/Transforms/Scalar/LowerWidenableCondition.cpp", ++ "llvm/lib/Transforms/Scalar/MakeGuardsExplicit.cpp", + "llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp", +- "llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp", + "llvm/lib/Transforms/Scalar/MergeICmps.cpp", ++ "llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp", ++ "llvm/lib/Transforms/Scalar/NaryReassociate.cpp", + "llvm/lib/Transforms/Scalar/NewGVN.cpp", + "llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp", + "llvm/lib/Transforms/Scalar/Reassociate.cpp", +- "llvm/lib/Transforms/Scalar/SCCP.cpp", ++ "llvm/lib/Transforms/Scalar/Reg2Mem.cpp", ++ "llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp", ++ "llvm/lib/Transforms/Scalar/SROA.cpp", ++ "llvm/lib/Transforms/Scalar/ScalarizeMaskedMemIntrin.cpp", ++ "llvm/lib/Transforms/Scalar/Scalarizer.cpp", + "llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp", + "llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp", + "llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp", ++ "llvm/lib/Transforms/Scalar/Sink.cpp", + "llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp", +- "llvm/lib/Transforms/Scalar/SROA.cpp", ++ "llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp", ++ "llvm/lib/Transforms/Scalar/StructurizeCFG.cpp", ++ "llvm/lib/Transforms/Scalar/TLSVariableHoist.cpp", + "llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp", + "llvm/lib/Transforms/Scalar/WarnMissedTransforms.cpp", ++ "llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp", ++ "llvm/lib/Transforms/Utils/AddDiscriminators.cpp", ++ "llvm/lib/Transforms/Utils/AssumeBundleBuilder.cpp", ++ "llvm/lib/Transforms/Utils/BasicBlockUtils.cpp", ++ "llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp", ++ "llvm/lib/Transforms/Utils/BuildLibCalls.cpp", ++ "llvm/lib/Transforms/Utils/BypassSlowDivision.cpp", ++ "llvm/lib/Transforms/Utils/CallGraphUpdater.cpp", ++ "llvm/lib/Transforms/Utils/CallPromotionUtils.cpp", ++ "llvm/lib/Transforms/Utils/CanonicalizeAliases.cpp", ++ "llvm/lib/Transforms/Utils/CanonicalizeFreezeInLoops.cpp", ++ "llvm/lib/Transforms/Utils/CloneFunction.cpp", ++ "llvm/lib/Transforms/Utils/CloneModule.cpp", ++ "llvm/lib/Transforms/Utils/CodeExtractor.cpp", ++ "llvm/lib/Transforms/Utils/CodeLayout.cpp", ++ "llvm/lib/Transforms/Utils/CodeMoverUtils.cpp", ++ "llvm/lib/Transforms/Utils/CtorUtils.cpp", ++ "llvm/lib/Transforms/Utils/Debugify.cpp", ++ "llvm/lib/Transforms/Utils/DemoteRegToStack.cpp", ++ "llvm/lib/Transforms/Utils/EntryExitInstrumenter.cpp", ++ "llvm/lib/Transforms/Utils/EscapeEnumerator.cpp", ++ "llvm/lib/Transforms/Utils/Evaluator.cpp", ++ "llvm/lib/Transforms/Utils/FixIrreducible.cpp", ++ "llvm/lib/Transforms/Utils/FlattenCFG.cpp", ++ "llvm/lib/Transforms/Utils/FunctionComparator.cpp", ++ "llvm/lib/Transforms/Utils/FunctionImportUtils.cpp", ++ "llvm/lib/Transforms/Utils/GlobalStatus.cpp", ++ "llvm/lib/Transforms/Utils/HelloWorld.cpp", ++ "llvm/lib/Transforms/Utils/InjectTLIMappings.cpp", ++ "llvm/lib/Transforms/Utils/InlineFunction.cpp", ++ "llvm/lib/Transforms/Utils/InstructionNamer.cpp", ++ "llvm/lib/Transforms/Utils/IntegerDivision.cpp", ++ "llvm/lib/Transforms/Utils/LCSSA.cpp", ++ "llvm/lib/Transforms/Utils/LibCallsShrinkWrap.cpp", ++ "llvm/lib/Transforms/Utils/LoopPeel.cpp", ++ "llvm/lib/Transforms/Utils/LoopRotationUtils.cpp", ++ "llvm/lib/Transforms/Utils/LoopSimplify.cpp", ++ "llvm/lib/Transforms/Utils/LoopUnroll.cpp", ++ "llvm/lib/Transforms/Utils/LoopUnrollAndJam.cpp", ++ "llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp", ++ "llvm/lib/Transforms/Utils/LoopUtils.cpp", ++ "llvm/lib/Transforms/Utils/LoopVersioning.cpp", ++ "llvm/lib/Transforms/Utils/LowerAtomic.cpp", ++ "llvm/lib/Transforms/Utils/LowerGlobalDtors.cpp", ++ "llvm/lib/Transforms/Utils/LowerIFunc.cpp", ++ "llvm/lib/Transforms/Utils/LowerInvoke.cpp", ++ "llvm/lib/Transforms/Utils/LowerSwitch.cpp", ++ "llvm/lib/Transforms/Utils/MatrixUtils.cpp", ++ "llvm/lib/Transforms/Utils/Mem2Reg.cpp", ++ "llvm/lib/Transforms/Utils/MemoryOpRemark.cpp", ++ "llvm/lib/Transforms/Utils/MemoryTaggingSupport.cpp", ++ "llvm/lib/Transforms/Utils/MetaRenamer.cpp", ++ "llvm/lib/Transforms/Utils/MisExpect.cpp", ++ "llvm/lib/Transforms/Utils/ModuleUtils.cpp", ++ "llvm/lib/Transforms/Utils/NameAnonGlobals.cpp", ++ "llvm/lib/Transforms/Utils/PredicateInfo.cpp", ++ "llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp", ++ "llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp", ++ "llvm/lib/Transforms/Utils/SCCPSolver.cpp", ++ "llvm/lib/Transforms/Utils/SSAUpdater.cpp", ++ "llvm/lib/Transforms/Utils/SSAUpdaterBulk.cpp", ++ "llvm/lib/Transforms/Utils/SampleProfileInference.cpp", ++ "llvm/lib/Transforms/Utils/SampleProfileLoaderBaseUtil.cpp", ++ "llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp", ++ "llvm/lib/Transforms/Utils/SimplifyCFG.cpp", ++ "llvm/lib/Transforms/Utils/SimplifyIndVar.cpp", ++ "llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp", ++ "llvm/lib/Transforms/Utils/SizeOpts.cpp", ++ "llvm/lib/Transforms/Utils/StripGCRelocates.cpp", ++ "llvm/lib/Transforms/Utils/StripNonLineTableDebugInfo.cpp", ++ "llvm/lib/Transforms/Utils/SymbolRewriter.cpp", ++ "llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp", ++ "llvm/lib/Transforms/Utils/UnifyLoopExits.cpp", ++ "llvm/lib/Transforms/Utils/VNCoercion.cpp", ++ "llvm/lib/Transforms/Utils/ValueMapper.cpp", ++ "llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp", ++ "llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp", ++ "llvm/lib/Transforms/Vectorize/LoopVectorize.cpp", ++ "llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp", ++ "llvm/lib/Transforms/Vectorize/VPlan.cpp", ++ "llvm/lib/Transforms/Vectorize/VPlanHCFGBuilder.cpp", ++ "llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp", ++ "llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp", ++ "llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp", ++ "llvm/lib/Transforms/Vectorize/VectorCombine.cpp", ++ "llvm/lib/Target/TargetLoweringObjectFile.cpp", ++ "llvm/lib/Target/TargetMachine.cpp", ++ "llvm/lib/Support/BLAKE3/blake3.c", ++ "llvm/lib/Support/BLAKE3/blake3_dispatch.c", ++ "llvm/lib/Support/BLAKE3/blake3_portable.c", ++ ] ++} ++swiftshader_llvm_source_set("swiftshader_llvm_source_set_1") { ++ sources = [ ++ "llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp", ++ "llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/COFF.cpp", ++ "llvm/lib/ExecutionEngine/JITLink/MachO.cpp", ++ "llvm/lib/IRPrinter/IRPrintingPasses.cpp", ++ "llvm/lib/Object/ELF.cpp", ++ "llvm/lib/Support/Error.cpp", ++ "llvm/lib/Support/LowLevelType.cpp", ++ "llvm/lib/Transforms/Instrumentation/SanitizerBinaryMetadata.cpp", ++ "llvm/lib/Transforms/Scalar/SCCP.cpp", ++ "llvm/lib/Transforms/Utils/GuardUtils.cpp", ++ "llvm/lib/Transforms/Utils/Local.cpp", ++ ] ++} ++ ++ ++swiftshader_llvm_source_set("swiftshader_llvm_debug") { ++ sources = [ ++ "llvm/lib/Analysis/RegionPrinter.cpp", ++ "llvm/lib/MC/MCDisassembler/MCDisassembler.cpp", + ] + } + + swiftshader_llvm_source_set("swiftshader_llvm_aarch64") { + sources = [ ++ "llvm/lib/CodeGen/MultiHazardRecognizer.cpp", ++ "llvm/lib/MC/ConstantPools.cpp", ++ "llvm/lib/MC/MCInstrInfo.cpp", + "llvm/lib/Target/AArch64/AArch64A53Fix835769.cpp", + "llvm/lib/Target/AArch64/AArch64A57FPLoadBalancing.cpp", + "llvm/lib/Target/AArch64/AArch64AdvSIMDScalarPass.cpp", + "llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp", + "llvm/lib/Target/AArch64/AArch64BranchTargets.cpp", +- "llvm/lib/Target/AArch64/AArch64CallLowering.cpp", + "llvm/lib/Target/AArch64/AArch64CallingConvention.cpp", + "llvm/lib/Target/AArch64/AArch64CleanupLocalDynamicTLSPass.cpp", + "llvm/lib/Target/AArch64/AArch64CollectLOH.cpp", +@@ -1039,18 +1311,20 @@ swiftshader_llvm_source_set("swiftshader_llvm_aarch64") { + "llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp", + "llvm/lib/Target/AArch64/AArch64ISelLowering.cpp", + "llvm/lib/Target/AArch64/AArch64InstrInfo.cpp", +- "llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp", +- "llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp", ++ "llvm/lib/Target/AArch64/AArch64KCFI.cpp", + "llvm/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp", ++ "llvm/lib/Target/AArch64/AArch64LowerHomogeneousPrologEpilog.cpp", + "llvm/lib/Target/AArch64/AArch64MCInstLower.cpp", ++ "llvm/lib/Target/AArch64/AArch64MIPeepholeOpt.cpp", ++ "llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.cpp", ++ "llvm/lib/Target/AArch64/AArch64MachineScheduler.cpp", + "llvm/lib/Target/AArch64/AArch64MacroFusion.cpp", + "llvm/lib/Target/AArch64/AArch64PBQPRegAlloc.cpp", +- "llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp", + "llvm/lib/Target/AArch64/AArch64PromoteConstant.cpp", + "llvm/lib/Target/AArch64/AArch64RedundantCopyElimination.cpp", +- "llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp", + "llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp", + "llvm/lib/Target/AArch64/AArch64SIMDInstrOpt.cpp", ++ "llvm/lib/Target/AArch64/AArch64SLSHardening.cpp", + "llvm/lib/Target/AArch64/AArch64SelectionDAGInfo.cpp", + "llvm/lib/Target/AArch64/AArch64SpeculationHardening.cpp", + "llvm/lib/Target/AArch64/AArch64StackTagging.cpp", +@@ -1063,6 +1337,16 @@ swiftshader_llvm_source_set("swiftshader_llvm_aarch64") { + "llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp", + "llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp", + "llvm/lib/Target/AArch64/Disassembler/AArch64ExternalSymbolizer.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64O0PreLegalizerCombiner.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerCombiner.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64PostLegalizerLowering.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64PostSelectOptimize.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64PreLegalizerCombiner.cpp", ++ "llvm/lib/Target/AArch64/GISel/AArch64RegisterBankInfo.cpp", + "llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp", + "llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp", + "llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp", +@@ -1075,24 +1359,34 @@ swiftshader_llvm_source_set("swiftshader_llvm_aarch64") { + "llvm/lib/Target/AArch64/MCTargetDesc/AArch64TargetStreamer.cpp", + "llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFObjectWriter.cpp", + "llvm/lib/Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp", ++ "llvm/lib/Target/AArch64/SMEABIPass.cpp", ++ "llvm/lib/Target/AArch64/SVEIntrinsicOpts.cpp", + "llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp", + "llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp", ++ "llvm/lib/Target/AArch64/Utils/AArch64SMEAttributes.cpp", ++ "llvm/lib/Transforms/IPO/BarrierNoopPass.cpp", + ] + } + + swiftshader_llvm_source_set("swiftshader_llvm_arm") { + sources = [ ++ "llvm/lib/CodeGen/MultiHazardRecognizer.cpp", ++ "llvm/lib/MC/ConstantPools.cpp", ++ "llvm/lib/MC/MCInstrInfo.cpp", + "llvm/lib/Target/ARM/A15SDOptimizer.cpp", + "llvm/lib/Target/ARM/ARMAsmPrinter.cpp", + "llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp", + "llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp", + "llvm/lib/Target/ARM/ARMBasicBlockInfo.cpp", ++ "llvm/lib/Target/ARM/ARMBlockPlacement.cpp", ++ "llvm/lib/Target/ARM/ARMBranchTargets.cpp", + "llvm/lib/Target/ARM/ARMCallLowering.cpp", + "llvm/lib/Target/ARM/ARMCallingConv.cpp", + "llvm/lib/Target/ARM/ARMConstantIslandPass.cpp", + "llvm/lib/Target/ARM/ARMConstantPoolValue.cpp", + "llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp", + "llvm/lib/Target/ARM/ARMFastISel.cpp", ++ "llvm/lib/Target/ARM/ARMFixCortexA57AES1742098Pass.cpp", + "llvm/lib/Target/ARM/ARMFrameLowering.cpp", + "llvm/lib/Target/ARM/ARMHazardRecognizer.cpp", + "llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp", +@@ -1109,6 +1403,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_arm") { + "llvm/lib/Target/ARM/ARMParallelDSP.cpp", + "llvm/lib/Target/ARM/ARMRegisterBankInfo.cpp", + "llvm/lib/Target/ARM/ARMRegisterInfo.cpp", ++ "llvm/lib/Target/ARM/ARMSLSHardening.cpp", + "llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp", + "llvm/lib/Target/ARM/ARMSubtarget.cpp", + "llvm/lib/Target/ARM/ARMTargetMachine.cpp", +@@ -1131,6 +1426,8 @@ swiftshader_llvm_source_set("swiftshader_llvm_arm") { + "llvm/lib/Target/ARM/MCTargetDesc/ARMWinCOFFStreamer.cpp", + "llvm/lib/Target/ARM/MLxExpansionPass.cpp", + "llvm/lib/Target/ARM/MVEGatherScatterLowering.cpp", ++ "llvm/lib/Target/ARM/MVELaneInterleavingPass.cpp", ++ "llvm/lib/Target/ARM/MVETPAndVPTOptimisationsPass.cpp", + "llvm/lib/Target/ARM/MVETailPredication.cpp", + "llvm/lib/Target/ARM/MVEVPTBlockPass.cpp", + "llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp", +@@ -1141,6 +1438,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_arm") { + "llvm/lib/Target/ARM/Thumb2SizeReduction.cpp", + "llvm/lib/Target/ARM/ThumbRegisterInfo.cpp", + "llvm/lib/Target/ARM/Utils/ARMBaseInfo.cpp", ++ "llvm/lib/Transforms/IPO/BarrierNoopPass.cpp", + ] + + # When is_ubsan_vptr is true, this file is added to swiftshader_llvm instead. +@@ -1149,6 +1447,38 @@ swiftshader_llvm_source_set("swiftshader_llvm_arm") { + } + } + ++swiftshader_llvm_source_set("swiftshader_llvm_loongarch64") { ++ sources = [ ++ "llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp", ++ "llvm/lib/Target/LoongArch/Disassembler/LoongArchDisassembler.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchAsmPrinter.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchExpandAtomicPseudoInsts.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchExpandPseudoInsts.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchFrameLowering.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchISelDAGToDAG.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchMCInstLower.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchRegisterInfo.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp", ++ "llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchAsmBackend.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchBaseInfo.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFObjectWriter.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchELFStreamer.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchInstPrinter.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCAsmInfo.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCCodeEmitter.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCExpr.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp", ++ "llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchTargetStreamer.cpp", ++ "llvm/lib/Target/LoongArch/TargetInfo/LoongArchTargetInfo.cpp", ++ "llvm/lib/TargetParser/LoongArchTargetParser.cpp", ++ "llvm/lib/Transforms/IPO/BarrierNoopPass.cpp", ++ ] ++} ++ + swiftshader_llvm_source_set("swiftshader_llvm_mips") { + sources = [ + "llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp", +@@ -1192,8 +1522,10 @@ swiftshader_llvm_source_set("swiftshader_llvm_mips") { + "llvm/lib/Target/Mips/MipsMCInstLower.cpp", + "llvm/lib/Target/Mips/MipsMachineFunction.cpp", + "llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp", ++ "llvm/lib/Target/Mips/MipsMulMulBugPass.cpp", + "llvm/lib/Target/Mips/MipsOptimizePICCall.cpp", + "llvm/lib/Target/Mips/MipsOs16.cpp", ++ "llvm/lib/Target/Mips/MipsPostLegalizerCombiner.cpp", + "llvm/lib/Target/Mips/MipsPreLegalizerCombiner.cpp", + "llvm/lib/Target/Mips/MipsRegisterBankInfo.cpp", + "llvm/lib/Target/Mips/MipsRegisterInfo.cpp", +@@ -1205,6 +1537,7 @@ swiftshader_llvm_source_set("swiftshader_llvm_mips") { + "llvm/lib/Target/Mips/MipsSubtarget.cpp", + "llvm/lib/Target/Mips/MipsTargetMachine.cpp", + "llvm/lib/Target/Mips/MipsTargetObjectFile.cpp", ++ "llvm/lib/Target/Mips/MipsTargetTransformInfo.cpp", + "llvm/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp", + ] + } +@@ -1213,27 +1546,35 @@ swiftshader_llvm_source_set("swiftshader_llvm_ppc") { + sources = [ + "llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp", + "llvm/lib/Target/PowerPC/Disassembler/PPCDisassembler.cpp", ++ "llvm/lib/Target/PowerPC/GISel/PPCCallLowering.cpp", ++ "llvm/lib/Target/PowerPC/GISel/PPCInstructionSelector.cpp", ++ "llvm/lib/Target/PowerPC/GISel/PPCLegalizerInfo.cpp", ++ "llvm/lib/Target/PowerPC/GISel/PPCRegisterBankInfo.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp", ++ "llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFStreamer.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCExpr.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp", +- "llvm/lib/Target/PowerPC/MCTargetDesc/PPCMachObjectWriter.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp", + "llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFObjectWriter.cpp", ++ "llvm/lib/Target/PowerPC/MCTargetDesc/PPCXCOFFStreamer.cpp", + "llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp", + "llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp", + "llvm/lib/Target/PowerPC/PPCBranchCoalescing.cpp", + "llvm/lib/Target/PowerPC/PPCBranchSelector.cpp", + "llvm/lib/Target/PowerPC/PPCCCState.cpp", + "llvm/lib/Target/PowerPC/PPCCTRLoops.cpp", ++ "llvm/lib/Target/PowerPC/PPCCTRLoopsVerify.cpp", + "llvm/lib/Target/PowerPC/PPCCallingConv.cpp", + "llvm/lib/Target/PowerPC/PPCEarlyReturn.cpp", ++ "llvm/lib/Target/PowerPC/PPCExpandAtomicPseudoInsts.cpp", + "llvm/lib/Target/PowerPC/PPCExpandISEL.cpp", + "llvm/lib/Target/PowerPC/PPCFastISel.cpp", + "llvm/lib/Target/PowerPC/PPCFrameLowering.cpp", ++ "llvm/lib/Target/PowerPC/PPCGenScalarMASSEntries.cpp", + "llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp", + "llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp", + "llvm/lib/Target/PowerPC/PPCISelLowering.cpp", +@@ -1244,8 +1585,8 @@ swiftshader_llvm_source_set("swiftshader_llvm_ppc") { + "llvm/lib/Target/PowerPC/PPCMIPeephole.cpp", + "llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp", + "llvm/lib/Target/PowerPC/PPCMachineScheduler.cpp", ++ "llvm/lib/Target/PowerPC/PPCMacroFusion.cpp", + "llvm/lib/Target/PowerPC/PPCPreEmitPeephole.cpp", +- "llvm/lib/Target/PowerPC/PPCQPXLoadSplat.cpp", + "llvm/lib/Target/PowerPC/PPCReduceCRLogicals.cpp", + "llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp", + "llvm/lib/Target/PowerPC/PPCSubtarget.cpp", +@@ -1265,21 +1606,24 @@ swiftshader_llvm_source_set("swiftshader_llvm_x86") { + sources = [ + "llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp", + "llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp", ++ "llvm/lib/Target/X86/MCA/X86CustomBehaviour.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86ATTInstPrinter.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86InstComments.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.cpp", ++ "llvm/lib/Target/X86/MCTargetDesc/X86InstrRelaxTables.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86IntelInstPrinter.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp", ++ "llvm/lib/Target/X86/MCTargetDesc/X86MnemonicTables.cpp", ++ "llvm/lib/Target/X86/MCTargetDesc/X86ShuffleDecode.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFStreamer.cpp", + "llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFTargetStreamer.cpp", + "llvm/lib/Target/X86/TargetInfo/X86TargetInfo.cpp", +- "llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp", + "llvm/lib/Target/X86/X86AsmPrinter.cpp", + "llvm/lib/Target/X86/X86AvoidStoreForwardingBlocks.cpp", + "llvm/lib/Target/X86/X86AvoidTrailingCall.cpp", +@@ -1287,12 +1631,14 @@ swiftshader_llvm_source_set("swiftshader_llvm_x86") { + "llvm/lib/Target/X86/X86CallLowering.cpp", + "llvm/lib/Target/X86/X86CallingConv.cpp", + "llvm/lib/Target/X86/X86CmovConversion.cpp", +- "llvm/lib/Target/X86/X86CondBrFolding.cpp", + "llvm/lib/Target/X86/X86DiscriminateMemOps.cpp", + "llvm/lib/Target/X86/X86DomainReassignment.cpp", ++ "llvm/lib/Target/X86/X86DynAllocaExpander.cpp", + "llvm/lib/Target/X86/X86EvexToVex.cpp", + "llvm/lib/Target/X86/X86ExpandPseudo.cpp", + "llvm/lib/Target/X86/X86FastISel.cpp", ++ "llvm/lib/Target/X86/X86FastPreTileConfig.cpp", ++ "llvm/lib/Target/X86/X86FastTileConfig.cpp", + "llvm/lib/Target/X86/X86FixupBWInsts.cpp", + "llvm/lib/Target/X86/X86FixupLEAs.cpp", + "llvm/lib/Target/X86/X86FixupSetCC.cpp", +@@ -1302,30 +1648,43 @@ swiftshader_llvm_source_set("swiftshader_llvm_x86") { + "llvm/lib/Target/X86/X86ISelDAGToDAG.cpp", + "llvm/lib/Target/X86/X86ISelLowering.cpp", + "llvm/lib/Target/X86/X86IndirectBranchTracking.cpp", ++ "llvm/lib/Target/X86/X86IndirectThunks.cpp", + "llvm/lib/Target/X86/X86InsertPrefetch.cpp", ++ "llvm/lib/Target/X86/X86InsertWait.cpp", ++ "llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp", + "llvm/lib/Target/X86/X86InstrFMA3Info.cpp", + "llvm/lib/Target/X86/X86InstrFoldTables.cpp", + "llvm/lib/Target/X86/X86InstrInfo.cpp", + "llvm/lib/Target/X86/X86InstructionSelector.cpp", + "llvm/lib/Target/X86/X86InterleavedAccess.cpp", ++ "llvm/lib/Target/X86/X86KCFI.cpp", + "llvm/lib/Target/X86/X86LegalizerInfo.cpp", ++ "llvm/lib/Target/X86/X86LoadValueInjectionLoadHardening.cpp", ++ "llvm/lib/Target/X86/X86LoadValueInjectionRetHardening.cpp", ++ "llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp", ++ "llvm/lib/Target/X86/X86LowerAMXType.cpp", ++ "llvm/lib/Target/X86/X86LowerTileCopy.cpp", + "llvm/lib/Target/X86/X86MCInstLower.cpp", + "llvm/lib/Target/X86/X86MachineFunctionInfo.cpp", + "llvm/lib/Target/X86/X86MacroFusion.cpp", + "llvm/lib/Target/X86/X86OptimizeLEAs.cpp", + "llvm/lib/Target/X86/X86PadShortFunction.cpp", ++ "llvm/lib/Target/X86/X86PartialReduction.cpp", ++ "llvm/lib/Target/X86/X86PreAMXConfig.cpp", ++ "llvm/lib/Target/X86/X86PreTileConfig.cpp", + "llvm/lib/Target/X86/X86RegisterBankInfo.cpp", + "llvm/lib/Target/X86/X86RegisterInfo.cpp", +- "llvm/lib/Target/X86/X86RetpolineThunks.cpp", ++ "llvm/lib/Target/X86/X86ReturnThunks.cpp", + "llvm/lib/Target/X86/X86SelectionDAGInfo.cpp", + "llvm/lib/Target/X86/X86ShuffleDecodeConstantPool.cpp", ++ "llvm/lib/Target/X86/X86SpeculativeExecutionSideEffectSuppression.cpp", + "llvm/lib/Target/X86/X86SpeculativeLoadHardening.cpp", + "llvm/lib/Target/X86/X86Subtarget.cpp", + "llvm/lib/Target/X86/X86TargetMachine.cpp", + "llvm/lib/Target/X86/X86TargetObjectFile.cpp", + "llvm/lib/Target/X86/X86TargetTransformInfo.cpp", ++ "llvm/lib/Target/X86/X86TileConfig.cpp", + "llvm/lib/Target/X86/X86VZeroUpper.cpp", +- "llvm/lib/Target/X86/X86WinAllocaExpander.cpp", + "llvm/lib/Target/X86/X86WinEHState.cpp", + ] + } +@@ -1334,34 +1693,48 @@ swiftshader_llvm_source_set("swiftshader_llvm_riscv64") { + sources = [ + "llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp", + "llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp", ++ "llvm/lib/Target/RISCV/GISel/RISCVCallLowering.cpp", ++ "llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp", ++ "llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp", ++ "llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp", ++ "llvm/lib/Target/RISCV/MCA/RISCVCustomBehaviour.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVAsmBackend.cpp", ++ "llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFObjectWriter.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVELFStreamer.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCCodeEmitter.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCExpr.cpp", ++ "llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCObjectFileInfo.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCTargetDesc.cpp", ++ "llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp", + "llvm/lib/Target/RISCV/MCTargetDesc/RISCVTargetStreamer.cpp", + "llvm/lib/Target/RISCV/RISCVAsmPrinter.cpp", +- "llvm/lib/Target/RISCV/RISCVCallLowering.cpp", ++ "llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp", ++ "llvm/lib/Target/RISCV/RISCVExpandAtomicPseudoInsts.cpp", + "llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp", + "llvm/lib/Target/RISCV/RISCVFrameLowering.cpp", +- "llvm/lib/Target/RISCV/RISCVInstrInfo.cpp", +- "llvm/lib/Target/RISCV/RISCVInstructionSelector.cpp", ++ "llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp", + "llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp", + "llvm/lib/Target/RISCV/RISCVISelLowering.cpp", +- "llvm/lib/Target/RISCV/RISCVLegalizerInfo.cpp", ++ "llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp", ++ "llvm/lib/Target/RISCV/RISCVInstrInfo.cpp", + "llvm/lib/Target/RISCV/RISCVMCInstLower.cpp", ++ "llvm/lib/Target/RISCV/RISCVMachineFunctionInfo.cpp", ++ "llvm/lib/Target/RISCV/RISCVMacroFusion.cpp", ++ "llvm/lib/Target/RISCV/RISCVMakeCompressible.cpp", + "llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp", +- "llvm/lib/Target/RISCV/RISCVRegisterBankInfo.cpp", ++ "llvm/lib/Target/RISCV/RISCVRedundantCopyElimination.cpp", + "llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp", ++ "llvm/lib/Target/RISCV/RISCVSExtWRemoval.cpp", ++ "llvm/lib/Target/RISCV/RISCVStripWSuffix.cpp", + "llvm/lib/Target/RISCV/RISCVSubtarget.cpp", + "llvm/lib/Target/RISCV/RISCVTargetMachine.cpp", + "llvm/lib/Target/RISCV/RISCVTargetObjectFile.cpp", + "llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp", + "llvm/lib/Target/RISCV/TargetInfo/RISCVTargetInfo.cpp", +- "llvm/lib/Target/RISCV/Utils/RISCVBaseInfo.cpp", +- "llvm/lib/Target/RISCV/Utils/RISCVMatInt.cpp", ++ "llvm/lib/TargetParser/RISCVTargetParser.cpp", ++ "llvm/lib/Transforms/IPO/BarrierNoopPass.cpp", + ] + } +diff --git a/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/scripts/template_BUILD.gn b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/scripts/template_BUILD.gn +new file mode 100644 +index 000000000..8d18e212d +--- /dev/null ++++ b/src/3rdparty/chromium/third_party/swiftshader/third_party/llvm-10.0/scripts/template_BUILD.gn +@@ -0,0 +1,248 @@ ++# Copyright 2023 The SwiftShader Authors. All Rights Reserved. ++# ++# Licensed under the Apache License, Version 2.0 (the "License"); ++# you may not use this file except in compliance with the License. ++# You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, ++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++# See the License for the specific language governing permissions and ++# limitations under the License. ++ ++%$%generated_file_comment ++ ++import("../../src/swiftshader.gni") ++ ++# Need a separate config to ensure the warnings are added to the end. ++config("swiftshader_llvm_private_config") { ++ cflags = [ ++ "-DBLAKE3_NO_AVX512", ++ "-DBLAKE3_NO_AVX2", ++ "-DBLAKE3_NO_SSE41", ++ "-DBLAKE3_NO_SSE2", ++ "-DBLAKE3_USE_NEON=0", ++ ] ++ ++ if (is_win) { ++ cflags += [ ++ "/wd4005", ++ "/wd4018", ++ "/wd4065", ++ "/wd4141", ++ "/wd4146", ++ "/wd4244", ++ "/wd4245", ++ "/wd4267", ++ "/wd4310", ++ "/wd4319", ++ "/wd4334", ++ "/wd4389", ++ "/wd4624", ++ "/wd4701", ++ "/wd4702", ++ "/wd4703", ++ "/wd4706", ++ "/wd4800", ++ "/wd4805", ++ "/wd4828", ++ ] ++ ++ if (!is_debug) { ++ cflags += [ "/wd4324" ] ++ } ++ ++ if (is_clang) { ++ cflags += [ ++ "-Wno-format", ++ "-Wno-sign-compare", ++ "-Wno-macro-redefined", ++ ] ++ } ++ } ++ ++ if (is_fuchsia) { ++ # Ignore #warning for unimplemented features in Process.inc. ++ cflags += [ "-Wno-cpp" ] ++ } ++ ++ if (is_clang) { ++ cflags += [ ++ "-Wno-attributes", ++ "-Wno-bitwise-instead-of-logical", ++ "-Wno-deprecated-anon-enum-enum-conversion", ++ "-Wno-deprecated-declarations", ++ "-Wno-deprecated-pragma", ++ "-Wno-deprecated-enum-enum-conversion", ++ "-Wno-enum-compare", ++ "-Wno-header-hygiene", ++ "-Wno-range-loop-bind-reference", ++ "-Wno-unused-function", ++ "-Wno-unused-local-typedef", ++ "-Wno-unused-private-field", ++ "-Wno-unused-result", ++ "-Wno-unused-variable", ++ ] ++ } ++ ++ defines = [ ++ "__STDC_CONSTANT_MACROS", ++ "__STDC_LIMIT_MACROS", ++ ] ++} ++ ++llvm_include_dirs = [ ++ "llvm/include/", ++ "llvm/lib/Target/AArch64/", ++ "llvm/lib/Target/ARM/", ++ "llvm/lib/Target/LoongArch/", ++ "llvm/lib/Target/Mips/", ++ "llvm/lib/Target/PowerPC/", ++ "llvm/lib/Target/RISCV/", ++ "llvm/lib/Target/X86/", ++ "configs/common/include/", ++ "configs/common/lib/ExecutionEngine/JITLink/", ++ "configs/common/lib/IR/", ++ "configs/common/lib/Target/AArch64/", ++ "configs/common/lib/Target/ARM/", ++ "configs/common/lib/Target/LoongArch/", ++ "configs/common/lib/Target/Mips/", ++ "configs/common/lib/Target/PowerPC/", ++ "configs/common/lib/Target/RISCV/", ++ "configs/common/lib/Target/X86/", ++ "configs/common/lib/Transforms/InstCombine/", ++] ++ ++if (is_linux || is_chromeos) { ++ llvm_include_dirs += [ "configs/linux/include/" ] ++} else if (is_fuchsia) { ++ llvm_include_dirs += [ "configs/fuchsia/include/" ] ++} else if (is_win) { ++ llvm_include_dirs += [ "configs/windows/include/" ] ++} else if (is_android) { ++ llvm_include_dirs += [ "configs/android/include/" ] ++} else if (is_mac) { ++ llvm_include_dirs += [ "configs/darwin/include/" ] ++} else { ++ assert(false, "llvm-10.0 not configured for target platform") ++} ++ ++template("swiftshader_llvm_source_set") { ++ swiftshader_source_set(target_name) { ++ configs = [ ":swiftshader_llvm_private_config" ] ++ include_dirs = llvm_include_dirs ++ ++ forward_variables_from(invoker, "*", [ "configs" ]) ++ if (defined(invoker.configs)) { ++ configs += invoker.configs ++ } ++ } ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm") { ++ # This class is declared on all platforms but only used on ARM. UBSanVPtr ++ # builds require that all declared classes have a definition even if they're ++ # not used. ++ if (is_ubsan_vptr) { ++ sources = [ ++ "llvm/lib/MC/MCWasmObjectTargetWriter.cpp", ++ "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp", ++ "llvm/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp", ++ "llvm/lib/Target/TargetIntrinsicInfo.cpp", ++ ] ++ } ++ ++ deps = [ ++%$%llvm_deps ++ ] ++ ++ if (is_debug) { ++ deps += [ ":swiftshader_llvm_debug" ] ++ } ++ ++ if (current_cpu == "arm64") { ++ deps += [ ":swiftshader_llvm_aarch64" ] ++ } else if (current_cpu == "arm") { ++ deps += [ ":swiftshader_llvm_arm" ] ++ } else if (current_cpu == "loong64") { ++ deps += [ ":swiftshader_llvm_loongarch64" ] ++ } else if (current_cpu == "mipsel" || current_cpu == "mips64el") { ++ deps += [ ":swiftshader_llvm_mips" ] ++ } else if (current_cpu == "ppc64") { ++ deps += [ ":swiftshader_llvm_ppc" ] ++ } else if (current_cpu == "riscv64") { ++ deps += [ ":swiftshader_llvm_riscv64" ] ++ } else if (current_cpu == "x86" || current_cpu == "x64") { ++ deps += [ ":swiftshader_llvm_x86" ] ++ } else { ++ assert(false, "Unsupported current_cpu") ++ } ++ ++ if ((current_cpu != current_cpu && ++ (current_cpu == "x86" || current_cpu == "x64")) || ++ # Windows ARM64 does cross compilation on Windows x64 host, and requires native ++ # x86 target. ++ (is_win && current_cpu == "arm64")) { ++ deps += [ ":swiftshader_llvm_x86" ] ++ } ++} ++ ++# This source_set would contain all source files, except that GN doesn't allow for duplicate source ++# file names, even if they are in different subdirectories. Because of this, some files are ++# split out into their own source_set. ++%$%llvm_source_sets ++ ++swiftshader_llvm_source_set("swiftshader_llvm_debug") { ++ sources = [ ++%$%files_llvm_debug ++ ] ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_aarch64") { ++ sources = [ ++%$%files_AArch64 ++ ] ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_arm") { ++ sources = [ ++%$%files_ARM ++ ] ++ ++ # When is_ubsan_vptr is true, this file is added to swiftshader_llvm instead. ++ if (!is_ubsan_vptr) { ++ sources += [ "llvm/lib/Target/ARM/MCTargetDesc/ARMTargetStreamer.cpp" ] ++ } ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_loongarch64") { ++ sources = [ ++%$%files_LoongArch ++ ] ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_mips") { ++ sources = [ ++%$%files_Mips ++ ] ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_ppc") { ++ sources = [ ++%$%files_PowerPC ++ ] ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_x86") { ++ sources = [ ++%$%files_x86 ++ ] ++} ++ ++swiftshader_llvm_source_set("swiftshader_llvm_riscv64") { ++ sources = [ ++%$%files_RISCV ++ ] ++} +diff --git a/src/3rdparty/chromium/third_party/swiftshader/third_party/marl/BUILD.gn b/src/3rdparty/chromium/third_party/swiftshader/third_party/marl/BUILD.gn +index d7cb142fa..c811c50ed 100644 +--- a/src/3rdparty/chromium/third_party/swiftshader/third_party/marl/BUILD.gn ++++ b/src/3rdparty/chromium/third_party/swiftshader/third_party/marl/BUILD.gn +@@ -86,7 +86,7 @@ swiftshader_source_set("Marl") { + "src/osfiber_asm_rv64.h", + "src/osfiber_asm_rv64.S", + ] +- } else if (current_cpu == "loong64") { ++ } else if (current_cpu == "loongarch64") { + sources += [ + "src/osfiber_loongarch64.c", + "src/osfiber_asm_loongarch64.h", +diff --git a/src/3rdparty/chromium/ui/gl/features.gni b/src/3rdparty/chromium/ui/gl/features.gni +index c950e87c6..224170da8 100644 +--- a/src/3rdparty/chromium/ui/gl/features.gni ++++ b/src/3rdparty/chromium/ui/gl/features.gni +@@ -33,5 +33,5 @@ declare_args() { + is_chromeos_ash || is_fuchsia) && + (target_cpu == "x86" || target_cpu == "x64" || target_cpu == "arm" || + target_cpu == "arm64" || target_cpu == "mipsel" || +- target_cpu == "mips64el" || target_cpu == "riscv64") ++ target_cpu == "mips64el" || target_cpu == "riscv64" || target_cpu == "loong64") + } +diff --git a/src/3rdparty/chromium/v8/BUILD.gn b/src/3rdparty/chromium/v8/BUILD.gn +index 13fb2576c..185b43714 100644 +--- a/src/3rdparty/chromium/v8/BUILD.gn ++++ b/src/3rdparty/chromium/v8/BUILD.gn +@@ -295,7 +295,7 @@ declare_args() { + # Enable heap reservation of size 4GB. Only possible for 64bit archs. + cppgc_enable_caged_heap = + v8_current_cpu == "x64" || v8_current_cpu == "arm64" || +- v8_current_cpu == "loong64" ++ v8_current_cpu == "loongarch64" + + # Enables additional heap verification phases and checks. + cppgc_enable_verify_heap = "" +@@ -575,7 +575,7 @@ assert(!v8_enable_unconditional_write_barriers || !v8_disable_write_barriers, + "Write barriers can't be both enabled and disabled") + + assert(!cppgc_enable_caged_heap || v8_current_cpu == "x64" || +- v8_current_cpu == "arm64" || v8_current_cpu == "loong64", ++ v8_current_cpu == "arm64" || v8_current_cpu == "loongarch64", + "CppGC caged heap requires 64bit platforms") + + assert(!cppgc_enable_young_generation || cppgc_enable_caged_heap, +@@ -1139,10 +1139,10 @@ config("toolchain") { + } + + # loong64 simulators. +- if (target_is_simulator && v8_current_cpu == "loong64") { ++ if (target_is_simulator && v8_current_cpu == "loongarch64") { + defines += [ "_LOONG64_TARGET_SIMULATOR" ] + } +- if (v8_current_cpu == "loong64") { ++ if (v8_current_cpu == "loongarch64") { + defines += [ "V8_TARGET_ARCH_LOONG64" ] + } + +@@ -2478,7 +2478,7 @@ v8_source_set("v8_initializers") { + ### gcmole(arch:mips64el) ### + "src/builtins/mips64/builtins-mips64.cc", + ] +- } else if (v8_current_cpu == "loong64") { ++ } else if (v8_current_cpu == "loongarch64") { + sources += [ + ### gcmole(arch:loong64) ### + "src/builtins/loong64/builtins-loong64.cc", +@@ -3883,7 +3883,7 @@ v8_header_set("v8_internal_headers") { + "src/regexp/mips64/regexp-macro-assembler-mips64.h", + "src/wasm/baseline/mips64/liftoff-assembler-mips64.h", + ] +- } else if (v8_current_cpu == "loong64") { ++ } else if (v8_current_cpu == "loongarch64") { + sources += [ ### gcmole(arch:loong64) ### + "src/baseline/loong64/baseline-assembler-loong64-inl.h", + "src/baseline/loong64/baseline-compiler-loong64-inl.h", +@@ -5005,7 +5005,7 @@ v8_source_set("v8_base_without_compiler") { + "src/execution/mips64/simulator-mips64.cc", + "src/regexp/mips64/regexp-macro-assembler-mips64.cc", + ] +- } else if (v8_current_cpu == "loong64") { ++ } else if (v8_current_cpu == "loongarch64") { + sources += [ ### gcmole(arch:loong64) ### + "src/codegen/loong64/assembler-loong64.cc", + "src/codegen/loong64/constants-loong64.cc", +@@ -5795,7 +5795,7 @@ v8_source_set("v8_heap_base") { + sources += [ "src/heap/base/asm/s390/push_registers_asm.cc" ] + } else if (current_cpu == "mips64el") { + sources += [ "src/heap/base/asm/mips64/push_registers_asm.cc" ] +- } else if (current_cpu == "loong64") { ++ } else if (current_cpu == "loongarch64") { + sources += [ "src/heap/base/asm/loong64/push_registers_asm.cc" ] + } else if (current_cpu == "riscv64" || current_cpu == "riscv32") { + sources += [ "src/heap/base/asm/riscv/push_registers_asm.cc" ] +diff --git a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc b/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc +index 7fa361f71..d9f898022 100644 +--- a/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc ++++ b/src/3rdparty/gn/src/gn/ninja_action_target_writer.cc +@@ -122,6 +122,14 @@ std::string NinjaActionTargetWriter::WriteRuleDefinition() { + // strictly necessary for regular one-shot actions, but it's easier to + // just always define unique_name. + std::string rspfile = custom_rule_name; ++ ++ //quick workaround if filename length > 255 - ".rsp", just cut the dirs starting from the end ++ //please note ".$unique_name" is not used at the moment ++ int pos = 0; ++ std::string delimiter("_"); ++ while (rspfile.length() > 250 && (pos = rspfile.find_last_of(delimiter)) != (int) std::string::npos) ++ rspfile = rspfile.substr(0,pos); ++ + if (!target_->sources().empty()) + rspfile += ".$unique_name"; + rspfile += ".rsp"; +diff --git a/src/3rdparty/gn/src/util/build_config.h b/src/3rdparty/gn/src/util/build_config.h +index 139f97a05..d1fd63fbb 100644 +--- a/src/3rdparty/gn/src/util/build_config.h ++++ b/src/3rdparty/gn/src/util/build_config.h +@@ -175,12 +175,12 @@ + #define ARCH_CPU_LITTLE_ENDIAN 1 + #elif defined(__loongarch__) + #if defined(__LP64__) +-#define ARCH_CPU_LOONG_FAMILY 1 ++#define ARCH_CPU_LOONGARCH_FAMILY 1 + #define ARCH_CPU_LOONG64 1 + #define ARCH_CPU_64_BITS 1 + #define ARCH_CPU_LITTLE_ENDIAN 1 + #else +-#define ARCH_CPU_LOONG_FAMILY 1 ++#define ARCH_CPU_LOONGARCH_FAMILY 1 + #define ARCH_CPU_LOONG32 1 + #define ARCH_CPU_32_BITS 1 + #define ARCH_CPU_LITTLE_ENDIAN 1 +-- +2.43.0 + diff --git a/qt6-qtwebengine.spec b/qt6-qtwebengine.spec index 4c14b2d441bc419ad1c9cddb3bd78480015395ca..7921c6ae9ce4d32dbee2cb33a6fd09bdc10d9123 100644 --- a/qt6-qtwebengine.spec +++ b/qt6-qtwebengine.spec @@ -12,13 +12,18 @@ %global use_system_libicu 1 %global use_system_py_six 1 + +%ifarch loongarch64 +%global _smp_mflags -j$(( ( $(/usr/bin/getconf _NPROCESSORS_ONLN) + 1 ) / 2 )) +%endif + # NEON support on ARM (detected at runtime) - disable this if you are hitting # FTBFS due to e.g. GCC bug https://bugzilla.redhat.com/show_bug.cgi?id=1282495 #global arm_neon 1 # the QMake CONFIG flags to force debugging information to be produced in # release builds, and for all parts of the code -%ifarch %{arm} aarch64 +%ifarch %{arm} aarch64 loongarch64 # the ARM builder runs out of memory during linking with the full setting below, # so omit debugging information for the parts upstream deems it dispensable for # (webcore, v8base) @@ -39,7 +44,7 @@ Summary: Qt6 - QtWebEngine components Name: qt6-qtwebengine Version: 6.5.2 -Release: 2 +Release: 3 # See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details # See also http://qt-project.org/doc/qt-5.0/qtdoc/licensing.html @@ -86,7 +91,7 @@ Patch111: CVE-2023-6112.patch # handled by qt6-srpm-macros, which defines %%qt6_qtwebengine_arches # FIXME use/update qt6_qtwebengine_arches # 32-bit arches not supported (https://bugreports.qt.io/browse/QTBUG-102143) -ExclusiveArch: aarch64 x86_64 riscv64 +ExclusiveArch: aarch64 x86_64 riscv64 loongarch64 Patch120: qtwebengine-icu-74.patch @@ -97,6 +102,8 @@ Patch1002: riscv-crashpad.patch Patch1003: riscv-dav1d.patch Patch1004: riscv-sandbox.patch +Patch1005: 0001-add-aupport-for-loongarch64.patch + BuildRequires: cmake BuildRequires: make BuildRequires: qt6-srpm-macros @@ -386,6 +393,11 @@ popd %patch1003 -p0 -d src/3rdparty %patch1004 -p0 -d src/3rdparty +##add loongarch64 patch +%ifarch loongarch64 +%patch1005 -p1 +%endif + # delete all "toolprefix = " lines from build/toolchain/linux/BUILD.gn, as we # never cross-compile in native Fedora RPMs, fixes ARM and aarch64 FTBFS sed -i -e '/toolprefix = /d' -e 's/\${toolprefix}//g' \ @@ -426,6 +438,11 @@ export STRIP=strip export NINJAFLAGS="%{__ninja_common_opts}" export NINJA_PATH=%{__ninja} +%ifarch loongarch64 +export CFLAGS="%{optflags} -mcmodel=medium" +export CXXFLAGS="%{optflags} -mcmodel=medium" +%endif + %cmake_qt6 \ -DCMAKE_TOOLCHAIN_FILE:STRING="%{_libdir}/cmake/Qt6/qt.toolchain.cmake" \ -DFEATURE_qtpdf_build:BOOL=ON \ @@ -445,7 +462,6 @@ export NINJA_PATH=%{__ninja} cmake --build . %{?_smp_mflags} --verbose - %install DESTDIR="%{buildroot}" cmake --install . @@ -664,6 +680,9 @@ done %changelog +* Thu Sep 18 2025 Wenlong Zhang - 6.5.2-3 +- add base support for loongarch64 + * Fri Apr 12 2024 misaka00251 - 6.5.2-2 - Add support for riscv64