--- cargo-crates/v8-150.4.0/build/toolchain/gcc_toolchain.gni.orig 2006-07-24 01:21:28 UTC +++ cargo-crates/v8-150.4.0/build/toolchain/gcc_toolchain.gni @@ -46,6 +46,12 @@ if (enable_resource_allowlist_generation) { "enable_resource_allowlist_generation=true does not work for target_os=$target_os") } +declare_args() { + extra_cflags = "" + extra_cppflags = "" + extra_cxxflags = "" + extra_ldflags = "" +} # This template defines a toolchain for something that works like gcc # (including clang). # @@ -323,7 +329,7 @@ template("single_gcc_toolchain") { # -fmodule-name is not supported by gcc. module_name_flag = "" if (is_clang) { - module_name_flag = " -fmodule-name=\"{{cc_module_name}}_Private\"" + module_name_flag = "" } enable_linker_map = defined(invoker.enable_linker_map) && @@ -375,7 +381,7 @@ template("single_gcc_toolchain") { # Module file doesn't need coverage instrumentation because module files # represent interfaces rather than implementations. - command = "$cxx -MD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} {{module_deps_no_self}} -fmodule-name=\"{{cc_module_name}}\" -x c++ -Xclang -emit-module -c {{source}} -o {{output}}" + command = "$cxx -MD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}}${extra_cppflags}${extra_cxxflags} {{module_deps_no_self}} -x c++ -Xclang -emit-module -c {{source}} -o {{output}}" depsformat = "gcc" description = "CXX_MODULE {{output}}" outputs = [ "$object_subdir/{{source_name_part}}.pcm" ] @@ -409,8 +415,6 @@ template("single_gcc_toolchain") { command = "cmd /s /c \"\"$python_path\" $tool_wrapper_path delete-file {{output}} && $command\"" } else { command = "rm -f {{output}} && $command" - inputs = - [ get_path_info(rebase_path(ar, ".", root_out_dir), "abspath") ] } # Almost all targets build with //build/config/compiler:thin_archive which @@ -1000,22 +1004,13 @@ template("clang_toolchain") { # actually just be doing a native compile. template("clang_toolchain") { gcc_toolchain(target_name) { - _path = "$clang_base_path/bin" - _is_path_absolute = get_path_info(_path, "abspath") == _path - # Preserve absolute paths for tools like distcc. - if (_is_path_absolute && filter_include([ _path ], [ "//*" ]) == []) { - prefix = _path - } else { - prefix = rebase_path(_path, root_build_dir) - } - - cc = "${prefix}/clang" - cxx = "${prefix}/clang++" + cc = "%%LLVM_PREFIX%%/bin/clang" + cxx = "%%LLVM_PREFIX%%/bin/clang++" ld = cxx - readelf = "${prefix}/llvm-readelf" - ar = "${prefix}/llvm-ar" - nm = "${prefix}/llvm-nm" + readelf = "%%LLVM_PREFIX%%/bin/llvm-readelf" + ar = "%%LLVM_PREFIX%%/bin/llvm-ar" + nm = "%%LLVM_PREFIX%%/bin/llvm-nm" forward_variables_from(invoker, "*", [ "toolchain_args" ])