From c298882092401fd4a97d8c5a86146055b7b6bb42 Mon Sep 17 00:00:00 2001 From: i-wangliangliang Date: Wed, 12 Oct 2022 15:05:37 +0800 Subject: [PATCH] =?UTF-8?q?iccarm=E7=BC=96=E8=AF=91=E6=97=B6=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E4=B8=AD=E9=97=B4=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: i-wangliangliang Change-Id: I5c0669f46f4eea1d2065cbe16bec20a5f67b6d6d --- config/toolchain/config.gni | 3 +++ toolchain/iccarm.gni | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/config/toolchain/config.gni b/config/toolchain/config.gni index c360c94..d4a1a2a 100644 --- a/config/toolchain/config.gni +++ b/config/toolchain/config.gni @@ -15,4 +15,7 @@ declare_args() { # using iccarm_link_helper.sh to link static library # which adds '--whole_archive' option for each static library while linking enable_iccarm_link_helper = false + + # save temp files for debug + enable_save_temps = false } diff --git a/toolchain/iccarm.gni b/toolchain/iccarm.gni index 0fedfb0..8aa4905 100644 --- a/toolchain/iccarm.gni +++ b/toolchain/iccarm.gni @@ -40,13 +40,25 @@ template("iccarm_toolchain") { tool("cc") { command = "$cc {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} -c {{source}} -o {{output}}" - description = "iccarm cross compiler {{output}}" + if (enable_save_temps) { + preprocess_outfile = "{{output}}.i" + list_outfile = "{{output}}.lst" + asm_outfile = "{{output}}.s" + command += " --preprocess $preprocess_outfile -lCN $list_outfile -lA $asm_outfile" + } + description = "iccarm CC {{output}}" outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] } tool("cxx") { depfile = "{{output}}.d" command = "$cxx {{defines}} {{include_dirs}} {{cflags_cc}} -c {{source}} -o {{output}}" + if (enable_save_temps) { + preprocess_outfile = "{{output}}.i" + list_outfile = "{{output}}.lst" + asm_outfile = "{{output}}.s" + command += " --preprocess $preprocess_outfile -lCN $list_outfile -lA $asm_outfile" + } description = "iccarm CXX {{output}}" outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] @@ -54,7 +66,7 @@ template("iccarm_toolchain") { tool("asm") { depfile = "{{output}}.d" command = "$as {{defines}} {{include_dirs}} {{asmflags}} {{source}} -o {{output}}" - description = "iccarm cross compiler {{output}}" + description = "iccarm ASM {{output}}" outputs = [ "{{source_out_dir}}/{{target_output_name}}.{{source_name_part}}.o" ] } @@ -64,7 +76,7 @@ template("iccarm_toolchain") { rspfile_content = "{{inputs}}" command = "rm -f {{output}} && $ar {{inputs}} -o {{output}}" - description = "AR {{output}}" + description = "iccarm AR {{output}}" outputs = [ outfile ] default_output_dir = "{{root_out_dir}}/libs" @@ -85,7 +97,7 @@ template("iccarm_toolchain") { if (need_strip) { command += " && $strip \"$unstripped_outfile\" \"$outfile\"" } - description = "SOLINK $outfile" + description = "iccarm SOLINK $outfile" outputs = [ outfile ] if (unstripped_outfile != outfile) { outputs += [ unstripped_outfile ] @@ -116,7 +128,7 @@ template("iccarm_toolchain") { command += " && $strip \"$unstripped_outfile\" \"$outfile\"" } - description = "LINK $outfile $command" + description = "iccarm LINK $outfile" default_output_dir = "{{root_out_dir}}" rspfile_content = "{{inputs}}" outputs = [ outfile ] -- GitLab