From d85c7a46b4b1e2a8aeb0b24dffcfdb6f39a946da Mon Sep 17 00:00:00 2001 From: hosted Date: Fri, 31 Oct 2025 14:13:42 +0800 Subject: [PATCH] libabigail changed its static library dependency on libxml2 to a dynamic library dependency. https://gitcode.com/openharmony/third_party_libabigail/issues/22 Signed-off-by: hosted --- bundle.json | 3 +-- config.h | 9 --------- src/BUILD.gn | 3 ++- tools/BUILD.gn | 2 ++ 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/bundle.json b/bundle.json index fc6c2715..f19646d1 100644 --- a/bundle.json +++ b/bundle.json @@ -23,8 +23,7 @@ "ram": "", "deps": { "components": [ - "elfutils", - "libxml2" + "elfutils" ], "third_party": [] }, diff --git a/config.h b/config.h index 9047ddfe..eb2e7917 100644 --- a/config.h +++ b/config.h @@ -233,12 +233,6 @@ /* Version number of package */ #define VERSION "2.4" -/* Defined if user enabled BTF usage */ -/* #define WITH_BTF 1*/ - -/* struct btf_enum64 is present */ -/* #define WITH_BTF_ENUM64 1 */ - /* The BTF_KIND_DECL_TAG enumerator is present */ /* #undef WITH_BTF_KIND_DECL_TAG */ @@ -251,9 +245,6 @@ /* The function btf__type_cnt is present */ #define WITH_BTF__TYPE_CNT 1 -/* Defined if user enables and system has the libctf library */ -/* #define WITH_CTF 1*/ - /* compile the deb package support in abipkgdiff */ #define WITH_DEB 1 diff --git a/src/BUILD.gn b/src/BUILD.gn index 609b4b96..7225f896 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -48,12 +48,13 @@ ohos_static_library("libabigail_static") { "//third_party/libabigail", "//third_party/libabigail/include", "//third_party/libabigail/src", + "/usr/include/libxml2" ] external_deps = [ "elfutils:libdw_static", - "libxml2:static_libxml2", ] + ldflags = [ "-lxml2" ] defines = [ "ABIGAIL_ROOT_SYSTEM_LIBDIR=\"lib\"" ] diff --git a/tools/BUILD.gn b/tools/BUILD.gn index 5808c9f3..f080bb85 100644 --- a/tools/BUILD.gn +++ b/tools/BUILD.gn @@ -26,6 +26,7 @@ ohos_executable("abidiff") { deps = [ "//third_party/libabigail/src:libabigail_static" ] external_deps = [ "elfutils:libdw_static" ] + ldflags = [ "-lxml2" ] install_enable = false subsystem_name = "thirdparty" part_name = "libabigail" @@ -45,6 +46,7 @@ ohos_executable("abidw") { deps = [ "//third_party/libabigail/src:libabigail_static" ] external_deps = [ "elfutils:libdw_static" ] + ldflags = [ "-lxml2" ] install_enable = false subsystem_name = "thirdparty" part_name = "libabigail"