1 From 2ee90379fbfa4bda0274f691c2c832621c2333df Mon Sep 17 00:00:00 2001
2 From: Joel Winarske <joel.winarske@linux.com>
3 Date: Fri, 19 Feb 2021 22:15:24 +0000
4 Subject: [PATCH 1/2] clang toolchain
7 build/toolchain/custom/BUILD.gn | 11 +++++------
8 1 file changed, 5 insertions(+), 6 deletions(-)
10 diff --git a/build/toolchain/custom/BUILD.gn b/build/toolchain/custom/BUILD.gn
11 index 65b1623..8b3f6f8 100644
12 --- a/build/toolchain/custom/BUILD.gn
13 +++ b/build/toolchain/custom/BUILD.gn
14 @@ -12,11 +12,11 @@ toolchain("custom") {
15 # these values in our scope.
16 cc = "${toolchain_bin}/clang"
17 cxx = "${toolchain_bin}/clang++"
18 - ar = "${toolchain_bin}/${custom_target_triple}-ar"
19 + ar = "${toolchain_bin}/llvm-ar"
20 ld = "${toolchain_bin}/clang++"
21 - readelf = "${toolchain_bin}/${custom_target_triple}-readelf"
22 - nm = "${toolchain_bin}/${custom_target_triple}-nm"
23 - strip = "${toolchain_bin}/${custom_target_triple}-strip"
24 + readelf = "${toolchain_bin}/llvm-readelf"
25 + nm = "${toolchain_bin}/llvm-nm"
26 + strip = "${toolchain_bin}/llvm-strip"
28 target_triple_flags = "--target=${custom_target_triple}"
29 sysroot_flags = "--sysroot ${custom_sysroot}"
30 @@ -84,10 +84,9 @@ toolchain("custom") {
31 link_command = "$ld $target_triple_flags $sysroot_flags -shared {{ldflags}} -o $unstripped_sofile $custom_lib_flags -Wl,--build-id=sha1 -Wl,-soname=$soname @$rspfile"
32 toc_command = "{ $readelf -d $unstripped_sofile | grep SONAME ; $nm -gD -f posix $unstripped_sofile | cut -f1-2 -d' '; } > $temporary_tocname"
33 replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi"
34 - strip_command = "$strip -o $sofile $unstripped_sofile"
37 - "$link_command && $toc_command && $replace_command && $strip_command"
38 + "$link_command && $toc_command && $replace_command"
39 rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive {{libs}}"
41 description = "SOLINK $sofile"