Index: build/toolchain/gcc_toolchain.gni |
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni |
index e415459eb09f40c562a3176c89891c601297c73e..4a4ef4552b12f839b99ef9422b30b88f411b0f1c 100644 |
--- a/build/toolchain/gcc_toolchain.gni |
+++ b/build/toolchain/gcc_toolchain.gni |
@@ -84,33 +84,33 @@ template("gcc_toolchain") { |
tool("cc") { |
depfile = "{{output}}.d" |
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
+ command = |
+ "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "CC {{output}}" |
- outputs = [ |
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
- ] |
+ outputs = |
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] |
} |
tool("cxx") { |
depfile = "{{output}}.d" |
- command = "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" |
+ command = |
+ "$cxx -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_cc}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "CXX {{output}}" |
- outputs = [ |
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
- ] |
+ outputs = |
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] |
} |
tool("asm") { |
# For GCC we can just use the C compiler to compile assembly. |
depfile = "{{output}}.d" |
- command = "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
+ command = |
+ "$cc -MMD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" |
depsformat = "gcc" |
description = "ASM {{output}}" |
- outputs = [ |
- "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o", |
- ] |
+ outputs = |
+ [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] |
} |
tool("alink") { |
@@ -118,9 +118,8 @@ template("gcc_toolchain") { |
command = "rm -f {{output}} && $ar rcs {{output}} @$rspfile" |
description = "AR {{output}}" |
rspfile_content = "{{inputs}}" |
- outputs = [ |
- "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" |
- ] |
+ outputs = |
+ [ "{{target_out_dir}}/{{target_output_name}}{{output_extension}}" ] |
default_output_extension = ".a" |
output_prefix = "lib" |
} |
@@ -136,15 +135,19 @@ template("gcc_toolchain") { |
# existing .TOC file, overwrite it, otherwise, don't change it. |
tocfile = sofile + ".TOC" |
temporary_tocname = sofile + ".tmp" |
- link_command = "$ld -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile" |
- toc_command = "{ readelf -d $sofile | grep SONAME ; nm -gD -f p $soname | cut -f1-2 -d' '; } > $temporary_tocname" |
- replace_command = "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi" |
+ link_command = |
+ "$ld -shared {{ldflags}} -o $sofile -Wl,-soname=$soname @$rspfile" |
+ toc_command = |
+ "{ readelf -d $sofile | grep SONAME ; nm -gD -f p $soname | cut -f1-2 -d' '; } > $temporary_tocname" |
+ replace_command = |
+ "if ! cmp -s $temporary_tocname $tocfile; then mv $temporary_tocname $tocfile; fi" |
command = "$link_command && $toc_command && $replace_command" |
if (defined(invoker.postsolink)) { |
command += " && " + invoker.postsolink |
} |
- rspfile_content = "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" |
+ rspfile_content = |
+ "-Wl,--whole-archive {{inputs}} {{solibs}} -Wl,--no-whole-archive $solink_libs_section_prefix {{libs}} $solink_libs_section_postfix" |
description = "SOLINK $sofile" |
@@ -176,7 +179,8 @@ template("gcc_toolchain") { |
tool("link") { |
outfile = "{{root_out_dir}}/{{target_output_name}}{{output_extension}}" |
rspfile = "$outfile.rsp" |
- command = "$ld {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix" |
+ command = |
+ "$ld {{ldflags}} -o $outfile -Wl,--start-group @$rspfile {{solibs}} -Wl,--end-group $libs_section_prefix {{libs}} $libs_section_postfix" |
if (defined(invoker.postlink)) { |
command += " && " + invoker.postlink |
} |
@@ -194,7 +198,8 @@ template("gcc_toolchain") { |
} |
tool("copy") { |
- command = "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" |
+ command = |
+ "ln -f {{source}} {{output}} 2>/dev/null || (rm -rf {{output}} && cp -af {{source}} {{output}})" |
description = "COPY {{source}} {{output}}" |
} |