From 185e129bac2b1503cdb37996e8b6d121b8a8aa2e Mon Sep 17 00:00:00 2001 From: liuyaning Date: Thu, 14 Nov 2024 10:44:02 +0800 Subject: [PATCH] [BUILD] Fix windows binary strip error Use strip on windows binary Issue:https://gitee.com/openharmony/third_party_llvm-project/issues/IB48NV Signed-off-by: liuyaning --- llvm-build/build.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm-build/build.py b/llvm-build/build.py index 2381f018f376..5b01a6600bc5 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -2418,7 +2418,7 @@ class LlvmPackage(BuildUtils): self.install_mingw_python(install_dir) - def strip_install_file(self, bin_dir, necessary_bin_files, script_bins): + def strip_install_file(self, bin_dir, necessary_bin_files, script_bins, host): for bin_filename in os.listdir(bin_dir): binary = os.path.join(bin_dir, bin_filename) @@ -2429,8 +2429,10 @@ class LlvmPackage(BuildUtils): elif bin_filename not in script_bins and self.build_config.strip: if self.host_is_darwin(): self.check_call(['strip', '-x', binary]) - else: + elif host.startswith('ohos'): self.check_call(['eu-strip', binary]) + else: + self.check_call(['strip', binary]) def strip_lldb_server(self, host, install_dir): @@ -2874,7 +2876,7 @@ class LlvmPackage(BuildUtils): script_bins = ['git-clang-format', 'scan-build', 'scan-view'] # Bin files should be stripped with -x args when host=darwin - self.strip_install_file(bin_dir, necessary_bin_files, script_bins) + self.strip_install_file(bin_dir, necessary_bin_files, script_bins, host) # Strip lldb-server self.strip_lldb_server(host, install_dir) -- Gitee