Browse Source

rework the workaround for files not found within sysroot path

Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
Rebecca Chang Swee Fun 1 year ago
parent
commit
df28f60180

+ 31 - 0
0020-build-config-linux-workaround-for-files-not-found-wi.patch

@@ -0,0 +1,31 @@
+From 3d3072b3f31a58a5f56908afcadef6ebe09c7321 Mon Sep 17 00:00:00 2001
+From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
+Date: Fri, 17 Jun 2022 06:06:06 +0000
+Subject: [PATCH] build: config: linux: workaround for files not found within
+ sysroot
+
+Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
+---
+ build/config/linux/BUILD.gn | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
+index b897c9920bc8..03e85a7c9b7c 100644
+--- a/build/config/linux/BUILD.gn
++++ b/build/config/linux/BUILD.gn
+@@ -27,6 +27,12 @@ config("compiler") {
+       asmflags += [ "-mbranch-protection=pac-ret" ]
+     }
+   }
++
++  if (current_cpu == "riscv64") {
++    cflags = []
++    cflags += [ "-I../../build/linux/debian_sid_riscv64-sysroot/usr/include",
++                "-I../../build/linux/debian_sid_riscv64-sysroot/usr/include/riscv64-linux-gnu", ]
++  }
+ }
+ 
+ # This is included by reference in the //build/config/compiler:runtime_library
+-- 
+2.25.1
+

+ 0 - 29
0020-workaround-for-files-not-found-in-sysroot.patch

@@ -1,29 +0,0 @@
-From dd931268ba165d00de11163a50d5acd80085a202 Mon Sep 17 00:00:00 2001
-From: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
-Date: Thu, 28 Apr 2022 01:03:56 +0000
-Subject: [PATCH 20/21] workaround for files not found in sysroot
-
-Signed-off-by: Rebecca Chang Swee Fun <rebecca.chang@starfivetech.com>
----
- buildtools/third_party/libc++/BUILD.gn | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
-index b3e5378f711c5..b54980669c194 100644
---- a/buildtools/third_party/libc++/BUILD.gn
-+++ b/buildtools/third_party/libc++/BUILD.gn
-@@ -23,7 +23,10 @@ config("config") {
-       "-std:c++20",
-     ]
-   } else {
--    cflags += [ "-fPIC" ]
-+    cflags += [
-+      "-fPIC",
-+      "-isystem../../build/linux/debian_sid_riscv64-sysroot/usr/include",
-+    ]
-     cflags_cc = [ "-std=c++20" ]
-   }
- 
--- 
-2.25.1
-