提交 099cd475 编写于 作者: W weifulun

Add 'enable_iccarm_link_helper' option

Signed-off-by: 蜗牛aonk's avatarweifulun <weifulun@huawei.com>

Change-Id: I45370f44922f0c4e63402815f667aa6b00267506
上级 e44e7cd1
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
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
}
......@@ -11,6 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import("//build/lite/config/toolchain/config.gni")
template("iccarm_toolchain") {
toolchain(target_name) {
assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value")
......@@ -101,8 +103,15 @@ template("iccarm_toolchain") {
if (need_strip) {
unstripped_outfile = "{{output_dir}}/unstripped/bin/{{target_output_name}}{{output_extension}}"
}
link_helper = rebase_path("//build/lite/toolchain/iccarm_link_helper.sh")
command += "$ld {{ldflags}} $extra_ldflags \$($link_helper {{inputs}} {{libs}}) -o $unstripped_outfile"
if (enable_iccarm_link_helper) {
link_helper =
rebase_path("//build/lite/toolchain/iccarm_link_helper.sh")
command += "$ld {{ldflags}} $extra_ldflags \$($link_helper {{inputs}} {{libs}}) -o $unstripped_outfile"
} else {
command += "$ld {{ldflags}} $extra_ldflags " +
"{{inputs}} {{libs}} -o $unstripped_outfile"
}
if (need_strip) {
command += " && $strip \"$unstripped_outfile\" \"$outfile\""
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册