--- build/toolchain/gcc_toolchain.gni.orig 2022-01-20 10:35:46 UTC +++ build/toolchain/gcc_toolchain.gni @@ -49,6 +49,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). # @@ -731,13 +736,23 @@ template("gcc_toolchain") { # use_gold too. template("clang_toolchain") { gcc_toolchain(target_name) { - prefix = rebase_path("$clang_base_path/bin", root_build_dir) - cc = "${prefix}/clang" - cxx = "${prefix}/clang++" - ld = cxx - readelf = "${prefix}/llvm-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 = "${prefix}/llvm-readelf" + ar = "${prefix}/llvm-ar" + nm = "${prefix}/llvm-nm" + } forward_variables_from(invoker, [