diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn index 135a53188c609af8d96f12d459abaeb8bfda605c..8c694f60549997ae606b3bd836c9abfcd69121bd 100755 --- a/config/BUILDCONFIG.gn +++ b/config/BUILDCONFIG.gn @@ -79,7 +79,7 @@ if (board_toolchain != "" && use_board_toolchain) { compile_prefix += "llvm-" ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix" ohos_current_ld_command = ohos_current_cc_command - ohos_current_strip_command = "${compile_prefix}objcopy$toolchain_cmd_suffix --strip-all" + ohos_current_strip_command = "${compile_prefix}strip$toolchain_cmd_suffix --strip-unneeded" default_target_configs = [ "//build/lite/config:clang_opt" ] } # Overwrite ld cmd by customed cmd. @@ -96,7 +96,7 @@ if (board_toolchain != "" && use_board_toolchain) { compile_prefix += "llvm-" ohos_current_ar_command = "${compile_prefix}ar$toolchain_cmd_suffix" ohos_current_ld_command = ohos_current_cxx_command - ohos_current_strip_command = "${compile_prefix}objcopy$toolchain_cmd_suffix --strip-all" + ohos_current_strip_command = "${compile_prefix}strip$toolchain_cmd_suffix --strip-unneeded" set_default_toolchain("//build/lite/toolchain:linux_x86_64_ohos_clang") default_target_configs = [ "//build/lite/config:ohos_clang" ] default_target_configs += [ "//build/lite/config:clang_opt" ] diff --git a/toolchain/clang.gni b/toolchain/clang.gni index 83d2820ccb5ee2558bbd911f30b92fa8c84047c2..ea26caee694eeaeb8c85a4255d303c0694c6c3f3 100644 --- a/toolchain/clang.gni +++ b/toolchain/clang.gni @@ -73,7 +73,7 @@ template("clang_toolchain") { command += "$ld -shared {{ldflags}} {{inputs}} {{libs}} -o $unstripped_outfile" if (need_strip) { - command += " && $strip \"$unstripped_outfile\" \"$outfile\"" + command += " && $strip \"$unstripped_outfile\" -o \"$outfile\"" } default_output_extension = ".so" @@ -98,7 +98,7 @@ template("clang_toolchain") { command += "$ld {{ldflags}} {{inputs}} {{libs}} $custom_ld_flags -o $unstripped_outfile" if (need_strip) { - command += " && $strip \"$unstripped_outfile\" \"$outfile\"" + command += " && $strip \"$unstripped_outfile\" -o \"$outfile\"" } description = "LLVM LINK $outfile"