From 2ad1fb7a884014e1b0089db3d5eb20a25fad13b3 Mon Sep 17 00:00:00 2001 From: liuyaning Date: Wed, 7 Feb 2024 16:51:03 +0800 Subject: [PATCH] [Build]Add a build libs debug args Add buildlibs_debug args Issue:https://gitee.com/openharmony/third_party_llvm-project/issues/I91GL8 Test:no Signed-off-by: liuyaning --- llvm-build/build.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/llvm-build/build.py b/llvm-build/build.py index f35164454c3b..50f4bc19b086 100755 --- a/llvm-build/build.py +++ b/llvm-build/build.py @@ -51,6 +51,7 @@ class BuildConfig(): self.need_libs = self.do_build and 'libs' not in args.no_build self.need_lldb_server = self.do_build and 'lldb-server' not in args.no_build self.build_python = args.build_python + self.build_with_debug_info = args.build_with_debug_info self.no_build_arm = args.skip_build or args.no_build_arm self.no_build_aarch64 = args.skip_build or args.no_build_aarch64 @@ -243,6 +244,12 @@ class BuildConfig(): default='bz2', help='Choose compression output format (bz2 or gz)' ) + + parser.add_argument( + '--build-with-debug-info', + action='store_true', + default=False, + help='Append -g to build flags in build_libs') def parse_args(self): @@ -1186,6 +1193,8 @@ class LlvmLibs(BuildUtils): '-ffunction-sections', '-fdata-sections', extra_flags, ] + if self.build_config.build_with_debug_info: + cflag.append('-g') cflags.extend(cflag) -- Gitee