diff --git a/bundle.json b/bundle.json index 6f6ca3b45fdbd616ca63b5d31320cd9c537919fc..f117642a5ad05e0d99b1f8157793d90827638e32 100644 --- a/bundle.json +++ b/bundle.json @@ -66,6 +66,16 @@ "header_base": "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" } }, + { + "name": "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog_base_for_musl", + "header": { + "header_files": [ + "hilog_base/log_base.h" + ], + "header_base": "//base/hiviewdfx/hilog/interfaces/native/innerkits/include" + }, + "visibility": [ "musl" ] + }, { "name": "//base/hiviewdfx/hilog/interfaces/rust:hilog_rust", "header": { diff --git a/interfaces/native/innerkits/BUILD.gn b/interfaces/native/innerkits/BUILD.gn index bdb885ec6da9e0f26e1a8709bee54d0df6e147f6..34b8a24d5eadd3b16d41344d0717032d5925c467 100644 --- a/interfaces/native/innerkits/BUILD.gn +++ b/interfaces/native/innerkits/BUILD.gn @@ -128,6 +128,44 @@ config("libhilog_base_config") { include_dirs = [ "../../../frameworks/libhilog/include" ] } +# part of default_compiler_configs from build/config/BUILDCONFIG.gn +musl_inherited_configs_for_musl = [ + "//build/config/compiler:afdo", + "//build/config/compiler:afdo_optimize_size", + "//build/config/compiler:compiler", + "//build/config/compiler:compiler_arm_fpu", + "//build/config/compiler:compiler_arm_thumb", + "//build/config/compiler:chromium_code", + "//build/config/compiler:default_include_dirs", + "//build/config/compiler:default_optimization", + "//build/config/compiler:default_stack_frames", + "//build/config/compiler:default_symbols", + "//build/config/compiler:export_dynamic", + "//build/config/compiler:no_exceptions", + "//build/config/compiler:no_rtti", + "//build/config/compiler:runtime_library", + "//build/config/sanitizers:default_sanitizer_flags", +] + +ohos_static_library("libhilog_base_for_musl") { + print("************libhilog_base use_musl ***************") + ldflags = [ "-nostdlib" ] + remove_configs = musl_inherited_configs_for_musl + configs = [ "//build/config/components/musl:soft_musl_config" ] + public_configs = [ ":libhilog_base_pub_cfg" ] + + # vsnprintf_sources = [ + # "$vsnprintf_root/vsnprintf_s_p.c", + # "$vsnprintf_root/vsprintf_p.c", + # ] + # include_dirs = [ + # "$vsnprintf_root/include", + # "//base/hiviewdfx/hilog/interfaces/native/innerkits/include", + # ] + # sources = vsnprintf_sources + # external_deps = [ "bounds_checking_function:libsec_static" ] +} + ohos_static_library("libhilog_base") { public_configs = [ ":libhilog_base_pub_cfg" ]