summaryrefslogtreecommitdiff
path: root/www/chromium/files/patch-build_toolchain_gcc__toolchain.gni
blob: 1613bd73a4068ab06318aaacb2244acdade640bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
--- build/toolchain/gcc_toolchain.gni.orig	2021-06-09 22:13:52 UTC
+++ build/toolchain/gcc_toolchain.gni
@@ -51,6 +51,11 @@ if (enable_resource_allowlist_generation) {
       "enable_resource_allowlist_generation=true does not work for target_os=$target_os")
 }
 
+declare_args() {
+  extra_cxxflags = ""
+  extra_ldflags = ""
+}
+
 # This template defines a toolchain for something that works like gcc
 # (including clang).
 #
@@ -647,20 +652,32 @@ template("gcc_toolchain") {
 # actually just be doing a native compile. The invoker can optionally override
 # use_gold too.
 template("clang_toolchain") {
-  if (defined(invoker.toolprefix)) {
-    toolprefix = invoker.toolprefix
-  } else {
-    toolprefix = ""
+  if (!is_bsd) {
+    if (defined(invoker.toolprefix)) {
+      toolprefix = invoker.toolprefix
+    } else {
+      toolprefix = ""
+    }
   }
 
   gcc_toolchain(target_name) {
-    prefix = rebase_path("$clang_base_path/bin", root_build_dir)
-    cc = "$prefix/clang"
-    cxx = "$prefix/clang++"
-    ld = cxx
-    readelf = "${toolprefix}readelf"
-    ar = "${prefix}/llvm-ar"
-    nm = "${prefix}/llvm-nm"
+    if (is_bsd) {
+      prefix = "/usr/local/bin"
+      cc = "cc"
+      cxx = "c++"
+      ld = cxx
+      readelf = "readelf"
+      ar = "${prefix}/ar"
+      nm = "${prefix}/nm"
+    } else {
+      prefix = rebase_path("$clang_base_path/bin", root_build_dir)
+      cc = "$prefix/clang"
+      cxx = "$prefix/clang++"
+      ld = cxx
+      readelf = "${toolprefix}readelf"
+      ar = "${prefix}/llvm-ar"
+      nm = "${prefix}/llvm-nm"
+    }
 
     forward_variables_from(invoker,
                            [