0001-third-party-angle.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. diff --git a/BUILD.gn b/BUILD.gn
  2. index b92e52fc2..8fd77fe35 100644
  3. --- a/BUILD.gn
  4. +++ b/BUILD.gn
  5. @@ -233,7 +233,12 @@ config("extra_warnings") {
  6. "-Wstrict-prototypes",
  7. "-Wunreachable-code-aggressive",
  8. "-Wshorten-64-to-32",
  9. +
  10. + # Workaround for clang unable to locate pci/pci.h header
  11. + "-I../../build/linux/debian_sid_riscv64-sysroot/usr/include/riscv64-linux-gnu",
  12. ]
  13. + # Workaround for linker unable to locate X11 related header
  14. + ldflags = [ "-Wl,-L../../build/linux/debian_sid_riscv64-sysroot/usr/lib/riscv64-linux-gnu" ]
  15. }
  16. if (is_gcc) {
  17. diff --git a/gni/angle.gni b/gni/angle.gni
  18. index 20cef2679..1b23c9f6d 100644
  19. --- a/gni/angle.gni
  20. +++ b/gni/angle.gni
  21. @@ -76,7 +76,8 @@ declare_args() {
  22. if (current_cpu == "arm64" || current_cpu == "x64" ||
  23. current_cpu == "mips64el" || current_cpu == "s390x" ||
  24. - current_cpu == "ppc64" || current_cpu == "loong64") {
  25. + current_cpu == "ppc64" || current_cpu == "loong64" ||
  26. + current_cpu == "riscv64") {
  27. angle_64bit_current_cpu = true
  28. } else if (current_cpu == "arm" || current_cpu == "x86" ||
  29. current_cpu == "mipsel" || current_cpu == "s390" ||
  30. diff --git a/src/common/platform.h b/src/common/platform.h
  31. index c39c7e040..b68561cbf 100644
  32. --- a/src/common/platform.h
  33. +++ b/src/common/platform.h
  34. @@ -101,8 +101,8 @@
  35. # define ANGLE_USE_SSE
  36. #endif
  37. -// Mips and arm devices need to include stddef for size_t.
  38. -#if defined(__mips__) || defined(__arm__) || defined(__aarch64__)
  39. +// Mips, arm and riscv devices need to include stddef for size_t.
  40. +#if defined(__mips__) || defined(__arm__) || defined(__aarch64__) || (defined(__riscv) && __riscv_xlen == 64)
  41. # include <stddef.h>
  42. #endif