diff --git a/BUILD.gn b/BUILD.gn index 4c4f6e2a325fe0281742b36d31ac8968cab57432..7c792f0ea9a34f97267ffece1bc48fdb0dc9c9bf 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -22,10 +22,6 @@ config("libabigail_defaults") { group("libabigail-tools_host_toolchain") { deps = [ - "//third_party/elfutils:libdw($host_toolchain)", - "//third_party/elfutils:libelf($host_toolchain)", - "//third_party/libabigail/src:libabigail($host_toolchain)", - "//third_party/libabigail/tools:abicompat($host_toolchain)", "//third_party/libabigail/tools:abidiff($host_toolchain)", "//third_party/libabigail/tools:abidw($host_toolchain)", ] diff --git a/README.OpenSource b/README.OpenSource index 670c2bcafd62d262a0f172f5b97a613a1594e595..2b7a012a915bb0c79280befda344c9ff97a8dc13 100644 --- a/README.OpenSource +++ b/README.OpenSource @@ -1,9 +1,9 @@ [ { "Name": "libabigail", - "License": "Apache 2.0", + "License": "Apache License 2.0", "License File": "LICENSE.txt", - "Version Number": "v2.2", + "Version Number": "2.2", "Owner": "zhanghaibo0@huawei.com", "Upstream URL": "https://sourceware.org/libabigail/", "Description": "ABI check for dynamic libraries of different versions." diff --git a/README_OpenHarmony.md b/README_OpenHarmony.md new file mode 100644 index 0000000000000000000000000000000000000000..de9cbc6ea34ffcb48cdc43f186c3b30a1a679e7d --- /dev/null +++ b/README_OpenHarmony.md @@ -0,0 +1,58 @@ +# libabigail + +仓库包含第三方开源软件libabigail,libabigail是一个用于不同版本二进制库的ABI检查工具。开发者使用这个工具可以生成二进制库的ABI特征文件,并且可以比较两个版本之间的特征文件,从而可以看出同一个二进制库在两个版本之间是否发生了ABI变化。 + +## 目录结构 + +``` +doc/ 文档 +include/ 头文件 +scripts/ 脚本 +src/ 源文件 +tests/ 测试目录 +tools/ 工具源码 +LICENSE.txt 证书文件 +README README说明 +``` + +## OpenHarmony如何使用libabigail + +SA独立升级的特性需要对相关的二进制库进行ABI检查,以保证二进制库的前向兼容。通过libabigail提供的工具对比基线的ABI特征文件与编译时实时生成的ABI特征文件,可以看出ABI是否发生了变化,如果是则编译报错。 + +## OpenHarmony如何集成libabigail + +libabigail是作为host端的工具存在,不会随镜像发布到产品中。 + +### 1.libabigail编译入口 + +libabigail的编译入口在其根目录下的BUILD.gn中。 + +```makefile +group("libabigail-tools_host_toolchain") { + deps = [ + "//third_party/libabigail/tools:abidiff($host_toolchain)", + "//third_party/libabigail/tools:abidw($host_toolchain)", + ] +} +``` + +可以看出使用了libabigail中的abidiff和abidw这两个工具。 + +### 2.使用libabigail + +SA独立升级特性提供了新的编译模板`ohos_module_package`,其中直接指定了对libabigail的依赖。 + +```makefile +deps += [ "//third_party/libabigail:libabigail-tools_host_toolchain" ] +``` +这样只要有模块使用了`ohos_module_package`模板,libabigail工具就会编译出来。 + +## libabigail相关内容 + +[libabigail官网](https://sourceware.org/libabigail/) + +## License + +`Apache License V2.0` + +‍ diff --git a/bundle.json b/bundle.json index a18f0381240de4910bd96ccbe893910ec534f325..806583ccb7bd2f5d964b26d3a65635f9ee172ece 100644 --- a/bundle.json +++ b/bundle.json @@ -2,15 +2,15 @@ "name": "@ohos/libabigail", "description": "The libabigail package aims at constructing, manipulating, serializing and de-serializing ABI-relevant artifacts.", "version": "2.2", - "license": "Apache V2", + "license": "Apache License 2.0", "publishAs": "code-segment", "segment": { "destPath": "third_party/libabigail" }, "dirs": {}, "scripts": {}, - "licensePath": "LICENSE.txt", - "readmePath": { + "licensePath": "LICENSE.txt", + "readmePath": { "en": "README" }, "component": { @@ -31,4 +31,4 @@ "test": [] } } -} \ No newline at end of file +} diff --git a/src/BUILD.gn b/src/BUILD.gn index 84072401097f9e307a81fe8fb558fa2da6691c71..bc045e738b15d21314bc940f5f6e5de89f388446 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -53,8 +53,7 @@ ohos_static_library("libabigail_static") { deps = [ "//third_party/elfutils:libdw_static", - "//third_party/elfutils:libelf_static", - "//third_party/libxml2:libxml2", + "//third_party/libxml2:static_libxml2", ] defines = [ "ABIGAIL_ROOT_SYSTEM_LIBDIR=\"lib\"" ] @@ -64,14 +63,3 @@ ohos_static_library("libabigail_static") { subsystem_name = "thirdparty" part_name = "libabigail" } - -ohos_shared_library("libabigail") { - deps = [ ":libabigail_static" ] - subsystem_name = "thirdparty" - part_name = "libabigail" - if (is_ohos) { - output_extension = "so" - } - install_images = [ "system" ] - license_file = "../LICENSE.txt" -} diff --git a/tools/BUILD.gn b/tools/BUILD.gn index bfb887ff657451e09e0ee107dc9c470248601251..5b14f01d885e2ee090d1c9c0b16b5e0660f1f7f4 100644 --- a/tools/BUILD.gn +++ b/tools/BUILD.gn @@ -25,10 +25,9 @@ ohos_executable("abidiff") { deps = [ "//third_party/libabigail/src:libabigail_static" ] - install_enable = true + install_enable = false subsystem_name = "thirdparty" part_name = "libabigail" - install_images = [ "system" ] license_file = "../LICENSE.txt" } @@ -44,28 +43,8 @@ ohos_executable("abidw") { deps = [ "//third_party/libabigail/src:libabigail_static" ] - install_enable = true + install_enable = false subsystem_name = "thirdparty" part_name = "libabigail" - install_images = [ "system" ] - license_file = "../LICENSE.txt" -} - -# Build abicompat -ohos_executable("abicompat") { - configs = [ "//third_party/libabigail:libabigail_defaults" ] - sources = [ "abicompat.cc" ] - - include_dirs = [ - "//third_party/libabigail", - "//third_party/libabigail/include", - ] - - deps = [ "//third_party/libabigail/src:libabigail_static" ] - - install_enable = true - subsystem_name = "thirdparty" - part_name = "libabigail" - install_images = [ "system" ] license_file = "../LICENSE.txt" }