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")
import("musl_template.gni")
musl_abi_target = "soft"
group("musl_all") {
group("musl_all") {
deps = [
deps = [
":musl_headers",
":a7_hard_neon_libs",
":soft_libs",
":a7_soft_libs",
":a7_soft_libs",
":a7_softfp_neon_libs",
":a7_softfp_neon_libs",
":a7_hard_neon_libs",
":musl_headers",
":soft_libs",
]
}
group("musl_libs") {
deps = [
":${musl_abi_target}_libs",
":musl_headers",
]
]
}
}
musl_libs("soft") {
musl_libs("soft
_libs
") {
target_abi = "soft"
target_abi = "soft"
}
}
musl_libs("a7_soft") {
musl_libs("a7_soft
_libs
") {
target_abi = "a7_soft"
target_abi = "a7_soft"
}
}
musl_libs("a7_softfp_neon") {
musl_libs("a7_softfp_neon
_libs
") {
target_abi = "a7_softfp_neon-vfpv4"
target_abi = "a7_softfp_neon-vfpv4"
}
}
musl_libs("a7_hard_neon") {
musl_libs("a7_hard_neon
_libs
") {
target_abi = "a7_hard_neon-vfpv4"
target_abi = "a7_hard_neon-vfpv4"
}
}
group("musl_headers") {
group("musl_headers") {
deps = [
deps = [
":copy_uapi",
":create_alltypes_h",
":create_alltypes_h",
":create_syscall_h",
":create_syscall_h",
":create_version_h",
":create_version_h",
...
@@ -39,16 +49,13 @@ group("musl_headers") {
...
@@ -39,16 +49,13 @@ group("musl_headers") {
":musl_copy_inc_root",
":musl_copy_inc_root",
":musl_copy_inc_scsi",
":musl_copy_inc_scsi",
":musl_copy_inc_sys",
":musl_copy_inc_sys",
":copy_uapi",
]
]
}
}
action("create_porting_src") {
action("create_porting_src") {
script = "scripts/porting.sh"
script = "scripts/porting.sh"
sources = [
sources = [ "//third_party/musl" ]
"//third_party/musl",
]
outdir = [ "${target_out_dir}/${musl_ported_dir}" ]
outdir = [ "${target_out_dir}/${musl_ported_dir}" ]
...
@@ -86,9 +93,9 @@ action("create_porting_src") {
...
@@ -86,9 +93,9 @@ action("create_porting_src") {
foreach(s, src_files) {
foreach(s, src_files) {
outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
outputs += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
}
}
args = [ "-i" ] + rebase_path(sources)
args = [ "-i" ] + rebase_path(sources)
args += [ "-o" ] + rebase_path(outdir)
args += [ "-o" ] + rebase_path(outdir)
args += [ "-p" ] + [ "${musl_target_os}" ]
args += [ "-p" ] + [ "${musl_target_os}" ]
}
}
...
@@ -97,8 +104,8 @@ action("create_alltypes_h") {
...
@@ -97,8 +104,8 @@ action("create_alltypes_h") {
outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/alltypes.h" ]
outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/alltypes.h" ]
sources = [
sources = [
"${target_out_dir}/${musl_ported_dir}/tools/mkalltypes.sed" ]
"${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}/arch/${musl_arch}/bits/alltypes.h.in",
"${target_out_dir}/${musl_ported_dir}/include/alltypes.h.in",
"${target_out_dir}/${musl_ported_dir}/include/alltypes.h.in",
]
]
...
@@ -131,7 +138,9 @@ action("create_syscall_h") {
...
@@ -131,7 +138,9 @@ action("create_syscall_h") {
outputs = [ "${target_out_dir}/${musl_inc_out_dir}/bits/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(sources, root_build_dir)
args += rebase_path(outputs, root_build_dir)
args += rebase_path(outputs, root_build_dir)
...
...
musl_template.gni
浏览文件 @
268b62c8
import("//build/ohos.gni")
import("//build/ohos.gni")
import("musl_src.gni")
import("musl_src.gni")
template("musl_libs") {
template("musl_libs") {
no_default_deps = true
no_default_deps = true
forward_variables_from(invoker, [ "target_abi" ])
forward_variables_from(invoker, ["target_abi"])
abi_prefix = target_abi
abi_prefix = "${target_name}"
if (target_abi == "soft") {
porting_deps = [
_libs_path_prefix = "."
"//third_party/musl:create_porting_src",
_libs_out_dir = "usr/lib/${musl_target_triple}"
"//third_party/musl:create_alltypes_h",
} else {
"//third_party/musl:create_syscall_h",
_libs_path_prefix = "${target_abi}"
"//third_party/musl:create_version_h",
_libs_out_dir = "usr/lib/${musl_target_triple}/${target_abi}"
]
}
if (target_abi == "soft") {
musl_subarch = ""
static_lib_out_dir = "usr/lib/${musl_target_triple}"
if (target_abi == "a7_hard_neon-vfpv4") {
shared_lib_out_dir = "."
musl_subarch = "hf"
} else {
}
static_lib_out_dir = "usr/lib/${musl_target_triple}/${target_abi}"
shared_lib_out_dir = "${target_abi}"
porting_deps = [
}
"//third_party/musl:create_alltypes_h",
"//third_party/musl:create_porting_src",
musl_subarch = ""
"//third_party/musl:create_syscall_h",
if (target_abi == "a7_hard_neon-vfpv4") {
"//third_party/musl:create_version_h",
musl_subarch = "hf"
]
}
group(target_name) {
group("${abi_prefix}_libs") {
deps = [
deps = [
":${abi_prefix}_create_linker",
":${abi_prefix}_libc_musl_shared",
":${abi_prefix}_libc_musl_shared",
":${abi_prefix}_libc_musl_static",
":${abi_prefix}_libc_musl_static",
":${abi_prefix}_libcrypt",
":${abi_prefix}_musl_crt_libs",
":${abi_prefix}_libdl",
]
":${abi_prefix}_libm",
}
":${abi_prefix}_libpthread",
":${abi_prefix}_libresolv",
group("${abi_prefix}_shared_libs") {
":${abi_prefix}_librt",
deps = [
":${abi_prefix}_libutil",
":${abi_prefix}_libc_musl_shared",
":${abi_prefix}_libxnet",
":${abi_prefix}_libcrypt",
":${abi_prefix}_musl_crt_install_action",
":${abi_prefix}_libdl",
":${abi_prefix}_create_linker",
":${abi_prefix}_libm",
]
":${abi_prefix}_libpthread",
}
":${abi_prefix}_libresolv",
":${abi_prefix}_librt",
# part of default_compiler_configs from build/config/BUILDCONFIG.gn
":${abi_prefix}_libutil",
musl_inherited_configs = [
":${abi_prefix}_libxnet",
"//build/config/compiler:afdo",
":${abi_prefix}_musl_crt_libs",
"//build/config/compiler:afdo_optimize_size",
":musl_headers",
"//build/config/compiler:compiler",
]
"//build/config/compiler:compiler_arm_fpu",
}
"//build/config/compiler:compiler_arm_thumb",
"//build/config/compiler:chromium_code",
group("${abi_prefix}_static_libs") {
"//build/config/compiler:default_include_dirs",
deps = [
"//build/config/compiler:default_optimization",
":${abi_prefix}_libc_musl_static",
"//build/config/compiler:default_stack_frames",
":${abi_prefix}_libcrypt",
"//build/config/compiler:default_symbols",
":${abi_prefix}_libdl",
"//build/config/compiler:export_dynamic",
":${abi_prefix}_libm",
"//build/config/compiler:no_exceptions",
":${abi_prefix}_libpthread",
"//build/config/compiler:no_rtti",
":${abi_prefix}_libresolv",
"//build/config/compiler:runtime_library",
":${abi_prefix}_librt",
"//build/config/compiler:thin_archive",
":${abi_prefix}_libutil",
]
":${abi_prefix}_libxnet",
":${abi_prefix}_musl_crt_libs",
config("${abi_prefix}_musl_abi_config") {
":musl_headers",
if (target_abi == "soft") {
]
cflags = [ "-mfloat-abi=soft" ]
}
} else if (target_abi == "a7_soft") {
cflags = [
group("${abi_prefix}_musl_crt_libs") {
"-mcpu=cortex-a7",
deps = [ ":${abi_prefix}_musl_crt_install_action" ]
"-mfloat-abi=soft",
}
]
} else if (target_abi == "a7_softfp_neon-vfpv4") {
# part of default_compiler_configs from build/config/BUILDCONFIG.gn
cflags = [
musl_inherited_configs = [
"-mcpu=cortex-a7",
"//build/config/compiler:afdo",
"-mfloat-abi=softfp",
"//build/config/compiler:afdo_optimize_size",
"-mfpu=neon-vfpv4",
"//build/config/compiler:compiler",
]
"//build/config/compiler:compiler_arm_fpu",
} else if (target_abi == "a7_hard_neon-vfpv4") {
"//build/config/compiler:compiler_arm_thumb",
cflags = [
"//build/config/compiler:chromium_code",
"-mcpu=cortex-a7",
"//build/config/compiler:default_include_dirs",
"-mfloat-abi=hard",
"//build/config/compiler:default_optimization",
"-mfpu=neon-vfpv4",
"//build/config/compiler:default_stack_frames",
]
"//build/config/compiler:default_symbols",
}
"//build/config/compiler:export_dynamic",
}
"//build/config/compiler:no_exceptions",
"//build/config/compiler:no_rtti",
config("${abi_prefix}_musl_config") {
"//build/config/compiler:runtime_library",
configs = [ ":${abi_prefix}_musl_abi_config" ]
"//build/config/compiler:thin_archive",
]
include_dirs = [
"${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}",
config("${abi_prefix}_musl_abi_config") {
"${target_out_dir}/${musl_ported_dir}/arch/generic",
if (target_abi == "soft") {
"${target_out_dir}/${musl_ported_dir}/src/internal",
cflags = [ "-mfloat-abi=soft" ]
"${target_out_dir}/${musl_ported_dir}/src/include",
} else if (target_abi == "a7_soft") {
"${target_out_dir}/${musl_ported_dir}/include",
cflags = [
"${target_out_dir}/${musl_inc_out_dir}",
"-mcpu=cortex-a7",
]
"-mfloat-abi=soft",
]
cflags_basic = [
} else if (target_abi == "a7_softfp_neon-vfpv4") {
"--target=${musl_target_triple}",
cflags = [
"-march=armv7-a",
"-mcpu=cortex-a7",
"-O2",
"-mfloat-abi=softfp",
"-Wall",
"-mfpu=neon-vfpv4",
"-D_FORTIFY_SOURCE=2",
]
"-Wl,-z,relro,-z,now,-z,noexecstack",
} else if (target_abi == "a7_hard_neon-vfpv4") {
]
cflags = [
"-mcpu=cortex-a7",
cflags_auto = [
"-mfloat-abi=hard",
"-D_XOPEN_SOURCE=700",
"-mfpu=neon-vfpv4",
"-Os",
]
"-pipe",
}
"-fomit-frame-pointer",
}
"-fno-unwind-tables",
"-fno-asynchronous-unwind-tables",
config("${abi_prefix}_musl_config") {
"-ffunction-sections",
configs = [ ":${abi_prefix}_musl_abi_config" ]
"-fdata-sections",
"-Werror=implicit-function-declaration",
include_dirs = [
"-Werror=implicit-int",
"${target_out_dir}/${musl_ported_dir}/arch/${musl_arch}",
"-Werror=pointer-sign",
"${target_out_dir}/${musl_ported_dir}/arch/generic",
"-Werror=pointer-arith",
"${target_out_dir}/${musl_ported_dir}/src/internal",
"-Qunused-arguments",
"${target_out_dir}/${musl_ported_dir}/src/include",
]
"${target_out_dir}/${musl_ported_dir}/include",
"${target_out_dir}/${musl_inc_out_dir}",
cflags_c99fse = [
]
"-std=c99",
"-nostdinc",
cflags_basic = [
"-ffreestanding",
"--target=${musl_target_triple}",
"-frounding-math",
"-march=armv7-a",
"-Wa,--noexecstack",
"-O2",
]
"-Wall",
"-D_FORTIFY_SOURCE=2",
cflags_all = cflags_basic +
"-Wl,-z,relro,-z,now,-z,noexecstack",
cflags_c99fse +
]
cflags_auto
cflags_auto = [
cflags = cflags_all
"-D_XOPEN_SOURCE=700",
"-Os",
if ("${target_abi}" != "a7_hard_neon-vfpv4") {
"-pipe",
defines = [ "BROKEN_VFP_ASM" ]
"-fomit-frame-pointer",
}
"-fno-unwind-tables",
"-fno-asynchronous-unwind-tables",
dynamic_list = rebase_path("${target_out_dir}/${musl_ported_dir}/dynamic.list")
"-ffunction-sections",
"-fdata-sections",
ldflags = cflags_all
"-Werror=implicit-function-declaration",
ldflags += [
"-Werror=implicit-int",
"--target=${musl_target_triple}",
"-Werror=pointer-sign",
"-fuse-ld=lld",
"-Werror=pointer-arith",
"-Wl,--sort-section,alignment",
"-Qunused-arguments",
"-Wl,--sort-common",
]
"-Wl,--gc-sections",
"-Wl,--hash-style=both",
cflags_c99fse = [
"-Wl,--no-undefined",
"-std=c99",
"-Wl,--exclude-libs=ALL",
"-nostdinc",
"-Wl,--dynamic-list=${dynamic_list}",
"-ffreestanding",
]
"-frounding-math",
asmflags = cflags
"-Wa,--noexecstack",
}
]
source_set("${abi_prefix}_musl_crt") {
cflags_all = cflags_basic + cflags_c99fse + cflags_auto
sources = [
"${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/crti.s",
cflags = cflags_all
"${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/crtn.s",
"${target_out_dir}/${musl_ported_dir}/crt/Scrt1.c",
if ("${target_abi}" != "a7_hard_neon-vfpv4") {
"${target_out_dir}/${musl_ported_dir}/crt/crt1.c",
defines = [ "BROKEN_VFP_ASM" ]
"${target_out_dir}/${musl_ported_dir}/crt/rcrt1.c",
}
]
dynamic_list =
defines = [ "CRT" ]
rebase_path("${target_out_dir}/${musl_ported_dir}/dynamic.list")
configs -= musl_inherited_configs
ldflags = cflags_all
configs += [ ":${abi_prefix}_musl_config" ]
ldflags += [
cflags = [
"--target=${musl_target_triple}",
"-fPIC",
"-fuse-ld=lld",
"-fno-stack-protector",
"-Wl,--sort-section,alignment",
]
"-Wl,--sort-common",
"-Wl,--gc-sections",
deps = porting_deps
"-Wl,--hash-style=both",
"-Wl,--no-undefined",
asmflags = cflags
"-Wl,--exclude-libs=ALL",
}
"-Wl,--dynamic-list=${dynamic_list}",
]
source_set("${abi_prefix}_musl_src") {
asmflags = cflags
sources_orig = []
}
sources = []
set_sources_assignment_filter([])
source_set("${abi_prefix}_musl_crt") {
sources = [
sources_orig = musl_src_arch_file + musl_src_file
"${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/crti.s",
sources_orig -= musl_src_filterout
"${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/crtn.s",
sources_orig -= [
"${target_out_dir}/${musl_ported_dir}/crt/Scrt1.c",
"src/string/mempcpy.c",
"${target_out_dir}/${musl_ported_dir}/crt/crt1.c",
"src/string/memset.c",
"${target_out_dir}/${musl_ported_dir}/crt/rcrt1.c",
"src/env/__init_tls.c",
]
"src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.c",
defines = [ "CRT" ]
"src/thread/${musl_arch}/__set_thread_area.c",
]
configs -= musl_inherited_configs
configs += [ ":${abi_prefix}_musl_config" ]
if ("${target_abi}" == "a7_hard_neon-vfpv4") {
cflags = [
defines = [ "__ARM_PCS_VFP" ]
"-fPIC",
}
"-fno-stack-protector",
]
foreach(s, sources_orig) {
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
deps = porting_deps
}
asmflags = cflags
cflags = [
}
"-O3",
"-fPIC",
source_set("${abi_prefix}_musl_src") {
"-fstack-protector-strong",
sources_orig = []
]
sources = []
set_sources_assignment_filter([])
configs -= musl_inherited_configs
configs += [ ":${abi_prefix}_musl_config" ]
sources_orig = musl_src_arch_file + musl_src_file
sources_orig -= musl_src_filterout
deps = porting_deps
sources_orig -= [
}
"src/string/mempcpy.c",
"src/string/memset.c",
source_set("${abi_prefix}_musl_src_nossp") {
"src/env/__init_tls.c",
sources = []
"src/env/__libc_start_main.c",
sources_orig = [
"src/env/__stack_chk_fail.c",
"src/string/mempcpy.c",
"src/thread/${musl_arch}/__set_thread_area.c",
"src/string/memset.c",
]
"src/env/__init_tls.c",
"src/env/__libc_start_main.c",
if ("${target_abi}" == "a7_hard_neon-vfpv4") {
"src/env/__stack_chk_fail.c",
defines = [ "__ARM_PCS_VFP" ]
"src/thread/${musl_arch}/__set_thread_area.c",
}
]
foreach(s, sources_orig) {
foreach(s, sources_orig) {
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
}
}
cflags = [
configs -= musl_inherited_configs
"-O3",
configs += [ ":${abi_prefix}_musl_config" ]
"-fPIC",
cflags = [
"-fstack-protector-strong",
"-O3",
]
"-fPIC",
"-fno-stack-protector",
configs -= musl_inherited_configs
]
configs += [ ":${abi_prefix}_musl_config" ]
deps = porting_deps
deps = porting_deps
}
}
source_set("${abi_prefix}_musl_ldso") {
source_set("${abi_prefix}_musl_src_nossp") {
sources = []
sources = []
sources_orig = musl_src_ldso
sources_orig = [
"src/string/mempcpy.c",
foreach(s, sources_orig) {
"src/string/memset.c",
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
"src/env/__init_tls.c",
}
"src/env/__libc_start_main.c",
"src/env/__stack_chk_fail.c",
configs -= musl_inherited_configs
"src/thread/${musl_arch}/__set_thread_area.c",
configs += [ ":${abi_prefix}_musl_config" ]
]
cflags = [
"-fPIC",
foreach(s, sources_orig) {
"-fno-stack-protector",
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
]
}
deps = porting_deps
configs -= musl_inherited_configs
}
configs += [ ":${abi_prefix}_musl_config" ]
cflags = [
static_library("${abi_prefix}_libc_musl_static") {
"-O3",
output_name = "libc"
"-fPIC",
complete_static_lib = true
"-fno-stack-protector",
]
configs -= musl_inherited_configs
deps = porting_deps
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
deps = [
":${abi_prefix}_musl_src",
source_set("${abi_prefix}_musl_ldso") {
":${abi_prefix}_musl_src_nossp",
sources = []
]
sources_orig = musl_src_ldso
}
foreach(s, sources_orig) {
static_library("${abi_prefix}_libm") {
sources += [ "${target_out_dir}/${musl_ported_dir}/${s}" ]
complete_static_lib = true
}
configs -= musl_inherited_configs
output_name = "libm"
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${static_lib_out_dir}"
configs += [ ":${abi_prefix}_musl_config" ]
}
cflags = [
"-fPIC",
static_library("${abi_prefix}_librt") {
"-fno-stack-protector",
complete_static_lib = true
]
configs -= musl_inherited_configs
output_name = "librt"
deps = porting_deps
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
}
static_library("${abi_prefix}_libc_musl_static") {
static_library("${abi_prefix}_libpthread") {
output_name = "libc"
complete_static_lib = true
complete_static_lib = true
configs -= musl_inherited_configs
output_name = "libpthread"
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
output_dir = "${target_out_dir}/${_libs_out_dir}"
deps = [
static_library("${abi_prefix}_libcrypt") {
":${abi_prefix}_musl_src",
complete_static_lib = true
":${abi_prefix}_musl_src_nossp",
configs -= musl_inherited_configs
]
output_name = "libcrypt"
}
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
static_library("${abi_prefix}_libm") {
complete_static_lib = true
static_library("${abi_prefix}_libutil") {
configs -= musl_inherited_configs
complete_static_lib = true
output_name = "libm"
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${_libs_out_dir}"
output_name = "libutil"
}
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
static_library("${abi_prefix}_librt") {
complete_static_lib = true
static_library("${abi_prefix}_libresolv") {
configs -= musl_inherited_configs
complete_static_lib = true
output_name = "librt"
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${_libs_out_dir}"
output_name = "libresolv"
}
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
static_library("${abi_prefix}_libpthread") {
complete_static_lib = true
static_library("${abi_prefix}_libxnet") {
configs -= musl_inherited_configs
complete_static_lib = true
output_name = "libpthread"
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${_libs_out_dir}"
output_name = "libxnet"
}
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
static_library("${abi_prefix}_libcrypt") {
complete_static_lib = true
static_library("${abi_prefix}_libdl") {
configs -= musl_inherited_configs
complete_static_lib = true
output_name = "libcrypt"
configs -= musl_inherited_configs
output_dir = "${target_out_dir}/${_libs_out_dir}"
output_name = "libdl"
}
output_dir = "${target_out_dir}/${static_lib_out_dir}"
}
static_library("${abi_prefix}_libutil") {
complete_static_lib = true
shared_library("${abi_prefix}_libc_musl_shared") {
configs -= musl_inherited_configs
output_dir = "${root_out_dir}/common/common/libc/${shared_lib_out_dir}"
output_name = "libutil"
output_name = "libc"
output_dir = "${target_out_dir}/${_libs_out_dir}"
output_extension = "so"
}
libclang_rt_path = rebase_path("${runtime_lib_path}/${musl_target_triple}/${shared_lib_out_dir}")
static_library("${abi_prefix}_libresolv") {
complete_static_lib = true
ldflags = [
configs -= musl_inherited_configs
"-nostdlib",
output_name = "libresolv"
"-Wl,-e,_dlstart",
output_dir = "${target_out_dir}/${_libs_out_dir}"
"-L${libclang_rt_path}",
}
"-lclang_rt.builtins",
]
static_library("${abi_prefix}_libxnet") {
complete_static_lib = true
remove_configs = musl_inherited_configs
configs -= musl_inherited_configs
remove_configs += [ "//build/config:default_libs" ]
output_name = "libxnet"
output_dir = "${target_out_dir}/${_libs_out_dir}"
configs -= musl_inherited_configs
}
configs -= [ "//build/config:default_libs" ]
configs += [ ":${abi_prefix}_musl_config" ]
static_library("${abi_prefix}_libdl") {
complete_static_lib = true
deps = [
configs -= musl_inherited_configs
":${abi_prefix}_musl_ldso",
output_name = "libdl"
":${abi_prefix}_musl_src",
output_dir = "${target_out_dir}/${_libs_out_dir}"
":${abi_prefix}_musl_src_nossp",
}
]
}
shared_library("${abi_prefix}_libc_musl_shared") {
output_dir = "${target_out_dir}/${_libs_out_dir}"
action_foreach("${abi_prefix}_musl_crt_install_action") {
output_name = "libc"
redir = "${root_out_dir}/obj"
output_extension = "so"
script = "${target_out_dir}/${musl_ported_dir}/scripts/install.py"
sources = [
libclang_rt_path = rebase_path(
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${musl_arch}/${abi_prefix}_musl_crt/crti.o",
"${runtime_lib_path}/${musl_target_triple}/${_libs_path_prefix}")
"${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",
ldflags = [
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${abi_prefix}_musl_crt/crt1.o",
"-nostdlib",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${abi_prefix}_musl_crt/rcrt1.o",
"-Wl,-e,_dlstart",
]
"-L${libclang_rt_path}",
"-lclang_rt.builtins",
outputs = [ "${target_out_dir}/${static_lib_out_dir}/{{source_file_part}}" ]
]
args = [
configs -= musl_inherited_configs
"--input",
configs -= [ "//build/config:default_libs" ]
"{{source}}",
configs += [ ":${abi_prefix}_musl_config" ]
]
args += [ "--output" ] + rebase_path(outputs, root_build_dir)
deps = [
":${abi_prefix}_musl_ldso",
deps = [ ":${abi_prefix}_musl_crt" ]
":${abi_prefix}_musl_src",
}
":${abi_prefix}_musl_src_nossp",
]
action("${abi_prefix}_create_linker") {
}
script = "${target_out_dir}/${musl_ported_dir}/tools/install.sh"
action_foreach("${abi_prefix}_musl_crt_install_action") {
sources = [ "${root_out_dir}/common/common/libc/${shared_lib_out_dir}/libc.so" ]
redir = "${root_out_dir}/obj"
script = "${target_out_dir}/${musl_ported_dir}/scripts/install.py"
outputs = [ "${root_out_dir}/common/common/libc/${shared_lib_out_dir}/ld-musl-${musl_arch}${musl_subarch}.so.1" ]
sources = [
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${abi_prefix}_musl_crt/Scrt1.o",
args = [
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${abi_prefix}_musl_crt/crt1.o",
"-D",
"${redir}/${target_out_dir}/${musl_ported_dir}/crt/${abi_prefix}_musl_crt/rcrt1.o",
"-r",
"${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",
args += rebase_path(sources)
]
args += rebase_path(outputs)
outputs = [ "${target_out_dir}/${_libs_out_dir}/{{source_file_part}}" ]
args = [
deps = [ ":${abi_prefix}_libc_musl_shared" ]
"--input",
}
"{{source}}",
]
}
args += [ "--output" ] + rebase_path(outputs, root_build_dir)
deps = [ ":${abi_prefix}_musl_crt" ]
}
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录