diff --git a/build/skia/BUILD.gn b/build/skia/BUILD.gn index f5bfe45c782c10c5b34164e6f0e45af31e5be329..108c7bbf063094ee6b4cd6ee24d32855cd4b77be 100644 --- a/build/skia/BUILD.gn +++ b/build/skia/BUILD.gn @@ -420,7 +420,7 @@ template("ace_skia_opts") { sources = [] - if (target_cpu == "x86_64" || platform == "windows" || platform == "mac" || + if (target_cpu == "x86_64" || target_cpu == "riscv64" || platform == "windows" || platform == "mac" || platform == "linux" || platform == "ios") { cflags -= [ "-march=armv8-a+crc" ] sources += [ @@ -966,7 +966,7 @@ template("ace_skia_core") { libs = [ "GL" ] } else { # Ohos and Android plarform - if (target_cpu != "arm") { + if (target_cpu != "arm" && target_cpu != "riscv64") { defines += [ "SKVM_JIT" ] } diff --git a/build/skia/ohos/BUILD.gn b/build/skia/ohos/BUILD.gn index 5c93a941bb9426aa1d95ef66f031cfb333466b33..81ea7e42aea4161baee03875efd7fbde40e32464 100644 --- a/build/skia/ohos/BUILD.gn +++ b/build/skia/ohos/BUILD.gn @@ -588,7 +588,7 @@ ohos_source_set("skia_core_ohos") { } # Ohos plarform - if (target_cpu != "arm") { + if (target_cpu != "arm" && target_cpu != "riscv64") { defines += [ "SKVM_JIT" ] } diff --git a/engine/flutter/fml/build_config.h b/engine/flutter/fml/build_config.h index 2714f46d1cebf154055712e1dcf0bacd34d308ed..bae00866d4703864850fbf54b6284a69473a442a 100644 --- a/engine/flutter/fml/build_config.h +++ b/engine/flutter/fml/build_config.h @@ -103,6 +103,11 @@ #define ARCH_CPU_32_BITS 1 #define ARCH_CPU_LITTLE_ENDIAN 1 #endif +#elif defined(__riscv) && (__riscv_xlen == 64) +#define ARCH_CPU_RISCV_FAMILY 1 +#define ARCH_CPU_RISCV64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 #else #error Please add support for your architecture in flutter/fml/build_config.h #endif diff --git a/engine/flutter/sky/tools/objcopy.py b/engine/flutter/sky/tools/objcopy.py index 630a6702cfc5688b4dbf7dfd8491685364c54318..2f4e683e9b9d7cbf78eaa867e08d92b032def303 100755 --- a/engine/flutter/sky/tools/objcopy.py +++ b/engine/flutter/sky/tools/objcopy.py @@ -14,6 +14,7 @@ BFD_ARCH = { 'arm64': 'aarch64', 'x86': 'i386', 'x86_64': 'i386:x86-64', + 'riscv64': 'riscv', } # BFD target names recognized by objcopy. @@ -22,6 +23,7 @@ BFD_TARGET = { 'arm64': 'elf64-littleaarch64', 'x86': 'elf32-i386', 'x86_64': 'elf64-x86-64', + 'riscv64': 'elf64-littleriscv', } def main():