Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
8d471392
T
Third Party Musl
项目概览
OpenHarmony
/
Third Party Musl
1 年多 前同步成功
通知
37
Star
125
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Musl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8d471392
编写于
8月 30, 2022
作者:
O
openharmony_ci
提交者:
Gitee
8月 30, 2022
浏览文件
操作
浏览文件
下载
差异文件
!481 标准系统适配march
Merge pull request !481 from xxlight/march1
上级
9f812210
11b87fdd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
78 addition
and
140 deletion
+78
-140
BUILD.gn
BUILD.gn
+1
-19
musl_template.gni
musl_template.gni
+77
-121
未找到文件。
BUILD.gn
浏览文件 @
8d471392
...
...
@@ -17,13 +17,8 @@ if (is_lite_system && current_os == "ohos") {
} else {
import("musl_template.gni")
musl_abi_target = "soft"
group("musl_all") {
deps = [
":a7_hard_neon_libs",
":a7_soft_libs",
":a7_softfp_neon_libs",
":musl_headers",
":soft_libs",
]
...
...
@@ -51,25 +46,12 @@ if (is_lite_system && current_os == "ohos") {
group("musl_libs") {
deps = [
":${musl_abi_target}_libs",
":musl_headers",
":soft_libs",
]
}
musl_libs("soft_libs") {
target_abi = "soft"
}
musl_libs("a7_soft_libs") {
target_abi = "a7_soft"
}
musl_libs("a7_softfp_neon_libs") {
target_abi = "a7_softfp_neon-vfpv4"
}
musl_libs("a7_hard_neon_libs") {
target_abi = "a7_hard_neon-vfpv4"
}
group("musl_headers") {
...
...
musl_template.gni
浏览文件 @
8d471392
...
...
@@ -4,21 +4,10 @@ import("musl_src.gni")
template("musl_libs") {
no_default_deps = true
forward_variables_from(invoker, [ "target_abi" ])
abi_prefix = target_abi
if (target_abi == "soft") {
_libs_path_prefix = "."
_libs_out_dir = "usr/lib/${musl_target_triple}"
} else {
_libs_path_prefix = "${target_abi}"
_libs_out_dir = "usr/lib/${musl_target_triple}/${target_abi}"
}
forward_variables_from(invoker, [ "*" ])
musl_subarch = ""
if (target_abi == "a7_hard_neon-vfpv4") {
musl_subarch = "hf"
}
_libs_path_prefix = "."
_libs_out_dir = "usr/lib/${musl_target_triple}"
dfx_deps = [ "//base/hiviewdfx/faultloggerd/interfaces/innerkits/signal_handler:dfxsignalhandler" ]
porting_deps = [
...
...
@@ -30,47 +19,47 @@ template("musl_libs") {
group(target_name) {
deps = [
":
${abi_prefix}
_create_linker",
":
${abi_prefix}
_libc_musl_shared",
":
${abi_prefix}
_libc_musl_static",
":
${abi_prefix}
_musl_crt_libs",
":
soft
_create_linker",
":
soft
_libc_musl_shared",
":
soft
_libc_musl_static",
":
soft
_musl_crt_libs",
]
}
group("
${abi_prefix}
_shared_libs") {
group("
soft
_shared_libs") {
deps = [
":${abi_prefix}_libc_musl_shared",
":${abi_prefix}_libcrypt",
":${abi_prefix}_libdl",
":${abi_prefix}_libm",
":${abi_prefix}_libpthread",
":${abi_prefix}_libresolv",
":${abi_prefix}_librt",
":${abi_prefix}_libutil",
":${abi_prefix}_libxnet",
":${abi_prefix}_musl_crt_libs",
":musl_headers",
":soft_libc_musl_shared",
":soft_libcrypt",
":soft_libdl",
":soft_libm",
":soft_libpthread",
":soft_libresolv",
":soft_librt",
":soft_libutil",
":soft_libxnet",
":soft_musl_crt_libs",
]
}
group("
${abi_prefix}
_static_libs") {
group("
soft
_static_libs") {
deps = [
":${abi_prefix}_libc_musl_static",
":${abi_prefix}_libcrypt",
":${abi_prefix}_libdl",
":${abi_prefix}_libm",
":${abi_prefix}_libpthread",
":${abi_prefix}_libresolv",
":${abi_prefix}_librt",
":${abi_prefix}_libutil",
":${abi_prefix}_libxnet",
":${abi_prefix}_musl_crt_libs",
":musl_headers",
":soft_libc_musl_static",
":soft_libcrypt",
":soft_libdl",
":soft_libm",
":soft_libpthread",
":soft_libresolv",
":soft_librt",
":soft_libutil",
":soft_libxnet",
":soft_musl_crt_libs",
]
}
group("
${abi_prefix}
_musl_crt_libs") {
deps = [ ":
${abi_prefix}
_musl_crt_install_action" ]
group("
soft
_musl_crt_libs") {
deps = [ ":
soft
_musl_crt_install_action" ]
}
# part of default_compiler_configs from build/config/BUILDCONFIG.gn
...
...
@@ -93,33 +82,8 @@ template("musl_libs") {
"//build/config/sanitizers:default_sanitizer_flags",
]
config("${abi_prefix}_musl_abi_config") {
if (musl_arch == "arm") {
if (target_abi == "soft") {
cflags = [ "-mfloat-abi=soft" ]
} else if (target_abi == "a7_soft") {
cflags = [
"-mcpu=cortex-a7",
"-mfloat-abi=soft",
]
} else if (target_abi == "a7_softfp_neon-vfpv4") {
cflags = [
"-mcpu=cortex-a7",
"-mfloat-abi=softfp",
"-mfpu=neon-vfpv4",
]
} else if (target_abi == "a7_hard_neon-vfpv4") {
cflags = [
"-mcpu=cortex-a7",
"-mfloat-abi=hard",
"-mfpu=neon-vfpv4",
]
}
}
}
config("${abi_prefix}_musl_config") {
configs = [ ":${abi_prefix}_musl_abi_config" ]
config("soft_musl_config") {
configs = [ "//build/config/compiler:compiler_cpu_abi" ]
include_dirs = [
"${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}",
...
...
@@ -138,10 +102,8 @@ template("musl_libs") {
]
if (musl_arch == "arm") {
cflags_basic += [ "-march=armv7-a" ]
cflags_basic += [ "-mtp=cp15" ]
} else if (musl_arch == "aarch64") {
cflags_basic += [ "-march=armv8" ]
}
cflags_auto = [
...
...
@@ -179,10 +141,7 @@ template("musl_libs") {
cflags = cflags_all
defines = []
if ("${target_abi}" != "a7_hard_neon-vfpv4") {
defines += [ "BROKEN_VFP_ASM" ]
}
defines = [ "BROKEN_VFP_ASM" ]
if (is_standard_system) {
defines += [
"OHOS_DNS_PROXY_BY_NETSYS=1",
...
...
@@ -212,7 +171,7 @@ template("musl_libs") {
asmflags = cflags
}
config("
${abi_prefix}
_hook") {
config("
soft
_hook") {
defines = []
configs = []
...
...
@@ -245,7 +204,7 @@ template("musl_libs") {
}
}
source_set("
${abi_prefix}
_musl_crt") {
source_set("
soft
_musl_crt") {
sources = [
"${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/crti.s",
"${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/crtn.s",
...
...
@@ -257,7 +216,7 @@ template("musl_libs") {
defines = [ "CRT" ]
configs -= musl_inherited_configs
configs += [ ":
${abi_prefix}
_musl_config" ]
configs += [ ":
soft
_musl_config" ]
cflags = [
"-fPIC",
"-fno-stack-protector",
...
...
@@ -268,7 +227,7 @@ template("musl_libs") {
asmflags = cflags
}
source_set("
${abi_prefix}
_musl_src") {
source_set("
soft
_musl_src") {
sources_orig = []
sources = []
set_sources_assignment_filter([])
...
...
@@ -305,9 +264,6 @@ template("musl_libs") {
}
defines = []
if ("${target_abi}" == "a7_hard_neon-vfpv4") {
defines += [ "__ARM_PCS_VFP" ]
}
if (musl_secure_level > 0) {
defines += [ "MALLOC_FREELIST_HARDENED" ]
}
...
...
@@ -390,7 +346,7 @@ template("musl_libs") {
]
configs -= musl_inherited_configs
configs += [ ":
${abi_prefix}
_musl_config" ]
configs += [ ":
soft
_musl_config" ]
if (!defined(defines)) {
defines = []
...
...
@@ -409,7 +365,7 @@ template("musl_libs") {
deps = porting_deps
}
source_set("
${abi_prefix}
_musl_src_nossp") {
source_set("
soft
_musl_src_nossp") {
sources = []
sources_orig = [
"src/string/mempcpy.c",
...
...
@@ -432,7 +388,7 @@ template("musl_libs") {
}
configs -= musl_inherited_configs
configs += [ ":
${abi_prefix}
_musl_config" ]
configs += [ ":
soft
_musl_config" ]
cflags = [
"-O3",
"-fPIC",
...
...
@@ -442,7 +398,7 @@ template("musl_libs") {
deps = porting_deps
}
source_set("
${abi_prefix}
_musl_ldso") {
source_set("
soft
_musl_ldso") {
sources = []
sources_orig = musl_src_ldso
...
...
@@ -451,7 +407,7 @@ template("musl_libs") {
}
configs -= musl_inherited_configs
configs += [ ":
${abi_prefix}
_musl_config" ]
configs += [ ":
soft
_musl_config" ]
cflags = [
"-fPIC",
"-fno-stack-protector",
...
...
@@ -476,7 +432,7 @@ template("musl_libs") {
}
}
source_set("
${abi_prefix}
_musl_hook") {
source_set("
soft
_musl_hook") {
sources = [
"./porting/linux/user/src/hook/malloc_common.c",
"./porting/linux/user/src/hook/memory_tag.c",
...
...
@@ -503,11 +459,11 @@ template("musl_libs") {
configs += [
"//build/config/compiler:compiler",
":
${abi_prefix}
_hook",
":
soft
_hook",
]
}
static_library("
${abi_prefix}
_libc_musl_static") {
static_library("
soft
_libc_musl_static") {
output_name = "libc"
complete_static_lib = true
...
...
@@ -515,9 +471,9 @@ template("musl_libs") {
output_dir = "${target_out_dir}/${_libs_out_dir}"
deps = [
":
${abi_prefix}
_musl_hook",
":
${abi_prefix}
_musl_src",
":
${abi_prefix}
_musl_src_nossp",
":
soft
_musl_hook",
":
soft
_musl_src",
":
soft
_musl_src_nossp",
]
deps += dfx_deps
if (is_standard_system) {
...
...
@@ -525,63 +481,63 @@ template("musl_libs") {
}
}
static_library("
${abi_prefix}
_libm") {
static_library("
soft
_libm") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libm"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_librt") {
static_library("
soft
_librt") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "librt"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_libpthread") {
static_library("
soft
_libpthread") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libpthread"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_libcrypt") {
static_library("
soft
_libcrypt") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libcrypt"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_libutil") {
static_library("
soft
_libutil") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libutil"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_libresolv") {
static_library("
soft
_libresolv") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libresolv"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_libxnet") {
static_library("
soft
_libxnet") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libxnet"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
static_library("
${abi_prefix}
_libdl") {
static_library("
soft
_libdl") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libdl"
output_dir = "${target_out_dir}/${_libs_out_dir}"
}
shared_library("
${abi_prefix}
_libc_musl_shared") {
shared_library("
soft
_libc_musl_shared") {
output_dir = "${target_out_dir}/${_libs_out_dir}"
output_name = "libc"
output_extension = "so"
...
...
@@ -604,16 +560,16 @@ template("musl_libs") {
configs -= musl_inherited_configs
configs -= [ "//build/config:default_libs" ]
configs += [ ":
${abi_prefix}
_musl_config" ]
configs += [ ":
soft
_musl_config" ]
deps = [
":
${abi_prefix}
_libdl",
":
${abi_prefix}
_libpthread",
":
${abi_prefix}
_musl_crt_install_action",
":
${abi_prefix}
_musl_hook",
":
${abi_prefix}
_musl_ldso",
":
${abi_prefix}
_musl_src",
":
${abi_prefix}
_musl_src_nossp",
":
soft
_libdl",
":
soft
_libpthread",
":
soft
_musl_crt_install_action",
":
soft
_musl_hook",
":
soft
_musl_ldso",
":
soft
_musl_src",
":
soft
_musl_src_nossp",
]
deps += dfx_deps
if (is_standard_system) {
...
...
@@ -621,15 +577,15 @@ template("musl_libs") {
}
}
action_foreach("
${abi_prefix}
_musl_crt_install_action") {
action_foreach("
soft
_musl_crt_install_action") {
redir = "${root_out_dir}/obj"
script = "${target_out_dir}/${musl_ported_dir}/scripts/install.py"
sources = [
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${
abi_prefix}_musl_crt/Scrt1
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${
abi_prefix}_musl_crt/crt1
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/
${abi_prefix}_musl_crt/r
crt1.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/
${musl_arch}/${abi_prefix}_musl_crt/crti
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/
${musl_arch}/${abi_prefix}_musl_crt/crtn
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${
musl_arch}/soft_musl_crt/crti
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${
musl_arch}/soft_musl_crt/crtn
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/
soft_musl_crt/S
crt1.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/
soft_musl_crt/crt1
.o",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/
soft_musl_crt/rcrt1
.o",
]
outputs = [ "${root_build_dir}/obj/third_party/musl/${_libs_out_dir}/{{source_file_part}}" ]
args = [
...
...
@@ -637,13 +593,13 @@ template("musl_libs") {
"{{source}}",
]
args += [ "--output" ] + rebase_path(outputs, root_build_dir)
deps = [ ":
${abi_prefix}
_musl_crt" ]
deps = [ ":
soft
_musl_crt" ]
}
copy("
${abi_prefix}
_create_linker") {
deps = [ ":
${abi_prefix}
_libc_musl_shared" ]
copy("
soft
_create_linker") {
deps = [ ":
soft
_libc_musl_shared" ]
# _libc_shared_outputs = get_target_outputs(":
${abi_prefix}
_libc_musl_shared")
# _libc_shared_outputs = get_target_outputs(":
soft
_libc_musl_shared")
_libc_shared_so = "${target_out_dir}/${_libs_out_dir}/libc.so"
sources = [ _libc_shared_so ]
if (is_asan) {
...
...
@@ -651,7 +607,7 @@ template("musl_libs") {
} else {
asan = ""
}
_muls_linker_so = "${root_out_dir}/common/common/libc/${_libs_path_prefix}/ld-musl-${musl_arch}${
musl_subarch}${
asan}.so.1"
_muls_linker_so = "${root_out_dir}/common/common/libc/${_libs_path_prefix}/ld-musl-${musl_arch}${asan}.so.1"
outputs = [ _muls_linker_so ]
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录