Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Musl
提交
268b62c8
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看板
提交
268b62c8
编写于
7月 29, 2021
作者:
O
openharmony_ci
提交者:
Gitee
7月 29, 2021
浏览文件
操作
浏览文件
下载
差异文件
!70 update musl build target
Merge pull request !70 from weichaox/musl_src
上级
6cef725e
37c22f0b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
439 addition
and
417 deletion
+439
-417
BUILD.gn
BUILD.gn
+25
-16
musl_template.gni
musl_template.gni
+414
-401
未找到文件。
BUILD.gn
浏览文件 @
268b62c8
import("musl_template.gni")
musl_abi_target = "soft"
group("musl_all") {
deps = [
":musl_headers",
":soft_libs",
":a7_hard_neon_libs",
":a7_soft_libs",
":a7_softfp_neon_libs",
":a7_hard_neon_libs",
":musl_headers",
":soft_libs",
]
}
musl_libs("soft") {
group("musl_libs") {
deps = [
":${musl_abi_target}_libs",
":musl_headers",
]
}
musl_libs("soft_libs") {
target_abi = "soft"
}
musl_libs("a7_soft") {
musl_libs("a7_soft
_libs
") {
target_abi = "a7_soft"
}
musl_libs("a7_softfp_neon") {
musl_libs("a7_softfp_neon
_libs
") {
target_abi = "a7_softfp_neon-vfpv4"
}
musl_libs("a7_hard_neon") {
musl_libs("a7_hard_neon
_libs
") {
target_abi = "a7_hard_neon-vfpv4"
}
group("musl_headers") {
deps = [
":copy_uapi",
":create_alltypes_h",
":create_syscall_h",
":create_version_h",
...
...
@@ -39,16 +49,13 @@ group("musl_headers") {
":musl_copy_inc_root",
":musl_copy_inc_scsi",
":musl_copy_inc_sys",
":copy_uapi",
]
}
action("create_porting_src") {
script = "scripts/porting.sh"
sources = [
"//third_party/musl",
]
sources = [ "//third_party/musl" ]
outdir = [ "${target_out_dir}/${musl_ported_dir}" ]
...
...
@@ -97,8 +104,8 @@ action("create_alltypes_h") {
outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/alltypes.h" ]
sources = [
"${target_out_dir}/${musl_ported_dir}/tools/mkalltypes.sed",
sources = [
"${target_out_dir}/${musl_ported_dir}/tools/mkalltypes.sed" ]
sources += [
"${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}/bits/alltypes.h.in",
"${target_out_dir}/${musl_ported_dir}/include/alltypes.h.in",
]
...
...
@@ -131,7 +138,9 @@ action("create_syscall_h") {
outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/syscall.h" ]
sources = [ "${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}/bits/syscall.h.in" ]
sources = [
"${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}/bits/syscall.h.in",
]
args = rebase_path(sources, root_build_dir)
args += rebase_path(outputs, root_build_dir)
...
...
musl_template.gni
浏览文件 @
268b62c8
...
...
@@ -2,25 +2,17 @@ import("//build/ohos.gni")
import("musl_src.gni")
template("musl_libs") {
no_default_deps = true
forward_variables_from(invoker, ["target_abi"])
abi_prefix = "${target_name}"
porting_deps = [
"//third_party/musl:create_porting_src",
"//third_party/musl:create_alltypes_h",
"//third_party/musl:create_syscall_h",
"//third_party/musl:create_version_h",
]
forward_variables_from(invoker, [ "target_abi" ])
abi_prefix = target_abi
if (target_abi == "soft") {
static_lib_out_dir = "usr/lib/${musl_target_triple}"
shared_lib_out_dir = "."
_libs_path_prefix = "."
_libs_out_dir = "usr/lib/${musl_target_triple}"
} else {
static_lib_out_dir = "usr/lib/${musl_target_triple}/${target_abi}"
shared_lib_out_dir = "${target_abi}"
_libs_path_prefix = "${target_abi}"
_libs_out_dir = "usr/lib/${musl_target_triple}/${target_abi}"
}
musl_subarch = ""
...
...
@@ -28,10 +20,25 @@ template("musl_libs") {
musl_subarch = "hf"
}
group("${abi_prefix}_libs") {
porting_deps = [
"//third_party/musl:create_alltypes_h",
"//third_party/musl:create_porting_src",
"//third_party/musl:create_syscall_h",
"//third_party/musl:create_version_h",
]
group(target_name) {
deps = [
":${abi_prefix}_create_linker",
":${abi_prefix}_libc_musl_shared",
":${abi_prefix}_libc_musl_static",
":${abi_prefix}_musl_crt_libs",
]
}
group("${abi_prefix}_shared_libs") {
deps = [
":${abi_prefix}_libc_musl_shared",
":${abi_prefix}_libcrypt",
":${abi_prefix}_libdl",
":${abi_prefix}_libm",
...
...
@@ -40,11 +47,31 @@ template("musl_libs") {
":${abi_prefix}_librt",
":${abi_prefix}_libutil",
":${abi_prefix}_libxnet",
":${abi_prefix}_musl_crt_
install_action",
":
${abi_prefix}_create_linker",
":${abi_prefix}_musl_crt_
libs",
":
musl_headers",
]
}
group("${abi_prefix}_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",
]
}
group("${abi_prefix}_musl_crt_libs") {
deps = [ ":${abi_prefix}_musl_crt_install_action" ]
}
# part of default_compiler_configs from build/config/BUILDCONFIG.gn
musl_inherited_configs = [
"//build/config/compiler:afdo",
...
...
@@ -132,9 +159,7 @@ template("musl_libs") {
"-Wa,--noexecstack",
]
cflags_all = cflags_basic +
cflags_c99fse +
cflags_auto
cflags_all = cflags_basic + cflags_c99fse + cflags_auto
cflags = cflags_all
...
...
@@ -142,7 +167,8 @@ template("musl_libs") {
defines = [ "BROKEN_VFP_ASM" ]
}
dynamic_list = rebase_path("${target_out_dir}/${musl_ported_dir}/dynamic.list")
dynamic_list =
rebase_path("${target_out_dir}/${musl_ported_dir}/dynamic.list")
ldflags = cflags_all
ldflags += [
...
...
@@ -268,7 +294,7 @@ template("musl_libs") {
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
deps = [
":${abi_prefix}_musl_src",
":${abi_prefix}_musl_src_nossp",
...
...
@@ -279,64 +305,65 @@ template("musl_libs") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libm"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_librt") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "librt"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_libpthread") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libpthread"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_libcrypt") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libcrypt"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_libutil") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libutil"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_libresolv") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libresolv"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_libxnet") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libxnet"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
static_library("${abi_prefix}_libdl") {
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libdl"
output_dir = "${target_out_dir}/${
static_lib_out_dir}"
output_dir = "${target_out_dir}/${
_libs_out_dir}"
}
shared_library("${abi_prefix}_libc_musl_shared") {
output_dir = "${
root_out_dir}/common/common/libc/${shared_lib_out_dir}"
output_dir = "${
target_out_dir}/${_libs_out_dir}"
output_name = "libc"
output_extension = "so"
libclang_rt_path = rebase_path("${runtime_lib_path}/${musl_target_triple}/${shared_lib_out_dir}")
libclang_rt_path = rebase_path(
"${runtime_lib_path}/${musl_target_triple}/${_libs_path_prefix}")
ldflags = [
"-nostdlib",
...
...
@@ -345,9 +372,6 @@ template("musl_libs") {
"-lclang_rt.builtins",
]
remove_configs = musl_inherited_configs
remove_configs += [ "//build/config:default_libs" ]
configs -= musl_inherited_configs
configs -= [ "//build/config:default_libs" ]
configs += [ ":${abi_prefix}_musl_config" ]
...
...
@@ -363,39 +387,28 @@ template("musl_libs") {
redir = "${root_out_dir}/obj"
script = "${target_out_dir}/${musl_ported_dir}/scripts/install.py"
sources = [
"${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/${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/rcrt1.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",
]
outputs = [ "${target_out_dir}/${static_lib_out_dir}/{{source_file_part}}" ]
outputs = [ "${target_out_dir}/${_libs_out_dir}/{{source_file_part}}" ]
args = [
"--input",
"{{source}}",
]
args += [ "--output" ] + rebase_path(outputs, root_build_dir)
deps = [ ":${abi_prefix}_musl_crt" ]
}
action("${abi_prefix}_create_linker") {
script = "${target_out_dir}/${musl_ported_dir}/tools/install.sh"
sources = [ "${root_out_dir}/common/common/libc/${shared_lib_out_dir}/libc.so" ]
outputs = [ "${root_out_dir}/common/common/libc/${shared_lib_out_dir}/ld-musl-${musl_arch}${musl_subarch}.so.1" ]
args = [
"-D",
"-r",
]
args += rebase_path(sources)
args += rebase_path(outputs)
copy("${abi_prefix}_create_linker") {
deps = [ ":${abi_prefix}_libc_musl_shared" ]
}
# _libc_shared_outputs = get_target_outputs(":${abi_prefix}_libc_musl_shared")
_libc_shared_so = "${target_out_dir}/${_libs_out_dir}/libc.so"
sources = [ _libc_shared_so ]
_muls_linker_so = "${root_out_dir}/common/common/libc/${_libs_path_prefix}/ld-musl-${musl_arch}${musl_subarch}.so.1"
outputs = [ _muls_linker_so ]
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录