!6 fix review issue

Merge pull request !6 from zhanghaibo/master
This commit is contained in:
openharmony_ci
2023-03-01 07:34:13 +00:00
committed by Gitee
4 changed files with 138 additions and 32 deletions
-28
View File
@@ -41,20 +41,6 @@ ohos_static_library("libelf_static") {
part_name = "elfutils"
}
ohos_shared_library("libelf") {
deps = [ ":libelf_static" ]
subsystem_name = "thirdparty"
part_name = "elfutils"
if (is_ohos) {
output_extension = "so"
}
install_images = [
"system",
"updater",
]
license_file = "COPYING-LGPLV3"
}
# Build libdw
ohos_static_library("libdw_static") {
configs = [ ":elfutils_defaults" ]
@@ -84,17 +70,3 @@ ohos_static_library("libdw_static") {
subsystem_name = "thirdparty"
part_name = "elfutils"
}
ohos_shared_library("libdw") {
deps = [ ":libdw_static" ]
subsystem_name = "thirdparty"
part_name = "elfutils"
if (is_ohos) {
output_extension = "so"
}
install_images = [
"system",
"updater",
]
license_file = "COPYING-LGPLV3"
}
+11 -2
View File
@@ -1,9 +1,18 @@
[
{
"Name": "elfutils",
"License": "LGPL V3.0",
"License": "LGPL V2.1",
"License File": "",
"Version Number": "0.185",
"Owner": "zhanghaibo0@huawei.com",
"Upstream URL": "https://sourceware.org/elfutils/",
"Description": "A collection of tools and libraries for reading, creating and modifying ELF binaries, finding and processing DWARF debug data, symbols, thread status, and stack trace of processes and core files on GNU/Linux."
},
{
"Name": "elfutils",
"License": "LGPL V3 or GPL V2",
"License File": "COPYING-LGPLV3",
"Version Number": "v0.185",
"Version Number": "0.185",
"Owner": "zhanghaibo0@huawei.com",
"Upstream URL": "https://sourceware.org/elfutils/",
"Description": "A collection of tools and libraries for reading, creating and modifying ELF binaries, finding and processing DWARF debug data, symbols, thread status, and stack trace of processes and core files on GNU/Linux."
+125
View File
@@ -0,0 +1,125 @@
# elfutils
仓库包含第三方开源软件elfutils,elfutils是一个用于读取、创建和修改ELF二进制文件,查找和处理GNU/Linux上进程和核心文件的DWARF调试数据、符号、线程状态和堆栈跟踪的工具和库的集合。libabigail软件依赖了elfutils。
## 目录结构
```
backends/ 不同平台的后端实现
doc/ 文档
lib/ 公共库源码
libasm/ asm相关库源码
libcpu/ cpu相关库源码
libdw/ dw相关库源码
libdwelf/ dwelf相关库源码
libdwfl/ dwfl相关库源码
libebl/ ebl相关库源码
libelf/ elf相关库源码
src/ 源文件
tests/ 测试目录
COPYING 证书文件
COPYING-GPLV2 证书文件
COPYING-LGPLV3 证书文件
README README说明
```
## OpenHarmony如何使用elfutils
OpenHarmony上elfutils是用作libabigail的依赖软件,libabigail在生成ABI特征文件的时候,需要通过elfutils读取二进制库内的DWARF调试数据。
## OpenHarmony如何集成elfutils
libabigail的编译依赖了elfutilselfutils被集成到libabigail工具中。
### 1.elfutils的编译
elfutils的编译入口在其根目录下的BUILD.gn中。简单示意如下:
```makefile
# Build libelf
ohos_static_library("libelf_static") {
configs = [ ":elfutils_defaults" ]
sources = sources_libelf
include_dirs = [
"//third_party/elfutils",
"//third_party/elfutils/lib",
"//third_party/elfutils/libelf",
]
deps = [ "//third_party/zlib:libz" ]
subsystem_name = "thirdparty"
part_name = "elfutils"
}
# Build libdw
ohos_static_library("libdw_static") {
configs = [ ":elfutils_defaults" ]
sources = sources_backends
sources += sources_libcpu
sources += sources_libdw
sources += sources_libdwelf
sources += sources_libdwfl
sources += sources_libebl
include_dirs = [
"//third_party/elfutils",
"//third_party/elfutils/lib",
"//third_party/elfutils/libasm",
"//third_party/elfutils/libelf",
"//third_party/elfutils/libcpu",
"//third_party/elfutils/libdw",
"//third_party/elfutils/libdwelf",
"//third_party/elfutils/libdwfl",
"//third_party/elfutils/libebl",
]
deps = [ ":libelf_static" ]
subsystem_name = "thirdparty"
part_name = "elfutils"
}
```
### 2.使用elfutils
libabigail的编译依赖了elfutils。简单示意如下:
```makefile
ohos_static_library("libabigail_static") {
configs = [ "//third_party/libabigail:libabigail_defaults" ]
sources = [
......
]
include_dirs = [
......
]
external_deps = [
"//third_party/elfutils:libdw_static",
]
subsystem_name = "thirdparty"
part_name = "libabigail"
}
```
## elfutils相关内容
[elfutils官网](https://sourceware.org/elfutils/)
## License
- `LGPL V3.0`
- `GPL V2.0`
- `GPL V3.0`
## 风险提示
**<u>elfutils是LGPL和GPL许可证的三方开源软件,请谨慎使用,使用时须履行相应的开源义务。</u>**
+2 -2
View File
@@ -2,14 +2,14 @@
"name": "@ohos/elfutils",
"description": "elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux.",
"version": "0.185",
"license": "GPL",
"license": "LGPL V2.1,LGPL V3 or GPL v2",
"publishAs": "code-segment",
"segment": {
"destPath": "third_party/elfutils"
},
"dirs": {},
"scripts": {},
"licensePath": "COPYING",
"licensePath": "COPYING-LGPLV3",
"readmePath": {
"en": "README"
},