提交 9862ceaf 编写于 作者: C Caoruihong

feat: strip libc and libc++

libc and libc++ should be stripped before packing into rootfs
Signed-off-by: NCaoruihong <crh.cao@huawei.com>
Change-Id: I303c03debdaa29bbefeb39e62a0ffd44764304a8
上级 cba516cb
......@@ -68,8 +68,29 @@ build_ext_component("build_sysroot") {
# copy standard libraries libc.so and libc++.so to lib out dir
libcpp = "\$($ohos_current_cxx_command --target=$target_triple --sysroot=$sysroot_path $arch_cflags -print-file-name=libc++.so)"
libc = "\$($ohos_current_cc_command --target=$target_triple --sysroot=$sysroot_path $arch_cflags -print-file-name=libc.so)"
lib_out_dir = rebase_path("$root_out_dir/libs/")
lib_out_dir = rebase_path("$root_out_dir/unstripped/usr/lib", exec_path)
command += " && mkdir -p $lib_out_dir && sh -c \"cp -f $libcpp $libc $lib_out_dir\""
outputs = [
"$root_out_dir/unstripped/usr/lib/libc.so",
"$root_out_dir/unstripped/usr/lib/libc++.so",
]
}
action_foreach("strip") {
deps = [ ":build_sysroot" ]
script = "//build/lite/run_shell_cmd.py"
sources = [
"$root_out_dir/unstripped/usr/lib/libc.so",
"$root_out_dir/unstripped/usr/lib/libc++.so",
]
outputs = [ "$root_out_dir/{{source_file_part}}" ]
args = [
"$ohos_current_strip_command",
"{{source}}",
"-o",
rebase_path("$root_out_dir/{{source_file_part}}", root_build_dir),
]
}
config("sysroot_flags") {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册