1From ca175ef5bf7f96db57fb5aa562602dc424fab81c Mon Sep 17 00:00:00 2001
2From: Joel Winarske <joel.winarsk@gmail.com>
3Date: Sun, 5 Mar 2023 10:43:02 -0800
4Subject: [PATCH] fix toolchain paths
5
6Flutter includes a copy of clang which is required to build. However, by
7default, build/toolchain/custom/BUILD.gn attempts to use several gcc utilities
8such as ar, readelf, nm, and strip. Change these to the proper llvm provided
9utility.
10
11Upstream: https://github.com/flutter/flutter/issues/123073
12
13Signed-off-by: Joel Winarske <joel.winarsk@gmail.com>
14Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
15---
16 build/toolchain/custom/BUILD.gn | 4 +++++------
17 1 file changed, 5 insertions(+), 6 deletions(-)
18
19diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn
20index 65b1623..8b3f6f8 100644
21--- a/build/toolchain/custom/BUILD.gn
22+++ b/build/toolchain/custom/BUILD.gn
23@@ -12,11 +12,11 @@ toolchain("custom") {
24   # these values in our scope.
25   cc = "${toolchain_bin}/clang"
26   cxx = "${toolchain_bin}/clang++"
27-  ar = "${toolchain_bin}/${custom_target_triple}-ar"
28+  ar = "${toolchain_bin}/llvm-ar"
29   ld = "${toolchain_bin}/clang++"
30-  readelf = "${toolchain_bin}/${custom_target_triple}-readelf"
31-  nm = "${toolchain_bin}/${custom_target_triple}-nm"
32-  strip = "${toolchain_bin}/${custom_target_triple}-strip"
33+  readelf = "${toolchain_bin}/llvm-readelf"
34+  nm = "${toolchain_bin}/llvm-nm"
35+  strip = "${toolchain_bin}/llvm-strip"
36
37   target_triple_flags = "--target=${custom_target_triple}"
38   sysroot_flags = "--sysroot ${custom_sysroot}"
39--
402.39.2
41